kaos.aci
Class ACIServer

java.lang.Object
  extended by kaos.aci.ACIServer

public class ACIServer
extends java.lang.Object

Author:
Administrator

Field Summary
static int ALL_OTHER_TAGS
           
static java.lang.String ALL_OTHER_TAGS_STR
           
static java.lang.String CARRIES_MESSAGE_PROPERTY
           
static java.lang.String CLASS_NAME_POLICY_ID_PREFIX
           
static java.lang.String CLASS_NAME_TYPE_PREFIX
           
static java.lang.String DATA_CONTEXT_PROPERTY
           
static java.lang.String DIS_SERVICE_ACTOR_CLASS
           
static int HIGH_PRIORITY_SA_TAG
           
static java.lang.String HIGH_PRIORITY_SA_TAG_STR
           
static int PIR_TAG
           
static java.lang.String PIR_TAG_STR
           
static java.lang.String POLICY_ID_PREFIX
           
static java.lang.String PULL_REPLICATION
           
static java.lang.String PUSH_REPLICATION
           
static int SA_TAG
           
static java.lang.String SA_TAG_STR
           
static java.lang.String SOURCE_PROPERTY
           
static java.lang.String STATUS_PROPERTY
           
static java.lang.String TIGR_NODE_ACTOR_CLASS
           
 
Constructor Summary
ACIServer(int port, java.lang.String transport)
           
 
Method Summary
 void addConnectionConstraint(java.lang.String srcHost, java.lang.Integer srcPort, java.lang.String dstHost, java.lang.Integer dstPort, java.lang.Integer maxBytesPerSecond)
          Use setConnectionConstraint instead because there can be only 0 or 1 maxBandwidth constraints per connection.
 void deregisterAgent(java.lang.String agentName)
           
 void deregisterEnvironment(java.lang.String envUUID)
           
static java.lang.String generateClassNameForPolicy(java.lang.String baseClass, java.lang.String type, java.lang.String policyId)
          generates the class name for a class in a policy
 ConnectionConstraints getConnectionConstraints(java.lang.String srcHost, java.lang.Integer srcPort, java.lang.String dstHost, java.lang.Integer dstPort)
           
static int getIntDataTag(java.lang.String tag)
          The DisService only handles tags of type integer, so this function converts between ontology names (short names that is) and integer tags
 java.util.Vector getPolicyConstraintsBetweenEntities(java.lang.String sourceId, java.lang.String destId, java.lang.String type)
          Returns the policy constraints of the given type for the given source and destination entities (that is, the source entity is the actor of the policy, and the destination entity is the target of the policy).
 PolicyConstraints getPolicyConstraintsForEntity(java.lang.String entityId, java.lang.String type)
          Returns the policy constraints of the given type for the given entity (that is, the given entity is the actor of the policy).
 java.util.Vector getPrioritizedClientIds(java.lang.String srcNodeId, java.lang.String destNodeId)
           
 java.util.List<java.lang.String> getPrioritizedDataTags(java.lang.String srcNodeId, java.lang.String destNodeId, java.lang.String replicationMode)
           
static void main(java.lang.String[] args)
           
 void modifyAgentRegistration(java.lang.String agentName, java.lang.String envUUID, java.util.Vector domainList)
          Modifies an agent registration with an updated envUUID and/or domainList
 void modifyEnvironmentRegistration(java.lang.String envUUID, java.util.Vector domainList, java.lang.Boolean isMobile)
          Modifies an environment registration with an updated domainList or mobility
 void registerAgent(java.lang.String agentName, java.lang.String envUUID, java.util.Vector domainList)
          Register an agent in FlexFeed.
 void registerEnvironment(java.lang.String envUUID, java.util.Vector domainList, java.lang.Boolean isMobile)
          Register the environment with KAoS.
 void removeConnectionConstraint(java.lang.String srcHost, java.lang.Integer srcPort, java.lang.String dstHost, java.lang.Integer dstPort)
          Remove the KAoS policy constraining max bytes per second for the give connection if one exists.
 void sendMessageToKPAT(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POLICY_ID_PREFIX

public static final java.lang.String POLICY_ID_PREFIX
See Also:
Constant Field Values

CLASS_NAME_POLICY_ID_PREFIX

public static final java.lang.String CLASS_NAME_POLICY_ID_PREFIX
See Also:
Constant Field Values

CLASS_NAME_TYPE_PREFIX

public static final java.lang.String CLASS_NAME_TYPE_PREFIX
See Also:
Constant Field Values

DIS_SERVICE_ACTOR_CLASS

public static final java.lang.String DIS_SERVICE_ACTOR_CLASS
See Also:
Constant Field Values

TIGR_NODE_ACTOR_CLASS

public static final java.lang.String TIGR_NODE_ACTOR_CLASS
See Also:
Constant Field Values

PULL_REPLICATION

public static final java.lang.String PULL_REPLICATION
See Also:
Constant Field Values

PUSH_REPLICATION

public static final java.lang.String PUSH_REPLICATION
See Also:
Constant Field Values

SOURCE_PROPERTY

public static final java.lang.String SOURCE_PROPERTY
See Also:
Constant Field Values

STATUS_PROPERTY

public static final java.lang.String STATUS_PROPERTY
See Also:
Constant Field Values

DATA_CONTEXT_PROPERTY

public static final java.lang.String DATA_CONTEXT_PROPERTY
See Also:
Constant Field Values

CARRIES_MESSAGE_PROPERTY

public static final java.lang.String CARRIES_MESSAGE_PROPERTY
See Also:
Constant Field Values

PIR_TAG_STR

public static final java.lang.String PIR_TAG_STR
See Also:
Constant Field Values

PIR_TAG

public static final int PIR_TAG
See Also:
Constant Field Values

SA_TAG_STR

public static final java.lang.String SA_TAG_STR
See Also:
Constant Field Values

SA_TAG

public static final int SA_TAG
See Also:
Constant Field Values

HIGH_PRIORITY_SA_TAG_STR

public static final java.lang.String HIGH_PRIORITY_SA_TAG_STR
See Also:
Constant Field Values

HIGH_PRIORITY_SA_TAG

public static final int HIGH_PRIORITY_SA_TAG
See Also:
Constant Field Values

ALL_OTHER_TAGS_STR

public static final java.lang.String ALL_OTHER_TAGS_STR
See Also:
Constant Field Values

ALL_OTHER_TAGS

public static final int ALL_OTHER_TAGS
See Also:
Constant Field Values
Constructor Detail

ACIServer

public ACIServer(int port,
                 java.lang.String transport)
          throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

registerEnvironment

public void registerEnvironment(java.lang.String envUUID,
                                java.util.Vector domainList,
                                java.lang.Boolean isMobile)
                         throws java.lang.Exception
Register the environment with KAoS. By environment, we mean a Physical node in the framework, e.g. a host. The envUUID provided is a FlexFeed-generated unique identifier. Any reference to this environment from FlexFeed will be based on its envUUID. The environment may be fixed or mobile, as indicated by the isMobile parameter.

Throws:
java.lang.Exception

registerAgent

public void registerAgent(java.lang.String agentName,
                          java.lang.String envUUID,
                          java.util.Vector domainList)
                   throws java.lang.Exception
Register an agent in FlexFeed. The name is unique within FlexFeed and will be used by the framework to register /lookup this agent with KAoS.

Throws:
java.lang.Exception

modifyAgentRegistration

public void modifyAgentRegistration(java.lang.String agentName,
                                    java.lang.String envUUID,
                                    java.util.Vector domainList)
                             throws java.lang.Exception
Modifies an agent registration with an updated envUUID and/or domainList

Throws:
java.lang.Exception

modifyEnvironmentRegistration

public void modifyEnvironmentRegistration(java.lang.String envUUID,
                                          java.util.Vector domainList,
                                          java.lang.Boolean isMobile)
                                   throws java.lang.Exception
Modifies an environment registration with an updated domainList or mobility

Throws:
java.lang.Exception

deregisterAgent

public void deregisterAgent(java.lang.String agentName)
                     throws java.lang.Exception
Throws:
java.lang.Exception

deregisterEnvironment

public void deregisterEnvironment(java.lang.String envUUID)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getPolicyConstraintsForEntity

public PolicyConstraints getPolicyConstraintsForEntity(java.lang.String entityId,
                                                       java.lang.String type)
                                                throws java.lang.Exception
Returns the policy constraints of the given type for the given entity (that is, the given entity is the actor of the policy). The type is currently limited to {MOBILITY_CONSTRAINTS}, since it doesn�t make sense to ask for VideoFeed constraints without a target. This method returns a PolicyConstraints object which corresponds to the type, in this case RobotMobilityConstraints.

Throws:
java.lang.Exception

getPolicyConstraintsBetweenEntities

public java.util.Vector getPolicyConstraintsBetweenEntities(java.lang.String sourceId,
                                                            java.lang.String destId,
                                                            java.lang.String type)
Returns the policy constraints of the given type for the given source and destination entities (that is, the source entity is the actor of the policy, and the destination entity is the target of the policy). The type is currently limited to {VIDEO_CONSTRAINTS}, and this method returns a VideoFeedConstraints object.


getConnectionConstraints

public ConnectionConstraints getConnectionConstraints(java.lang.String srcHost,
                                                      java.lang.Integer srcPort,
                                                      java.lang.String dstHost,
                                                      java.lang.Integer dstPort)

addConnectionConstraint

public void addConnectionConstraint(java.lang.String srcHost,
                                    java.lang.Integer srcPort,
                                    java.lang.String dstHost,
                                    java.lang.Integer dstPort,
                                    java.lang.Integer maxBytesPerSecond)
Use setConnectionConstraint instead because there can be only 0 or 1 maxBandwidth constraints per connection.

Parameters:
srcHost - - IP of the source node
srcPort - - port of the source node
dstHost - - IP of the destination node
dstPort - - port of the destination node
maxBytesPerSecond - - maximum permitted bytes per socond for this source-destination connection
Throws:
java.io.IOException

generateClassNameForPolicy

public static java.lang.String generateClassNameForPolicy(java.lang.String baseClass,
                                                          java.lang.String type,
                                                          java.lang.String policyId)
generates the class name for a class in a policy

Parameters:
type - the type of class (controls, trigger, condition, or obligation)
policyId - the id of the policy (should begin with POLICY_ID_PREFIX)

removeConnectionConstraint

public void removeConnectionConstraint(java.lang.String srcHost,
                                       java.lang.Integer srcPort,
                                       java.lang.String dstHost,
                                       java.lang.Integer dstPort)
Remove the KAoS policy constraining max bytes per second for the give connection if one exists.

Parameters:
srcHost - - IP of the source node
srcPort - - port of the source node
dstHost - - IP of the destination node
dstPort - - port of the destination node
Throws:
java.io.IOException

sendMessageToKPAT

public void sendMessageToKPAT(java.lang.String message)

getPrioritizedClientIds

public java.util.Vector getPrioritizedClientIds(java.lang.String srcNodeId,
                                                java.lang.String destNodeId)

getPrioritizedDataTags

public java.util.List<java.lang.String> getPrioritizedDataTags(java.lang.String srcNodeId,
                                                               java.lang.String destNodeId,
                                                               java.lang.String replicationMode)

getIntDataTag

public static int getIntDataTag(java.lang.String tag)
The DisService only handles tags of type integer, so this function converts between ontology names (short names that is) and integer tags


main

public static void main(java.lang.String[] args)