com.hp.ucmdb.api.topology
Interface TopologyUpdateService


public interface TopologyUpdateService

Interface for updating topology: creating, updating, and deleting CIs and relations. To create the data structures used by the methods of this interface, use the factory obtained with the getFactory method.

A typical usage of this interface is demonstrated below:

 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);


 


Method Summary
 CreateOutput create(TopologyModificationData modificationData, CreateMode mode)
          Creates the specified set of CIs and relations in the UCMDB.
 DeleteOutput delete(TopologyModificationData modificationData, DeleteMode mode)
          Deletes a set of CIs and relations from the UCMDB.
 ExecuteOutput execute(TopologyModification topologyModification, ModifyMode mode)
          Modifies the specified set of CIs and relations in the UCMDB.
 TopologyUpdateFactory getFactory()
           
 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.
 

Method Detail

getFactory

TopologyUpdateFactory getFactory()

create

CreateOutput create(TopologyModificationData modificationData,
                    CreateMode mode)
                    throws UcmdbException
Creates the specified set of CIs and relations in the UCMDB.
Generally, the elements in 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.
If the elements in 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.

Parameters:
modificationData - describes the CIs and relations to create
mode - specifies the behavior if items already exist. See the CreateMode enum.
Throws:
UcmdbException

update

UpdateOutput update(TopologyModificationData modificationData)
                    throws UcmdbException
Updates a set of CIs and relations in the UCMDB. If the specified CIs and relations do not exist, the operation fails and no elements are updated. You must specify the elements in modificationData with permanent UCMDB IDs.

Parameters:
modificationData - describes CIs and relations to update
Throws:
UcmdbException

touch

void touch(TopologyModificationData modificationData)
           throws UcmdbException
Delays deletion of UCMDB CIs and relations due to aging. If an element is neither updated nor touched for a sufficiently long time, it is deleted. The obsolescence period is configured per type in the UCMDB. Calling this method puts off the automatic deletion of the specified elements for another obsolescence period.

Parameters:
modificationData - Specifies the the CIs and relations to touch. This method only uses the IDs from the modificationData. Other properties are ignored.
Throws:
UcmdbException

delete

DeleteOutput delete(TopologyModificationData modificationData,
                    DeleteMode mode)
                    throws UcmdbException
Deletes a set of CIs and relations from the UCMDB.
These deletions may result in the deletion of additional elements. This occurs if elements in modificationData are the independent ends of relations that require deletion of dependent CIs.
The elements in modificationData be specified using have permanent UCMDB IDs.

Parameters:
modificationData - specifies the elements to delete
mode - specifies the behavior if items do not exist. See the DeleteMode enum.
Throws:
UcmdbException

execute

ExecuteOutput execute(TopologyModification topologyModification,
                      ModifyMode mode)
                      throws UcmdbException
Modifies the specified set of CIs and relations in the UCMDB.

Parameters:
topologyModification - describes the CIs and relations to be modified
mode - specifies the behavior if CI or relation modification fails. See the ModifyMode enum.
Throws:
UcmdbException


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.