public interface TopologyUpdateService
TopologyUpdateService topologyUpdateService = ucmdbService.getTopologyUpdateService(); TopologyUpdateFactory topologyUpdateFactory = topologyUpdateService.getFactory(); TopologyModificationData topologyModificationData = topologyUpdateFactory.createTopologyModificationData(); CI host = topologyModificationData.addCI("host"); host.setPropertyValue("host_key", "test1"); CI ip = topologyModificationData.addCI("ip"); ip.setPropertyValue("ip_address", "127.0.0.10"); ip.setPropertyValue("ip_domain", "DefaultDomain"); topologyModificationData.addRelation("contained", host, ip); TopologyModificationData topologyCleanupData = topologyUpdateFactory.createTopologyModificationData(); CI test_host = topologyCleanupData.addCI("host"); test_host.setPropertyValue("host_key", "test2"); TopologyModification topologyModification = topologyUpdateFactory.createTopologyModification(); topologyModification.setDataForCreate(topologyModificationData).setDataForDelete(topologyCleanupData); topologyUpdateService.execute(topologyModification,ModifyMode.OPTIMISTIC);
Modifier and Type | Method and Description |
---|---|
CreateOutput |
create(TopologyModificationData modificationData,
CreateMode mode)
Creates the specified set of CIs and relations in the UCMDB.
|
CreateStatus |
createGracefully(TopologyModificationData modificationData,
CreateGracefullyMode mode)
Similar to
create(TopologyModificationData, CreateMode) , except that on failure, instead of throwing an
exception, the given modificationData is split to smaller chunks that are processed individually. |
DeleteOutput |
delete(TopologyModificationData modificationData,
DeleteMode mode)
Deletes a set of CIs and relations from the UCMDB.
|
DeleteStatus |
deleteGracefully(TopologyModificationData modificationData)
Similar to
delete(TopologyModificationData, DeleteMode) , except that on failure, instead of throwing an
exception, the given modificationData is split to smaller chunks that are processed individually. |
ExecuteOutput |
execute(TopologyModificationBulk topologyModificationBulk)
Executes bulk of topology modifications
|
ExecuteOutput |
execute(TopologyModification topologyModification,
ModifyMode mode)
Deprecated.
|
GracefulTopologyModificationOutput |
executeGracefully(SingleTopologyModification topologyModification)
Executes single topology modification gracefully.
|
TopologyUpdateFactory |
getFactory() |
MergeOutput |
merge(MergeInput idsToMerge)
Merge a set of CIs in the UCMDB.
|
void |
touch(TopologyModificationData modificationData)
Delays deletion of UCMDB CIs and relations due to aging.
|
UpdateOutput |
update(TopologyModificationData modificationData)
Updates a set of CIs and relations in the UCMDB.
|
TopologyUpdateFactory getFactory()
CreateOutput create(TopologyModificationData modificationData, CreateMode mode) throws UcmdbException
modificationData
have temporary IDs. All key attributes
must be defined on these elements. This method calculates UCMDB IDs from the key attributes
and replaces the temporary IDs. All key attributes must be specified in the input modificationData
.
modificationData
have permanent UCMDB IDs, they are used only if the
type of those elements is defined as having randomly generated IDs. The IDs specified are used
to check whether the CIs and relations already exist.modificationData
- describes the CIs and relations to createmode
- specifies the behavior if items already exist. See the CreateMode
enum.UcmdbException
- in case of an exceptionCreateStatus createGracefully(TopologyModificationData modificationData, CreateGracefullyMode mode)
create(TopologyModificationData, CreateMode)
, except that on failure, instead of throwing an
exception, the given modificationData
is split to smaller chunks that are processed individually. That is done
in attempt to isolate the failed CI and to process the input bulk as much as possible. Splitting is done logically by avoiding
"breaking" relations that are essential in identifying the data.
Using this method may slow down performance when the modificationData
causes failures, otherwise,
performance is the same.
modificationData
- describes the CIs and relations to createmode
- specifies the behavior if items already exist. See the CreateGracefullyMode
enum.UpdateOutput update(TopologyModificationData modificationData) throws UcmdbException
modificationData
with
permanent UCMDB IDs.modificationData
- describes CIs and relations to updateUcmdbException
- in case of an exceptionvoid touch(TopologyModificationData modificationData) throws UcmdbException
modificationData
- Specifies the the CIs and relations to touch.
This method only uses the IDs from the modificationData.
Other properties are ignored.UcmdbException
- in case of an exceptionDeleteOutput delete(TopologyModificationData modificationData, DeleteMode mode) throws UcmdbException
modificationData
are the independent ends of relations that
require deletion of dependent CIs.
modificationData
be specified using have permanent UCMDB IDs.modificationData
- specifies the elements to deletemode
- specifies the behavior if items do not exist. See the DeleteMode
enum.UcmdbException
- in case of an exceptionDeleteStatus deleteGracefully(TopologyModificationData modificationData)
delete(TopologyModificationData, DeleteMode)
, except that on failure, instead of throwing an
exception, the given modificationData
is split to smaller chunks that are processed individually. That is done
in attempt to isolate the failed CI and to process the input bulk as much as possible. Splitting is done logically by avoiding
"breaking" relations that are essential in identifying the data.
Unlike delete(TopologyModificationData, DeleteMode)
, that has several deletion modes, this method supports a single
mode: DeleteMode.IGNORE_NON_EXISTING
.
Using this method may slow down performance when the modificationData
causes failures, otherwise,
performance is the same.
modificationData
- specifies the elements to delete@Deprecated ExecuteOutput execute(TopologyModification topologyModification, ModifyMode mode) throws UcmdbException
execute(TopologyModificationBulk)
com.hp.ucmdb.api.topology.ModifyMode.OPTIMISTIC
:
- When using the com.hp.ucmdb.api.topology.TopologyModification#setDataForCreate(...)
: is equivalent to com.hp.ucmdb.api.topology.CreateMode.UPDATE_EXISTING
when calling to com.hp.ucmdb.api.topology.TopologyUpdateService#create(com.hp.ucmdb.api.topology.TopologyModificationData, com.hp.ucmdb.api.topology.CreateMode)
- When using the com.hp.ucmdb.api.topology.TopologyModification#setDataForUpdate(...)
: Will ignore non existing CIs (will not fail).
- When using the com.hp.ucmdb.api.topology.TopologyModification#setDataForDelete(...)
: is equivalent to com.hp.ucmdb.api.topology.DeleteMode.IGNORE_NON_EXISTING
when calling to com.hp.ucmdb.api.topology.TopologyUpdateService#delete(com.hp.ucmdb.api.topology.TopologyModificationData, com.hp.ucmdb.api.topology.DeleteMode)
topologyModification
- describes the CIs and relations to be modifiedmode
- specifies the behavior if CI or relation modification fails. See the ModifyMode
enum.UcmdbException
- in case of an exceptionMergeOutput merge(MergeInput idsToMerge) throws UcmdbException
modificationData
with
permanent UCMDB IDs.idsToMerge
- describes CIs to mergeUcmdbException
- in case of an exceptionExecuteOutput execute(TopologyModificationBulk topologyModificationBulk) throws UcmdbException
topologyModificationBulk
- topology modification bulkUcmdbException
GracefulTopologyModificationOutput executeGracefully(SingleTopologyModification topologyModification)
Using this method may slow down performance when input causes failures. Otherwise, performance is the same.
topologyModification
- specifies and the action to be taken on it Documentation Feedback
Copyright 2011 - 2018 Micro Focus or one of its affiliates.