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 Details

    • 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

      Map<String,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

      URL getClassIconByName(String iconName, IconSize size)
      Returns absolute URL for icon with the given name and size.
      Parameters:
      iconName -
      size -
      Returns:
    • getChangedClassNames

      Map<String,String> getChangedClassNames(String fromVersion, 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

      Map<String,String> getChangedAttributesNames(String fromVersion, 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