org.xiruss.repository.server
Class RepositoryObjectBase

java.lang.Object
  extended by org.xiruss.repository.server.RepositoryObjectBase
All Implemented Interfaces:
java.lang.Comparable, RepositoryObject
Direct Known Subclasses:
BranchBase, DependencyLinkBase, ResolutionPolicyBase, ResourceBase, SessionBase, SnapshotBase, StorageManagerBase, UserBase, VersionBase

public class RepositoryObjectBase
extends java.lang.Object
implements java.lang.Comparable, RepositoryObject

Superclass for all SnapCM Repository objects.


Field Summary
protected  java.lang.String id
           
protected  java.lang.String name
           
protected  int objectTypeConstant
           
protected  java.util.Map properties
           
protected  Repository rep
           
 
Constructor Summary
RepositoryObjectBase()
           
 
Method Summary
 void accept(RepositoryVisitor visitor)
           
 int compareTo(java.lang.Object arg0)
           
 java.lang.String getId()
           
 java.lang.String getName()
           
 java.util.Map getProperties()
          Returns the hash map of properties for the object.
 java.lang.Object getProperty(java.lang.String propertyName)
           
 java.util.Set getPropertyNames()
           
 Repository getRepository()
           
 int getType()
           
 boolean hasProperty(java.lang.String propertyName)
           
protected  void initialize(Repository rep, java.lang.String objId)
           
 void initialize(Repository rep, java.lang.String objId, java.lang.String objName)
          Initialize the object with the specified object ID and name.
 boolean isNull()
           
 void setId(java.lang.String id)
          Sets the ID on a newly-created repository object.
 java.lang.String setName(java.lang.String newName)
          Sets the name of object.
protected  void setProperties(java.util.HashMap properties)
          Only to be used for object persistence.
 void setProperty(java.lang.String propertyName, java.lang.Object propertyValue)
           
protected  void setRepository(Repository rep)
           
protected  void setType(int objectType)
          Only to be used for object persistence.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rep

protected Repository rep

properties

protected java.util.Map properties

name

protected java.lang.String name

id

protected java.lang.String id

objectTypeConstant

protected int objectTypeConstant
Constructor Detail

RepositoryObjectBase

public RepositoryObjectBase()
Method Detail

setId

public void setId(java.lang.String id)
           throws ObjectMutationException
Description copied from interface: RepositoryObject
Sets the ID on a newly-created repository object. This is write-once property.

Specified by:
setId in interface RepositoryObject
Parameters:
id - Object ID (assigned by the owning repository)
Throws:
ObjectMutationException - If object already has an assigned ID, indicating that is has already been constructed.

initialize

protected void initialize(Repository rep,
                          java.lang.String objId)
                   throws ObjectMutationException
Throws:
ObjectMutationException

setType

protected void setType(int objectType)
Only to be used for object persistence.

Parameters:
objectType - one of XirussRepConst.SnapcmObjectTypes

setProperties

protected void setProperties(java.util.HashMap properties)
Only to be used for object persistence.

Parameters:
properties -

initialize

public void initialize(Repository rep,
                       java.lang.String objId,
                       java.lang.String objName)
                throws ObjectMutationException
Description copied from interface: RepositoryObject
Initialize the object with the specified object ID and name. This method is for the benefit of repositories that need to construct new objects using no-argument constructors.

Specified by:
initialize in interface RepositoryObject
Throws:
ObjectMutationException - If object already has an assigned ID, indicating that is has already been constructed.

getName

public java.lang.String getName()
Specified by:
getName in interface RepositoryObject

setName

public java.lang.String setName(java.lang.String newName)
Description copied from interface: RepositoryObject
Sets the name of object. Returns the old object name.

Specified by:
setName in interface RepositoryObject
Parameters:
newName - New name to set on the object.
Returns:
Old object name

getId

public java.lang.String getId()
Specified by:
getId in interface RepositoryObject

getRepository

public Repository getRepository()
Specified by:
getRepository in interface RepositoryObject
Returns:

hasProperty

public boolean hasProperty(java.lang.String propertyName)
Specified by:
hasProperty in interface RepositoryObject
Parameters:
propertyName -
Returns:

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Specified by:
getProperty in interface RepositoryObject
Parameters:
propertyName - The name of the property to retrieve.
Returns:
The property value object.

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object propertyValue)
Specified by:
setProperty in interface RepositoryObject
Parameters:
propertyName -
value - object

compareTo

public int compareTo(java.lang.Object arg0)
Specified by:
compareTo in interface java.lang.Comparable
Specified by:
compareTo in interface RepositoryObject

toString

public java.lang.String toString()
Specified by:
toString in interface RepositoryObject
Overrides:
toString in class java.lang.Object

getType

public int getType()
Specified by:
getType in interface RepositoryObject
Returns:

getProperties

public java.util.Map getProperties()
Returns the hash map of properties for the object.

Specified by:
getProperties in interface RepositoryObject

setRepository

protected void setRepository(Repository rep)

isNull

public boolean isNull()
Specified by:
isNull in interface RepositoryObject

getPropertyNames

public java.util.Set getPropertyNames()
Specified by:
getPropertyNames in interface RepositoryObject

accept

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