Package lumis.portal.serialization
Class SerializationManager2
- java.lang.Object
-
- lumis.portal.serialization.SerializationManager2
-
- All Implemented Interfaces:
ISerializationManager2
public class SerializationManager2 extends java.lang.Object implements ISerializationManager2
Manager for portal objects serialization and deserialization- Since:
- 4.0.7
- Version:
- $Revision$ $Date$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SerializationManager2.SerializeChannelRunner
class
SerializationManager2.WorkflowSerializationMessageConfig
-
Field Summary
-
Fields inherited from interface lumis.portal.serialization.ISerializationManager2
ATTRIBUTE_DESERIALIZING, ATTRIBUTE_SERIALIZING
-
-
Constructor Summary
Constructors Constructor Description SerializationManager2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginDeserializeChannel(DeserializationContext deserializationContext)
Deserialize a channel from a xml file asynchronously.void
beginDeserializeServiceInstanceContent(DeserializationContext deserializationContext, java.lang.String serviceInstanceId)
Deserialize the contents of aServiceInstanceConfig
from a xml file asynchronously.void
beginSerializeChannel(SerializationContext serializationContext)
Serialize a channel to a xml file asynchronously.java.lang.String
deserializeChannel(DeserializationContext deserializationContext)
Deserialize a channel from a xml file.<T> T
deserializeObject(java.lang.Class<T> objectClass, IDirectory directory, java.lang.String filePath, java.lang.String alias, boolean fileIsOptional)
<T> T
deserializeObject(java.lang.Class<T> objectClass, IDirectory directory, java.lang.String filePath, java.lang.String alias, ISerializer serializer, boolean fileIsOptional)
Deserializes an object from a file in a directory.<T> T
deserializeObject(java.lang.Class<T> objectClass, IDirectory directory, java.lang.String filePath, java.lang.String alias, SerializationSettings serializationSettings, boolean fileIsOptional)
void
deserializePage(DeserializationContext deserializationContext, java.lang.String pageId, boolean setupSerializationContext, boolean checkUnresolvedDependencies)
Deserialize a page from a xml file.SerializationSettings
getExternalDependenciesSerializationSettings()
TODO: Método movido para SerializationContext e deprecated.void
serializeChannel(SerializationContext serializationContext)
Serialize a channel to a xml file.void
serializeMap(java.util.Map<java.lang.String,java.lang.String> map, IDirectory directory, java.lang.String filePath, java.lang.String alias)
Serializes a Map object where the name and value are of type String.void
serializeObject(java.lang.Object o, IDirectory directory, java.lang.String filePath, java.lang.String alias)
void
serializeObject(java.lang.Object o, IDirectory directory, java.lang.String filePath, java.lang.String alias, ISerializer serializer)
Serializes an object to a file in a directory.void
serializeObject(java.lang.Object o, IDirectory directory, java.lang.String filePath, java.lang.String alias, SerializationSettings serializationSettings)
java.lang.String
serializeObjectToString(java.lang.Object o, java.lang.String alias)
Serialize an object to a xml String.java.lang.String
serializeObjectToString(java.lang.Object o, java.lang.String alias, ISerializer serializer)
Serialize an object to a xml String, using a given XStream objectjava.lang.String
serializeObjectToString(java.lang.Object o, java.lang.String alias, SerializationSettings serializationSettings)
Serialize an object to a xml String, using custom serialization settingsvoid
serializePage(SerializationContext serializationContext, java.lang.String pageId, boolean setupSerializationContext)
Serialize a page to a xml file.
-
-
-
Method Detail
-
beginSerializeChannel
public void beginSerializeChannel(SerializationContext serializationContext) throws ManagerException, PortalException
Description copied from interface:ISerializationManager2
Serialize a channel to a xml file asynchronously.- Specified by:
beginSerializeChannel
in interfaceISerializationManager2
- Parameters:
serializationContext
- context object that contains all operation settings- Throws:
ManagerException
PortalException
-
beginDeserializeChannel
public void beginDeserializeChannel(DeserializationContext deserializationContext) throws ManagerException, PortalException
Description copied from interface:ISerializationManager2
Deserialize a channel from a xml file asynchronously.- Specified by:
beginDeserializeChannel
in interfaceISerializationManager2
- Parameters:
deserializationContext
- context object that contains all operation settings- Throws:
ManagerException
PortalException
-
beginDeserializeServiceInstanceContent
public void beginDeserializeServiceInstanceContent(DeserializationContext deserializationContext, java.lang.String serviceInstanceId) throws ManagerException, PortalException
Description copied from interface:ISerializationManager2
Deserialize the contents of aServiceInstanceConfig
from a xml file asynchronously.- Specified by:
beginDeserializeServiceInstanceContent
in interfaceISerializationManager2
- Parameters:
deserializationContext
- context object that contains all operation settings.serviceInstanceId
- the service instance identifier.- Throws:
ManagerException
PortalException
-
serializeChannel
public void serializeChannel(SerializationContext serializationContext) throws ManagerException, PortalException
Description copied from interface:ISerializationManager2
Serialize a channel to a xml file.- Specified by:
serializeChannel
in interfaceISerializationManager2
- Parameters:
serializationContext
- context object that contains all operation settings- Throws:
ManagerException
PortalException
-
getExternalDependenciesSerializationSettings
public SerializationSettings getExternalDependenciesSerializationSettings()
TODO: Método movido para SerializationContext e deprecated.- Specified by:
getExternalDependenciesSerializationSettings
in interfaceISerializationManager2
-
deserializeChannel
public java.lang.String deserializeChannel(DeserializationContext deserializationContext) throws ManagerException, PortalException
Description copied from interface:ISerializationManager2
Deserialize a channel from a xml file.- Specified by:
deserializeChannel
in interfaceISerializationManager2
- Parameters:
deserializationContext
- context object that contains all operation settings- Returns:
- Throws:
ManagerException
PortalException
-
deserializePage
public void deserializePage(DeserializationContext deserializationContext, java.lang.String pageId, boolean setupSerializationContext, boolean checkUnresolvedDependencies) throws ManagerException, PortalException
Description copied from interface:ISerializationManager2
Deserialize a page from a xml file.- Specified by:
deserializePage
in interfaceISerializationManager2
- Parameters:
deserializationContext
- context object that contains all operation settingspageId
- page to be deserializedsetupSerializationContext
- indicates if the serialization settings must be set before the operationcheckUnresolvedDependencies
- indicates when the existence of unresolved dependencies must raise aSerializationException
- Throws:
ManagerException
PortalException
-
serializePage
public void serializePage(SerializationContext serializationContext, java.lang.String pageId, boolean setupSerializationContext) throws ManagerException, PortalException
Description copied from interface:ISerializationManager2
Serialize a page to a xml file.- Specified by:
serializePage
in interfaceISerializationManager2
- Parameters:
serializationContext
- context object that contains all operation settingspageId
- page to be serializedsetupSerializationContext
- indicates if the serialization settings must be set before the operation- Throws:
ManagerException
PortalException
-
serializeObjectToString
public java.lang.String serializeObjectToString(java.lang.Object o, java.lang.String alias) throws SerializationException
Description copied from interface:ISerializationManager2
Serialize an object to a xml String.- Specified by:
serializeObjectToString
in interfaceISerializationManager2
- Parameters:
o
- object to be serializedalias
- alias (tag name) for the object- Returns:
- Throws:
SerializationException
-
serializeObjectToString
public java.lang.String serializeObjectToString(java.lang.Object o, java.lang.String alias, SerializationSettings serializationSettings) throws SerializationException
Description copied from interface:ISerializationManager2
Serialize an object to a xml String, using custom serialization settings- Specified by:
serializeObjectToString
in interfaceISerializationManager2
- Parameters:
o
- object to be serializedalias
- alias (tag name) for the objectserializationSettings
- serialization settings for the operation- Returns:
- Throws:
SerializationException
-
serializeObjectToString
public java.lang.String serializeObjectToString(java.lang.Object o, java.lang.String alias, ISerializer serializer) throws SerializationException
Description copied from interface:ISerializationManager2
Serialize an object to a xml String, using a given XStream object- Specified by:
serializeObjectToString
in interfaceISerializationManager2
- Parameters:
o
- object to be serializedalias
- alias (tag name) for the object.serializer
- the object serializer instance.- Returns:
- String representation of the object.
- Throws:
SerializationException
-
serializeObject
public void serializeObject(java.lang.Object o, IDirectory directory, java.lang.String filePath, java.lang.String alias) throws SerializationException
- Specified by:
serializeObject
in interfaceISerializationManager2
- Throws:
SerializationException
-
serializeObject
public void serializeObject(java.lang.Object o, IDirectory directory, java.lang.String filePath, java.lang.String alias, SerializationSettings serializationSettings) throws SerializationException
- Specified by:
serializeObject
in interfaceISerializationManager2
- Throws:
SerializationException
-
serializeObject
public void serializeObject(java.lang.Object o, IDirectory directory, java.lang.String filePath, java.lang.String alias, ISerializer serializer) throws SerializationException
Description copied from interface:ISerializationManager2
Serializes an object to a file in a directory.- Specified by:
serializeObject
in interfaceISerializationManager2
- Parameters:
o
- the object.directory
- the directory.filePath
- the file path in the directory.alias
- the alias for the object.serializer
- the object serializer instance.- Throws:
SerializationException
-
serializeMap
public void serializeMap(java.util.Map<java.lang.String,java.lang.String> map, IDirectory directory, java.lang.String filePath, java.lang.String alias) throws SerializationException
Description copied from interface:ISerializationManager2
Serializes a Map object where the name and value are of type String.- Specified by:
serializeMap
in interfaceISerializationManager2
- Parameters:
map
- the map object to be serialized.directory
- the directory objecto to be serialized to.filePath
- the file path within the directory.alias
- alias to use for the Map object.- Throws:
SerializationException
-
deserializeObject
public <T> T deserializeObject(java.lang.Class<T> objectClass, IDirectory directory, java.lang.String filePath, java.lang.String alias, boolean fileIsOptional) throws SerializationException
- Specified by:
deserializeObject
in interfaceISerializationManager2
- Throws:
SerializationException
-
deserializeObject
public <T> T deserializeObject(java.lang.Class<T> objectClass, IDirectory directory, java.lang.String filePath, java.lang.String alias, SerializationSettings serializationSettings, boolean fileIsOptional) throws SerializationException
- Specified by:
deserializeObject
in interfaceISerializationManager2
- Throws:
SerializationException
-
deserializeObject
public <T> T deserializeObject(java.lang.Class<T> objectClass, IDirectory directory, java.lang.String filePath, java.lang.String alias, ISerializer serializer, boolean fileIsOptional) throws SerializationException
Description copied from interface:ISerializationManager2
Deserializes an object from a file in a directory.- Specified by:
deserializeObject
in interfaceISerializationManager2
- Type Parameters:
T
- the object type.- Parameters:
objectClass
- the object class type.directory
- the directory.filePath
- the file path in the directory.alias
- the alias for the object.serializer
- the object serializer instance.fileIsOptional
- iftrue
, the file may not exist, which causes the return to benull
.- Returns:
- the deserialized object, or
null
iffileIsOptional
is true and the file is not found. - Throws:
SerializationException
-
-