org.wso2.carbon.registry.core
Class CollectionVersionImpl

java.lang.Object
  extended by org.wso2.carbon.registry.core.ResourceImpl
      extended by org.wso2.carbon.registry.core.CollectionImpl
          extended by org.wso2.carbon.registry.core.CollectionVersionImpl
All Implemented Interfaces:
org.wso2.carbon.registry.api.Collection, org.wso2.carbon.registry.api.Resource

public class CollectionVersionImpl
extends CollectionImpl

Implementation of CollectionImpl, Instance of this class is returned when requested for an early version of some collection.


Field Summary
 
Fields inherited from class org.wso2.carbon.registry.core.CollectionImpl
childCount
 
Fields inherited from class org.wso2.carbon.registry.core.ResourceImpl
authorUserName, content, contentModified, createdTime, dataAccessManager, dbBasedContentID, description, directory, id, lastModified, lastUpdaterUserName, matchingSnapshotID, mediaType, name, parentPath, path, pathID, permanentPath, properties, propertiesModified, resourceDAO, snapshotID, state, tenantId, userName, userRealm, uuid, versionableChange, versionNumber
 
Fields inherited from interface org.wso2.carbon.registry.core.Collection
ALLOW_ALL, ALLOW_SELECTED, DENY_SELECTED
 
Constructor Summary
CollectionVersionImpl()
          Default Constructor.
CollectionVersionImpl(CollectionVersionImpl collection)
          A copy constructor used to create a shallow-copy of this collection.
CollectionVersionImpl(String path, ResourceDO resourceDO)
          Constructor a CollectionVersionImpl for a provided path and a resourceDO.
 
Method Summary
 int getChildCount()
          Method to return the the number of children.
 String[] getChildren()
          Method to return the absolute paths of the children of the collection.
 String[] getChildren(int start, int pageLen)
          Method to return the paths of the selected range of children.
 Object getContent()
          Collection's content is a string array, which contains paths of its children.
 void setDataAccessManager(DataAccessManager dataAccessManager)
          Method to set the data access manager.
 void setVersionList(VersionRetriever versionList)
          Method to set the version retriever instance.
 void setVersionListIndex(int versionListIndex)
          Method to set the index of the current collection in the version list
 
Methods inherited from class org.wso2.carbon.registry.core.CollectionImpl
fillCollectionCopy, fixPaths, getShallowCopy, setChildCount, setChildren, setContent, setContentWithNoUpdate
 
Methods inherited from class org.wso2.carbon.registry.core.ResourceImpl
addAspect, addProperty, addPropertyWithNoUpdate, clearSessionInformation, discard, editPropertyValue, fillResourceCopy, getAspects, getAuthorUserName, getContentStream, getCreatedTime, getDbBasedContentID, getDescription, getId, getLastModified, getLastUpdaterUserName, getMatchingSnapshotID, getMediaType, getName, getParentPath, getPath, getPathID, getPermanentPath, getProperties, getProperty, getPropertyValues, getResourceDO, getResourceIDImpl, getSnapshotID, getState, getUUID, getVersionNumber, isContentModified, isPropertiesModified, isVersionableChange, prepareContentForPut, pullContentFromOriginal, removeAspect, removeProperty, removePropertyValue, removePropertyWithNoUpdate, setAuthorUserName, setContentModified, setContentStream, setContentStreamWithNoUpdate, setCreatedTime, setDbBasedContentID, setDescription, setId, setLastModified, setLastUpdaterUserName, setMatchingSnapshotID, setMediaType, setName, setParentPath, setPath, setPathID, setProperties, setPropertiesModified, setPropertiesModifiedWithNoUpdate, setProperty, setProperty, setSessionInformation, setSnapshotID, setState, setTenantId, setUserName, setUserRealm, setUUID, setVersionableChange, setVersionNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.wso2.carbon.registry.core.Resource
addAspect, addProperty, discard, editPropertyValue, getAspects, getAuthorUserName, getContentStream, getCreatedTime, getDescription, getId, getLastModified, getLastUpdaterUserName, getMediaType, getParentPath, getPath, getPermanentPath, getProperties, getProperty, getPropertyValues, getState, getUUID, isVersionableChange, removeAspect, removeProperty, removePropertyValue, setContentStream, setDescription, setMediaType, setProperties, setProperty, setProperty, setUUID, setVersionableChange
 

Constructor Detail

CollectionVersionImpl

public CollectionVersionImpl()
Default Constructor. Creates an empty CollectionVersion instance.


CollectionVersionImpl

public CollectionVersionImpl(String path,
                             ResourceDO resourceDO)
Constructor a CollectionVersionImpl for a provided path and a resourceDO.

Parameters:
path - the path of the collection.
resourceDO - the resourceDO instance.

CollectionVersionImpl

public CollectionVersionImpl(CollectionVersionImpl collection)
A copy constructor used to create a shallow-copy of this collection.

Parameters:
collection - the collection of which the copy is created.
Method Detail

setDataAccessManager

public void setDataAccessManager(DataAccessManager dataAccessManager)
Description copied from class: ResourceImpl
Method to set the data access manager.

Overrides:
setDataAccessManager in class ResourceImpl
Parameters:
dataAccessManager - the data access manager.

setVersionList

public void setVersionList(VersionRetriever versionList)
Method to set the version retriever instance.

Parameters:
versionList - the version retriever.

setVersionListIndex

public void setVersionListIndex(int versionListIndex)
Method to set the index of the current collection in the version list

Parameters:
versionListIndex - the index of the current collection in the list.

getChildren

public String[] getChildren()
                     throws RegistryException
Method to return the absolute paths of the children of the collection. All the returning paths will be in the same snapshot as the current collection.

Specified by:
getChildren in interface org.wso2.carbon.registry.api.Collection
Overrides:
getChildren in class CollectionImpl
Returns:
the array of absolute paths of the children
Throws:
RegistryException - if the operation fails.

getChildren

public String[] getChildren(int start,
                            int pageLen)
                     throws RegistryException
Method to return the paths of the selected range of children.

Specified by:
getChildren in interface org.wso2.carbon.registry.api.Collection
Overrides:
getChildren in class CollectionImpl
Parameters:
start - the starting number of children.
pageLen - the number of entries to retrieve.
Returns:
an array of paths of the selected range of children.
Throws:
RegistryException - if the operation fails.

getChildCount

public int getChildCount()
                  throws RegistryException
Method to return the the number of children.

Specified by:
getChildCount in interface org.wso2.carbon.registry.api.Collection
Overrides:
getChildCount in class CollectionImpl
Returns:
the number of children.
Throws:
RegistryException - if the operation fails.

getContent

public Object getContent()
                  throws RegistryException
Collection's content is a string array, which contains paths of its children. These paths are loaded on demand to increase performance. It is recommended to use getChildren() method to get child paths of a collection, which provides pagination. Calling this method will load all child paths.

Specified by:
getContent in interface org.wso2.carbon.registry.api.Resource
Overrides:
getContent in class CollectionImpl
Returns:
String array of child paths.
Throws:
RegistryException - On any error.


Copyright © 2012 WSO2 Inc. All Rights Reserved.