fr.cnes.sitools.persistence
Class Paginable<E extends IResource>

java.lang.Object
  extended by fr.cnes.sitools.persistence.Paginable<E>
Type Parameters:
E - The elements returned for pagination
Direct Known Subclasses:
AuthorizationStoreXML, SitoolsStoreXML, SitoolsSynchronizedStoreXML

public abstract class Paginable<E extends IResource>
extends java.lang.Object

Class to extend if resource contains method providing paginable results

Author:
AKKA

Constructor Summary
Paginable(org.restlet.Context context)
          Constructor with file location
Paginable(java.io.File location, org.restlet.Context context)
          Constructor with file location
 
Method Summary
 void close()
          Close the Store ...
 java.util.List<E> getList()
          Return the list
 java.util.List<E> getListByXQuery(java.lang.String xquery)
          get the list with XQuery
 java.util.logging.Logger getLog()
          Gets the log value
 java.util.List<E> getPage(ResourceCollectionFilter filter, java.util.List<E> result)
          Get the list according to filter and full list
 E getPaginableClass()
          Gets the instance value
 java.util.List<E> getRawList()
          Gets the list value
abstract  void init(java.io.File location)
          Initialization with location method to override
 void init(java.io.File location, java.util.Map<java.lang.String,java.lang.Class<?>> aliases)
          XStream FilePersistenceStrategy initialization
 void setList(java.util.List<E> list)
          Sets the value of list
abstract  void sort(java.util.List<E> list, ResourceCollectionFilter filter)
          Sort the list according to criteria specified in subclasses
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Paginable

public Paginable(org.restlet.Context context)
Constructor with file location

Parameters:
context - TODO

Paginable

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

Parameters:
location - the file location
context - TODO
Method Detail

init

public abstract void init(java.io.File location)
Initialization with location method to override

Parameters:
location - the file location

getPage

public final java.util.List<E> getPage(ResourceCollectionFilter filter,
                                       java.util.List<E> result)
Get the list according to filter and full list

Parameters:
filter - query filters
result - global results
Returns:
the list of elements to be returned in the page

init

public final void init(java.io.File location,
                       java.util.Map<java.lang.String,java.lang.Class<?>> aliases)
XStream FilePersistenceStrategy initialization

Parameters:
location - Directory
aliases - map of aliases given to objects

getList

public final java.util.List<E> getList()
Return the list

Returns:
the list

sort

public abstract void sort(java.util.List<E> list,
                          ResourceCollectionFilter filter)
Sort the list according to criteria specified in subclasses

Parameters:
list - the list
filter - the filter

setList

public final void setList(java.util.List<E> list)
Sets the value of list

Parameters:
list - the list to set

getRawList

public final java.util.List<E> getRawList()
Gets the list value

Returns:
the list

getListByXQuery

public final java.util.List<E> getListByXQuery(java.lang.String xquery)
get the list with XQuery

Parameters:
xquery - the XQuery
Returns:
the list

close

public final void close()
Close the Store ...


getPaginableClass

public final E getPaginableClass()
Gets the instance value

Returns:
the instance

getLog

public final java.util.logging.Logger getLog()
Gets the log value

Returns:
the log


Copyright © 2010-2013 CNES. All Rights Reserved.