Magentix2
2.1.1
|
Public Member Functions | |
OMSProxy (BaseAgent agent, String OMSServiceDescriptionLocation) throws Exception | |
OMSProxy (CProcessor agent, String OMSServiceDescriptionLocation) | |
OMSProxy (BaseAgent agent) throws Exception | |
OMSProxy (CProcessor myProcessor) | |
ACLMessage | buildOrganizationalMessage (String OrganizationID) throws ForbiddenNormException, UnitNotExistsException, AgentNotInUnitException, NotPlaysAnyRoleException, InvalidUnitTypeException, OnlyPlaysCreatorException, EmptyParametersException, NotInUnitOrParentUnitException, AgentNotExistsException, RoleNotExistsException, VisibilityRoleException, InvalidVisibilityException |
String | leaveRole (String RoleID, String UnitID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, NotPlaysRoleException, MySQLException |
ArrayList< ArrayList< String > > | informAgentRole (String RequestedAgentID) throws EmptyParametersException, AgentNotExistsException, ForbiddenNormException |
ArrayList< ArrayList< String > > | informMembers (String UnitID, String RoleID, String PositionID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, AgentNotExistsException, AgentNotInUnitException, InvalidRolePositionException, VisibilityRoleException, RoleNotExistsException, UnitNotExistsException |
ArrayList< String > | informRole (String RoleID, String UnitID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, VisibilityRoleException |
ArrayList< String > | informUnit (String UnitID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, InvalidUnitTypeException, NotInUnitOrParentUnitException |
ArrayList< ArrayList< String > > | informUnitRoles (String UnitID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, InvalidVisibilityException |
int | informQuantityMembers (String UnitID, String RoleID, String PositionID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, AgentNotExistsException, AgentNotInUnitException, InvalidRolePositionException, VisibilityRoleException, RoleNotExistsException, InvalidVisibilityException, InvalidPositionException |
String | registerRole (String RoleID, String UnitID, String AccessibilityID, String VisibilityID, String PositionID) throws ForbiddenNormException, NotValidIdentifierException, EmptyParametersException, UnitNotExistsException, RoleExistsInUnitException, AgentNotInUnitException, NotInUnitAndNotCreatorException, InvalidUnitTypeException, NotMemberOrCreatorInUnitException, NotSupervisorOrCreatorInUnitException, InvalidPositionException, InvalidAccessibilityException, InvalidVisibilityException, MySQLException |
String | registerUnit (String UnitID, String TypeID, String ParentUnitID, String CreatorID) throws ForbiddenNormException, NotValidIdentifierException, EmptyParametersException, UnitExistsException, NotCreatorInParentUnitException, ParentUnitNotExistsException, InvalidVisibilityException, InvalidAccessibilityException, InvalidPositionException, InsertingTableException, InvalidUnitTypeException, MySQLException |
String | registerNorm (String UnitID, String NormContent) throws NotValidIdentifierException, InvalidIDException, InvalidDeonticException, InvalidTargetTypeException, InvalidTargetValueException,InvalidOMSActionException,InvalidExpressionException,RoleNotExistsException,InvalidPositionException,InvalidUnitTypeException,ForbiddenNormException,NotSupervisorOrCreatorInUnitException,NotMemberOrCreatorInUnitException,NotInUnitAndNotCreatorException,AgentNotInUnitException,NormExistsInUnitException,UnitNotExistsException,EmptyParametersException, MySQLException |
String | informNorm (String NormName, String UnitID) throws InvalidUnitTypeException,NotInUnitOrParentUnitException, ForbiddenNormException,NormNotExistsException,UnitNotExistsException,EmptyParametersException, MySQLException |
ArrayList< ArrayList< String > > | informTargetNorms (String TargetTypeName, String TargetTypeValue, String UnitID) throws ForbiddenNormException, AgentNotInUnitException,InvalidTargetTypeException,UnitNotExistsException,EmptyParametersException, MySQLException |
String | deregisterNorm (String NormName, String UnitID) throws RoleNotExistsException,InvalidPositionException,InvalidUnitTypeException,ForbiddenNormException,NotSupervisorOrCreatorInUnitException,NotMemberOrCreatorInUnitException,NotInUnitAndNotCreatorException,AgentNotInUnitException,NormNotExistsException,UnitNotExistsException,EmptyParametersException, MySQLException |
String | joinUnit (String UnitID, String ParentUnitID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, ParentUnitNotExistsException, AgentNotInUnitException, NotCreatorInUnitException, NotCreatorInParentUnitException, VirtualParentException, SameUnitException, MySQLException |
String | deregisterRole (String RoleID, String UnitID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, RoleContainsNormsException, RoleInUseException, AgentNotInUnitException, NotInUnitAndNotCreatorException, InvalidUnitTypeException, NotMemberOrCreatorInUnitException, NotSupervisorOrCreatorInUnitException, MySQLException |
String | deregisterUnit (String UnitID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, VirtualUnitException, NotCreatorInUnitOrParentUnitException, SubunitsInUnitException, NotCreatorAgentInUnitException, DeletingTableException, InvalidPositionException, MySQLException |
String | deallocateRole (String RoleID, String UnitID, String TargetAgentID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, InvalidUnitTypeException, NotInUnitAndNotCreatorException, NotMemberOrCreatorInUnitException, AgentNotInUnitException, NotSupervisorOrCreatorInUnitException, NotPlaysRoleException, SameAgentNameException, MySQLException |
String | allocateRole (String RoleID, String UnitID, String TargetAgentID) throws ForbiddenNormException, NotValidIdentifierException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, InvalidUnitTypeException, NotInUnitAndNotCreatorException, NotMemberOrCreatorInUnitException, AgentNotInUnitException, NotSupervisorOrCreatorInUnitException, PlayingRoleException, SameAgentNameException |
String | acquireRole (String RoleID, String UnitID) throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, NotInUnitOrParentUnitException, NotSupervisorOrCreatorInUnitException, PlayingRoleException |
Package Attributes | |
ServiceTools | st = new ServiceTools() |
This class gives us the support to accede to the services of the OMS. The OMS provides a group of services for registering or deregistering structural components, specific roles, norms and units. It also offers services for reporting on these components.
Definition at line 70 of file OMSProxy.java.
es.upv.dsic.gti_ia.organization.OMSProxy.OMSProxy | ( | BaseAgent | agent, |
String | OMSServiceDescriptionLocation | ||
) | throws Exception |
This class gives us the support to access to the services of the OMS
agent | is a Magentix2 agent, this agent implemented the communication protocol. |
OMSServiceDesciptionLocation | The URL where the owl's document is located. |
Definition at line 87 of file OMSProxy.java.
{ super(agent, "OMS", OMSServiceDescriptionLocation); l10n = new THOMASMessages(); }
es.upv.dsic.gti_ia.organization.OMSProxy.OMSProxy | ( | CProcessor | agent, |
String | OMSServiceDescriptionLocation | ||
) |
Definition at line 93 of file OMSProxy.java.
{ super(agent, "OMS", OMSServiceDescriptionLocation); l10n = new THOMASMessages(); }
es.upv.dsic.gti_ia.organization.OMSProxy.OMSProxy | ( | BaseAgent | agent | ) | throws Exception |
This class gives us the support to accede to the services of the OMS, Checked that the data contained in the file configuration/Settings.xml, the URL ServiceDescriptionLocation is not empty and is the correct path.
agent | is a Magentix2 Agent, this agent implemented the communication protocol |
Definition at line 110 of file OMSProxy.java.
{ super(agent, "OMS"); ServiceDescriptionLocation = c.getOMSServiceDescriptionLocation(); l10n = new THOMASMessages(); }
es.upv.dsic.gti_ia.organization.OMSProxy.OMSProxy | ( | CProcessor | myProcessor | ) |
Definition at line 117 of file OMSProxy.java.
{ super(myProcessor, "OMS"); ServiceDescriptionLocation = c.getOMSServiceDescriptionLocation(); l10n = new THOMASMessages(); }
String es.upv.dsic.gti_ia.organization.OMSProxy.acquireRole | ( | String | RoleID, |
String | UnitID | ||
) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, NotInUnitOrParentUnitException, NotSupervisorOrCreatorInUnitException, PlayingRoleException |
Service used for acquiring a role inside a specific unit.
RoleID | Identifier of the role |
UnitID | Identifier of the organization unit |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
RoleNotExistsException | If role not exists. |
NotInUnitOrParentUnitException | If agent does not play any role in unit or parent unit. |
NotSupervisorOrCreatorInUnitException | If agent does not play any role with position supervisor or creator in unit. |
PlayingRoleException | If agent is already playing the role. |
Definition at line 1598 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("RoleID", RoleID); inputs.put("UnitID", UnitID); call = st.buildServiceContent("AcquireRole", inputs); try { return (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (RoleNotExistsException e) { throw e; } catch (NotInUnitOrParentUnitException e) { throw e; } catch (NotSupervisorOrCreatorInUnitException e) { throw e; } catch (PlayingRoleException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
String es.upv.dsic.gti_ia.organization.OMSProxy.allocateRole | ( | String | RoleID, |
String | UnitID, | ||
String | TargetAgentID | ||
) | throws ForbiddenNormException, NotValidIdentifierException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, InvalidUnitTypeException, NotInUnitAndNotCreatorException, NotMemberOrCreatorInUnitException, AgentNotInUnitException, NotSupervisorOrCreatorInUnitException, PlayingRoleException, SameAgentNameException |
Forces an agent to acquire a specific role.
RoleID | Identifier of the role |
UnitID | Identifier of the unit |
TargetAgentID | Identifier of the agent |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
RoleNotExistsException | If role not exists. |
InvalidUnitTypeException | If unit type is not valid. |
NotInUnitAndNotCreatorException | If agent does not play any role in unit and does not play any role with position creator. |
NotMemberOrCreatorInUnitException | If agent does not play any role with position member or creator inside the unit. |
AgentNotInUnitException | If agent does not play any role inside the unit. |
NotSupervisorOrCreatorInUnitException | If agent does not play any role with position supervisor or creator inside the unit. |
PlayingRoleException | If agent is already playing the role. |
SameAgentNameException | If the agent is the same than target agent. |
Definition at line 1521 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("RoleID", RoleID); inputs.put("UnitID", UnitID); inputs.put("TargetAgentID", TargetAgentID); call = st.buildServiceContent("AllocateRole", inputs); try { return (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (RoleNotExistsException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (NotInUnitAndNotCreatorException e) { throw e; } catch (NotMemberOrCreatorInUnitException e) { throw e; } catch (AgentNotInUnitException e) { throw e; } catch (NotSupervisorOrCreatorInUnitException e) { throw e; } catch (PlayingRoleException e) { throw e; } catch (SameAgentNameException e) { throw e; } catch (NotValidIdentifierException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
Builds a new organizational message with the appropriate receivers according to the type of unit and position of the role that the agent is performing
OrganizationID | represents the ID of the organization to which the agent wants to send a message |
UnitNotExistsException | If unit not exists. |
AgentNotInUnitException | If agent does not play any role in unit. |
NotPlaysAnyRoleException | If agent does not play any role. |
OnlyPlaysCreatorException | If agent only plays the role creator. |
NotInUnitOrParentUnitException | If agent does not play any role in unit or parent unit. |
EmptyParametersException | If any parameter is empty or null |
AgentNotExistsException | If agent not exists. |
VisibilityRoleException | If visibility role is not valid. |
RoleNotExistsException | If role not exists. |
InvalidVisibilityException | If visibility is not valid. |
InvalidUnitTypeException | If unit type is not valid. |
Definition at line 158 of file OMSProxy.java.
{ ArrayList<String> unit; ArrayList<ArrayList<String>> agentRoles = null; ArrayList<String> agentPositions = new ArrayList<String>(); String rol_aux; String unit_aux; boolean insideUnit = false; boolean containsPositonNoCreator = false; // Create a new ACLMessage ACLMessage msg = new ACLMessage(); msg.setSender(agent.getAid()); // agentName String agentName = agent.getAid().name; // Inform Unit unit = this.informUnit(OrganizationID); // If unit not exist if (unit.isEmpty()) { String message = l10n.getMessage(MessageID.UNIT_NOT_EXISTS, OrganizationID); throw new UnitNotExistsException(message); } else { String unitType = unit.get(0); agentRoles = this.informAgentRole(agentName); if (agentRoles.isEmpty()) { String message = l10n.getMessage(MessageID.NOT_PLAYS_ANY_ROLE); throw new NotPlaysAnyRoleException(message); } else { for (ArrayList<String> agentRole : agentRoles) { rol_aux = agentRole.get(0); unit_aux = agentRole.get(1); ArrayList<String> informRole = this.informRole(rol_aux, unit_aux); String position = informRole.get(0); if (position != null) { if (!position.equals("creator")) containsPositonNoCreator = true; agentPositions.add(position); } } // If only contains the role creator, then can not send a // organizational message if (containsPositonNoCreator) { // agentPositions.clear(); // The unit type is flat if (unitType.equals("flat")) { msg.putExchangeHeader("participant", OrganizationID); msg.setReceiver(new AgentID(OrganizationID)); } else { for (ArrayList<String> agentRole : agentRoles) { // Cogemos primero el rol, para que solamente // compruebe la unidad que es el segundo elemento. rol_aux = agentRole.get(0); if (agentRole.get(1).equals(OrganizationID)) { insideUnit = true; } } if (insideUnit) { if (unitType.equals("team")) { msg.putExchangeHeader("participant", OrganizationID); msg.setReceiver(new AgentID(OrganizationID)); } else if (unitType.equals("hierarchy")) { // Sacamos la posición del agente // Debemos elegir el de mayor if (agentPositions.contains("supervisor")) { msg.putExchangeHeader("supervisor", OrganizationID); msg.putExchangeHeader("participant", OrganizationID); } else if (agentPositions.contains("subordinate")) { msg.putExchangeHeader("supervisor", OrganizationID); } msg.setReceiver(new AgentID(OrganizationID)); } else { String message = l10n.getMessage(MessageID.INVALID_UNIT_TYPE, unitType); throw new InvalidUnitTypeException(message); } } else { // The agent is not inside the unit String message = l10n.getMessage(MessageID.AGENT_NOT_IN_UNIT, OrganizationID, agentName); throw new AgentNotInUnitException(message); } } } else { String message = l10n.getMessage(MessageID.ONLY_PLAYS_CREATOR, agentName); throw new OnlyPlaysCreatorException(message); } } } return msg; }
String es.upv.dsic.gti_ia.organization.OMSProxy.deallocateRole | ( | String | RoleID, |
String | UnitID, | ||
String | TargetAgentID | ||
) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, InvalidUnitTypeException, NotInUnitAndNotCreatorException, NotMemberOrCreatorInUnitException, AgentNotInUnitException, NotSupervisorOrCreatorInUnitException, NotPlaysRoleException, SameAgentNameException, MySQLException |
Forces an agent to leave a specific role.
RoleID | Identifier of the role |
UnitID | Identifier of the unit |
TargetAgentID | Identifier of the agent |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
RoleNotExistsException | If role not exists. |
InvalidUnitTypeException | If unit type is not valid. |
NotInUnitAndNotCreatorException | If agent does not play any role in unit and does not play any role with position creator. |
NotMemberOrCreatorInUnitException | If agent does not play any role with position member or creator inside the unit. |
AgentNotInUnitException | If agent does not play any role in unit. |
NotSupervisorOrCreatorInUnitException | If agent does not play any role with position supervisor or creator in unit. |
NotPlaysRoleException | If agent does not play the role. |
SameAgentNameException | If the agent is the same than target agent. |
MySQLException |
Definition at line 1432 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("TargetAgentID", TargetAgentID); inputs.put("RoleID", RoleID); inputs.put("UnitID", UnitID); call = st.buildServiceContent("DeallocateRole", inputs); try { return (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (RoleNotExistsException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (NotInUnitAndNotCreatorException e) { throw e; } catch (NotMemberOrCreatorInUnitException e) { throw e; } catch (AgentNotInUnitException e) { throw e; } catch (NotSupervisorOrCreatorInUnitException e) { throw e; } catch (NotPlaysRoleException e) { throw e; } catch (SameAgentNameException e) { throw e; } catch (MySQLException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
Definition at line 1102 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); inputs.put("NormName", NormName); call = st.buildServiceContent("DeregisterNorm", inputs); try { return (String) this.sendInform(); } catch (RoleNotExistsException e) { throw e; } catch (InvalidPositionException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (NotSupervisorOrCreatorInUnitException e) { throw e; } catch (NotMemberOrCreatorInUnitException e) { throw e; } catch (NotInUnitAndNotCreatorException e) { throw e; } catch (AgentNotInUnitException e) { throw e; } catch (NormNotExistsException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (EmptyParametersException e) { throw e; } catch (MySQLException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); return null; } }
Removes a specific role from a unit.
RoleID | Identifier of the role |
UnitID | Identifier of the unit |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
RoleNotExistsException | If role not exists. |
RoleContainsNormsException | If role contains associated norms. |
RoleInUseException | If role is played by some agents. |
AgentNotInUnitException | If agent does not play any role in unit. |
NotInUnitAndNotCreatorException | If agent does not play any role in unit and does not play any role with position creator. |
InvalidUnitTypeException | If unit type is invalid. |
NotMemberOrCreatorInUnitException | If agent does not play any role with position member or creator inside the unit. |
NotSupervisorOrCreatorInUnitException | If agent does not play any role with position superverisor or creator inside the unit. |
MySQLException |
Definition at line 1272 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("RoleID", RoleID); inputs.put("UnitID", UnitID); call = st.buildServiceContent("DeregisterRole", inputs); try { return (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (RoleNotExistsException e) { throw e; } catch (RoleContainsNormsException e) { throw e; } catch (RoleInUseException e) { throw e; } catch (AgentNotInUnitException e) { throw e; } catch (NotInUnitAndNotCreatorException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (NotMemberOrCreatorInUnitException e) { throw e; } catch (NotSupervisorOrCreatorInUnitException e) { throw e; } catch (MySQLException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
Removes a unit from an organization.
UnitID | Identifier of the unit |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | Unit not exists. |
VirtualUnitException | If unit is the virtual unit. |
NotCreatorInUnitOrParentUnitException | The agent does not play any role with position creator in unit or parent unit. |
SubunitsInUnitException | The unit contains subunits. |
NotCreatorAgentInUnitException | If agent does not play any role with position creator in unit. |
DeletingTableException | If any error occurs deleting table. |
InvalidPositionException | If position is invalid. |
Definition at line 1350 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); call = st.buildServiceContent("DeregisterUnit", inputs); try { return (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (VirtualUnitException e) { throw e; } catch (NotCreatorInUnitOrParentUnitException e) { throw e; } catch (SubunitsInUnitException e) { throw e; } catch (NotCreatorAgentInUnitException e) { throw e; } catch (DeletingTableException e) { throw e; } catch (InvalidPositionException e) { throw e; } catch (MySQLException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
ArrayList<ArrayList<String> > es.upv.dsic.gti_ia.organization.OMSProxy.informAgentRole | ( | String | RequestedAgentID | ) | throws EmptyParametersException, AgentNotExistsException, ForbiddenNormException |
Requesting the list of roles and units in which an agent is in a specific moment.
RequestedAgentID | Identifier of the agent requested |
EmptyParametersException | If any parameter is empty or null. |
AgentNotExistsException | If agent not exists. |
Definition at line 335 of file OMSProxy.java.
{ ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>(); HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("RequestedAgentID", RequestedAgentID); call = st.buildServiceContent("InformAgentRole", inputs); try { result = (ArrayList<ArrayList<String>>) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (AgentNotExistsException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); } return result; }
ArrayList<ArrayList<String> > es.upv.dsic.gti_ia.organization.OMSProxy.informMembers | ( | String | UnitID, |
String | RoleID, | ||
String | PositionID | ||
) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, AgentNotExistsException, AgentNotInUnitException, InvalidRolePositionException, VisibilityRoleException, RoleNotExistsException, UnitNotExistsException |
Indicates entities that are members of a specific unit. Optionally, it is possible to specify a role and position of this unit, so then only members playing this role or position are detailed.
UnitID | Identifier of the unit |
RoleID | Identifier of the role |
PositionID | Identifier of the position inside the unit, such as member, supervisor or subordinate |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
AgentNotExistsException | If agent not exists. |
AgentNotInUnitException | If agent is not inside the unit. |
InvalidRolePositionException | If role position is invalid. |
VisibilityRoleException | If visibility of the role is not valid. |
RoleNotExistsException | If role not exists. |
UnitNotExistsException | If unit not exists. |
Definition at line 396 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("RoleID", RoleID); inputs.put("UnitID", UnitID); inputs.put("PositionID", PositionID); call = st.buildServiceContent("InformMembers", inputs); try { return (ArrayList<ArrayList<String>>) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (AgentNotExistsException e) { throw e; } catch (AgentNotInUnitException e) { throw e; }catch (InvalidRolePositionException e) { throw e; } catch (VisibilityRoleException e) { throw e; } catch (RoleNotExistsException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
String es.upv.dsic.gti_ia.organization.OMSProxy.informNorm | ( | String | NormName, |
String | UnitID | ||
) | throws InvalidUnitTypeException,NotInUnitOrParentUnitException, ForbiddenNormException,NormNotExistsException,UnitNotExistsException,EmptyParametersException, MySQLException |
Definition at line 1014 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); inputs.put("NormName", NormName); call = st.buildServiceContent("InformNorm", inputs); try { return (String) this.sendInform(); } catch (NotInUnitOrParentUnitException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (NormNotExistsException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (EmptyParametersException e) { throw e; } catch (MySQLException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); return null; } }
int es.upv.dsic.gti_ia.organization.OMSProxy.informQuantityMembers | ( | String | UnitID, |
String | RoleID, | ||
String | PositionID | ||
) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, AgentNotExistsException, AgentNotInUnitException, InvalidRolePositionException, VisibilityRoleException, RoleNotExistsException, InvalidVisibilityException, InvalidPositionException |
Provides the number of current members of a specific unit. Optionally, if a role and position is indicated then only the quantity of members playing this roles or position is detailed.
UnitID | Identifier of the unit |
RoleID | Identifier of the role |
PositionID | Identifier of the position inside the unit, such as member, supervisor or subordinate |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
AgentNotExistsException | If agent not exists. |
AgentNotInUnitException | If agent is not inside the unit. |
InvalidRolePositionException | If role position is not valid. |
VisibilityRoleException | If role visibility is not valid. |
RoleNotExistsException | If role not exists. |
InvalidVisibilityException | If visibility is not valid. |
InvalidPositionException | If position is not valid. |
Definition at line 628 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("RoleID", RoleID); inputs.put("UnitID", UnitID); inputs.put("PositionID", PositionID); call = st.buildServiceContent("QuantityMembers", inputs); try { ArrayList<String> a = (ArrayList<String>) this.sendInform(); return Integer.parseInt(a.get(0)); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (AgentNotExistsException e) { throw e; } catch (AgentNotInUnitException e) { throw e; }catch (InvalidRolePositionException e) { throw e; } catch (VisibilityRoleException e) { throw e; } catch (RoleNotExistsException e) { throw e; } catch (InvalidVisibilityException e) { throw e; } catch (InvalidPositionException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return -1; } }
ArrayList<String> es.upv.dsic.gti_ia.organization.OMSProxy.informRole | ( | String | RoleID, |
String | UnitID | ||
) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, VisibilityRoleException |
Provides a role description of a specific unit.
RoleID | Identifier of the role |
UnitID | Identifier of the unit |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
RoleNotExistsException | If role not exists. |
VisibilityRoleException | If visibility role is not valid. |
Definition at line 462 of file OMSProxy.java.
{ ArrayList<String> result = new ArrayList<String>(); HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); inputs.put("RoleID", RoleID); call = st.buildServiceContent("InformRole", inputs); try { result = (ArrayList<String>) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (RoleNotExistsException e) { throw e; } catch (VisibilityRoleException e) { throw e; }catch (ForbiddenNormException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); } return result; }
ArrayList<ArrayList<String> > es.upv.dsic.gti_ia.organization.OMSProxy.informTargetNorms | ( | String | TargetTypeName, |
String | TargetTypeValue, | ||
String | UnitID | ||
) | throws ForbiddenNormException, AgentNotInUnitException,InvalidTargetTypeException,UnitNotExistsException,EmptyParametersException, MySQLException |
Definition at line 1058 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); inputs.put("TargetTypeName", TargetTypeName); inputs.put("TargetValueName", TargetTypeValue); call = st.buildServiceContent("InformTargetNorms", inputs); try { return (ArrayList<ArrayList<String>>) this.sendInform(); }catch (ForbiddenNormException e) { throw e; } catch (AgentNotInUnitException e) { throw e; } catch (InvalidTargetTypeException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (EmptyParametersException e) { throw e; } catch (MySQLException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); return null; } }
ArrayList<String> es.upv.dsic.gti_ia.organization.OMSProxy.informUnit | ( | String | UnitID | ) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, InvalidUnitTypeException, NotInUnitOrParentUnitException |
Provides unit description.
UnitID | Identifier of the unit |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
InvalidUnitTypeException | If unit type is not valid. |
NotInUnitOrParentUnitException | If agent does not play any role in unit or parent unit. |
Definition at line 516 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); call = st.buildServiceContent("InformUnit", inputs); try { return (ArrayList<String>) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (NotInUnitOrParentUnitException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
ArrayList<ArrayList<String> > es.upv.dsic.gti_ia.organization.OMSProxy.informUnitRoles | ( | String | UnitID | ) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, InvalidVisibilityException |
Used for requesting the list of roles that have been registered inside a unit.
UnitID | Identifier of the unit |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
InvalidVisibilityException | If visibility is not valid. |
Definition at line 566 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); call = st.buildServiceContent("InformUnitRoles", inputs); try { return (ArrayList<ArrayList<String>>) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (InvalidVisibilityException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
String es.upv.dsic.gti_ia.organization.OMSProxy.joinUnit | ( | String | UnitID, |
String | ParentUnitID | ||
) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, ParentUnitNotExistsException, AgentNotInUnitException, NotCreatorInUnitException, NotCreatorInParentUnitException, VirtualParentException, SameUnitException, MySQLException |
Update the parent unit.
UnitID | Identifier of the unit |
ParentUnitID | Identifier of the new parent unit |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
ParentUnitNotExistsException | If parent unit not exists. |
AgentNotInUnitException | If agent is not inside the unit. |
NotCreatorInUnitException | If agent does not play any role with position creator inside the unit. |
NotCreatorInParentUnitException | If agent does not play any role with position creator inside the parent unit. |
VirtualParentException | The Parent Unit can not be changed. |
SameUnitException | If the unit and the parent unit are same. |
MySQLException |
Definition at line 1191 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); inputs.put("ParentUnitID", ParentUnitID); call = st.buildServiceContent("JointUnit", inputs); try { return (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (ParentUnitNotExistsException e) { throw e; } catch (AgentNotInUnitException e) { throw e; } catch (NotCreatorInUnitException e) { throw e; } catch (NotCreatorInParentUnitException e) { throw e; } catch (VirtualParentException e) { throw e; } catch (SameUnitException e) { throw e; } catch (MySQLException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); return null; } }
String es.upv.dsic.gti_ia.organization.OMSProxy.leaveRole | ( | String | RoleID, |
String | UnitID | ||
) | throws ForbiddenNormException, EmptyParametersException, UnitNotExistsException, RoleNotExistsException, NotPlaysRoleException, MySQLException |
Service used for leaving a role inside a specific unit.
RoleID | Identifier of the role |
UnitID | Identifier of the organization unit |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
RoleNotExistsException | If role not exists. |
NotPlaysRoleException | If agent does not play the role. |
MySQLException | If a MySql exception occurs. |
Definition at line 287 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("RoleID", RoleID); inputs.put("UnitID", UnitID); call = st.buildServiceContent("LeaveRole", inputs); String result = new String(); try { result = (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (RoleNotExistsException e) { throw e; } catch (NotPlaysRoleException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (MySQLException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); } return result; }
UnitID | |
NormContent |
InvalidIDException | |
InvalidDeonticException | |
InvalidTargetTypeException | |
InvalidTargetValueException | |
InvalidOMSActionException | |
InvalidExpressionException | |
RoleNotExistsException | |
InvalidPositionException | |
InvalidUnitTypeException | |
ForbiddenNormException | |
NotSupervisorOrCreatorInUnitException | |
NotMemberOrCreatorInUnitException | |
NotInUnitAndNotCreatorException | |
AgentNotInUnitException | |
NormExistsInUnitException | |
UnitNotExistsException | |
EmptyParametersException | |
MySQLException |
Definition at line 925 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); inputs.put("NormContent", "<!-- "+NormContent+" -->"); call = st.buildServiceContent("RegisterNorm", inputs); try { return (String) this.sendInform(); } catch (RoleNotExistsException e) { throw e; } catch (InvalidPositionException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (ForbiddenNormException e) { throw e; } catch (NotSupervisorOrCreatorInUnitException e) { throw e; } catch (NotMemberOrCreatorInUnitException e) { throw e; } catch (NotInUnitAndNotCreatorException e) { throw e; } catch (AgentNotInUnitException e) { throw e; } catch (NormExistsInUnitException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (EmptyParametersException e) { throw e; } catch (InvalidIDException e) { throw e; } catch (InvalidDeonticException e) { throw e; } catch (InvalidTargetTypeException e) { throw e; } catch (InvalidTargetValueException e) { throw e; } catch (InvalidOMSActionException e) { throw e; } catch (InvalidExpressionException e) { throw e; } catch (NotValidIdentifierException e) { throw e; } catch (MySQLException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); return null; } }
String es.upv.dsic.gti_ia.organization.OMSProxy.registerRole | ( | String | RoleID, |
String | UnitID, | ||
String | AccessibilityID, | ||
String | VisibilityID, | ||
String | PositionID | ||
) | throws ForbiddenNormException, NotValidIdentifierException, EmptyParametersException, UnitNotExistsException, RoleExistsInUnitException, AgentNotInUnitException, NotInUnitAndNotCreatorException, InvalidUnitTypeException, NotMemberOrCreatorInUnitException, NotSupervisorOrCreatorInUnitException, InvalidPositionException, InvalidAccessibilityException, InvalidVisibilityException, MySQLException |
Creates a new role inside a unit.
RoleID | Identifier of the role |
UnitID | Identifier of the unit |
AccessibilityID | considers two types of roles: (internal) internal roles, which are assigned to internal agents of the system platform; and (external) external roles, which can be enacted by any agent. |
VisibilityID | indicates whether agents can obtain information of this role from outside the unit in which this role is defined (public) or from inside (private). |
PositionID | determines its structural position inside the unit, such as member, supervisor or subordinate. |
EmptyParametersException | If any parameter is empty or null. |
UnitNotExistsException | If unit not exists. |
RoleExistsInUnitException | If role not exists. |
AgentNotInUnitException | If agent is not inside the unit. |
NotInUnitAndNotCreatorException | If agent is not inside the unit and does not play any role with position creator. |
InvalidUnitTypeException | If unit type is not valid. |
NotMemberOrCreatorInUnitException | If agent does not play any role with position member or creator inside the unit. |
NotSupervisorOrCreatorInUnitException | If agent does not play any role with position supervisor or creatir inside the unit. |
InvalidPositionException | If position is not valid. |
InvalidAccessibilityException | If accessibility is not valid. |
InvalidVisibilityException | If visibility is not valid. |
MySQLException | If a MySql exception occurs. |
Definition at line 728 of file OMSProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("RoleID", RoleID); inputs.put("UnitID", UnitID); inputs.put("AccessibilityID", AccessibilityID); inputs.put("PositionID", PositionID); inputs.put("VisibilityID", VisibilityID); call = st.buildServiceContent("RegisterRole", inputs); try { return (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitNotExistsException e) { throw e; } catch (RoleExistsInUnitException e) { throw e; } catch (AgentNotInUnitException e) { throw e; } catch (NotInUnitAndNotCreatorException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (NotMemberOrCreatorInUnitException e) { throw e; } catch (NotSupervisorOrCreatorInUnitException e) { throw e; } catch (InvalidPositionException e) { throw e; } catch (InvalidAccessibilityException e) { throw e; } catch (InvalidVisibilityException e) { throw e; }catch (NotValidIdentifierException e) { throw e; } catch (MySQLException e) { throw e; } catch (ForbiddenNormException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); return null; } }
String es.upv.dsic.gti_ia.organization.OMSProxy.registerUnit | ( | String | UnitID, |
String | TypeID, | ||
String | ParentUnitID, | ||
String | CreatorID | ||
) | throws ForbiddenNormException, NotValidIdentifierException, EmptyParametersException, UnitExistsException, NotCreatorInParentUnitException, ParentUnitNotExistsException, InvalidVisibilityException, InvalidAccessibilityException, InvalidPositionException, InsertingTableException, InvalidUnitTypeException, MySQLException |
Creates a new empty unit in the organization, with a specific structure, creatorName and parent unit.
UnitID | Identifier of the unit |
TypeID | indicates the topology of the new unit: (i) Hierarchy, in which a supervisor agent has control over other members; (ii) Team, which are groups of agents that share a common goal, collaborating and cooperating between them; and (iii) Flat, in which there is none agent with control over other members. |
ParentUnitID | Identifier of the parent unit |
CreatorID | The name of the new creator role |
EmptyParametersException | If any parameter is empty or null. |
UnitExistsException | If unit exists. |
NotCreatorInParentUnitException | If agent does not play any role with position creator inside the parent unit. |
ParentUnitNotExistsException | If agent parent unit not exists. |
InvalidVisibilityException | If visibility is not valid. |
InvalidAccessibilityException | If accessibility is not valid. |
InvalidPositionException | If position is not valid. |
InsertingTableException | If any error occurs inserting table. |
InvalidUnitTypeException | If unit type is invalid. |
Definition at line 828 of file OMSProxy.java.
{ if (ParentUnitID == null) { HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); inputs.put("TypeID", TypeID); inputs.put("CreatorID", CreatorID); call = st.buildServiceContent("RegisterUnit", inputs); } else { HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("AgentID", agent.getAid().name.replace('~', '@')); inputs.put("UnitID", UnitID); inputs.put("TypeID", TypeID); inputs.put("CreatorID", CreatorID); inputs.put("ParentUnitID", ParentUnitID); call = st.buildServiceContent("RegisterUnit", inputs); } try { return (String) this.sendInform(); } catch (EmptyParametersException e) { throw e; } catch (UnitExistsException e) { throw e; } catch (NotCreatorInParentUnitException e) { throw e; } catch (ParentUnitNotExistsException e) { throw e; } catch (InvalidVisibilityException e) { throw e; } catch (InvalidAccessibilityException e) { throw e; } catch (InvalidPositionException e) { throw e; } catch (InsertingTableException e) { throw e; } catch (InvalidUnitTypeException e) { throw e; } catch (MySQLException e) { throw e; } catch (NotValidIdentifierException e) { throw e; } catch (ForbiddenNormException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); return null; } }
ServiceTools es.upv.dsic.gti_ia.organization.OMSProxy.st = new ServiceTools() [package] |
Definition at line 72 of file OMSProxy.java.