D Frequently Used APIs for Design and Assign Methods

This appendix provides pointers to the design and assign methods of APIs that are frequently used when working with the Oracle Communications Unified Inventory Management (UIM) application programming interfaces (APIs).

You can download this technology pack, use the methods, and see code examples for common business solutions. You can also include this package in your custom solution to have numerous classes that are available.

Reference UIMTECHPACK Cartridge

Java package: OracleComms_UIM_DesignAndAssign_Common

oracle.communications.inventory.api.dna.ServiceDesigner

Table D-1 oracle.communications.inventory.api.dna.ServiceDesigner

Topic Class/Method

oracle.communications.inventory.api.dna. ServiceDesigner

ServiceDesigner.create(String serviceId, String serviceSpecificationName)

Description: Creates a service with the given service ID and the specification name.

getParentService

ServiceDesigner.getParentService(Service service)

Description: Returns the parent service in which the given service is assigned.Parent service to child service is not directly between two service entities like other entities. But it is done using assignment of child services to a configuration item of a parent service's configuration.

relating child service to a parent service

ServiceDesigner.addService(Service parentService, Service newService, String configItem)

Description: Creates a new configuration item with the given name in the parent service active configuration and assigns the new service to it. This is how parent-child relationship is created between services. This is a typical example of relating a CFS (Customer Facing Service - parent service) and an RFS (Resource Facing Service - child service).

relateServiceToParty

ServiceDesigner.relateServiceToParty(ServiceConfigurationVersion scv, Party party,String roleSpec)

Description: This method relates the given party to the given service.

getAssociatedService

ServiceDesigner.getAssociatedService (BusinessInteraction businessInteraction)

Description: Returns the list of Service Entities associated to the given Business Interaction via Configuration Version.

getService

ServiceDesigner.getService(String serviceId, String extObjId)

Description: This method gets the service using the service ID. If the service ID is not specified, the service is retrieved based on the service external object ID.

updateServiceCharacteristic

ServiceDesigner.updateServiceCharacteristic(Service service, String charName, String charValue);

Description: Finds and creates a new characteristic on the service with the provided charName and populates the provided value.

getAssignedService

ServiceDesigner.getAssignedService(ConsumableResource resource)

Description: Returns the assigned service for a given consumable resource.

getAssignedServiceConfigVersion

ServiceDesigner.getAssignedServiceConfigVersion(ConsumableResource resource)

Description: Returns the current active configuration in which the given consumable resource is assigned.

updateConfigItemCharacteristic

ServiceDesigner.updateConfigItemCharacteristic(ServiceConfigurationItem configItem, String charName, String charValue)

Description: Updates the characteristic of the Service Configuration Item.

assignEntity

ConfigurationDesignerImpl.assignEntity(Configurable configurable, ConsumableResource entity, String config-ItemName)

Description: Assigns a given consumable resource entity to the given configurable entity (Service, Logical Device, Site, network and so on) and associates to the provided Configuration Item.

referenceEntity

ConfigurationDesignerImpl.referenceEntity(Configurable configurable, ConfigurationReferenceEnabled entity, String configItemName)

Description: References a given entity to the given configurable entity (Service, Logical Device, Site, network and so on) and associates it to the provided Configuration Item.

getAssociatedVersions

ConfigurationDesignerImpl.getAssociatedVersions(String biId, String extObjId)

Description: Returns the list of Inventory Configurations associated to the given Business Interaction. Either biId or extObjId are required.

getAssociatedConfigurableEntity

ConfigurationDesignerImpl.getAssociatedConfigurableEntity(BusinessInteraction businessInteraction)

Description: Returns the list of Configurable Entities (Service, Logical Device, Device Interface, Network and so on) associated to given Business Interaction via Configuration Version.

getPreviousVersion

ConfigurationDesignerImpl.getPreviousVersion(InventoryConfigurationVersion version)

Description: Returns the latest previous completed configuration version.

getBusinessInteractionItems

ConfigurationDesignerImpl.getBusinessInteractionItems(BusinessInteraction bi)

Description: Returns the list of all Business Interaction Items associated to given Business Interaction.

getBusinessInteraction

ConfigurationDesignerImpl.getBusinessInteraction(String biId, String extObjId)

Description: Returns the Business Interaction for the Business Interaction id or External Object Id. Either biId or extObjId are required.

getConfigurationProperty

ConfigurationDesignerImpl.getConfigurationProperty(InventoryConfigurationItem item, String name)

Description: Returns the value of a characteristic associated to the configuration item.

getConfigurationItem

ConfigurationDesignerImpl.getConfigurationItem(InventoryConfigurationVersion ConfVersion, String name)

Description: Returns a configuration item with the given name associated to the provided Configuration Version.

isValidConfigItemCharacteristic

ConfigurationDesignerImpl.isValidConfigItemCharacteristic (InventoryConfigurationItem item, String charName)

Description: Checks if the given characteristic belongs to the given configuration item.

addChildConfigItem to a given parentItem

ConfigurationDesignerImpl.addChildConfigItem(InventoryConfigurationVersion configVersion, InventoryConfigurationItem parentItem, String childItemName)

Description: Creates the child configuration item under the parent configuration item provided.

getLatestConfigurationVersionForState

ConfigurationDesignerImpl.getLatestConfigurationVersionForState(Configurable configurable, BusinessInteractionState state)

Description: This method gets the latest configuration version for a given configurable entity (Service, Logical Device, Network etc.) using the given state as the criteria.

checkItemAssignedReferenced

ConfigurationDesignerImpl.checkItemAssignedReferenced(InventoryConfigurationVersion configVersion, InventoryConfigurationItem entityConfigItem)

Description: Checks if the configuration item has a assignment or reference.

getConfigurationVersion

ConfigurationDesignerImpl.getConfigurationVersion(Configurable configurable, String configSpecName)

Description: This method determines if an in-progress version exists before creating a new one. If a completed version exists, then it uses that to create the next version. If neither an in-progress or completed version exists, it uses the configuration specification to create the first configuration version for the configurable entity such as a service.

getConfigurationItems of an assignment object

ConfigurationDesignerImpl.getConfigurationItems(Assignment assignment, InventoryConfigurationVersion scv)

Description: Returns the configuration items based on the assignment object provided.

getConfigurationItems of an reference object

ConfigurationDesignerImpl.getConfigurationItems(InventoryConfigurationVersion scv, ConfigurationReference reference)

Description: Returns the Configuration Items based on the reference object provided.

createConfigurationVersion

ConfigurationDesignerImpl.createConfigurationVersion(Configurable configurable, String configSpec)

Description: This method will use the configuration specification to create the configuration version for the given configurable entity.

getConfigItemByNameAndParent

ConfigurationDesignerImpl.getConfigItemByNameAndParent(InventoryConfigurationVersion scv, String itemName, String parentName)

Description: Returns the configuration item with the given name.If parentName is not null the method will make sure that the item is child of parent item before returning.

setConfigItemCharacteristics

ConfigurationDesignerImpl.setConfigItemCharacteristics (InventoryConfigurationItem configItem, String propertyName, String value)

Description: If a Characteristic with this name already exists, then this method will update the value. Otherwise creates a new characteristic.

referenceEntityToConfiguration

ConfigurationDesignerImpl.referenceEntityToConfiguration(ConfigurationReferenceEnabled resource, InventoryConfigurationVersion config, String configItemName)

Description: Reference a given resource to the configuration item in the given configuration version.

assignEntityToConfiguration

ConfigurationDesignerImpl.assignEntityToConfiguration(InventoryConfigurationVersion configuration, ConsumableResource consumableResource, String configItemName, String parentConfigItemName, boolean switchToConfigurationContext)

Description: Assigns a given resource to the configuration item in the given configuration version.

switchToConfigurationContext: If set to true, ensures that the assignment is done under configuration context.

switchToConfigurationContext: If set to false, assignment is done in whichever context is carried in the UserEnvironment at the time of execution, which may result in wrong assignment depending on the context. Hence, always set switchToConfigurationContext to true for the right context.

This method also makes sure to set back the context to current or live after the assignment is done.

referenceEntityToConfiguration

ConfigurationDesignerImpl.referenceEntityToConfiguration(InventoryConfigurationVersion configuration, ConfigurationReferenceEnabled entity, String configItemName, String parentConfigItemName, boolean switchToConfigurationContext)

Description: References a given resource to the configuration item in the given configuration version.

getConfigSpecByResourceSpec

ConfigurationDesignerImpl.getConfigSpecByResourceSpec(Specification resourceSpecification, Specification configurationSpec)

Description: Returns the Configuration Item Specification on which this resource specification can be assigned or referenced in the given Configuration specification.

getParentConfigSpec

ConfigurationDesignerImpl.getParentConfigSpec(InventoryConfigurationSpec childSpec)

Description: Returns the parent configuration item specification for a given child configuration specification.

getActiveConfigurationVersion

ConfigurationDesignerImpl.getActiveConfigurationVersion

Description: This method gets the latest configuration version for a given configurable Entity like Service, Logical Device, Network, etc.If there is any in progress configuration version available it returns it.Otherwise it returns the last completed configuration version.

oracle.communications.inventory.api.dna. ConnectivityDesigner

Table D-2 oracle.communications.inventory.api.dna. ConnectivityDesigner

Topic Class/Method

createServiceConnectivity

ConnectivityDesigner.createServiceConnectivity(String connSpec, String technology,String function, ServiceNetwork serviceNetwork, int serialNumber,

ServiceConfigurationVersion scv, String aLocationName, String zLocationName, BigDecimal cir, UnitOfMeasure cirUoM, BigDecimal mir, UnitOfMeasure mirUoM)

Description: Helper method used to create Service Connectivity.

oracle.communications.inventory.api.dna. ConnectivityHelper

Table D-3 oracle.communications.inventory.api.dna. ConnectivityHelper

Topic Class/Method

getAssignedConnectivities

ConnectivityHelper.getAssignedConnectivities(LogicalDevice device, Specification specification, RateCode rateCode)

Description: Returns the connectivities assigned to any interface on the provided logical device for the provided device interface specification and rate code.

getConnectivityFromTermination

ConnectivityHelper.getConnectivityFromTermination(DeviceInterface di)

Description: Get the assigned connectivity given the device interface.

getConnectivityUniN

ConnectivityHelper.getConnectivityUniN(Pipe connectivity, String roleName)

Description: Return the Device Interface based on a specific role name. Checks the Z side first for the role, then checks the A side. The UNI-N is the interface on SP's (Service Provider's) side of the UNI. Use a device role to identify it.

getDeviceInterfaceRole

ConnectivityHelper.getDeviceInterfaceRole(DeviceInterface di, String roleName)

Description: Returns true if the device interface has a specific role.

getDeviceInterfaceByAssignment

ConnectivityHelper.getDeviceInterfaceByAssignment(List<Assignment> assignments, String roleName)

Description: Return the device interface for a given assignment and role.

findTransportConnectivity

ConnectivityHelper.findTransportConnectivity(LogicalDevice logicalDevice, String specName)

Description: Returns the first connectivity assigned to a logical device with a specific connectivity specification name.

findTransportInterface

ConnectivityHelper.findTransportInterface(LogicalDevice logicalDevice, String specName)

Description: Returns the first device interface found on the logical device with a specific connectivity assigned with a specific type of connectivity specification. For example, inter-network transport to the core has a unique connectivity specification.

getFunction

ConnectivityHelper.getFunction(String name)

Description: Return the Connectivity Function entity with a specific name.

getTechnology

ConnectivityHelper.getTechnology(String name)

Description: Returns the technology entity for a specific name.

getRateCode

ConnectivityHelper.getRateCode(String name)

Description: Return the Rate Code entity for a specific rate code name.

getConnectivityServiceLocation

ConnectivityHelper.getConnectivityServiceLocation(Connectivity connectivity)

Description: Returns the service location for a given connectivity.Assumes there is only one and checks the A side location first.

hasValidResourceTerminations

ConnectivityHelper.hasValidResourceTerminations(Connectivity connectivity)

Description: Returns true if the connectivity has any resource terminations. For example, this method can be used to determine if the connectivity has been terminated to any device interfaces.

oracle.communications.inventory.api.dna. ResourceHelper

Table D-4 oracle.communications.inventory.api.dna. ResourceHelper

Topic Class/Method

findEntityByName

ResourceHelper.findEntityByName(Class<E> entityClass, String name)

Description: Returns the entity object based on the name and class provided

makeEntityCharacteristic

ResourceHelper.makeEntityCharacteristic(CharacteristicExtensible<T> entity)

Description: Returns new Characteristic Value object for the given entity

setCharacteristic

ResourceHelper.setCharacteristic(CharacteristicExtensible<T> entity, List<PropertyType> properties)

Description: Sets the characteristic value on the given CharacteristicExtensible entity

getSpecification

ResourceHelper.getSpecification(Class<T> specClass, SpecificationType specType)

Description: Returns the Specification object based on the Specification class and Specification Type Provided

getAdminState

ResourceHelper.getAdminState(InventoryStateEnum.Enum state)

Description: Returns the Inventory State based on the state provided.

getAssignmentState

ResourceHelper.getAssignmentState(AssignmentStateEnum.Enum state)

Description: Returns the AssignmentState based on the state provided

getSpecification

ResourceHelper.getSpecification(Class specClass, String name)

Description: Returns the specification based on the name and specification class provided.

findFirstEntityByName

ResourceHelper.findFirstEntityByName(Class<E> klass, String name)

Description: Finds and returns the first entity from the result set matching the given name.Returns null if none found.

findEntityById

ResourceHelper.findEntityById(Class<E> entityClass, String id)

Description: Finds and returns the entity by given id and class provided.

findEntitiesByName

ResourceHelper.findEntitiesByName(Class<E> klass, String name)

Description: Finds and returns the entity by class and name.

findFirstEntityById

ResourceHelper.findFirstEntityById(Class<E> klass, String id)

Description: Finds and returns the first entity found by class and id.

findEntitiesById

ResourceHelper.findEntitiesById(Class<E> klass, String id)

Description: Finds and returns a list of entities by class and id.

populateCharacteristics

ResourceHelper.populateCharacteristics(T entity, Set<E> characteristics)

Description: Populates the set of characteristics provided on the characteristicExtensible entity.

populateCharacteristic

ResourceHelper.populateCharacteristic(T entity, E characteristic)

Description: Populates the characteristic provided on the CharacteristicExtensible entity.

createCustomInvolvement

ResourceHelper.createCustomInvolvement(E fromEntity, T toEntity)

Description: Creates Custom Involvement between the given from Entity and the to Entity.

deleteCustomInvolvement

ResourceHelper.deleteCustomInvolvement(E fromEntity, T toEntity)

Description: Deletes the custom involvement between the given two entities.First it tries with the fromEntity and toEntity and find the involvement.If not found it tries other way around by setting to entity as from entity and to entity as from entity

associateToInventoryGroup

ResourceHelper.associateToInventoryGroup(InventoryGroup group, List<GroupEnabled> entities)

Description: Associate the given list of entities to inventory group.

disassociateFromInventoryGroup

ResourceHelper.disassociateFromInventoryGroup(InventoryGroup group, List<GroupEnabled> entities)

Description: Disassociates the list of entities from the inventory group.

associateToPlace

ResourceHelper.associateToPlace(GeographicPlace parentPlace, GeographicPlace childPlace)

Description: Associates the child place to parent place.

associateToPlace

Logical Device to Place

ResourceHelper.associateToPlace(GeographicPlace parentPlace, LogicalDevice device)

Description: Associates the given Logical Device to the given place.

associateToPlace

Logical Device Account to Place

ResourceHelper.associateToPlace(GeographicPlace parentPlace, LogicalDeviceAccount account)

Description: Associates given Logical Device Account to the given place.

associateToPlace

Physical Device to Place

ResourceHelper.associateToPlace(GeographicPlace parentPlace, PhysicalDevice device)

Description: Associates the given Physical Device to the given place.

associateToPlace

Service to Place

ResourceHelper.associateToPlace(GeographicPlace parentPlace, Service service)

Description: Associates the given Service to the given place.

associateToPlace

Inventory Group to Place

ResourceHelper.associateToPlace(GeographicPlace parentPlace, InventoryGroup group)

Description: Associates the given Inventory Group to the given place.

associateToPlace

PipeTerminationPoint to Place

ResourceHelper.associateToPlace(GeographicPlace parentPlace, PipeTerminationPoint ptp)

Description: Associates the given Pipe Termination Point to the given place.

associateToPlace

NetworkNode to Place

ResourceHelper.associateToPlace(GeographicPlace parentPlace, NetworkNode node)

Description: Associates the given Network Node to the given place

disassociateFromPlace

ResourceHelper.disassociateFromPlace(GeographicPlace parentPlace, Persistent entity)

Description: Disassociates the given Persistent entity from the given place.

findInventoryGroup

ResourceHelper.findInventoryGroup(String inventoryGroupName, String specificationName)

Description: Finds and returns Inventory Group based on the inventory group name and specification name provided.

findDeviceInterfaces

ResourceHelper.findDeviceInterfaces(LogicalDevice device, Specification specification,RateCode rateCode, AssignmentState state)

Description: Finds the Device interfaces based on the logical device, specification, assignment state and rate code.Not all arguments are mandatory.Only non null values will be added as search criteria.

findAndValidateSpecification

ResourceHelper.findAndValidateSpecification(String specificationName)

Description: Returns only valid specification based on the given name.

findAndValidateSpecification

ResourceHelper.findAndValidateSpecification(Class specClass, String specificationName)

Description: Returns only valid specification based on the given name and specification class.

createParty

ResourceHelper.createParty(PartyType type, String partySpecName, String roleSpecName)

Description: Creates Party based on the party type and specification.If the role specification is provided it creates party role too.

createPartyRole

ResourceHelper.createPartyRole(Party party, String roleSpecName)

Description: Creates the party role object based on the party object and role specification name provided.

makeCharValue

ResourceHelper.makeCharValue(CharacteristicExtensible<CharValue> characteristicExtensible, String charSpecName, String value)

Description: Creates and returns the char value object based on the provided details for any entity which is CharacteristicExtensible like inventory configuration item, logical device, Service.Network etc.

findOrCreateLogicalDevice

ResourceHelper.findOrCreateLogicalDevice(String logicalDeviceId, String name, String specName)

Description: Finds the logical device based on the ID, name and specification provided. If not found, creates a logical device and returns.

createLogicalDevice

ResourceHelper.createLogicalDevice(String logicalDeviceId, String specName)

Description: Creates a logical device.

findLogicalDevice

ResourceHelper.findLogicalDevice(String id, String name, String specName)

Description: Finds the logical device based on the provided details.

findConnectivity

ResourceHelper.findConnectivity(String identifier)

Description: Finds the connectivity object based on the provided identifier.

createPropertyAddress

ResourceHelper.createPropertyAddress(String streetAddress, String city, String state, String postalCode, String country)

Description: Creates the property address based on the details provided.

createPropertyLocation

ResourceHelper.createPropertyLocation(PropertyAddress address)

Description: Creates the property Location of type Service Location based on the details provided.

findPropertyLocations

ResourceHelper.findPropertyLocations(PropertyAddress address)

Description: Finds and returns the Property Location based on the address provided.

findOrCreatePropertyLocation

ResourceHelper.findOrCreatePropertyLocation(PropertyAddress address)

Description: Finds the property Location with the given address. If available, returns the entity. Otherwise, creates a new Property Location.

createCritieriaItem

ResourceHelper.createCritieriaItem(String itemName, CriteriaOperator operator, InventorySearchCriteria criteria)

Description: Creates and returns the criteria Item object.

findCustomObjects

ResourceHelper.findCustomObjects(String specName, String customObjectName)

Description: Finds and returns the custom objects with the given criteria.Either Name or SpecName is mandatory.

findOrCreateCustomObject

ResourceHelper.findOrCreateCustomObject(String customObjectName, String specName, Set<CustomObjectCharacteristic> chars)

Description: Finds the Custom Object with the given details. If available, returns the entity. Otherwise, creates a new Custom Object.

createCustomObject

ResourceHelper.createCustomObject(String customObjectName, String specName, Set<CustomObjectCharacteristic> chars)

Description: Create a Custom Object.

findCharacteristicByName

ResourceHelper.findCharacteristicByName( CharacteristicExtensible entity, String itemName)

Description: Finds and returns the characteristic value for a specific entity and characteristic name.

findLogicalDevice

ResourceHelper.findLogicalDevice(String id, String name)

Description: Finds a logical device by ID and name.

findNetworkLocation

ResourceHelper.findNetworkLocation(String networkLocationCode)

Description: Finds and returns a property location using the network location code.

findNetworkEntityCode

ResourceHelper.findNetworkEntityCode(PropertyLocation propertyLocation, String networkEntityCode)

Description: Finds and returns the Network Entity Code given a property location and network entity code name.

createNetworkEntityCode

ResourceHelper.createNetworkEntityCode(PropertyLocation networkLocation, String networkEntityCode, String networkEntityLocationCode)

Description: Creates a Network Entity Code given a property location, network entity code and network entity location code.

updateBusinessInteractionCharacteristic

ResourceHelper.updateBusinessInteractionCharacteristic(BusinessInteraction bi, String charName, String charValue)

Description: Updates a Business Interaction Characteristic.

updateNetworkCharacteristic

ResourceHelper.updateNetworkCharacteristic(Network network, String charName, String charValue)

Description: Updates a Networks Characteristics.

getBIParameterValue by BusinessInteractionItemType

ResourceHelper. getBIParameterValue(BusinessInteractionItemType item, String paramName)

Description: Returns the value of parameter provided. It can be used to return the value from a name/value pairs from the CaptureInteraction Payload given the Parameter name.

getBIParameterValue by ParameterType

ResourceHelper.getBIParameterValue(List<oracle.communications.inventory.xmlbeans.ParameterType> parameterList, String paramName)

Description: Returns the value of parameter provided. It can be used to return the value from a name/value pairs from the CaptureInteraction Payload given the Parameter name.