Interface MetadataEntityManager
-
- All Superinterfaces:
AbstractEntityManager
- All Known Implementing Classes:
MetadataEntityManagerImpl
public interface MetadataEntityManager extends AbstractEntityManager
Manages the metadata entities of the data model, such as classes and attributes.- Author:
- Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPossibleChildren(long parentClassId, long[] possibleChildren)
Adds to a given class a list of possible children classes whose instances can be contained using the class id to find the parent classvoid
addPossibleChildren(String parentClassName, String[] possibleChildren)
Adds to a given class a list of possible children classes whose instances can be contained using the class name to find the parent classvoid
addPossibleSpecialChildren(long parentClassId, long[] possibleSpecialChildren)
Adds to a given class a list of possible special children classes whose instances can be contained using the class id to find the parent classvoid
addPossibleSpecialChildren(String parentClassName, String[] possibleSpecialChildren)
Adds to a given class a list of possible special children classes whose instances can be contained, using the class name to find the parent classvoid
buildClassCache()
Clears the class cache and re-built it.boolean
canBeChild(String allegedParent, String childToBeEvaluated)
Finds out if an instance of a given class can be child of an instance of allegedParent.boolean
canBeSpecialChild(String allegedParent, String childToBeEvaluated)
Same ascanBeChild
, but using the special containment hierarchyvoid
createAttribute(long classId, AttributeMetadata attributeDefinition)
Adds an attribute to a classvoid
createAttribute(String className, AttributeMetadata attributeDefinition, boolean recursive)
Adds an attribute to a class.long
createClass(ClassMetadata classDefinition)
Creates a class metadata with its attributes (some new and others inherited from the parent class).void
deleteAttribute(long classId, String attributeName)
Deletes an attribute from a class.void
deleteAttribute(String className, String attributeName)
Deletes an attribute from a class.void
deleteClass(long classId)
Deletes a class metadata, its attributes and category relationshipsvoid
deleteClass(String className)
Deletes a class metadata, its attributes and category relationshipsList<ClassMetadata>
getAllClasses(boolean includeListTypes, boolean includeIndesign)
Retrieves all the class metadata except for classes marked as dummyList<ClassMetadataLight>
getAllClassesLight(boolean includeListTypes, boolean includeIndesign)
Retrieves the simplified list of classes, This list won't include either those classes marked as dummyAttributeMetadata
getAttribute(long classId, long attributeId)
Gets an attribute belonging to a classAttributeMetadata
getAttribute(String className, String attributeName)
Gets an attribute belonging to a classClassMetadata
getClass(long classId)
Gets a class metadata, its attributes and CategoryClassMetadata
getClass(String className)
Gets a class metadata, its attributes and CategoryList<ClassMetadata>
getClasses(String classNameTofilter, int page, int limit)
Gets a list of classes, its attributes and Category with a given class name to filterList<AttributeMetadata>
getMandatoryAttributesInClass(String className)
Retrieves the list of the attributes marked as mandatoryList<ClassMetadataLight>
getPossibleChildren(String parentClassName, boolean ignoreAbstract)
Gets all classes whose instances can be contained into the given parent class.This method is recursive, so the result include the possible children in children classesList<ClassMetadataLight>
getPossibleChildrenNoRecursive(String parentClassName)
Same as getPossibleChildren but this one only gets the direct possible children for the given class, this is, subclasses are not includedList<ClassMetadataLight>
getPossibleSpecialChildren(String parentClassName)
Gets all classes whose instances can be contained into the given parent class, but using a CHILD_OF_SPECIAL relationship instead of a CHILD_OF one.List<ClassMetadataLight>
getPossibleSpecialChildrenNoRecursive(String parentClassName)
Same as getPossibleSpecialChildren but this one only gets the direct special possible children for the given class, this is, subclasses are not includedString
getSpecialRelationshipDisplayName(String relationshipName)
Returns the display name of a special relationship.long
getSubClassesCount(String className)
Get the subclasses count given a parent class name.List<ClassMetadataLight>
getSubClassesLight(String className, boolean includeAbstractClasses, boolean includeSelf)
Gets the subclasses of a given class recursively.List<ClassMetadataLight>
getSubClassesLightNoRecursive(String className, boolean includeAbstractClasses, boolean includeSelf)
Gets the direct subclasses of a given classList<ClassMetadataLight>
getSuperClassesLight(String className, boolean includeSelf)
Retrieves the superclasses of a given class up to InventoryObject.List<ClassMetadataLight>
getUpstreamClassHierarchy(String className, boolean includeSelf)
Gets the parent classes of a given class up toInventoryObject
.List<ClassMetadataLight>
getUpstreamContainmentHierarchy(String className, boolean recursive)
Get the upstream containment hierarchy for a given class, unlike getPossibleChildren (which will give you the downstream hierarchy).List<ClassMetadataLight>
getUpstreamSpecialContainmentHierarchy(String className, boolean recursive)
Gets the upstream special containment hierarchy for a given class, unlike getPossibleChildren (which will give you the downstream hierarchy).boolean
hasAttribute(String className, String attributeName)
Checks if a class has a attribute with a given nameboolean
isSubclassOf(String allegedParent, String classToBeEvaluated)
Assess if a given class is subclass of anothervoid
removePossibleChildren(long parentClassId, long[] childrenToBeRemoved)
The opposite of addPossibleChildren.void
removePossibleSpecialChildren(long parentClassId, long[] childrenToBeRemoved)
The opposite of addPossibleSpecialChildren.ChangeDescriptor
setAttributeProperties(long classId, long attributeId, HashMap<String,Object> newProperties)
Changes an attribute definition belonging to a class metadata using the class id as keyChangeDescriptor
setAttributeProperties(String className, long attributeId, HashMap<String,Object> newProperties)
Changes an attribute definition belonging to a class metadata use the class name as idChangeDescriptor
setClassProperties(long classId, HashMap<String,Object> newProperties)
Changes a class metadata definition.void
setSpecialRelationshipDisplayName(String relationshipName, String relationshipDisplayName)
Sets the display name of a special relationship used in a model-
Methods inherited from interface org.neotropic.kuwaiba.core.apis.persistence.AbstractEntityManager
initCache, setConfiguration
-
-
-
-
Method Detail
-
createClass
long createClass(ClassMetadata classDefinition) throws DatabaseException, MetadataObjectNotFoundException, InvalidArgumentException
Creates a class metadata with its attributes (some new and others inherited from the parent class).- Parameters:
classDefinition
- the class definition, name, display name, etc- Returns:
- the Id of the newClassMetadata
- Throws:
MetadataObjectNotFoundException
- if the specified parent class doesn't existDatabaseException
- if the reference node doesn't existInvalidArgumentException
- if any of the fields of the class definition has an invalid value
-
buildClassCache
void buildClassCache() throws InvalidArgumentException
Clears the class cache and re-built it.- Throws:
InvalidArgumentException
- If the unique attributes cache cannot be load.
-
setClassProperties
ChangeDescriptor setClassProperties(long classId, HashMap<String,Object> newProperties) throws ApplicationObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException, BusinessObjectNotFoundException
Changes a class metadata definition.- Parameters:
classId
- The id of the class. A class metadata definition can not be updated using the name as the key, because the name itself could change.newProperties
- A hashmap with the properties to be updated. The possible key values are: name, color, displayName, description, icon, smallIcon, countable, abstract, inDesign and custom. See user manual for a more complete explanation on what each one of them are for.- Returns:
- The summary of the changes that were made.
- Throws:
ApplicationObjectNotFoundException
MetadataObjectNotFoundException
- If the class could no be found.InvalidArgumentException
- If any of the property names provided is unknown or if the name has invalid characters, the new name is empty or if that name already exists.BusinessObjectNotFoundException
- If there is any problem retrieving an object while checking if every created object of the class with an attributes marked as mandatory has value.
-
deleteClass
void deleteClass(String className) throws MetadataObjectNotFoundException, InvalidArgumentException
Deletes a class metadata, its attributes and category relationships- Parameters:
className
- the class name- Throws:
MetadataObjectNotFoundException
- if there is not a class with de ClassNameInvalidArgumentException
- If the class is a core class, has instances, has incoming relationships or is a list type that is used by another class.
-
deleteClass
void deleteClass(long classId) throws MetadataObjectNotFoundException, InvalidArgumentException
Deletes a class metadata, its attributes and category relationships- Parameters:
classId
- the class id- Throws:
MetadataObjectNotFoundException
- if there is not a class with de ClassNameInvalidArgumentException
- If the class is a core class, has instances, has incoming relationships or is a list type that is used by another class.
-
getAllClassesLight
List<ClassMetadataLight> getAllClassesLight(boolean includeListTypes, boolean includeIndesign) throws MetadataObjectNotFoundException
Retrieves the simplified list of classes, This list won't include either those classes marked as dummy- Parameters:
includeListTypes
- boolean to indicate if the list should include the subclasses of GenericObjectListincludeIndesign
- Include all the data model classes or only the classes in production- Returns:
- The list of type classes
- Throws:
MetadataObjectNotFoundException
- If GenericListType class does not exist.
-
getSubClassesLight
List<ClassMetadataLight> getSubClassesLight(String className, boolean includeAbstractClasses, boolean includeSelf) throws MetadataObjectNotFoundException, InvalidArgumentException
Gets the subclasses of a given class recursively.- Parameters:
className
- Class nameincludeAbstractClasses
- Should the list include the abstract subclassesincludeSelf
- Should the list include the subclasses and the parent class?- Returns:
- The list of subclasses
- Throws:
MetadataObjectNotFoundException
- If the class can not be foundInvalidArgumentException
- If the provided class is not a subclass of InventoryObject
-
getSubClassesLightNoRecursive
List<ClassMetadataLight> getSubClassesLightNoRecursive(String className, boolean includeAbstractClasses, boolean includeSelf) throws MetadataObjectNotFoundException
Gets the direct subclasses of a given class- Parameters:
className
- The class nameincludeAbstractClasses
- If abstract classes should be included.includeSelf
- Also return the metadata of classclassName
- Returns:
- The list of subclasses
- Throws:
MetadataObjectNotFoundException
- If the class could not be found.
-
getSuperClassesLight
List<ClassMetadataLight> getSuperClassesLight(String className, boolean includeSelf) throws MetadataObjectNotFoundException
Retrieves the superclasses of a given class up to InventoryObject.- Parameters:
className
- The class to be evaluated.includeSelf
- If the result should include the the very class that was provided inclassName
parameter- Returns:
- The list of super classes.
- Throws:
MetadataObjectNotFoundException
- If the class provided could not be found
-
getSubClassesCount
long getSubClassesCount(String className) throws MetadataObjectNotFoundException
Get the subclasses count given a parent class name.- Parameters:
className
- parent class Name.- Returns:
- Number of direct subclasses.
- Throws:
MetadataObjectNotFoundException
- If the class provided could not be found.
-
getAllClasses
List<ClassMetadata> getAllClasses(boolean includeListTypes, boolean includeIndesign)
Retrieves all the class metadata except for classes marked as dummy- Parameters:
includeListTypes
- boolean to indicate if the list should include the subclasses of GenericObjectListincludeIndesign
- Include classes marked as "in design"- Returns:
- An array with the metadata of the classes
-
getClass
ClassMetadata getClass(String className) throws MetadataObjectNotFoundException
Gets a class metadata, its attributes and Category- Parameters:
className
- The class name- Returns:
- A ClassMetadata with the className
- Throws:
MetadataObjectNotFoundException
- If there is no class with such className
-
getClasses
List<ClassMetadata> getClasses(String classNameTofilter, int page, int limit)
Gets a list of classes, its attributes and Category with a given class name to filter- Parameters:
classNameTofilter
- The class name to filter forpage
- the number of results to skip or the pagelimit
- The number of results per page- Returns:
- A list of Classes that contains the filter in the classMetada name
-
getClass
ClassMetadata getClass(long classId) throws MetadataObjectNotFoundException
Gets a class metadata, its attributes and Category- Parameters:
classId
- The class id- Returns:
- A ClassMetadata with the classId
- Throws:
MetadataObjectNotFoundException
- If there is no class with such classId
-
createAttribute
void createAttribute(String className, AttributeMetadata attributeDefinition, boolean recursive) throws MetadataObjectNotFoundException, InvalidArgumentException
Adds an attribute to a class.- Parameters:
className
- The class the attribute will be added to.attributeDefinition
- An object with the definition of the attribute.recursive
- Defines if the subclasses that has an attribute with name equal to the name of the new attribute can conserve (false) it or must be removed (true), in the case when the attribute must be removed throws an exception- Throws:
MetadataObjectNotFoundException
- if there is no a class with such classNameInvalidArgumentException
- if any of the parameters to create the attribute has a wrong value
-
createAttribute
void createAttribute(long classId, AttributeMetadata attributeDefinition) throws MetadataObjectNotFoundException, InvalidArgumentException
Adds an attribute to a class- Parameters:
classId
- The id of the class the attribute will be added to.attributeDefinition
- An object with the definition of the attribute.- Throws:
MetadataObjectNotFoundException
- if there is no a class with such classIdInvalidArgumentException
- if any of the parameters to create the attribute has a wrong value
-
hasAttribute
boolean hasAttribute(String className, String attributeName) throws MetadataObjectNotFoundException
Checks if a class has a attribute with a given name- Parameters:
className
- Class nameattributeName
- Attribute name- Returns:
- True if the given class has the attribute
- Throws:
MetadataObjectNotFoundException
- If there is no a class with such className
-
getAttribute
AttributeMetadata getAttribute(String className, String attributeName) throws MetadataObjectNotFoundException, InvalidArgumentException
Gets an attribute belonging to a class- Parameters:
className
- Class name.attributeName
- Attribute name.- Returns:
- AttributeMetata of the requested attribute.
- Throws:
MetadataObjectNotFoundException
- if there is no a class with such classNameInvalidArgumentException
- if the attributeName does not exist
-
getAttribute
AttributeMetadata getAttribute(long classId, long attributeId) throws InvalidArgumentException, MetadataObjectNotFoundException
Gets an attribute belonging to a class- Parameters:
classId
- Class id.attributeId
- Attribute id.- Returns:
- AttributeMetata of the requested attribute.
- Throws:
MetadataObjectNotFoundException
- if there is no a class with such classIdInvalidArgumentException
- if the attributeName does not exist
-
setAttributeProperties
ChangeDescriptor setAttributeProperties(long classId, long attributeId, HashMap<String,Object> newProperties) throws MetadataObjectNotFoundException, InvalidArgumentException, BusinessObjectNotFoundException
Changes an attribute definition belonging to a class metadata using the class id as key- Parameters:
classId
- Id of the class the attribute belongs to.attributeId
-newProperties
- A hashmap with the properties to be updated. The possible key values are: name, color, displayName, description, icon, smallIcon, countable, abstract, inDesign and custom. See user manual for a more complete explanation on what each one of them are for.- Returns:
- The summary of the changes that were made.
- Throws:
MetadataObjectNotFoundException
- If the class could not be found.InvalidArgumentException
- If any of the new attribute parameters has a wrong value.BusinessObjectNotFoundException
- If an object can't be find, while it is checking if every object of the class (or subclasses) has a value in an attribute marked as mandatory
-
setAttributeProperties
ChangeDescriptor setAttributeProperties(String className, long attributeId, HashMap<String,Object> newProperties) throws MetadataObjectNotFoundException, InvalidArgumentException, BusinessObjectNotFoundException
Changes an attribute definition belonging to a class metadata use the class name as id- Parameters:
className
- Class the attribute belongs to.attributeId
- Id of the attribute to be updated.newProperties
- A hashmap with the properties to be updated. The possible key values are: name, color, displayName, description, icon, smallIcon, countable, abstract, inDesign and custom. See user manual for a more complete explanation on what each one of them are for.- Returns:
- The summary of the changes that were made.
- Throws:
MetadataObjectNotFoundException
- If the class could not be found.InvalidArgumentException
- If any of the new attribute parameters has a wrong value.BusinessObjectNotFoundException
- If an object can't be find, while it is checking if every object of the class (or subclasses) has a value in an attribute marked as mandatory
-
deleteAttribute
void deleteAttribute(String className, String attributeName) throws MetadataObjectNotFoundException, InvalidArgumentException
Deletes an attribute from a class.- Parameters:
className
- Class name.attributeName
- Attribute name.- Throws:
MetadataObjectNotFoundException
- If the class could not be found.InvalidArgumentException
- If the attributes name or creationDate are to be deleted.
-
deleteAttribute
void deleteAttribute(long classId, String attributeName) throws MetadataObjectNotFoundException, InvalidArgumentException
Deletes an attribute from a class.- Parameters:
classId
- Class id.attributeName
- Attribute name.- Throws:
MetadataObjectNotFoundException
- If the class could not be found.InvalidArgumentException
- If the attributes name or creationDate are to be deleted.
-
getPossibleChildren
List<ClassMetadataLight> getPossibleChildren(String parentClassName, boolean ignoreAbstract) throws MetadataObjectNotFoundException
Gets all classes whose instances can be contained into the given parent class.This method is recursive, so the result include the possible children in children classes- Parameters:
parentClassName
- The name of the class.ignoreAbstract
- true to ignore abstract classes.- Returns:
- An array with the list of direct possible children classes in the containment hierarchy.
- Throws:
MetadataObjectNotFoundException
- If the class can not be found.
-
getPossibleSpecialChildren
List<ClassMetadataLight> getPossibleSpecialChildren(String parentClassName) throws MetadataObjectNotFoundException
Gets all classes whose instances can be contained into the given parent class, but using a CHILD_OF_SPECIAL relationship instead of a CHILD_OF one. This is mostly used in complex models, such as the physical layer model. This method is recursive, so the result include the possible children in children classes- Parameters:
parentClassName
- The name of the class.- Returns:
- An array with the list of direct possible children classes in the containment hierarchy.
- Throws:
MetadataObjectNotFoundException
- If the class can not be found.
-
getPossibleChildrenNoRecursive
List<ClassMetadataLight> getPossibleChildrenNoRecursive(String parentClassName) throws MetadataObjectNotFoundException
Same as getPossibleChildren but this one only gets the direct possible children for the given class, this is, subclasses are not included- Parameters:
parentClassName
- The name of the class.- Returns:
- An array with the list of possible children classes in the containment hierarchy, including the subclasses of the abstract classes.
- Throws:
MetadataObjectNotFoundException
- If the class could not be found.
-
getPossibleSpecialChildrenNoRecursive
List<ClassMetadataLight> getPossibleSpecialChildrenNoRecursive(String parentClassName) throws MetadataObjectNotFoundException
Same as getPossibleSpecialChildren but this one only gets the direct special possible children for the given class, this is, subclasses are not included- Parameters:
parentClassName
- The name of the class.- Returns:
- An array with the list of possible children classes in the containment hierarchy, including the subclasses of the abstract classes.
- Throws:
MetadataObjectNotFoundException
- If the class could not be found.
-
canBeChild
boolean canBeChild(String allegedParent, String childToBeEvaluated) throws MetadataObjectNotFoundException
Finds out if an instance of a given class can be child of an instance of allegedParent. This is a sort of reverse getPossibleChildren- Parameters:
allegedParent
- Possible parentchildToBeEvaluated
- Class to be evaluated- Returns:
- True an instance of class childToBeEvaluated be a contained into an instance of allegedParent. False otherwise.
- Throws:
MetadataObjectNotFoundException
- If any of the classes involved doesn't exist
-
canBeSpecialChild
boolean canBeSpecialChild(String allegedParent, String childToBeEvaluated) throws MetadataObjectNotFoundException
Same ascanBeChild
, but using the special containment hierarchy- Parameters:
allegedParent
- Possible parentchildToBeEvaluated
- Class to be evaluated- Returns:
- True an instance of class childToBeEvaluated be a contained into an instance of allegedParent (as in the special containment hierarchy). False otherwise.
- Throws:
MetadataObjectNotFoundException
-
addPossibleChildren
void addPossibleChildren(long parentClassId, long[] possibleChildren) throws MetadataObjectNotFoundException, InvalidArgumentException
Adds to a given class a list of possible children classes whose instances can be contained using the class id to find the parent class- Parameters:
parentClassId
- Id of the class whose instances can contain the instances of the classes in possibleChildren. Use -1 to refer to the DummyRootpossibleChildren
- ids of the candidates to be contained- Throws:
MetadataObjectNotFoundException
- if any of the possible children or the parent doesn't existInvalidArgumentException
- If any of the possible children classes already are possible children or if one of the possible children is not an instance of a subclass of InventoryObject or if the parent class is abstract.
-
addPossibleSpecialChildren
void addPossibleSpecialChildren(long parentClassId, long[] possibleSpecialChildren) throws MetadataObjectNotFoundException, InvalidArgumentException
Adds to a given class a list of possible special children classes whose instances can be contained using the class id to find the parent class- Parameters:
parentClassId
- Id of the class whose instances can contain the instances of the classes in possibleChildren.possibleSpecialChildren
- ids of the candidates to be contained- Throws:
MetadataObjectNotFoundException
- If any of the possible children or the parent doesn't existInvalidArgumentException
- If any of the possible children classes already are possible special children or if one of the possible children is not an instance of a subclass of InventoryObject or if the parent class is abstract or if it's attempted to use the navigation tree root as parent class (addPossibleChildren(java.lang.String, java.lang.String[])
supports -1 as parent class id)
-
addPossibleChildren
void addPossibleChildren(String parentClassName, String[] possibleChildren) throws MetadataObjectNotFoundException, InvalidArgumentException
Adds to a given class a list of possible children classes whose instances can be contained using the class name to find the parent class- Parameters:
parentClassName
- parent class name. Use DummyRoot for the Navigation Tree rootpossibleChildren
- list of possible children- Throws:
MetadataObjectNotFoundException
- if the parent class or any of the possible children can not be foundInvalidArgumentException
- if any of the given possible children can not be a possible children of parentClassName or if one of the possible children is not an instance of a subclass of InventoryObject or if the parent class is abstract.
-
addPossibleSpecialChildren
void addPossibleSpecialChildren(String parentClassName, String[] possibleSpecialChildren) throws MetadataObjectNotFoundException, InvalidArgumentException
Adds to a given class a list of possible special children classes whose instances can be contained, using the class name to find the parent class- Parameters:
parentClassName
- parent class name.possibleSpecialChildren
- list of possible children- Throws:
MetadataObjectNotFoundException
- if the parent class or any of the possible children can not be foundInvalidArgumentException
- if any of the given possible children can not be a possible children of parentClassName or if one of the possible children is not an instance of a subclass of InventoryObject or if the parent class is abstract.
-
removePossibleChildren
void removePossibleChildren(long parentClassId, long[] childrenToBeRemoved) throws MetadataObjectNotFoundException
The opposite of addPossibleChildren. It removes the given possible children TODO: Make this method safe. This is, check if there's already intances of the given "children to be deleted" with parentClass as their parent- Parameters:
parentClassId
- Id of the class whos instances can contain the instances of the next paramchildrenToBeRemoved
- ids of the candidates to be deleted- Throws:
MetadataObjectNotFoundException
- If any of the ids provided can't be found
-
removePossibleSpecialChildren
void removePossibleSpecialChildren(long parentClassId, long[] childrenToBeRemoved) throws MetadataObjectNotFoundException
The opposite of addPossibleSpecialChildren. It removes the given possible special children- Parameters:
parentClassId
- Id of the class whos instances can contain the instances of the next paramchildrenToBeRemoved
- ids of the candidates to be deleted- Throws:
MetadataObjectNotFoundException
- If any of the ids provided can't be found
-
setSpecialRelationshipDisplayName
void setSpecialRelationshipDisplayName(String relationshipName, String relationshipDisplayName)
Sets the display name of a special relationship used in a model- Parameters:
relationshipName
- The name of the relationship the display name is going to be setrelationshipDisplayName
- The display name
-
getSpecialRelationshipDisplayName
String getSpecialRelationshipDisplayName(String relationshipName)
Returns the display name of a special relationship. The display name is useful to improve the way the relationship is displayed on trees and other modules- Parameters:
relationshipName
- The name of the relationship- Returns:
- The display name for the relationship name provided. If it can not be found, the relationship name is returned instead
-
isSubclassOf
boolean isSubclassOf(String allegedParent, String classToBeEvaluated) throws MetadataObjectNotFoundException
Assess if a given class is subclass of another- Parameters:
allegedParent
- Alleged super classclassToBeEvaluated
- class to be evaluated- Returns:
- True if classToBeEvaluated is subclass of allegedParent. False otherwise. This method also returns true if allegedParent == classToBeEvaluated
- Throws:
MetadataObjectNotFoundException
- If any of the classes provided doesn't exist
-
getUpstreamContainmentHierarchy
List<ClassMetadataLight> getUpstreamContainmentHierarchy(String className, boolean recursive) throws MetadataObjectNotFoundException
Get the upstream containment hierarchy for a given class, unlike getPossibleChildren (which will give you the downstream hierarchy).- Parameters:
className
- Class namerecursive
- Get only the direct possible parents, or go up into the containment hierarchy. Beware: don't mistake the class hierarchy for the containment one- Returns:
- An sorted list with the upstream containment hierarchy. Repeated elements are omitted
- Throws:
MetadataObjectNotFoundException
- if className does not correspond to any existing class
-
getUpstreamSpecialContainmentHierarchy
List<ClassMetadataLight> getUpstreamSpecialContainmentHierarchy(String className, boolean recursive) throws MetadataObjectNotFoundException
Gets the upstream special containment hierarchy for a given class, unlike getPossibleChildren (which will give you the downstream hierarchy).- Parameters:
className
- Class namerecursive
- Get only the direct possible parents, or go up into the containment hierarchy. Beware: don't mistake the class hierarchy for the containment one- Returns:
- An sorted list with the special upstream containment hierarchy. Repeated elements are omitted
- Throws:
MetadataObjectNotFoundException
- if className does not correspond to any existing class
-
getUpstreamClassHierarchy
List<ClassMetadataLight> getUpstreamClassHierarchy(String className, boolean includeSelf) throws MetadataObjectNotFoundException
Gets the parent classes of a given class up toInventoryObject
. Please note thatRootObject
is being deliberately omitted.- Parameters:
className
- The class to get the superclasses fromincludeSelf
- If the result should also include the class in className- Returns:
- The list of super classes until the root of the hierarchy
- Throws:
MetadataObjectNotFoundException
- If the class provided could not be found
-
getMandatoryAttributesInClass
List<AttributeMetadata> getMandatoryAttributesInClass(String className) throws MetadataObjectNotFoundException
Retrieves the list of the attributes marked as mandatory- Parameters:
className
- the class name- Returns:
- a list of AttributeMetadata
- Throws:
MetadataObjectNotFoundException
- if the class doesn't exist
-
-