com.metamatrix.common.config.api
Class LockedConfigurationID

java.lang.Object
  extended by com.metamatrix.common.namedobject.BaseID
      extended by com.metamatrix.common.config.api.ComponentObjectID
          extended by com.metamatrix.common.config.api.ConfigurationID
              extended by com.metamatrix.common.config.api.LockedConfigurationID
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class LockedConfigurationID
extends ConfigurationID

This class acts as a wrapper around a single ConfigurationID, denoting that ID as being locked. However, this lock wrapper, since it extends ConfigurationID, can be treated like a ConfigurationID. In other words, this class uses the Decorator pattern to add a locked attribute to any ConfigurationID instance.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.metamatrix.common.namedobject.BaseID
atomicNames, DELIMITER, fullName, WILDCARD
 
Constructor Summary
LockedConfigurationID(ConfigurationID id, java.lang.String versionName, java.lang.String lockHolder, long lockAcquiredAt)
          Create a locked wrapper around the specified MetadataID instance.
 
Method Summary
 java.lang.Object clone()
          Return a deep cloned instance of this object.
 int compareTo(java.lang.Object obj)
          Compares this object to another.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object is semantically equal to this instance.
 java.lang.String getLockHolder()
           
 ConfigurationID getOriginalID()
           
 java.util.Date getTimeOfAcquisition()
           
 long getTimeOfAcquisitionAsLong()
           
 java.lang.String getVersion()
           
 
Methods inherited from class com.metamatrix.common.namedobject.BaseID
compareToByName, computeHashCode, getFullName, getName, getNameComponent, getNameComponents, getParentFullName, hashCode, hasParent, size, toString, updateHashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LockedConfigurationID

public LockedConfigurationID(ConfigurationID id,
                             java.lang.String versionName,
                             java.lang.String lockHolder,
                             long lockAcquiredAt)
Create a locked wrapper around the specified MetadataID instance.

Parameters:
configrationName - is the configuration that is to be locked.
versionName - along with configurationName uniquely identifies the configuration
Throws:
java.lang.IllegalArgumentException - if the ID is null
Method Detail

getOriginalID

public ConfigurationID getOriginalID()

getVersion

public java.lang.String getVersion()

getLockHolder

public java.lang.String getLockHolder()

getTimeOfAcquisitionAsLong

public long getTimeOfAcquisitionAsLong()

getTimeOfAcquisition

public java.util.Date getTimeOfAcquisition()

compareTo

public int compareTo(java.lang.Object obj)
Compares this object to another. If the specified object is an instance of the same class, then this method compares the name; otherwise, it throws a ClassCastException (as instances are comparable only to instances of the same class). Note: this method is consistent with equals().

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class BaseID
Parameters:
obj - the object that this instance is to be compared to.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object, respectively.
Throws:
java.lang.IllegalArgumentException - if the specified object reference is null
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this instance.

equals

public boolean equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this instance. Note: this method is consistent with compareTo().

Overrides:
equals in class BaseID
Parameters:
obj - the object that this instance is to be compared to.
Returns:
whether the object is equal to this object.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Return a deep cloned instance of this object. Subclasses must override this method.

Overrides:
clone in class BaseID
Returns:
the object that is the clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if this object cannot be cloned (i.e., only objects in Defaults cannot be cloned).


Copyright © 2009. All Rights Reserved.