fr.cnes.sitools.common.store
Class SitoolsStoreXML<T extends IResource>

java.lang.Object
  extended by fr.cnes.sitools.persistence.Paginable<T>
      extended by fr.cnes.sitools.common.store.SitoolsStoreXML<T>
Type Parameters:
T - object class to be stored
All Implemented Interfaces:
SitoolsStore<T>, java.io.Closeable
Direct Known Subclasses:
AppRegistryStoreXML, CollectionsStoreXML, ConceptTemplateStoreXML, ConverterStoreXML, DatasetViewStoreXML, DictionaryStoreXML, DimensionStoreXML, FeedsStoreXML, FilterPluginStoreXML, FilterStoreXML, FormComponentsStoreXML, FormProjectStoreXML, FormStoreXML, GraphStoreXML, GuiServicePluginStoreXML, GuiServiceStoreXML, InscriptionStoreXML, JDBCDataSourceStoreXML, MongoDBDataSourceStoreXML, OpenSearchStoreXML, OrderStoreXML, ProjectModuleStoreXML, ResourcePluginStoreXML, RoleStoreXML, ServiceStoreXML, UserBlackListStoreXML

public abstract class SitoolsStoreXML<T extends IResource>
extends Paginable<T>
implements SitoolsStore<T>

Base class for XML stores

Author:
m.marseille (AKKA technologies)

Constructor Summary
SitoolsStoreXML(java.lang.Class<T> cl, org.restlet.Context context)
          Constructor with object class
SitoolsStoreXML(java.lang.Class<T> cl, java.io.File location, org.restlet.Context context)
          Constructor with file location
 
Method Summary
 T create(T resource)
          Method for creating a object
 boolean delete(java.lang.String id)
          Method for deleting a object by its id
 T[] getArray()
          Method for getting all objects
 T[] getArray(ResourceCollectionFilter filter)
          Method for getting objects according to the specified filter
 T[] getArrayByXQuery(java.lang.String xquery)
          Method for getting objects according to the XQuery
abstract  java.lang.String getCollectionName()
          Method to implement for collection name
 java.util.List<T> getList(ResourceCollectionFilter filter)
          Method for getting objects with specific criteria
 T retrieve(java.lang.String id)
          Method for retrieving a object by its id
 void sort(java.util.List<T> list, ResourceCollectionFilter filter)
          Sort the list according to criteria specified in subclasses
 
Methods inherited from class fr.cnes.sitools.persistence.Paginable
close, getList, getListByXQuery, getLog, getPage, getPaginableClass, getRawList, init, init, setList
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.cnes.sitools.common.store.SitoolsStore
getList, getListByXQuery, getPage, retrieveByParent, update
 
Methods inherited from interface java.io.Closeable
close
 

Constructor Detail

SitoolsStoreXML

public SitoolsStoreXML(java.lang.Class<T> cl,
                       org.restlet.Context context)
Constructor with object class

Parameters:
cl - the class to keep
context - TODO

SitoolsStoreXML

public SitoolsStoreXML(java.lang.Class<T> cl,
                       java.io.File location,
                       org.restlet.Context context)
Constructor with file location

Parameters:
cl - the class to keep
location - the file location
context - TODO
Method Detail

getArray

public final T[] getArray()
Description copied from interface: SitoolsStore
Method for getting all objects

Specified by:
getArray in interface SitoolsStore<T extends IResource>
Returns:
Array

getArrayByXQuery

public final T[] getArrayByXQuery(java.lang.String xquery)
Description copied from interface: SitoolsStore
Method for getting objects according to the XQuery

Specified by:
getArrayByXQuery in interface SitoolsStore<T extends IResource>
Parameters:
xquery - String with XQuery syntax
Returns:
Array

getArray

public final T[] getArray(ResourceCollectionFilter filter)
Description copied from interface: SitoolsStore
Method for getting objects according to the specified filter

Specified by:
getArray in interface SitoolsStore<T extends IResource>
Parameters:
filter - criteria (pagination, ...)
Returns:
Array

getList

public java.util.List<T> getList(ResourceCollectionFilter filter)
Description copied from interface: SitoolsStore
Method for getting objects with specific criteria

Specified by:
getList in interface SitoolsStore<T extends IResource>
Parameters:
filter - criteria (pagination, ...)
Returns:
ArrayList of objects

create

public T create(T resource)
Description copied from interface: SitoolsStore
Method for creating a object

Specified by:
create in interface SitoolsStore<T extends IResource>
Parameters:
resource - input
Returns:
created object

retrieve

public final T retrieve(java.lang.String id)
Description copied from interface: SitoolsStore
Method for retrieving a object by its id

Specified by:
retrieve in interface SitoolsStore<T extends IResource>
Parameters:
id - project identifier
Returns:
retrieved object

delete

public final boolean delete(java.lang.String id)
Description copied from interface: SitoolsStore
Method for deleting a object by its id

Specified by:
delete in interface SitoolsStore<T extends IResource>
Parameters:
id - object identifier
Returns:
true if deleted

sort

public void sort(java.util.List<T> list,
                 ResourceCollectionFilter filter)
Description copied from class: Paginable
Sort the list according to criteria specified in subclasses

Specified by:
sort in class Paginable<T extends IResource>
Parameters:
list - the list
filter - the filter

getCollectionName

public abstract java.lang.String getCollectionName()
Method to implement for collection name

Returns:
the collection name


Copyright © 2010-2013 CNES. All Rights Reserved.