Class MetadataEntityManagerRestController
- java.lang.Object
-
- org.neotropic.kuwaiba.northbound.rest.mem.MetadataEntityManagerRestController
-
- All Implemented Interfaces:
MetadataEntityManagerRestOpenApi
@RestController @RequestMapping("/v2.1.1/core/mem/") public class MetadataEntityManagerRestController extends Object implements MetadataEntityManagerRestOpenApi
Manages the metadata entities of the data model, such as classes and attributes.- Author:
- Mauricio Ruiz Beltrán <mauricio.ruiz@kuwaiba.org>, Julian David Camacho Erazo <julian.camacho@kuwaiba.org>
-
-
Constructor Summary
Constructors Constructor Description MetadataEntityManagerRestController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPossibleChildren(String parentClassName, String[] possibleChildren, String sessionId)
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.void
addPossibleChildrenForClassWithId(long parentClassId, long[] possibleChildren, String sessionId)
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.void
addPossibleSpecialChildren(String parentClassName, String[] possibleSpecialChildren, String sessionId)
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.void
addPossibleSpecialChildrenWithId(long parentClassId, long[] possibleSpecialChildren, String sessionId)
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.boolean
canBeChild(String allegedParent, String childToBeEvaluated, String sessionId)
Finds out if an instance of a given class can be child of an instance of allegedParent.This is a sort of reverse getPossibleChildren.boolean
canBeSpecialChild(String allegedParent, String childToBeEvaluated, String sessionId)
Same ascanBeChild
, but using the special containment hierarchy.void
createAttribute(String className, AttributeMetadata attributeDefinition, boolean recursive, String sessionId)
Adds an attribute to a class.void
createAttributeForClassWithId(long classId, AttributeMetadata attributeDefinition, String sessionId)
Adds an attribute to a class.long
createClass(ClassMetadata classDefinition, String sessionId)
Creates a class metadata with its attributes (some new and others inherited from the parent class).void
deleteAttribute(String className, String name, String sessionId)
Deletes an attribute from a class.void
deleteAttributeForClassWithId(long classId, String name, String sessionId)
Deletes an attribute from a class.void
deleteClass(String className, String sessionId)
Deletes a class metadata, its attributes and category relationships.void
deleteClassWithId(long classId, String sessionId)
Deletes a class metadata, its attributes and category relationships.List<ClassMetadata>
getAllClasses(boolean includeListTypes, boolean includeIndesign, String sessionId)
Retrieves all the class metadata except for classes marked as dummy.List<ClassMetadataLight>
getAllClassesLight(boolean includeListTypes, boolean includeIndesign, String sessionId)
Retrieves the simplified list of classes, This list won't include either those classes marked as dummy.AttributeMetadata
getAttribute(String className, String name, String sessionId)
Gets an attribute belonging to a class.AttributeMetadata
getAttributeForClassWithId(long classId, long id, String sessionId)
Gets an attribute belonging to a class.ClassMetadata
getClass(String className, String sessionId)
Gets a class metadata, its attributes and Category.List<ClassMetadata>
getClasses(String className, int page, int limit, String sessionId)
Gets a list of classes, its attributes and Category with a given class name to filter.byte[]
getClassIcon(String className)
Get a class icon as a byte array.byte[]
getClassSmallIcon(String className)
Get a small class icon as a byte array.ClassMetadata
getClassWithId(long classId, String sessionId)
Gets a class metadata, its attributes and Category.List<AttributeMetadata>
getMandatoryAttributesInClass(String className, String sessionId)
Retrieves the list of the attributes marked as mandatory.List<ClassMetadataLight>
getPossibleChildren(String parentClassName, boolean ignoreAbstract, String sessionId)
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.List<ClassMetadataLight>
getPossibleChildrenNoRecursive(String parentClassName, String sessionId)
Same as getPossibleChildren but this one only gets the direct possible children for the given class, this is, subclasses are not included.List<ClassMetadataLight>
getPossibleSpecialChildren(String parentClassName, String sessionId)
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, String sessionId)
Same as getPossibleSpecialChildren but this one only gets the direct special possible children for the given class, this is, subclasses are not included.byte[]
getRelationshipIcon(int color, int width, int height)
Get a relationship icon as a byte array.String
getSpecialRelationshipDisplayName(String relationshipName, String sessionId)
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.long
getSubClassesCount(String className, String sessionId)
Get the subclasses count given a parent class name.List<ClassMetadataLight>
getSubClassesLight(String className, boolean includeAbstractClasses, boolean includeSelf, String sessionId)
Gets the subclasses of a given class recursively.List<ClassMetadataLight>
getSubClassesLightNoRecursive(String className, boolean includeAbstractClasses, boolean includeSelf, String sessionId)
Gets the direct subclasses of a given class.List<ClassMetadataLight>
getSuperClassesLight(String className, boolean includeSelf, String sessionId)
Retrieves the superclasses of a given class up to InventoryObject.List<ClassMetadataLight>
getUpstreamClassHierarchy(String className, boolean includeSelf, String sessionId)
Gets the parent classes of a given class up toInventoryObject
.List<ClassMetadataLight>
getUpstreamContainmentHierarchy(String className, boolean recursive, String sessionId)
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, String sessionId)
Gets the upstream special containment hierarchy for a given class, unlike getPossibleChildren (which will give you the downstream hierarchy).boolean
hasAttribute(String className, String name, String sessionId)
Checks if a class has a attribute with a given name.boolean
isSubclassOf(String allegedParent, String className, String sessionId)
Assess if a given class is subclass of another.void
removePossibleChildren(long parentClassId, long[] childrenToBeRemoved, String sessionId)
The opposite of addPossibleChildren.void
removePossibleSpecialChildren(long parentClassId, long[] childrenToBeRemoved, String sessionId)
The opposite of addPossibleSpecialChildren.ChangeDescriptor
setAttributeProperties(String className, long id, HashMap<String,Object> properties, String sessionId)
Changes an attribute definition belonging to a class metadata use the class name as id.ChangeDescriptor
setAttributePropertiesForClassWithId(long classId, long id, HashMap<String,Object> properties, String sessionId)
Changes an attribute definition belonging to a class metadata using the class id as key.ChangeDescriptor
setClassProperties(long classId, HashMap<String,Object> properties, String sessionId)
Changes a class metadata definition.void
setSpecialRelationshipDisplayName(String relationshipName, String relationshipDisplayName, String sessionId)
Sets the display name of a special relationship used in a model.
-
-
-
Field Detail
-
PATH
public static final String PATH
Path that includes the Kuwaiba version and core- See Also:
- Constant Field Values
-
-
Method Detail
-
getClassIcon
@GetMapping(value="icons/large/{className}", produces="image/png") public byte[] getClassIcon(@PathVariable String className)
Get a class icon as a byte array.- Parameters:
className
- The class name of the Icon.- Returns:
- The Icon as a byte array.
-
getClassSmallIcon
@GetMapping(value="icons/small/{className}", produces="image/png") public byte[] getClassSmallIcon(@PathVariable String className)
Get a small class icon as a byte array.- Parameters:
className
- The class name of the small Icon.- Returns:
- The small Icon as a byte array.
-
getRelationshipIcon
@GetMapping(value="icons/relationships/{color}/{width}/{height}", produces="image/png") public byte[] getRelationshipIcon(@PathVariable int color, @PathVariable int width, @PathVariable int height)
Get a relationship icon as a byte array.- Parameters:
color
- Color of the relationshipwidth
- Width of the relationshipheight
- Height of the relationship- Returns:
- The relationship Icon as a byte array.
-
createClass
@RequestMapping(method=POST, value="createClass/{sessionId}", produces="application/json") public long createClass(@RequestBody ClassMetadata classDefinition, @PathVariable("sessionId") String sessionId)
Creates a class metadata with its attributes (some new and others inherited from the parent class).- Specified by:
createClass
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
classDefinition
- The class definition, name, display name, etc.sessionId
- The session token id.- Returns:
- The Id of the newClassMetadata.
-
setClassProperties
@RequestMapping(method=PUT, value="setClassProperties/{classId}/{sessionId}", produces="application/json") public ChangeDescriptor setClassProperties(@PathVariable("classId") long classId, @RequestBody HashMap<String,Object> properties, @PathVariable("sessionId") String sessionId)
Changes a class metadata definition.- Specified by:
setClassProperties
in interfaceMetadataEntityManagerRestOpenApi
- 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.properties
- An HashMapwith 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. sessionId
- The session token id.- Returns:
- The summary of the changes that were made.
-
deleteClass
@RequestMapping(method=DELETE, value="deleteClass/{className}/{sessionId}", produces="application/json") public void deleteClass(@PathVariable("className") String className, @PathVariable("sessionId") String sessionId)
Deletes a class metadata, its attributes and category relationships.- Specified by:
deleteClass
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- The class name.sessionId
- The session token id.
-
deleteClassWithId
@RequestMapping(method=DELETE, value="deleteClassWithId/{classId}/{sessionId}", produces="application/json") public void deleteClassWithId(@PathVariable("classId") long classId, @PathVariable("sessionId") String sessionId)
Deletes a class metadata, its attributes and category relationships.- Specified by:
deleteClassWithId
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
classId
- The class id.sessionId
- The session token id.
-
getAllClassesLight
@RequestMapping(method=GET, value="getAllClassesLight/{includeListTypes}/{includeIndesign}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getAllClassesLight(@PathVariable("includeListTypes") boolean includeListTypes, @PathVariable("includeIndesign") boolean includeIndesign, @PathVariable("sessionId") String sessionId)
Retrieves the simplified list of classes, This list won't include either those classes marked as dummy.- Specified by:
getAllClassesLight
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
includeListTypes
- To indicate if the list should include the subclasses of GenericObjectList.includeIndesign
- Include all the data model classes or only the classes in production.sessionId
- The session token id.- Returns:
- The list of type classes.
-
getSubClassesLight
@RequestMapping(method=GET, value="getSubClassesLight/{className}/{includeAbstractClasses}/{includeSelf}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getSubClassesLight(@PathVariable("className") String className, @PathVariable("includeAbstractClasses") boolean includeAbstractClasses, @PathVariable("includeSelf") boolean includeSelf, @PathVariable("sessionId") String sessionId)
Gets the subclasses of a given class recursively.- Specified by:
getSubClassesLight
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- The class name.includeAbstractClasses
- Should the list include the abstract subclasses.includeSelf
- Should the list include the subclasses and the parent class?sessionId
- The session token id.- Returns:
- The list of subclasses.
-
getSubClassesLightNoRecursive
@RequestMapping(method=GET, value="getSubClassesLightNoRecursive/{className}/{includeAbstractClasses}/{includeSelf}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getSubClassesLightNoRecursive(@PathVariable("className") String className, @PathVariable("includeAbstractClasses") boolean includeAbstractClasses, @PathVariable("includeSelf") boolean includeSelf, @PathVariable("sessionId") String sessionId)
Gets the direct subclasses of a given class.- Specified by:
getSubClassesLightNoRecursive
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- The class name.includeAbstractClasses
- If abstract classes should be included.includeSelf
- Also return the metadata of classclassName
sessionId
- The session token id.- Returns:
- The list of subclasses.
-
getSuperClassesLight
@RequestMapping(method=GET, value="getSuperClassesLight/{className}/{includeSelf}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getSuperClassesLight(@PathVariable("className") String className, @PathVariable("includeSelf") boolean includeSelf, @PathVariable("sessionId") String sessionId)
Retrieves the superclasses of a given class up to InventoryObject.- Specified by:
getSuperClassesLight
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- The class to be evaluated.includeSelf
- If the result should include the the very class that was provided inclassName
parameter.sessionId
- The session token id.- Returns:
- The list of super classes.
-
getSubClassesCount
@RequestMapping(method=GET, value="getSubClassesCount/{className}/{sessionId}", produces="application/json") public long getSubClassesCount(@PathVariable("className") String className, @PathVariable("sessionId") String sessionId)
Get the subclasses count given a parent class name.- Specified by:
getSubClassesCount
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- Parent class Name.sessionId
- The session token id.- Returns:
- Number of direct subclasses.
-
getAllClasses
@RequestMapping(method=GET, value="getAllClasses/{includeListTypes}/{includeIndesign}/{sessionId}", produces="application/json") public List<ClassMetadata> getAllClasses(@PathVariable("includeListTypes") boolean includeListTypes, @PathVariable("includeIndesign") boolean includeIndesign, @PathVariable("sessionId") String sessionId)
Retrieves all the class metadata except for classes marked as dummy.- Specified by:
getAllClasses
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
includeListTypes
- Boolean to indicate if the list should include the subclasses of GenericObjectList.includeIndesign
- Include classes marked as "in design".sessionId
- The session token id.- Returns:
- An array with the metadata of the classes.
-
getClass
@RequestMapping(method=GET, value="getClass/{className}/{sessionId}", produces="application/json") public ClassMetadata getClass(@PathVariable("className") String className, @PathVariable("sessionId") String sessionId)
Gets a class metadata, its attributes and Category.- Specified by:
getClass
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- The class name.sessionId
- The session token id.- Returns:
- A ClassMetadata with the className.
-
getClassWithId
@RequestMapping(method=GET, value="getClassWithId/{classId}/{sessionId}", produces="application/json") public ClassMetadata getClassWithId(@PathVariable("classId") long classId, @PathVariable("sessionId") String sessionId)
Gets a class metadata, its attributes and Category.- Specified by:
getClassWithId
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
classId
- The class id.sessionId
- The session token id.- Returns:
- A ClassMetadata with the classId.
-
getClasses
@RequestMapping(method=GET, value="getClasses/{className}/{page}/{limit}/{sessionId}", produces="application/json") public List<ClassMetadata> getClasses(@PathVariable("className") String className, @PathVariable("page") int page, @PathVariable("limit") int limit, @PathVariable("sessionId") String sessionId)
Gets a list of classes, its attributes and Category with a given class name to filter.- Specified by:
getClasses
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- The class name to filter for.page
- The number of results to skip or the page.limit
- The number of results per page.sessionId
- The session token id.- Returns:
- A list of Classes that contains the filter in the classMetada name.
-
isSubclassOf
@RequestMapping(method=GET, value="isSubclassOf/{allegedParent}/{className}/{sessionId}", produces="application/json") public boolean isSubclassOf(@PathVariable("allegedParent") String allegedParent, @PathVariable("className") String className, @PathVariable("sessionId") String sessionId)
Assess if a given class is subclass of another.- Specified by:
isSubclassOf
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
allegedParent
- Alleged super class.className
- Class to be evaluated.sessionId
- The session token id.- Returns:
- True if classToBeEvaluated is subclass of allegedParent. False otherwise. This method also returns true if allegedParent == className.
-
createAttribute
@RequestMapping(method=POST, value="createAttribute/{className}/{recursive}/{sessionId}", produces="application/json") public void createAttribute(@PathVariable("className") String className, @RequestBody AttributeMetadata attributeDefinition, @PathVariable("recursive") boolean recursive, @PathVariable("sessionId") String sessionId)
Adds an attribute to a class.- Specified by:
createAttribute
in interfaceMetadataEntityManagerRestOpenApi
- 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.sessionId
- The session token id.
-
createAttributeForClassWithId
@RequestMapping(method=POST, value="createAttributeForClassWithId/{classId}/{sessionId}", produces="application/json") public void createAttributeForClassWithId(@PathVariable("classId") long classId, @RequestBody AttributeMetadata attributeDefinition, @PathVariable("sessionId") String sessionId)
Adds an attribute to a class.- Specified by:
createAttributeForClassWithId
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
classId
- The id of the class the attribute will be added to.attributeDefinition
- An object with the definition of the attribute.sessionId
- The session token id.
-
hasAttribute
@RequestMapping(method=GET, value="hasAttribute/{className}/{name}/{sessionId}", produces="application/json") public boolean hasAttribute(@PathVariable("className") String className, @PathVariable("name") String name, @PathVariable("sessionId") String sessionId)
Checks if a class has a attribute with a given name.- Specified by:
hasAttribute
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- Class name.name
- Attribute name.sessionId
- The session token id.- Returns:
- True if the given class has the attribute.
-
getAttribute
@RequestMapping(method=GET, value="getAttribute/{className}/{name}/{sessionId}", produces="application/json") public AttributeMetadata getAttribute(@PathVariable("className") String className, @PathVariable("name") String name, @PathVariable("sessionId") String sessionId)
Gets an attribute belonging to a class.- Specified by:
getAttribute
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- Class name.name
- Attribute name.sessionId
- The session token id.- Returns:
- AttributeMetata of the requested attribute.
-
getAttributeForClassWithId
@RequestMapping(method=GET, value="getAttributeForClassWithId/{classId}/{id}/{sessionId}", produces="application/json") public AttributeMetadata getAttributeForClassWithId(@PathVariable("classId") long classId, @PathVariable("id") long id, @PathVariable("sessionId") String sessionId)
Gets an attribute belonging to a class.- Specified by:
getAttributeForClassWithId
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
classId
- Class id.id
- Attribute id.sessionId
- The session token id.- Returns:
- AttributeMetata of the requested attribute.
-
getMandatoryAttributesInClass
@RequestMapping(method=GET, value="getMandatoryAttributesInClass/{className}/{sessionId}", produces="application/json") public List<AttributeMetadata> getMandatoryAttributesInClass(@PathVariable("className") String className, @PathVariable("sessionId") String sessionId)
Retrieves the list of the attributes marked as mandatory.- Specified by:
getMandatoryAttributesInClass
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- The class name.sessionId
- The session token id.- Returns:
- A list of AttributeMetadata.
-
setAttributeProperties
@RequestMapping(method=PUT, value="setAttributeProperties/{className}/{id}/{sessionId}", produces="application/json") public ChangeDescriptor setAttributeProperties(@PathVariable("className") String className, @PathVariable("id") long id, @RequestBody HashMap<String,Object> properties, @PathVariable("sessionId") String sessionId)
Changes an attribute definition belonging to a class metadata use the class name as id.- Specified by:
setAttributeProperties
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- Class the attribute belongs to.id
- Id of the attribute to be updated.properties
- An HashMapwith 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. sessionId
- The session token id.- Returns:
- The summary of the changes that were made.
-
setAttributePropertiesForClassWithId
@RequestMapping(method=PUT, value="setAttributePropertiesForClassWithId/{classId}/{id}/{sessionId}", produces="application/json") public ChangeDescriptor setAttributePropertiesForClassWithId(@PathVariable("classId") long classId, @PathVariable("id") long id, @RequestBody HashMap<String,Object> properties, @PathVariable("sessionId") String sessionId)
Changes an attribute definition belonging to a class metadata using the class id as key.- Specified by:
setAttributePropertiesForClassWithId
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
classId
- Id of the class the attribute belongs to.id
- Id of the attribute to be updated.properties
- An HashMapwith 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. sessionId
- The session token id.- Returns:
- The summary of the changes that were made.
-
deleteAttribute
@RequestMapping(method=DELETE, value="deleteAttribute/{className}/{name}/{sessionId}", produces="application/json") public void deleteAttribute(@PathVariable("className") String className, @PathVariable("name") String name, @PathVariable("sessionId") String sessionId)
Deletes an attribute from a class.- Specified by:
deleteAttribute
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- Class name.name
- Attribute name.sessionId
- The session token id.
-
deleteAttributeForClassWithId
@RequestMapping(method=DELETE, value="deleteAttributeForClassWithId/{classId}/{name}/{sessionId}", produces="application/json") public void deleteAttributeForClassWithId(@PathVariable("classId") long classId, @PathVariable("name") String name, @PathVariable("sessionId") String sessionId)
Deletes an attribute from a class.- Specified by:
deleteAttributeForClassWithId
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
classId
- Class id.name
- Attribute name.sessionId
- The session token id.
-
getPossibleChildren
@RequestMapping(method=GET, value="getPossibleChildren/{parentClassName}/{ignoreAbstract}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getPossibleChildren(@PathVariable("parentClassName") String parentClassName, @PathVariable("ignoreAbstract") boolean ignoreAbstract, @PathVariable("sessionId") String sessionId)
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.- Specified by:
getPossibleChildren
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassName
- The name of the class.ignoreAbstract
- true to ignore abstract classes.sessionId
- The session token id.- Returns:
- An array with the list of direct possible children classes in the containment hierarchy.
-
getPossibleSpecialChildren
@RequestMapping(method=GET, value="getPossibleSpecialChildren/{parentClassName}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getPossibleSpecialChildren(@PathVariable("parentClassName") String parentClassName, @PathVariable("sessionId") String sessionId)
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.- Specified by:
getPossibleSpecialChildren
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassName
- The name of the class.sessionId
- The session token id.- Returns:
- An array with the list of direct possible children classes in the containment hierarchy.
-
getPossibleChildrenNoRecursive
@RequestMapping(method=GET, value="getPossibleChildrenNoRecursive/{parentClassName}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getPossibleChildrenNoRecursive(@PathVariable("parentClassName") String parentClassName, @PathVariable("sessionId") String sessionId)
Same as getPossibleChildren but this one only gets the direct possible children for the given class, this is, subclasses are not included.- Specified by:
getPossibleChildrenNoRecursive
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassName
- The name of the class.sessionId
- The session token id.- Returns:
- An array with the list of possible children classes in the containment hierarchy, including the subclasses of the abstract classes.
-
getPossibleSpecialChildrenNoRecursive
@RequestMapping(method=GET, value="getPossibleSpecialChildrenNoRecursive/{parentClassName}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getPossibleSpecialChildrenNoRecursive(@PathVariable("parentClassName") String parentClassName, @PathVariable("sessionId") String sessionId)
Same as getPossibleSpecialChildren but this one only gets the direct special possible children for the given class, this is, subclasses are not included.- Specified by:
getPossibleSpecialChildrenNoRecursive
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassName
- The name of the class.sessionId
- The session token id.- Returns:
- An array with the list of possible children classes in the containment hierarchy, including the subclasses of the abstract classes.
-
canBeChild
@RequestMapping(method=GET, value="canBeChild/{allegedParent}/{childToBeEvaluated}/{sessionId}", produces="application/json") public boolean canBeChild(@PathVariable("allegedParent") String allegedParent, @PathVariable("childToBeEvaluated") String childToBeEvaluated, @PathVariable("sessionId") String sessionId)
Finds out if an instance of a given class can be child of an instance of allegedParent.This is a sort of reverse getPossibleChildren.- Specified by:
canBeChild
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
allegedParent
- Possible parent.childToBeEvaluated
- Class to be evaluated.sessionId
- The session token id.- Returns:
- True an instance of class childToBeEvaluated be a contained into an instance of allegedParent. False otherwise.
-
canBeSpecialChild
@RequestMapping(method=GET, value="canBeSpecialChild/{allegedParent}/{childToBeEvaluated}/{sessionId}", produces="application/json") public boolean canBeSpecialChild(@PathVariable("allegedParent") String allegedParent, @PathVariable("childToBeEvaluated") String childToBeEvaluated, @PathVariable("sessionId") String sessionId)
Same ascanBeChild
, but using the special containment hierarchy.- Specified by:
canBeSpecialChild
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
allegedParent
- Possible parent.childToBeEvaluated
- Class to be evaluated.sessionId
- The session token id.- Returns:
- True an instance of class childToBeEvaluated be a contained into an instance of allegedParent (as in the special containment hierarchy). False otherwise.
-
addPossibleChildrenForClassWithId
@RequestMapping(method=POST, value="addPossibleChildrenForClassWithId/{parentClassId}/{possibleChildren}/{sessionId}", produces="application/json") public void addPossibleChildrenForClassWithId(@PathVariable("parentClassId") long parentClassId, @PathVariable("possibleChildren") long[] possibleChildren, @PathVariable("sessionId") String sessionId)
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.- Specified by:
addPossibleChildrenForClassWithId
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassId
- Id of the class whose instances can contain the instances of the classes in possibleChildren. Use -1 to refer to the DummyRoot.possibleChildren
- Ids of the candidates to be contained.sessionId
- The session token id.
-
addPossibleChildren
@RequestMapping(method=POST, value="addPossibleChildren/{parentClassName}/{possibleChildren}/{sessionId}", produces="application/json") public void addPossibleChildren(@PathVariable("parentClassName") String parentClassName, @PathVariable("possibleChildren") String[] possibleChildren, @PathVariable("sessionId") String sessionId)
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.- Specified by:
addPossibleChildren
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassName
- Parent class name. Use DummyRoot for the Navigation Tree root.possibleChildren
- List of possible children.sessionId
- The session token id.
-
addPossibleSpecialChildrenWithId
@RequestMapping(method=POST, value="addPossibleSpecialChildrenWithId/{parentClassId}/{possibleSpecialChildren}/{sessionId}", produces="application/json") public void addPossibleSpecialChildrenWithId(@PathVariable("parentClassId") long parentClassId, @PathVariable("possibleSpecialChildren") long[] possibleSpecialChildren, @PathVariable("sessionId") String sessionId)
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.- Specified by:
addPossibleSpecialChildrenWithId
in interfaceMetadataEntityManagerRestOpenApi
- 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.sessionId
- The session token id.
-
addPossibleSpecialChildren
@RequestMapping(method=POST, value="addPossibleSpecialChildren/{parentClassName}/{possibleSpecialChildren}/{sessionId}", produces="application/json") public void addPossibleSpecialChildren(@PathVariable("parentClassName") String parentClassName, @PathVariable("possibleSpecialChildren") String[] possibleSpecialChildren, @PathVariable("sessionId") String sessionId)
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.- Specified by:
addPossibleSpecialChildren
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassName
- Parent class name.possibleSpecialChildren
- List of possible children.sessionId
- The session token id.
-
removePossibleChildren
@RequestMapping(method=DELETE, value="removePossibleChildren/{parentClassId}/{childrenToBeRemoved}/{sessionId}", produces="application/json") public void removePossibleChildren(@PathVariable("parentClassId") long parentClassId, @PathVariable("childrenToBeRemoved") long[] childrenToBeRemoved, @PathVariable("sessionId") String sessionId)
The opposite of addPossibleChildren. It removes the given possible children TODO: Make this method safe. This is, check if there's already instances of the given "children to be deleted" with parentClass as their parent.- Specified by:
removePossibleChildren
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassId
- Id of the class whos instances can contain the instances of the next param.childrenToBeRemoved
- Ids of the candidates to be deleted.sessionId
- The session token id.
-
removePossibleSpecialChildren
@RequestMapping(method=DELETE, value="removePossibleSpecialChildren/{parentClassId}/{childrenToBeRemoved}/{sessionId}", produces="application/json") public void removePossibleSpecialChildren(@PathVariable("parentClassId") long parentClassId, @PathVariable("childrenToBeRemoved") long[] childrenToBeRemoved, @PathVariable("sessionId") String sessionId)
The opposite of addPossibleSpecialChildren. It removes the given possible special children.- Specified by:
removePossibleSpecialChildren
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
parentClassId
- Id of the class whos instances can contain the instances of the next param.childrenToBeRemoved
- Ids of the candidates to be deleted.sessionId
- The session token id.
-
setSpecialRelationshipDisplayName
@RequestMapping(method=PUT, value="setSpecialRelationshipDisplayName/{relationshipName}/{relationshipDisplayName}/{sessionId}", produces="application/json") public void setSpecialRelationshipDisplayName(@PathVariable("relationshipName") String relationshipName, @PathVariable("relationshipDisplayName") String relationshipDisplayName, @PathVariable("sessionId") String sessionId)
Sets the display name of a special relationship used in a model.- Specified by:
setSpecialRelationshipDisplayName
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
relationshipName
- The name of the relationship the display name is going to be set.relationshipDisplayName
- The display name.sessionId
- The session token id.
-
getSpecialRelationshipDisplayName
@RequestMapping(method=GET, value="getSpecialRelationshipDisplayName/{relationshipName}/{sessionId}", produces="application/json") public String getSpecialRelationshipDisplayName(@PathVariable("relationshipName") String relationshipName, @PathVariable("sessionId") String sessionId)
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.- Specified by:
getSpecialRelationshipDisplayName
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
relationshipName
- The name of the relationship.sessionId
- The session token id.- Returns:
- The display name for the relationship name provided. If it can not be found, the relationship name is returned instead.
-
getUpstreamContainmentHierarchy
@RequestMapping(method=GET, value="getUpstreamContainmentHierarchy/{className}/{recursive}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getUpstreamContainmentHierarchy(@PathVariable("className") String className, @PathVariable("recursive") boolean recursive, @PathVariable("sessionId") String sessionId)
Get the upstream containment hierarchy for a given class, unlike getPossibleChildren (which will give you the downstream hierarchy).- Specified by:
getUpstreamContainmentHierarchy
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- Class name.recursive
- Get only the direct possible parents, or go up into the containment hierarchy. Beware: don't mistake the class hierarchy for the containment one.sessionId
- The session token id.- Returns:
- An sorted list with the upstream containment hierarchy. Repeated elements are omitted.
-
getUpstreamSpecialContainmentHierarchy
@RequestMapping(method=GET, value="getUpstreamSpecialContainmentHierarchy/{className}/{recursive}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getUpstreamSpecialContainmentHierarchy(@PathVariable("className") String className, @PathVariable("recursive") boolean recursive, @PathVariable("sessionId") String sessionId)
Gets the upstream special containment hierarchy for a given class, unlike getPossibleChildren (which will give you the downstream hierarchy).- Specified by:
getUpstreamSpecialContainmentHierarchy
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- Class name.recursive
- Get only the direct possible parents, or go up into the containment hierarchy. Beware: don't mistake the class hierarchy for the containment one.sessionId
- The session token id.- Returns:
- An sorted list with the special upstream containment hierarchy. Repeated elements are omitted.
-
getUpstreamClassHierarchy
@RequestMapping(method=GET, value="getUpstreamClassHierarchy/{className}/{includeSelf}/{sessionId}", produces="application/json") public List<ClassMetadataLight> getUpstreamClassHierarchy(@PathVariable("className") String className, @PathVariable("includeSelf") boolean includeSelf, @PathVariable("sessionId") String sessionId)
Gets the parent classes of a given class up toInventoryObject
. Please note thatRootObject
is being deliberately omitted.- Specified by:
getUpstreamClassHierarchy
in interfaceMetadataEntityManagerRestOpenApi
- Parameters:
className
- The class to get the superclasses from.includeSelf
- If the result should also include the class in className.sessionId
- The session token id.- Returns:
- The list of super classes until the root of the hierarchy.
-
-