Package com.hp.ucmdb.api.classmodel
Interface ClassModelService
- All Superinterfaces:
ScopedClassModelService
Interface for querying the UCMDB class model.
Here is an example of using this interface:
ClassModelService classModelService = ucmdbService.getClassModelService(); for (ClassDefinition def : classModelService.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:
- 8.0
-
Method Summary
Modifier and TypeMethodDescriptiongetAllClassesIcons
(IconSize size) Returns absolute URLs to all classes icons.getChangedAttributesNames
(String fromVersion, String toVersion) Returns the changes in attribute names between versions.getChangedClassNames
(String fromVersion, String toVersion) Returns all changes in class names between given versions.getClassIconByName
(String iconName, IconSize size) Returns absolute URL for icon with the given name and size.Returns the object containing enums defined in the UCMDB class model.getScopedService
(Scope scope) Returns the interface for querying scoped UCMDB class model.void
Registers a client-side listener to be called on changes in the server's class model.void
Unregisters a previously registered listener.Methods inherited from interface com.hp.ucmdb.api.classmodel.ScopedClassModelService
forceRefresh, getAllClasses, getCalculatedLink, getCalculatedLinks, getCalculatedLinkTripletsForType, getClassDefinition, getValidRelations, getValidRelationTypes, hasClassDefinition, isRelationValid
-
Method Details
-
getFactory
ClassModelFactory getFactory() -
registerChangesListener
Registers a client-side listener to be called on changes in the server's class model. The first invocation ofregisterChangesListener
causes a thread to be launched at the client side . This thread polls the server for changes. The delay between a change and the listener invocation can be up to two minutes.- Parameters:
listener
-- Since:
- 8.0
-
unregisterChangesListener
Unregisters a previously registered listener. If the listener was not registered previously, the method returns silently without exception. If after theunregisterChangesListener
invocation, the internal list of registered listeners is empty, the polling thread is stopped. (The polling thread is started by the first registerChangesListener invocation.)- Parameters:
listener
-- Since:
- 8.0
-
getScopedService
Returns the interface for querying scoped UCMDB class model.- Parameters:
scope
-- Since:
- 9.0
-
getEnumDefinitions
EnumDefinitions getEnumDefinitions()Returns the object containing enums defined in the UCMDB class model.- Returns:
- the object containing enums defined in the UCMDB class model
-
getAllClassesIcons
Returns absolute URLs to all classes icons.- Parameters:
size
-- Returns:
- Map where the key is the icon name () and value is the URL to get this icon
-
getClassIconByName
Returns absolute URL for icon with the given name and size.- Parameters:
iconName
-size
-- Returns:
-
getChangedClassNames
Returns all changes in class names between given versions.- Parameters:
fromVersion
- currently should be "0"toVersion
- currently should be "1"- Returns:
- map oldClassName -> newClassName
-
getChangedAttributesNames
Returns the changes in attribute names between versions.- Parameters:
fromVersion
- always pass "0"toVersion
- always pass "1"- Returns:
- map oldClassName.oldAttributeName -> newClassName.newAttributeName
-