com.hp.ucmdb.api.classmodel
Interface ClassModelService

All Superinterfaces:
ScopedClassModelService

public interface ClassModelService
extends 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
 java.util.Map<java.lang.String,java.net.URL> getAllClassesIcons(IconSize size)
          Returns absolute URLs to all classes icons.
 java.util.Map<java.lang.String,java.lang.String> getChangedAttributesNames(java.lang.String fromVersion, java.lang.String toVersion)
          Returns the changes in attribute names between versions.
 java.util.Map<java.lang.String,java.lang.String> getChangedClassNames(java.lang.String fromVersion, java.lang.String toVersion)
          Returns all changes in class names between given versions.
 java.net.URL getClassIconByName(java.lang.String iconName, IconSize size)
          Returns absolute URL for icon with the given name and size.
 EnumDefinitions getEnumDefinitions()
          Returns the object containing enums defined in the UCMDB class model.
 ClassModelFactory getFactory()
           
 ScopedClassModelService getScopedService(Scope scope)
          Returns the interface for querying scoped UCMDB class model.
 void registerChangesListener(ClassModelChangesListener listener)
          Registers a client-side listener to be called on changes in the server's class model.
 void unregisterChangesListener(ClassModelChangesListener listener)
          Unregisters a previously registered listener.
 
Methods inherited from interface com.hp.ucmdb.api.classmodel.ScopedClassModelService
getAllClasses, getClassDefinition, getValidRelations, getValidRelationTypes, hasClassDefinition, isRelationValid
 

Method Detail

getFactory

ClassModelFactory getFactory()

registerChangesListener

void registerChangesListener(ClassModelChangesListener listener)
Registers a client-side listener to be called on changes in the server's class model. The first invocation of registerChangesListener 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

void unregisterChangesListener(ClassModelChangesListener listener)
Unregisters a previously registered listener. If the listener was not registered previously, the method returns silently without exception. If after the unregisterChangesListener 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

ScopedClassModelService getScopedService(Scope scope)
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

java.util.Map<java.lang.String,java.net.URL> getAllClassesIcons(IconSize size)
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

java.net.URL getClassIconByName(java.lang.String iconName,
                                IconSize size)
Returns absolute URL for icon with the given name and size.

Parameters:
iconName -
size -
Returns:

getChangedClassNames

java.util.Map<java.lang.String,java.lang.String> getChangedClassNames(java.lang.String fromVersion,
                                                                      java.lang.String toVersion)
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

java.util.Map<java.lang.String,java.lang.String> getChangedAttributesNames(java.lang.String fromVersion,
                                                                           java.lang.String toVersion)
Returns the changes in attribute names between versions.

Parameters:
fromVersion - always pass "0"
toVersion - always pass "1"
Returns:
map oldClassName.oldAttributeName -> newClassName.newAttributeName


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