com.versionone.om
Class Entity

java.lang.Object
  extended by com.versionone.om.Entity
Direct Known Subclasses:
Attachment, BaseAsset, Conversation, Effort, Environment, Link, MessageReceipt, Note, Role, State

public abstract class Entity
extends java.lang.Object

Abstract representation of entities in the VersionOne system.


Field Summary
protected static java.lang.String ASSET_STATE_VALUE
           
protected static java.lang.String ASSET_VALUE
           
static java.lang.String CHANGE_DATE_UTC
          Change date attribute.
protected static java.lang.String CONTENT_TYPE_VALUE
           
protected static java.lang.String CONTENT_VALUE
           
static java.lang.String CREATE_DATE_UTC
          Create date attribute.
protected static java.lang.String DELETE_OPERATION
           
protected static java.lang.String DESCRIPTION_VALUE
           
protected static java.lang.String FILENAME_VALUE
           
protected static java.lang.String NAME_VALUE
           
 
Constructor Summary
protected Entity(AssetID id, V1Instance instance)
          Constructor used to represent an entity that DOES exist in the VersionOne System.
protected Entity(V1Instance instance)
          Constructor used to represent an entity that does NOT exist yet in the VersionOne System.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this Entity with the specified object.
protected  java.lang.Object get(java.lang.String name)
          Gets a simple value by name for this entity.
 java.lang.String getChangeComment()
           
 DateTime getChangeDate()
           
 Member getChangedBy()
           
 java.lang.String getCreateComment()
           
 DateTime getCreateDate()
           
 Member getCreatedBy()
           
 AssetID getID()
          Unique ID of this entity.
protected  V1Instance getInstance()
           
 int hashCode()
          To calculate hashCode used assetID or stubAssetID field.
 void save()
          Save any changes to this entity to the VersionOne System.
 void save(java.lang.String comment)
          Save any changes to this entity to the VersionOne System with a comment.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DESCRIPTION_VALUE

protected static final java.lang.String DESCRIPTION_VALUE
See Also:
Constant Field Values

ASSET_VALUE

protected static final java.lang.String ASSET_VALUE
See Also:
Constant Field Values

ASSET_STATE_VALUE

protected static final java.lang.String ASSET_STATE_VALUE
See Also:
Constant Field Values

CONTENT_TYPE_VALUE

protected static final java.lang.String CONTENT_TYPE_VALUE
See Also:
Constant Field Values

FILENAME_VALUE

protected static final java.lang.String FILENAME_VALUE
See Also:
Constant Field Values

NAME_VALUE

protected static final java.lang.String NAME_VALUE
See Also:
Constant Field Values

CONTENT_VALUE

protected static final java.lang.String CONTENT_VALUE
See Also:
Constant Field Values

CREATE_DATE_UTC

public static final java.lang.String CREATE_DATE_UTC
Create date attribute.

See Also:
Constant Field Values

CHANGE_DATE_UTC

public static final java.lang.String CHANGE_DATE_UTC
Change date attribute.

See Also:
Constant Field Values

DELETE_OPERATION

protected static final java.lang.String DELETE_OPERATION
See Also:
Constant Field Values
Constructor Detail

Entity

protected Entity(AssetID id,
                 V1Instance instance)
Constructor used to represent an entity that DOES exist in the VersionOne System.

Parameters:
id - Unique ID of this entity.
instance - this entity belongs to.

Entity

protected Entity(V1Instance instance)
Constructor used to represent an entity that does NOT exist yet in the VersionOne System.

Parameters:
instance - this entity belongs to.
Method Detail

getInstance

protected V1Instance getInstance()
Returns:
V1Instance this entity belongs to.

getID

public AssetID getID()
Unique ID of this entity.

Returns:
id of this entity.

getChangeDate

public DateTime getChangeDate()
Returns:
Date this entity was last changed in UTC.

getChangeComment

public java.lang.String getChangeComment()
Returns:
Comment entered when this entity was last updated.

getChangedBy

public Member getChangedBy()
Returns:
Member or user that last changed this entity.

getCreateDate

public DateTime getCreateDate()
Returns:
Date this entity was created in UTC.

getCreateComment

public java.lang.String getCreateComment()
Returns:
Comment entered when this entity was created.

getCreatedBy

public Member getCreatedBy()
Returns:
Member or user that created this entity.

get

protected java.lang.Object get(java.lang.String name)
Gets a simple value by name for this entity.

Parameters:
name - Name of the attribute.
Returns:
An attribute value.

save

public void save(java.lang.String comment)
          throws DataException,
                 ApplicationUnavailableException
Save any changes to this entity to the VersionOne System with a comment.

Parameters:
comment - Comment.
Throws:
DataException - Thrown when a rule or security violation has occurred.
ApplicationUnavailableException - Thrown when network connection to V1 Server is lost.

save

public void save()
          throws DataException,
                 ApplicationUnavailableException
Save any changes to this entity to the VersionOne System.

Throws:
DataException - Thrown when a rule or security violation has occurred.
ApplicationUnavailableException - Thrown when network connection to V1 Server is lost.

equals

public boolean equals(java.lang.Object obj)
Compares this Entity with the specified object. The result is true if and only if the argument is not null and is an Entity with the same AssetID.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare this Entity against.
Returns:
true if the given object represents the same Entity on the server, false otherwise.

hashCode

public int hashCode()
To calculate hashCode used assetID or stubAssetID field.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.
See Also:
AssetID.hashCode().

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
AssetID token for the Entity.
See Also:
AssetID.toString().