Class AbstractRelationshipManagementAction
- java.lang.Object
-
- org.neotropic.kuwaiba.core.apis.integration.modules.actions.AbstractVisualAction
-
- org.neotropic.kuwaiba.core.apis.integration.modules.actions.AbstractVisualInventoryAction
-
- org.neotropic.kuwaiba.core.apis.integration.modules.actions.AbstractRelationshipManagementAction
-
- All Implemented Interfaces:
Comparable
- Direct Known Subclasses:
NetworkResourcesRelationshipManagementAction
public abstract class AbstractRelationshipManagementAction extends AbstractVisualInventoryAction
Former Relate to.../Release from... actions (used in complex models to create/remove relationships between inventory objects) should now handled using a single action, subclass of the present class.- Author:
- Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractRelationshipManagementAction.RelationshipCardinality
Defines the cardinality between inventory objects.-
Nested classes/interfaces inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.actions.AbstractVisualAction
AbstractVisualAction.VisualActionType
-
-
Field Summary
-
Fields inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.actions.AbstractVisualInventoryAction
SELECTION_ANY_OBJECTS, SELECTION_NO_OBJECTS
-
Fields inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.actions.AbstractVisualAction
childrenActions, formatOptions, icon, listeners, moduleId, type
-
-
Constructor Summary
Constructors Constructor Description AbstractRelationshipManagementAction(String moduleId)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
createRelationship(List<BusinessObjectLight> sourceObjects, List<BusinessObjectLight> targetObjects)
Creates the actual relationships between the the source object and the target objects, depending on the cardinality defined ingetCardinality()
.abstract AbstractRelationshipManagementAction.RelationshipCardinality
getCardinality()
Indicates the cardinality of the relationship.abstract String
getIncomingRelationshipDisplayName()
The display name that should be used to show the relationship between the target object(s) and the selected object(s).abstract String
getOutgoingRelationshipDisplayName()
The display name that should be used to show the relationship between the selected object(s) and the target object(s).abstract String
getRelationshipName()
Gets the actual name of the relationship in the database.abstract String
getTargetObjectClass()
Returns the type of inventory objects that can be related through the given relationship to the selected objects.abstract void
releaseRelationship(List<BusinessObjectLight> sourceObjects, List<BusinessObjectLight> targetObjects)
Releases the actual relationships between the the source object and the target objects.-
Methods inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.actions.AbstractVisualInventoryAction
appliesTo, getName, getRequiredSelectedObjects, toString
-
Methods inherited from class org.neotropic.kuwaiba.core.apis.integration.modules.actions.AbstractVisualAction
clearListeners, compareTo, fireActionCompletedEvent, getChildrenActions, getFormatOptions, getIcon, getModuleAction, getModuleId, getVisualComponent, registerActionCompletedLister, setChildrenActions, setFormatOptions, setIcon, setModuleId, unregisterListener
-
-
-
-
Constructor Detail
-
AbstractRelationshipManagementAction
public AbstractRelationshipManagementAction(String moduleId)
-
-
Method Detail
-
getTargetObjectClass
public abstract String getTargetObjectClass()
Returns the type of inventory objects that can be related through the given relationship to the selected objects.- Returns:
- The type (it can be an abstract class)
-
getRelationshipName
public abstract String getRelationshipName()
Gets the actual name of the relationship in the database.- Returns:
- Said relationship name.
-
getIncomingRelationshipDisplayName
public abstract String getIncomingRelationshipDisplayName()
The display name that should be used to show the relationship between the target object(s) and the selected object(s).- Returns:
- Said display name.
-
getOutgoingRelationshipDisplayName
public abstract String getOutgoingRelationshipDisplayName()
The display name that should be used to show the relationship between the selected object(s) and the target object(s).- Returns:
- Said display name.
-
getCardinality
public abstract AbstractRelationshipManagementAction.RelationshipCardinality getCardinality()
Indicates the cardinality of the relationship. SeeAbstractRelationshipManagementAction.RelationshipCardinality
for possible values.- Returns:
- Said cardinality.
-
createRelationship
public abstract void createRelationship(List<BusinessObjectLight> sourceObjects, List<BusinessObjectLight> targetObjects) throws IllegalArgumentException
Creates the actual relationships between the the source object and the target objects, depending on the cardinality defined ingetCardinality()
.- Parameters:
sourceObjects
- The list of source objects to be related.targetObjects
- The list of target objects to be related.- Throws:
IllegalArgumentException
- If the cardinality or the type of target objects does not match the one specified in thegetCardinality()
andgetTargetObjectClass()
methods.
-
releaseRelationship
public abstract void releaseRelationship(List<BusinessObjectLight> sourceObjects, List<BusinessObjectLight> targetObjects) throws IllegalArgumentException
Releases the actual relationships between the the source object and the target objects. What "releases" means can be- Parameters:
sourceObjects
- The list of source objects to be related.targetObjects
- The list of target objects to be related.- Throws:
IllegalArgumentException
- If the cardinality or the type of target objects does not match the one specified in thegetCardinality()
andgetTargetObjectClass()
methods.
-
-