fr.cnes.sitools.userstorage
Class UserStorageStoreXML

java.lang.Object
  extended by fr.cnes.sitools.userstorage.UserStorageStoreXML
All Implemented Interfaces:
UserStorageStore, java.io.Closeable

public final class UserStorageStoreXML
extends java.lang.Object
implements UserStorageStore

Implementation of UserStorageStore with XStream FilePersistenceStrategy

Author:
AKKA

Constructor Summary
UserStorageStoreXML(org.restlet.Context context)
          Default constructor
UserStorageStoreXML(java.io.File location, org.restlet.Context context)
          Constructor with the XML file location
 
Method Summary
 void close()
           
 UserStorage create(UserStorage userStorage)
          Method for creating a UserStorage
 boolean delete(java.lang.String id)
          Method for deleting a UserStorage by its id
 UserStorage[] getArray()
          Method for getting all objects
 UserStorage[] getArray(ResourceCollectionFilter filter)
          Method for getting userStorages according to the specified filter
 UserStorage[] getArrayByXQuery(java.lang.String xquery)
          Method for getting objects according to the XQuery
 java.util.List<UserStorage> getList()
          Method for getting all userStorage
 java.util.List<UserStorage> getList(ResourceCollectionFilter filter)
          Method for getting userStorage with specific criteria
 java.util.List<UserStorage> getListByXQuery(java.lang.String xquery)
          Method for getting userStorage with XQuery request syntax
 java.util.List<UserStorage> getPage(ResourceCollectionFilter filter, java.util.List<UserStorage> result)
          Filters a list according to the pagination
 UserStorage retrieve(java.lang.String id)
          Method for retrieving a userStorage by its id
 UserStorage update(UserStorage userStorage)
          Method for updating a userStorage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserStorageStoreXML

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

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

UserStorageStoreXML

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

Parameters:
context - the Restlet Context
Method Detail

create

public UserStorage create(UserStorage userStorage)
                   throws SitoolsException
Description copied from interface: UserStorageStore
Method for creating a UserStorage

Specified by:
create in interface UserStorageStore
Parameters:
userStorage - UserStorage input
Returns:
created UserStorage
Throws:
SitoolsException - if error occurs when creating a new UserStorage

retrieve

public UserStorage retrieve(java.lang.String id)
Description copied from interface: UserStorageStore
Method for retrieving a userStorage by its id

Specified by:
retrieve in interface UserStorageStore
Parameters:
id - userStorage identifier
Returns:
retrieved userStorage

update

public UserStorage update(UserStorage userStorage)
Description copied from interface: UserStorageStore
Method for updating a userStorage

Specified by:
update in interface UserStorageStore
Parameters:
userStorage - input
Returns:
updated userStorage

delete

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

Specified by:
delete in interface UserStorageStore
Parameters:
id - userStorage identifier
Returns:
true if deleted

getArray

public UserStorage[] getArray()
Description copied from interface: UserStorageStore
Method for getting all objects

Specified by:
getArray in interface UserStorageStore
Returns:
Array

getArray

public UserStorage[] getArray(ResourceCollectionFilter filter)
Description copied from interface: UserStorageStore
Method for getting userStorages according to the specified filter

Specified by:
getArray in interface UserStorageStore
Parameters:
filter - criteria (pagination, ...)
Returns:
Array

getArrayByXQuery

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

Specified by:
getArrayByXQuery in interface UserStorageStore
Parameters:
xquery - String with XQuery syntax
Returns:
Array

getList

public java.util.List<UserStorage> getList(ResourceCollectionFilter filter)
Description copied from interface: UserStorageStore
Method for getting userStorage with specific criteria

Specified by:
getList in interface UserStorageStore
Parameters:
filter - criteria (pagination, ...)
Returns:
ArrayList of userStorage

getPage

public java.util.List<UserStorage> getPage(ResourceCollectionFilter filter,
                                           java.util.List<UserStorage> result)
Filters a list according to the pagination

Specified by:
getPage in interface UserStorageStore
Parameters:
filter - for pagination
result - source
Returns:
ArrayList

getList

public java.util.List<UserStorage> getList()
Description copied from interface: UserStorageStore
Method for getting all userStorage

Specified by:
getList in interface UserStorageStore
Returns:
ArrayList of userStorage

getListByXQuery

public java.util.List<UserStorage> getListByXQuery(java.lang.String xquery)
Description copied from interface: UserStorageStore
Method for getting userStorage with XQuery request syntax

Specified by:
getListByXQuery in interface UserStorageStore
Parameters:
xquery - String
Returns:
ArrayList of userStorage

close

public void close()
Specified by:
close in interface java.io.Closeable


Copyright © 2010-2013 CNES. All Rights Reserved.