fr.cnes.sitools.tasks
Class TaskStoreXML

java.lang.Object
  extended by fr.cnes.sitools.persistence.Paginable<T>
      extended by fr.cnes.sitools.common.store.SitoolsSynchronizedStoreXML<TaskModel>
          extended by fr.cnes.sitools.tasks.TaskStoreXML
All Implemented Interfaces:
SitoolsStore<TaskModel>, java.io.Closeable

public final class TaskStoreXML
extends SitoolsSynchronizedStoreXML<TaskModel>

Implementation of TaskModelStore with XStream FilePersistenceStrategy

Author:
AKKA

Constructor Summary
TaskStoreXML(org.restlet.Context context)
          Default constructor
TaskStoreXML(java.io.File location, org.restlet.Context context)
          Constructor with the XML file location
 
Method Summary
 TaskModel create(TaskModel resource)
          Method for creating a object
 java.lang.String getCollectionName()
          Method to implement for collection name
 void init(java.io.File location)
          XStream FilePersistenceStrategy initialization
 java.util.List<TaskModel> retrieveByParent(java.lang.String id)
          Get the list of object by parent ID
 void sort(java.util.List<TaskModel> result, ResourceCollectionFilter filter)
          Sort the list according to criteria specified in subclasses
 TaskModel update(TaskModel taskModel)
          Method for updating a object
 
Methods inherited from class fr.cnes.sitools.common.store.SitoolsSynchronizedStoreXML
delete, getArray, getArray, getArrayByXQuery, getList, retrieve
 
Methods inherited from class fr.cnes.sitools.persistence.Paginable
close, getList, getListByXQuery, getLog, getPage, getPaginableClass, getRawList, 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
 
Methods inherited from interface java.io.Closeable
close
 

Constructor Detail

TaskStoreXML

public TaskStoreXML(java.io.File location,
                    org.restlet.Context context)
Constructor with the XML file location

Parameters:
location - directory of FilePersistenceStrategy
context - the Restlet Context

TaskStoreXML

public TaskStoreXML(org.restlet.Context context)
Default constructor

Parameters:
context - the Restlet Context
Method Detail

update

public TaskModel update(TaskModel taskModel)
Description copied from interface: SitoolsStore
Method for updating a object

Parameters:
taskModel - input
Returns:
updated object

create

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

Specified by:
create in interface SitoolsStore<TaskModel>
Overrides:
create in class SitoolsSynchronizedStoreXML<TaskModel>
Parameters:
resource - input
Returns:
created object

init

public void init(java.io.File location)
XStream FilePersistenceStrategy initialization

Specified by:
init in class Paginable<TaskModel>
Parameters:
location - Directory

sort

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

Overrides:
sort in class SitoolsSynchronizedStoreXML<TaskModel>
Parameters:
result - the list
filter - the filter

retrieveByParent

public java.util.List<TaskModel> retrieveByParent(java.lang.String id)
Description copied from interface: SitoolsStore
Get the list of object by parent ID

Parameters:
id - the parent ID
Returns:
the list of resource objects

getCollectionName

public java.lang.String getCollectionName()
Description copied from class: SitoolsSynchronizedStoreXML
Method to implement for collection name

Specified by:
getCollectionName in class SitoolsSynchronizedStoreXML<TaskModel>
Returns:
the collection name


Copyright © 2010-2013 CNES. All Rights Reserved.