public class SDOHelper
extends java.lang.Object
Constructor and Description |
---|
SDOHelper() |
Modifier and Type | Method and Description |
---|---|
static DataObject |
cloneDataObject(DataObject dataObject)
Clones the input DataObject.
|
static EObject |
cloneEObject(EObject obj)
Clones an EObject.
|
static DataObject |
cloneRootDataObject(DataObject root)
Clones the input root DataObject.
|
static DataObject |
createChangeCtrlFromChangeRespCtrl(DataObject newRoot,
DataObject prevRoot)
Creates ChangeControl DataObject using the ChangeResponseControl DataObject.
|
static DataObject |
createConfigDataObject(DataObject parentDO,
java.lang.String uri,
java.lang.String configType)
Creates a config type data object under the specified parent data ojbect, with specified virtual member manager configuration uri.
|
static DataObject |
createConfigProviderDataObject()
Creates an empty data object that contains virtual member manager configuration name space URI in the document root.
|
static DataObject |
createConfigRepositoryDataObject(DataObject configProvider,
java.lang.String repositoryTypeName)
Creates an entity data object under the specified root data object with specified eitity type URI.
|
static DataObject |
createContextDataObject(DataGraph dataGraph,
java.lang.String uri,
java.lang.String contextTypeName)
Creates a context data object under the specified data graph with specified context type uri.
|
static DataObject |
createContextDataObject(DataObject root,
java.lang.String uri,
java.lang.String contextTypeName)
Creates a context data object under the specified root data object with specified context type URI.
|
static DataObject |
createControlDataObject(DataGraph dataGraph,
java.lang.String uri,
java.lang.String controlTypeName)
Creates a control data object under the specified data graph with specified control type URI.
|
static DataObject |
createControlDataObject(DataObject root,
java.lang.String uri,
java.lang.String controlTypeName)
Creates a control data object under the specified root data object with specified control type URI.
|
static DataGraph |
createDataGraph(java.lang.String uri)
Creates an empty data graph that has the document root under the specified URI.
|
static DataObject |
createDataObject(java.lang.String uri,
java.lang.String typeName)
Creates a type data object with specified uri.
|
static DataObject |
createEntityDataObject(DataGraph dataGraph,
java.lang.String uri,
java.lang.String entityTypeName)
Creates an entity data object under the specified data graph with specified entity type URI.
|
static DataObject |
createEntityDataObject(DataObject root,
java.lang.String uri,
java.lang.String entityTypeName)
Creates an entity data object under the specified root data object with specified eitity type URI.
|
static DataObject |
createRootDataObject()
Creates an empty data object that contains virtual member manager name space URI in the document root.
|
static DataObject |
deepCloneRootDataObject(DataObject root)
Returns a deep clone of root DataObject once ChangeSummary is not null,
otherwise, normal cloneRootDataObject will be returned.
|
static java.lang.Object |
deepCopyObject(java.lang.Object root)
Returns a deep copy of an object, return null if the object to be cloned is null.
|
static java.util.Date |
getDateFromString(java.lang.String dateStr)
Returns a Date from the specified String.
|
static java.lang.String |
getDateString(java.util.Date date)
Returns a date String from the specified Date object.
|
public static DataObject createRootDataObject() throws WIMException
WIMException
public static DataObject createConfigDataObject(DataObject parentDO, java.lang.String uri, java.lang.String configType) throws WIMException
parentDO
- The parent data object to create the new data object under.uri
- The virtual member manager configuration namespace uri.configType
- The configuration type.WIMException
public static DataObject createConfigProviderDataObject()
WIMException
public static DataObject createConfigRepositoryDataObject(DataObject configProvider, java.lang.String repositoryTypeName)
SDOHelper.createConfigRepositoryDataObject(configProvider, ConfigConstants.CONFIG_DO_LDAP_REPOSITORY_TYPE);
configProvider
- The configuration provider data object that the repository data object to create under.repositoryTypeName
- A repository type name.public static DataGraph createDataGraph(java.lang.String uri)
uri
- The document root URI.public static DataObject createEntityDataObject(DataGraph dataGraph, java.lang.String uri, java.lang.String entityTypeName)
SDOHelper.createEntityDataObject(datagraph, null, SchemaConstants.DO_PERSON_ACCOUNT);
dataGraph
- A data graph that the entity data object to create under.uri
- The name space URI of the entity. If not specified, virtual member manager name space URI will be used ("http://www.ibm.com/websphere/wim").entityTypeName
- An entity type name.public static DataObject createEntityDataObject(DataObject root, java.lang.String uri, java.lang.String entityTypeName)
SDOHelper.createEntityDataObject(root, null, SchemaConstants.DO_PERSON_ACCOUNT);
root
- The root data object that the entity data object to create under.uri
- The name space URI of the entity. If not specified, virtual member manager name space URI will be used ("http://www.ibm.com/websphere/wim").entityTypeName
- An entity type name.public static DataObject createControlDataObject(DataGraph dataGraph, java.lang.String uri, java.lang.String controlTypeName)
SDOHelper.createControlDataObject(datagraph, null, SchemaConstants.DO_PROPERTY_CONTROL);
dataGraph
- The data graph that the control data object to create under.uri
- The name space URI of the control. If not specified, virtual member manager name space URI will be used ("http://www.ibm.com/websphere/wim").controlTypeName
- A control type name.public static DataObject createControlDataObject(DataObject root, java.lang.String uri, java.lang.String controlTypeName)
SDOHelper.createControlDataObject(root, null, SchemaConstants.DO_PROPERTY_CONTROL);
root
- The root data object that the control data object to create under.uri
- The name space URI of the control. If not specified, virtual member manager name space URI will be used ("http://www.ibm.com/websphere/wim").controlTypeName
- A control type name.public static DataObject createContextDataObject(DataGraph dataGraph, java.lang.String uri, java.lang.String contextTypeName)
SDOHelper.createContextDataObject(datagraph, null, SchemaConstants.TYPE_CONTEXT)
dataGraph
- The data graph that the context data object to create under.uri
- The name space URI of the context. If not specified, virtual member manager name space URI will be used ("http://www.ibm.com/websphere/wim").contextTypeName
- A context type name.public static DataObject createContextDataObject(DataObject root, java.lang.String uri, java.lang.String contextTypeName)
SDOHelper.createContextDataObject(root, null, SchemaConstants.TYPE_CONTEXT)
root
- The root data object that the context data object to create under.uri
- The name space URI of the context. If not specified, virtual member manager name space URI will be used ("http://www.ibm.com/websphere/wim").contextTypeName
- A context type name.public static DataObject createDataObject(java.lang.String uri, java.lang.String typeName)
SDOHelper.createDataObject(SchemaContants.WIM_NS_URI, SchemaConstants.DO_GROUP)
uri
- the name space URI of the type. If it is null or empty, default is virtual member manager name space URI ("http://www.ibm.com/websphere/wim").typeName
- The name of the type.public static java.lang.String getDateString(java.util.Date date)
date
- The Date object.public static java.util.Date getDateFromString(java.lang.String dateStr) throws WIMException
date
- Date string.WIMException
- if a parsing error occurs.public static DataObject cloneDataObject(DataObject dataObject)
dataObject
- the DataObject to be cloned.public static DataObject cloneRootDataObject(DataObject root)
root
- root DataObject to be cloned.public static EObject cloneEObject(EObject obj)
obj
- EOObject to be cloned.public static final DataObject deepCloneRootDataObject(DataObject root)
root
- DataObject to be copiedpublic static final java.lang.Object deepCopyObject(java.lang.Object root)
source
- Object to be copied (must be Serializable)public static DataObject createChangeCtrlFromChangeRespCtrl(DataObject newRoot, DataObject prevRoot)
newRoot
- It has/will have the ChangeControlprevRoot
- It has the ChangeResponseControl from which the checkpoint
list is to be copied to the ChangeControl in the newRoot