Overview Package Class Tree Serialized Deprecated Index Help PREV class NEXT class SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
com.ibm.portal.identification
Interface Identification
- public interface Identification
The
Identification interface provides serialization and deserialization functionality for ObjectID instances.
Basically, deserialization can only be applied to String instances, which have been created by serialize(com.ibm.portal.ObjectID). One exception is a String that contains a unique name, because deserialize(java.lang.String) also resolves unique names.
Serialized com.ibm.portal.ObjectID instances do not expire. They can be deserialized using this method at any time. Additionally, serialized representations will be recognized in future versions of WebSphere Portal.
However, transient flavors of com.ibm.portal.ObjectID do have an expiration period. They are valid within a single session. During that session they are serializable and deserializable for up to 50 days.
Usage:
try
{
Context ctx = new InitialContext();
Name ctxName = new CompositeName("portal:service/Identification");
Identification identification = (Identification) ctx.lookup(ctxName);
String serializedOID = identification.serialize(aOID);
...
ObjectID anotherOID = identification.deserialize(serializedOID);
}
catch (SerializationException sx}
{
// some error handling code here
}
catch (NamingException nx}
{
// some error handling code here
}
- Since:
- 5.1.0.1
Method Summary ObjectID deserialize(java.lang.String serialized)
Deserializes String instances to ObjectID instances.
Input of this method must be the output of serialize(com.ibm.portal.ObjectID).
Unique names are the only exception.java.lang.String serialize(ObjectID oid)
Serializes com.ibm.portal.ObjectID instances into their String representation.
In order to revert the resulting String back to the corresponding ObjectID instance use deserialize(java.lang.String).
Method Detail serialize
public java.lang.String serialize(ObjectID oid) throws SerializationException
- Serializes com.ibm.portal.ObjectID instances into their String representation.
In order to revert the resulting String back to the corresponding ObjectID instance use deserialize(java.lang.String).
- Parameters:
- oid - The ObjectID instance, which will be serialized
- Returns:
- The String representation of the ObjectID instance supplied
- Throws:
- SerializationException - The exception is thrown if there was an error during serialization
deserialize
public ObjectID deserialize(java.lang.String serialized) throws SerializationException
- Deserializes String instances to ObjectID instances.
Input of this method must be the output of serialize(com.ibm.portal.ObjectID).
Unique names are the only exception. They can be resolved to ObjectID instances by this method, too, if they have been defined in this portal before. Unknown names cause this method to throw a SerializationException.
An exception is thrown, if a ObjectID is supposed to be deserialized although this object ID still can be generated in future.
However, a successful deserialization does not give any evidence regarding the validity of the value that was provided as parameter. But the parameter has an incorrect value, if an exception was thrown.
- Parameters:
- serialized - A serialized ObjectID or a valid unique name, respectively
- Returns:
- The ObjectID instance that is represented by the parameter
- Throws:
- SerializationException - The exception is thrown if the parameter is neither a ObjectID instance in its serialized format nor a valid unique name
Overview Package Class Tree Serialized Deprecated Index Help PREV class NEXT class SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.