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
 java.util.Collection<ClassDefinition> getAllClasses()
          Returns an Iterable collection of classes defined in the UCMDB class model.
 ClassDefinition getClassDefinition(java.lang.String typeName)
          Returns the object representing the specified type.
 java.util.Collection<ValidRelation> getValidRelations()
          Returns an Iterable collection of valid relations defined in the UCMDB class model.
 java.lang.Iterable<ClassDefinition> getValidRelationTypes(java.lang.String end1TypeName, java.lang.String end2TypeName)
          Returns an Iterable collection of all types of relations that can be created between CIs of the specified types.
 boolean hasClassDefinition(java.lang.String typeName)
          Returns true if the type with the specified name is defined in the UCMDB.
 boolean isRelationValid(java.lang.String relationTypeName, java.lang.String end1TypeName, java.lang.String end2TypeName)
          Checks whether a relation of the specified type is permitted between the specified end types.
 

Method Detail

getClassDefinition

ClassDefinition getClassDefinition(java.lang.String typeName)
                                   throws ClassDoesNotExistException
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

hasClassDefinition

boolean hasClassDefinition(java.lang.String typeName)
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

java.util.Collection<ClassDefinition> getAllClasses()
Returns an Iterable collection of classes defined in the UCMDB class model.

Returns:
an Iterable collection of classes defined in the UCMDB class model.

isRelationValid

boolean isRelationValid(java.lang.String relationTypeName,
                        java.lang.String end1TypeName,
                        java.lang.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 name
end1TypeName - a CI type name
end2TypeName - a CI type name
Returns:
true if the relation is allowed.
Throws:
ClassDoesNotExistException

getValidRelationTypes

java.lang.Iterable<ClassDefinition> getValidRelationTypes(java.lang.String end1TypeName,
                                                          java.lang.String end2TypeName)
                                                          throws ClassDoesNotExistException
Returns an Iterable collection of all types of relations that can be created between CIs of the specified types.

Parameters:
end1TypeName - a CI type name
end2TypeName - a CI type name
Throws:
ClassDoesNotExistException

getValidRelations

java.util.Collection<ValidRelation> getValidRelations()
Returns an Iterable collection of valid relations defined in the UCMDB class model.

Returns:
an Iterable collection of valid relations defined in the UCMDB class model.


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