org.exoplatform.ks.common.jcr
Class JCRListAccess<E>

java.lang.Object
  extended by org.exoplatform.ks.common.jcr.JCRListAccess<E>
All Implemented Interfaces:
ListAccess<E>

public abstract class JCRListAccess<E>
extends java.lang.Object
implements ListAccess<E>

Basis for JCR-based list access. Acquires and releases system sessions on default workspace.

Version:
$Revision$
Author:
Patrice Lamarque

Constructor Summary
JCRListAccess()
           
 
Method Summary
 int getSize()
          Returns the list size.
protected abstract  int getSize(javax.jcr.Session session)
           
 E[] load(int index, int length)
          Retrieves an array of object from the list.
protected abstract  E[] load(javax.jcr.Session session, int index, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCRListAccess

public JCRListAccess()
Method Detail

load

public E[] load(int index,
                int length)
         throws java.lang.Exception,
                java.lang.IllegalArgumentException
Description copied from interface: ListAccess

Retrieves an array of object from the list. The returned array size is expected to be equals to the length argument.

The index value and the lenght value cannot be negative, and the sum of the index and the length cannot be greater than the list size. Those values are considered as non correct.

Specified by:
load in interface ListAccess<E>
Parameters:
index - the index
length - the limit
Returns:
the array
Throws:
java.lang.Exception - any exception that would prevent access to the list
java.lang.IllegalArgumentException - if the index value or the length value are not correct

getSize

public int getSize()
            throws java.lang.Exception
Description copied from interface: ListAccess
Returns the list size.

Specified by:
getSize in interface ListAccess<E>
Returns:
the size
Throws:
java.lang.Exception - any exception that would prevent access to the list

load

protected abstract E[] load(javax.jcr.Session session,
                            int index,
                            int length)
                     throws java.lang.Exception,
                            java.lang.IllegalArgumentException
Throws:
java.lang.Exception
java.lang.IllegalArgumentException

getSize

protected abstract int getSize(javax.jcr.Session session)
                        throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2011 eXo Platform SAS. All Rights Reserved.