Package com.hp.ucmdb.api.classmodel
Interface ScopedClassModelService
- All Known Subinterfaces:
ClassModelService
public interface ScopedClassModelService
Interface for querying the UCMDB scoped class model.
Example of using this interface:
ClassModelService classModelService = ucmdbService.getClassModelService(); ScopedClassModelService scopedClassModelService = classModelService.getScopedService(Scope.BDM); for (ClassDefinition def : scopedClassModelService.getAllClasses()) { System.out.println("Type " + def.getName() + " (" + def.getDisplayName() + ") is derived from type " + def.getParentClassName()); System.out.println("Has " + def.getChildClasses().size() + " derived types"); System.out.println("Defined and inherited attributes:"); for (Attribute attr : def.getAllAttributes().values()) { System.out.println("Attribute " + attr.getName() + " of type " + attr.getType()); } }
- Since:
- 9.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
force refresh class model cacheReturns anIterable
collection of classes defined in the UCMDB class model.getCalculatedLink
(String type) Returns a collection of all calculated link triplets defined in UCMDB class modelgetCalculatedLinkTripletsForType
(String typeName) getClassDefinition
(String typeName) Returns the object representing the specified type.Returns anIterable
collection of valid relations defined in the UCMDB class model.getValidRelationTypes
(String end1TypeName, String end2TypeName) Returns anIterable
collection of all types of relations that can be created between CIs of the specified types.boolean
hasClassDefinition
(String typeName) Returns true if the type with the specified name is defined in the UCMDB.boolean
isRelationValid
(String relationTypeName, String end1TypeName, String end2TypeName) Checks whether a relation of the specified type is permitted between the specified end types.
-
Method Details
-
getClassDefinition
Returns the object representing the specified type.- Parameters:
typeName
-- Returns:
- the object representing the type with the specified name
- Throws:
ClassDoesNotExistException
- if there is no type with the specified name in the UCMDB
-
forceRefresh
void forceRefresh()force refresh class model cache -
hasClassDefinition
Returns true if the type with the specified name is defined in the UCMDB.- Parameters:
typeName
-- Returns:
true
if the type with the specified name is defined in the UCMDB
-
getAllClasses
Collection<ClassDefinition> getAllClasses()Returns anIterable
collection of classes defined in the UCMDB class model.- Returns:
- an
Iterable
collection of classes defined in the UCMDB class model.
-
isRelationValid
boolean isRelationValid(String relationTypeName, String end1TypeName, String end2TypeName) throws ClassDoesNotExistException Checks whether a relation of the specified type is permitted between the specified end types. The relation and end types are checked against the valid relations definition in the class model. The end types can be exact types or super-types.- Parameters:
relationTypeName
- a relation type nameend1TypeName
- a CI type nameend2TypeName
- a CI type name- Returns:
true
if the relation is allowed.- Throws:
ClassDoesNotExistException
-
getValidRelationTypes
Iterable<ClassDefinition> getValidRelationTypes(String end1TypeName, String end2TypeName) throws ClassDoesNotExistException Returns anIterable
collection of all types of relations that can be created between CIs of the specified types.- Parameters:
end1TypeName
- a CI type nameend2TypeName
- a CI type name- Throws:
ClassDoesNotExistException
-
getValidRelations
Collection<ValidRelation> getValidRelations()Returns anIterable
collection of valid relations defined in the UCMDB class model.- Returns:
- an
Iterable
collection of valid relations defined in the UCMDB class model.
-
getCalculatedLinks
Collection<CalculatedLink> getCalculatedLinks()Returns a collection of all calculated link triplets defined in UCMDB class model- Returns:
-
getCalculatedLink
-
getCalculatedLinkTripletsForType
-