public class NegotiationACCProxyAgentSide extends java.lang.Object implements NegotiationACC
Constructor and Description |
---|
NegotiationACCProxyAgentSide(java.lang.Object aid)
Builds a Negotiation ACC given the associated agent ID or name
|
NegotiationACCProxyAgentSide(java.lang.Object aid,
java.lang.String n,
int p)
Builds a Negotiation ACC given the associated agent ID or name, the IP
address of the TuCSoN node the agent is willing to interact with, and the
TCP port also.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Role> |
listPlayableRoles()
Request the list of the roles playable by the requesting agent, according
to RBAC configuration (as installed in the TuCSoN node who released this
ACC) and to the requesting agent class.
|
protected void |
log(java.lang.String msg) |
boolean |
login(java.lang.String username,
java.lang.String password)
Attempts to perform login, so as to receive the associated agent class,
according to RBAC configuration (as installed in the TuCSoN node who
released this ACC).
|
EnhancedACC |
playDefaultRole()
Requests to play the default role according to RBAC configuration (as
installed in the TuCSoN node who released this ACC) and to the requesting
agent class.
|
EnhancedACC |
playRole(java.lang.String roleName)
Requests to play the given role according to RBAC configuration (as
installed in the TuCSoN node who released this ACC) and to the requesting
agent class.
|
EnhancedACC |
playRole(java.lang.String roleName,
java.lang.Long timeout)
Requests to play the given role according to RBAC configuration (as
installed in the TuCSoN node who released this ACC) and to the requesting
agent class, waiting
timeout milliseconds at most for operation
completion. |
EnhancedACC |
playRoleWithPermissions(java.util.List<java.lang.String> permissionsId)
Requests to play a role given a set of desired permissions, according to
RBAC configuration (as installed in the TuCSoN node who released this
ACC) and to the requesting agent class.
|
EnhancedACC |
playRoleWithPermissions(java.util.List<java.lang.String> permissionsId,
java.lang.Long l)
Requests to play a role given a set of desired permissions, according to
RBAC configuration (as installed in the TuCSoN node who released this
ACC) and to the requesting agent class, waiting
timeout
milliseconds at most for operation completion. |
public NegotiationACCProxyAgentSide(java.lang.Object aid) throws TucsonInvalidAgentIdException, TucsonInvalidTupleCentreIdException
aid
- the associated agent ID or name (String)TucsonInvalidAgentIdException
- if the given agent ID is NOT validTucsonInvalidTupleCentreIdException
- if the given tuple centre ID is NOT validpublic NegotiationACCProxyAgentSide(java.lang.Object aid, java.lang.String n, int p) throws TucsonInvalidAgentIdException, TucsonInvalidTupleCentreIdException
aid
- the associated agent ID or name (String)n
- the IP address of the target TuCSoN nodep
- the TCP port of the target TuCSoN nodeTucsonInvalidAgentIdException
- if the given agent ID is NOT validTucsonInvalidTupleCentreIdException
- if the given tuple centre ID is NOT validpublic java.util.List<Role> listPlayableRoles() throws TucsonOperationNotPossibleException, UnreachableNodeException, OperationTimeOutException
NegotiationACC
listPlayableRoles
in interface NegotiationACC
TucsonOperationNotPossibleException
- if the requested TuCSoN operation cannot be performedUnreachableNodeException
- if the TuCSoN node target of this operation is not
network-reachableOperationTimeOutException
- if the operation timeout expired prior to operation
completionpublic boolean login(java.lang.String username, java.lang.String password) throws TucsonOperationNotPossibleException, UnreachableNodeException, OperationTimeOutException
NegotiationACC
login
in interface NegotiationACC
username
- the username of the agentpassword
- the password of the agenttrue
or false
depending on login success/failureTucsonOperationNotPossibleException
- if the requested TuCSoN operation cannot be performedUnreachableNodeException
- if the TuCSoN node target of this operation is not
network-reachableOperationTimeOutException
- if the operation timeout expired prior to operation
completionpublic EnhancedACC playDefaultRole() throws TucsonOperationNotPossibleException, UnreachableNodeException, OperationTimeOutException, TucsonInvalidAgentIdException
NegotiationACC
playDefaultRole
in interface NegotiationACC
TucsonOperationNotPossibleException
- if the requested TuCSoN operation cannot be performedUnreachableNodeException
- if the TuCSoN node target of this operation is not
network-reachableOperationTimeOutException
- if the operation timeout expired prior to operation
completionTucsonInvalidAgentIdException
- if the requesting agent ID is not a valid TuCSoN agent IDpublic EnhancedACC playRole(java.lang.String roleName) throws TucsonOperationNotPossibleException, UnreachableNodeException, OperationTimeOutException, TucsonInvalidAgentIdException, AgentNotAllowedException
NegotiationACC
playRole
in interface NegotiationACC
roleName
- the name of the role to playTucsonOperationNotPossibleException
- if the requested TuCSoN operation cannot be performedUnreachableNodeException
- if the TuCSoN node target of this operation is not
network-reachableOperationTimeOutException
- if the operation timeout expired prior to operation
completionTucsonInvalidAgentIdException
- if the requesting agent ID is not a valid TuCSoN agent IDAgentNotAllowedException
- if the requesting agent is not allowed to request this TuCSoN
operationpublic EnhancedACC playRole(java.lang.String roleName, java.lang.Long timeout) throws TucsonOperationNotPossibleException, UnreachableNodeException, OperationTimeOutException, TucsonInvalidAgentIdException, AgentNotAllowedException
NegotiationACC
timeout
milliseconds at most for operation
completion.playRole
in interface NegotiationACC
roleName
- the name of the role to playtimeout
- the maximum waiting time in millisecondsTucsonOperationNotPossibleException
- if the requested TuCSoN operation cannot be performedUnreachableNodeException
- if the TuCSoN node target of this operation is not
network-reachableOperationTimeOutException
- if the operation timeout expired prior to operation
completionTucsonInvalidAgentIdException
- if the requesting agent ID is not a valid TuCSoN agent IDAgentNotAllowedException
- if the requesting agent is not allowed to request this TuCSoN
operationpublic EnhancedACC playRoleWithPermissions(java.util.List<java.lang.String> permissionsId) throws TucsonOperationNotPossibleException, UnreachableNodeException, OperationTimeOutException, TucsonInvalidAgentIdException, AgentNotAllowedException
NegotiationACC
playRoleWithPermissions
in interface NegotiationACC
permissionsId
- the set of desired permission namesTucsonOperationNotPossibleException
- if the requested TuCSoN operation cannot be performedUnreachableNodeException
- if the TuCSoN node target of this operation is not
network-reachableOperationTimeOutException
- if the operation timeout expired prior to operation
completionTucsonInvalidAgentIdException
- if the requesting agent ID is not a valid TuCSoN agent IDAgentNotAllowedException
- if the requesting agent is not allowed to request this TuCSoN
operationpublic EnhancedACC playRoleWithPermissions(java.util.List<java.lang.String> permissionsId, java.lang.Long l) throws TucsonOperationNotPossibleException, UnreachableNodeException, OperationTimeOutException, TucsonInvalidAgentIdException, AgentNotAllowedException
NegotiationACC
timeout
milliseconds at most for operation completion.playRoleWithPermissions
in interface NegotiationACC
permissionsId
- the set of desired permission namesl
- the maximum waiting time in millisecondsTucsonOperationNotPossibleException
- if the requested TuCSoN operation cannot be performedUnreachableNodeException
- if the TuCSoN node target of this operation is not
network-reachableOperationTimeOutException
- if the operation timeout expired prior to operation
completionTucsonInvalidAgentIdException
- if the requesting agent ID is not a valid TuCSoN agent IDAgentNotAllowedException
- if the requesting agent is not allowed to request this TuCSoN
operationprotected void log(java.lang.String msg)