com.sap.netweaver.bc.serialize

Interface ISerializer

All Known Subinterfaces:
IPAISerializer
All Known Implementing Classes:
CollaborationTransportExport

public interface ISerializer

Interface to be implemented by all repository services, global services etc. that are interested in adding data when a snapshot of an IResource. is taken. This snapshot can be stored within the system or send to another instance of a KMC runtime. The data written out by an implementation using the export method will be used to reconstruct the resource as it was at the time the snapshot was taken.
Instances must be registered with the central ISerializerRegistrator.

Copyright 2004 SAP AG


Nested Class Summary
static class ISerializer.DeserializationParameters
           
static class ISerializer.IDValidator
           
static class ISerializer.ImportMode
          Utility Class used to define the different ways a deserialization can occur.
static class ISerializer.SerializationParameters
          Container to group all the data needed for the export step
 
Field Summary
static ISerializer.ImportMode ADD_AND_DELETE
           
static ISerializer.ImportMode ADD_ONLY
           
static ISerializer.ImportMode MERGE_FOLDER
           
static String VALID_CHARS
           
 
Method Summary
 IDeserializer deserialize(ISerializer.DeserializationParameters parameters)
          called to actually recreate the snapshot of the resource denoted by the RID passed here.
 String getDisplayName(Locale locale)
          Gets the localized display name of this ISerializer.
 HeaderData getHeaderData()
           
 String getID()
          Gets the unique identifier of this ISerializer.
 boolean isDeserializable(ISerializer.DeserializationParameters parameters)
          Returns whether this serializer is able to import content for resources in the repository denoted by its root resource passed in parameter.
 boolean isSerializable(ISerializer.SerializationParameters params)
          Returns whether this serializer wants to export content for resources in the repository denoted by its root resource passed in parameter.
 void serialize(ISerializer.SerializationParameters params)
          Exports that part of the content of the specified resource this serializer is responsible for.
 

Field Detail

ADD_ONLY

static final ISerializer.ImportMode ADD_ONLY

ADD_AND_DELETE

static final ISerializer.ImportMode ADD_AND_DELETE

MERGE_FOLDER

static final ISerializer.ImportMode MERGE_FOLDER

VALID_CHARS

static final String VALID_CHARS
See Also:
Constant Field Values
Method Detail

getID

String getID()
Gets the unique identifier of this ISerializer. Must be unique in the matching table of the ISerializerRegistrator. So for each RID in the registrator, only one ISeralizer can have a certain ID. The returned string must not be null, must not consist of only blanks. It must only contain characters stated in the VALID_CHARS constant of this interface. You can check validity by using ISerializer.IDValidator.isValid(String). A serializer with an invalid ID will not be registered with the Registrator instead, a runtime exception will be thrown.

Returns:
the unique identifier

getDisplayName

String getDisplayName(Locale locale)
Gets the localized display name of this ISerializer.

Parameters:
locale - the Locale
Returns:
the localized display name or null

isSerializable

boolean isSerializable(ISerializer.SerializationParameters params)
                       throws SerializationException
Returns whether this serializer wants to export content for resources in the repository denoted by its root resource passed in parameter.

If an implementation returns false, the callback method serialize(com.sap.netweaver.bc.serialize.ISerializer.SerializationParameters)will not be called for resources of that repository within the current serialization cycle.

Parameters:
params - defining the parameters for the call, must not be null
Returns:
flag, if this ISerializer should be called for resources in the repository defined in the parameters parameter.
Throws:
SerializationException - If the exception is thrown, the calling class should interpret this exception the same way as it would interpret a false as return value

serialize

void serialize(ISerializer.SerializationParameters params)
               throws SerializationException
Exports that part of the content of the specified resource this serializer is responsible for.

If the implementing class does not need to serialize any data for the given IResource, it should not call the IXMLSerializer supplied in the params-container. If that xmlserializer is called, it will create an xml-file or snippet for the calling class. This will result in a call to that class when the deserialization is triggered as well. So the unneeded call to the xmlserializer results in a double performance overhead.

Parameters:
params - defining the parameters for the call, must not be null
Throws:
SerializationException - The calling class has to ensure, that any Stream object passed to this method will be properly closed. Depending on the severity of the exception, the snapshot of the complete resource has to be aborted.

isDeserializable

boolean isDeserializable(ISerializer.DeserializationParameters parameters)
                         throws SerializationException
Returns whether this serializer is able to import content for resources in the repository denoted by its root resource passed in parameter.

If an implementation returns false, the callback method deserialize(com.sap.netweaver.bc.serialize.ISerializer.DeserializationParameters)will not be called for resources of that repository within the current deserialization cycle.

Parameters:
parameters - defining the parameters for the call, must not be null
Returns:
flag, if this ISerializer should be called for resources in the repository defined in the parameters parameter.
Throws:
SerializationException - If the exception is thrown, the calling class should interpret this exception the same way as it would interpret a false as return value

deserialize

IDeserializer deserialize(ISerializer.DeserializationParameters parameters)
                          throws SerializationException
called to actually recreate the snapshot of the resource denoted by the RID passed here. The data created in the serialize(com.sap.netweaver.bc.serialize.ISerializer.SerializationParameters)will be used for this. Only data created by this serializer will be available. It will be available exactly as it was created.

Parameters:
parameters - defining the parameters for the call, must not be null
Returns:
the handler which will be called when parsing the data created in the serialize(com.sap.netweaver.bc.serialize.ISerializer.SerializationParameters)method. Must not be null
Throws:
SerializationException - Depending on the severity of the exception, the snapshot of the complete resource has to be aborted.

getHeaderData

HeaderData getHeaderData()
Returns:
the properties of this instance of a ISerializer implementation. Must not return null, but might return an empty instance.
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice