org.xiruss.repository.server
Class ResourceBase

java.lang.Object
  extended by org.xiruss.repository.server.RepositoryObjectBase
      extended by org.xiruss.repository.server.ResourceBase
All Implemented Interfaces:
java.lang.Comparable, RepositoryObject, Resource

public class ResourceBase
extends RepositoryObjectBase
implements Resource

A SnapCM resource representing a set of versions.


Field Summary
(package private) static org.apache.log4j.Logger logger
           
(package private)  VersionMap versionsById
           
 
Fields inherited from class org.xiruss.repository.server.RepositoryObjectBase
id, name, objectTypeConstant, properties, rep
 
Constructor Summary
ResourceBase()
           
ResourceBase(java.lang.String resourceId, java.lang.String resourceName, Repository rep)
           
 
Method Summary
 void accept(RepositoryVisitor visitor)
           
 void addVersion(Version version)
           
 VersionMap getInitialVersions()
          Gets a map of the initial versions for the resource.
 long getVersionCount()
          Returns the total number of versions for this resource.
 VersionMap getVersions()
           
 
Methods inherited from class org.xiruss.repository.server.RepositoryObjectBase
compareTo, getId, getName, getProperties, getProperty, getPropertyNames, getRepository, getType, hasProperty, initialize, initialize, isNull, setId, setName, setProperties, setProperty, setRepository, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xiruss.snapcm.api.RepositoryObject
compareTo, getId, getName, getProperties, getProperty, getPropertyNames, getRepository, getType, hasProperty, initialize, isNull, setId, setName, setProperty, toString
 

Field Detail

logger

static org.apache.log4j.Logger logger

versionsById

VersionMap versionsById
Constructor Detail

ResourceBase

public ResourceBase()

ResourceBase

public ResourceBase(java.lang.String resourceId,
                    java.lang.String resourceName,
                    Repository rep)
Method Detail

getVersions

public VersionMap getVersions()
Specified by:
getVersions in interface Resource

addVersion

public void addVersion(Version version)
Specified by:
addVersion in interface Resource
Parameters:
version -

getInitialVersions

public VersionMap getInitialVersions()
Gets a map of the initial versions for the resource. Initial versions are versions that have no previous version.

Specified by:
getInitialVersions in interface Resource
Returns:
Map of initial versions, if any

accept

public void accept(RepositoryVisitor visitor)
            throws java.lang.Throwable
Specified by:
accept in interface RepositoryObject
Overrides:
accept in class RepositoryObjectBase
Throws:
java.lang.Throwable

getVersionCount

public long getVersionCount()
Description copied from interface: Resource
Returns the total number of versions for this resource.

Specified by:
getVersionCount in interface Resource