com.metamatrix.common.id
Class TransactionIDFactory

java.lang.Object
  extended by com.metamatrix.core.id.LongIDFactory
      extended by com.metamatrix.common.id.TransactionIDFactory
All Implemented Interfaces:
ObjectIDFactory, java.io.Serializable

public class TransactionIDFactory
extends LongIDFactory

See Also:
Serialized Form

Constructor Summary
TransactionIDFactory()
           
 
Method Summary
 ObjectID create()
          Create a new ObjectID instance using this protocol.
 java.lang.String getProtocol()
          Return the name of the protocol that this factory uses.
 ObjectID stringToObject(java.lang.String value)
          Attempt to convert the specified string to the appropriate ObjectID instance.
 boolean validate(ObjectID id)
          Return whether the specified ObjectID instance is valid.
 
Methods inherited from class com.metamatrix.core.id.LongIDFactory
getDescription, getNextValue, stringWithoutProtocolToObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionIDFactory

public TransactionIDFactory()
Method Detail

getProtocol

public java.lang.String getProtocol()
Return the name of the protocol that this factory uses.

Specified by:
getProtocol in interface ObjectIDFactory
Overrides:
getProtocol in class LongIDFactory
Returns:
the protocol name

stringToObject

public ObjectID stringToObject(java.lang.String value)
                        throws InvalidIDException
Attempt to convert the specified string to the appropriate ObjectID instance.

Specified by:
stringToObject in interface ObjectIDFactory
Overrides:
stringToObject in class LongIDFactory
Parameters:
value - the stringified id with the protocol and ObjectID.DELIMITER already removed, and which is never null or zero length
Returns:
the ObjectID instance for the stringified ID if this factory is able to parse the string, or null if the factory is unaware of the specified format.
Throws:
InvalidIDException - if the parser is aware of this protocol, but it is of the wrong format for this type of ObjectID.

validate

public boolean validate(ObjectID id)
Return whether the specified ObjectID instance is valid. Only ObjectID instances that are for this protocol will be passed in.

This implementation only checks whether the ObjectID is an instance of a LongID.

Overrides:
validate in class LongIDFactory
Parameters:
id - the ID that is to be validated, and which is never null
Returns:
true if the instance is valid for this protocol, or false if it is not valid.

create

public ObjectID create()
Create a new ObjectID instance using this protocol.

Specified by:
create in interface ObjectIDFactory
Overrides:
create in class LongIDFactory
Returns:
the new instance


Copyright © 2009. All Rights Reserved.