kaos.core.service.directory
Class DefaultKAoSEntityDescription

java.lang.Object
  extended by BasicAgentDescription
      extended by kaos.core.service.directory.DefaultKAoSEntityDescription
All Implemented Interfaces:
KAoSEntityDescription
Direct Known Subclasses:
DefaultKAoSAgentContainerDescription, DefaultKAoSAgentDescription, DefaultKAoSGuardDescription

public class DefaultKAoSEntityDescription
extends BasicAgentDescription
implements KAoSEntityDescription

Implements the operations to access information about a KAoS entity. The information includes the host name/address, the domain names the entity is member of, the entity type (GUARD or AGENT), and the ID of the execution environmnet the entity is running in.


Field Summary
 
Fields inherited from interface kaos.core.service.directory.KAoSEntityDescription
ENTITY_DOMAIN_NAMES, ENTITY_HOST_ADDRESS, ENTITY_HOST_NAME, ENTITY_ONTOLOGICAL_TYPE_NAMES, EXECUTION_ENVIRONMENT, FULL_SEARCH, IS_ENTITY_POLICY_SUBJECT, SEARCH_PARAMS
 
Constructor Summary
DefaultKAoSEntityDescription()
           
 
Method Summary
 void addDomainName(java.lang.String name)
          Add a domain name to the collection of domain names held by the KAoSEntityDescription.
 void addEntityDAMLSType(java.lang.String type, java.lang.String damlSInterface)
          Add DAML-S type to the collection of DAML-S types held by the KAoSEntityDescription.
 void addEntityOntologicalType(java.lang.String typeName, java.lang.String damlDesc)
          Add an ontological type to the collection of types held by the KAoSEntityDescription.
 void clearLocators()
          Clear the locators property contained by this KAoSEntityDescription.
 java.lang.String getConceptMappingName()
          Get the name of the concept mapping between the entity system's ontological concepts and KAoS ontology.
 java.util.List getDomainNames()
          Obtain List of names of domains the agent is member of.
 java.util.Enumeration getEntityDAMLSTypeNames()
          Obtain the collection of just names of DAML-S types of KAoS entity described by this KAoSEntityDescription.
 java.util.Map getEntityDAMLSTypes()
          Obtain the collection of DAML-S types of KAoS entity described by this KAoSEntityDescription.
 java.lang.String getEntityNameAsString()
          Obtain the agent's name as String.
 java.lang.String getEntityOntologicalType()
          Obtain the ontological type of KAoS entity described by this KAoSEntityDescription.
 java.util.Enumeration getEntityOntologicalTypeNames()
          Obtain the collection of just names of ontological types of KAoS entity described by this KAoSEntityDescription.
 java.util.Map getEntityOntologicalTypes()
          Obtain the collection of ontological types of KAoS entity described by this KAoSEntityDescription.
 java.lang.String getEntityType()
          Obtain the type of entity described this KAoSEntityDescription.
 java.lang.String getExecutionEnv()
          Obtain the id of the execution environment property contained by this KAoSAgentDescription.
 java.lang.String getHostAddress()
          Obtain the host address property contained by this the KAoSEntityDescription.
 java.lang.String getHostName()
          Obtain the host name property contained by this KAoSEntityDescription.
 Locator[] getLocators()
          This method overrides the superclass' getLocators() in order to return empty Locators for virtual(non-running) entities.
protected  void initialize()
           
 boolean isEntityPolicySubject()
          Obtain the info whether the entity is a subject of policies.
 boolean isEntityRunning()
          Obtain the info whether the entity is running or not (virtual).
protected  void logMessage(java.lang.String msg)
           
 void modifyProperties(java.util.List properties)
          Modify key-value pairs of this KAoSEntityDescription as specified by the Property objects containted in the given list.
 boolean removeDomainName(java.lang.String name)
          Remove a domain name from the collection of domain names held by the KAoSAgentDescription.
 boolean removeEntityDAMLSType(java.lang.String type)
          Remove a DAML-S type from the collection of DAML-S types held by the KAoSEntityDescription.
 boolean removeEntityOntologicalType(java.lang.String type)
          Remove an ontological type from the collection of types held by the KAoSEntityDescription.
 java.lang.String removeExecutionEnv()
          Remove the id of the execution environment property contained by this KAoSAgentDescription.
 java.lang.String removeHostAddress()
          Remove the address of the host.
 java.lang.String removeHostName()
          Remove the host name property contained by this KAoSEntityDescription.
 void setConceptMappingName(java.lang.String mappingName)
          Set the name of the concept mapping between the entity system's ontological concepts and KAoS ontology.
 void setDomainNames(java.util.List domainNames)
          Set names of the domains a given entity is member of.
 void setEntityDAMLSTypes(java.util.Map types)
          Set the DAML-S types of KAoS entity.
 void setEntityNameAsString(java.lang.String name)
          Set the name of the entity as String, which is the String representation of AgentName.
 void setEntityOntologicalType(java.lang.String type)
          Set the ontological type of KAoS entity.
 void setEntityOntologicalTypes(java.util.Map types)
          Set the ontological types of KAoS entity.
 void setEntityType(java.lang.String type)
          Set the type of KAoS entity.
 void setExecutionEnv(java.lang.String executionEnv)
          Set the id of the execution environment the entity is running in.
 void setHostAddress(java.lang.String address)
          Set the address of the host the agent is running on.
 void setHostName(java.lang.String name)
          Set the name of the host the agent is running on.
 void setIsEntityPolicySubject(boolean isPolicySubject)
          Set the indicator of whether the entity will/will not be a policy subject.
 void setIsEntityRunning(boolean isEntityRunning)
          Set the indicator of whether the entity is running.
 java.lang.String toString()
          A utility method to create a String representation of the DefaultKAoSEntityDescription.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultKAoSEntityDescription

public DefaultKAoSEntityDescription()
Method Detail

getConceptMappingName

public java.lang.String getConceptMappingName()
Get the name of the concept mapping between the entity system's ontological concepts and KAoS ontology.

Specified by:
getConceptMappingName in interface KAoSEntityDescription
Returns:
String specifying the name of the mapping to be used to translate ontological names from the entity system to KAoS ontologies. The default name is "KAoS" indicating KAoS ontologies to be used, no translation necessary.

setConceptMappingName

public void setConceptMappingName(java.lang.String mappingName)
Set the name of the concept mapping between the entity system's ontological concepts and KAoS ontology.

Specified by:
setConceptMappingName in interface KAoSEntityDescription
Parameters:
mappingName - The name of the mapping to be used to translate ontological names from the entity system to KAoS ontologies.

addDomainName

public void addDomainName(java.lang.String name)
Add a domain name to the collection of domain names held by the KAoSEntityDescription.

Specified by:
addDomainName in interface KAoSEntityDescription
Parameters:
name - The name of a domain to be added to the collection of domain names.

getDomainNames

public java.util.List getDomainNames()
Obtain List of names of domains the agent is member of.

Specified by:
getDomainNames in interface KAoSEntityDescription
Returns:
List of domain names the enitity has registered in.

setDomainNames

public void setDomainNames(java.util.List domainNames)
Set names of the domains a given entity is member of.

Specified by:
setDomainNames in interface KAoSEntityDescription
Parameters:
domainNames - The domainNames containing a List of all names of domains a given entity is registered in.

removeDomainName

public boolean removeDomainName(java.lang.String name)
Remove a domain name from the collection of domain names held by the KAoSAgentDescription.

Specified by:
removeDomainName in interface KAoSEntityDescription
Parameters:
name - The name of a domain to be removed from the collection of domain names.
Returns:
true if the collection of domain names contained the specified name; otherwise return false.

setExecutionEnv

public void setExecutionEnv(java.lang.String executionEnv)
Set the id of the execution environment the entity is running in.

Specified by:
setExecutionEnv in interface KAoSEntityDescription
Parameters:
executionEnv - The id of the execution environment in which the entity is running.

getExecutionEnv

public java.lang.String getExecutionEnv()
Obtain the id of the execution environment property contained by this KAoSAgentDescription.

Specified by:
getExecutionEnv in interface KAoSEntityDescription
Returns:
String representing the id of the execution environment the entity is running in.

removeExecutionEnv

public java.lang.String removeExecutionEnv()
Remove the id of the execution environment property contained by this KAoSAgentDescription.

Specified by:
removeExecutionEnv in interface KAoSEntityDescription
Returns:
String containing the removed id of the execution environment.

setHostAddress

public void setHostAddress(java.lang.String address)
Set the address of the host the agent is running on.

Specified by:
setHostAddress in interface KAoSEntityDescription
Parameters:
address - The address of the host where the agent is running.

removeHostAddress

public java.lang.String removeHostAddress()
Remove the address of the host.

Specified by:
removeHostAddress in interface KAoSEntityDescription
Returns:
String containing the removed host address.

getHostAddress

public java.lang.String getHostAddress()
Obtain the host address property contained by this the KAoSEntityDescription.

Specified by:
getHostAddress in interface KAoSEntityDescription
Returns:
String representing the address of the host the agent is running on.

setHostName

public void setHostName(java.lang.String name)
Set the name of the host the agent is running on.

Specified by:
setHostName in interface KAoSEntityDescription
Parameters:
name - The name of the host where the agent is running.

getHostName

public java.lang.String getHostName()
Obtain the host name property contained by this KAoSEntityDescription.

Specified by:
getHostName in interface KAoSEntityDescription
Returns:
String representing the name of the host the agent is running on.

removeHostName

public java.lang.String removeHostName()
Remove the host name property contained by this KAoSEntityDescription.

Specified by:
removeHostName in interface KAoSEntityDescription
Returns:
String containing the removed name of the host.

getEntityNameAsString

public java.lang.String getEntityNameAsString()
Obtain the agent's name as String.

Specified by:
getEntityNameAsString in interface KAoSEntityDescription
Returns:
String representing the agent's name.

setEntityNameAsString

public void setEntityNameAsString(java.lang.String name)
Set the name of the entity as String, which is the String representation of AgentName. Set only if the AgentName has not been set yet.

Specified by:
setEntityNameAsString in interface KAoSEntityDescription
Parameters:
name - The name of entity represented as String.

setEntityType

public void setEntityType(java.lang.String type)
Set the type of KAoS entity. The type can be either a GUARD or an AGENT.

Specified by:
setEntityType in interface KAoSEntityDescription
Parameters:
name - The type of of the host where the entity is running.

getEntityType

public java.lang.String getEntityType()
Obtain the type of entity described this KAoSEntityDescription.

Specified by:
getEntityType in interface KAoSEntityDescription
Returns:
String describing either GUARD or AGENT type.

setEntityOntologicalType

public void setEntityOntologicalType(java.lang.String type)
Set the ontological type of KAoS entity. Presently, the types are defined by constants in kaos.ontology.jena.ActorConcepts. This is the default type for the entity described by this description.

Specified by:
setEntityOntologicalType in interface KAoSEntityDescription
Parameters:
type - The ontological type of the entity this description is associated with.

getEntityOntologicalType

public java.lang.String getEntityOntologicalType()
Obtain the ontological type of KAoS entity described by this KAoSEntityDescription. Presently, the types are defined by constants in kaos.ontology.jena.ActorConcepts.

Specified by:
getEntityOntologicalType in interface KAoSEntityDescription
Returns:
String describing one ontological type of entity, or null, if there isn't one set.

addEntityOntologicalType

public void addEntityOntologicalType(java.lang.String typeName,
                                     java.lang.String damlDesc)
Add an ontological type to the collection of types held by the KAoSEntityDescription. Presently, the types are defined by constants in kaos.ontology.jena.ActorConcepts.

Specified by:
addEntityOntologicalType in interface KAoSEntityDescription
Parameters:
type - String containing the name of ontological type of the entity described by this description.
damlDesc - String containing DAML description of the corresponding ontological type.

removeEntityOntologicalType

public boolean removeEntityOntologicalType(java.lang.String type)
Remove an ontological type from the collection of types held by the KAoSEntityDescription.

Specified by:
removeEntityOntologicalType in interface KAoSEntityDescription
Parameters:
type - The name of the ontological type to be removed from the collection of ontological types.
Returns:
true if the collection of ontological types contained the specified type; otherwise return false.

setEntityOntologicalTypes

public void setEntityOntologicalTypes(java.util.Map types)
Set the ontological types of KAoS entity. NOTE: The new types replace existing ones, if there were any set! Presently, the types are defined by constants in kaos.ontology.jena.ActorConcepts.

Specified by:
setEntityOntologicalTypes in interface KAoSEntityDescription
Parameters:
types - Map containing type name -> DAML description mapping of ontological types of the entity this description is associated with.

getEntityOntologicalTypes

public java.util.Map getEntityOntologicalTypes()
Obtain the collection of ontological types of KAoS entity described by this KAoSEntityDescription. Presently, the types are defined by constants in kaos.ontology.jena.ActorConcepts.

Specified by:
getEntityOntologicalTypes in interface KAoSEntityDescription
Returns:
Map containing mappings of ontological type names -> DAML descriptions of the types , or null, if ontological types have not been set.

getEntityOntologicalTypeNames

public java.util.Enumeration getEntityOntologicalTypeNames()
Obtain the collection of just names of ontological types of KAoS entity described by this KAoSEntityDescription. Presently, the types are defined by constants in kaos.ontology.jena.ActorConcepts.

Specified by:
getEntityOntologicalTypeNames in interface KAoSEntityDescription
Returns:
Enumeration containing names of ontological types, or null if there are no types specified in the KAoSEntityDescription.

addEntityDAMLSType

public void addEntityDAMLSType(java.lang.String type,
                               java.lang.String damlSInterface)
Add DAML-S type to the collection of DAML-S types held by the KAoSEntityDescription.

Specified by:
addEntityDAMLSType in interface KAoSEntityDescription
Parameters:
type - String containing the name of DAML-S type of the entity described by this description.
damlDesc - String containing DAML-S interface as String of the corresponding DAML-S type.

removeEntityDAMLSType

public boolean removeEntityDAMLSType(java.lang.String type)
Remove a DAML-S type from the collection of DAML-S types held by the KAoSEntityDescription.

Specified by:
removeEntityDAMLSType in interface KAoSEntityDescription
Parameters:
type - The name of the DAML-S type to be removed from the collection of DAML-S types.
Returns:
true if the collection of DAML-S types contained the specified type; otherwise return false.

setEntityDAMLSTypes

public void setEntityDAMLSTypes(java.util.Map types)
Set the DAML-S types of KAoS entity. NOTE: The new DAML-S types replace existing ones, if there were any set!

Specified by:
setEntityDAMLSTypes in interface KAoSEntityDescription
Parameters:
types - Map containing DAML-S name -> DAML-S interface mapping of the entity this description is associated with.

getEntityDAMLSTypes

public java.util.Map getEntityDAMLSTypes()
Obtain the collection of DAML-S types of KAoS entity described by this KAoSEntityDescription.

Specified by:
getEntityDAMLSTypes in interface KAoSEntityDescription
Returns:
Map containing mappings of DAML-S names -> DAML-S interface String of the types or null, if ontological types have not been set.

getEntityDAMLSTypeNames

public java.util.Enumeration getEntityDAMLSTypeNames()
Obtain the collection of just names of DAML-S types of KAoS entity described by this KAoSEntityDescription.

Specified by:
getEntityDAMLSTypeNames in interface KAoSEntityDescription
Returns:
Enumeration containing names of DAML-S types or null, if there no types specified in the KAoSEntityDescription.

isEntityPolicySubject

public boolean isEntityPolicySubject()
Obtain the info whether the entity is a subject of policies.

Specified by:
isEntityPolicySubject in interface KAoSEntityDescription
Returns:
boolean indicating whether the entity will/will not be a subject of policies.

setIsEntityPolicySubject

public void setIsEntityPolicySubject(boolean isPolicySubject)
Set the indicator of whether the entity will/will not be a policy subject.

Specified by:
setIsEntityPolicySubject in interface KAoSEntityDescription
Parameters:
isPolicySubject - The boolean indicating whether the entity will/will not be governed by policies.

isEntityRunning

public boolean isEntityRunning()
Obtain the info whether the entity is running or not (virtual).

Specified by:
isEntityRunning in interface KAoSEntityDescription
Returns:
boolean indicating whether the entity is running.

setIsEntityRunning

public void setIsEntityRunning(boolean isEntityRunning)
Set the indicator of whether the entity is running. The default is true, the entity is running.

Specified by:
setIsEntityRunning in interface KAoSEntityDescription
Parameters:
isEntityRunning - The boolean indicating whether the entity is running.

getLocators

public Locator[] getLocators()
This method overrides the superclass' getLocators() in order to return empty Locators for virtual(non-running) entities. Ideally, for virtual entities the Locators should be removed from the KAoSEntityDescription, but JAS does not provide a 'removeLocators' method, so in case of virtual entities, an empty array is returned even though the description may have non-empty Locators.


clearLocators

public void clearLocators()
Clear the locators property contained by this KAoSEntityDescription.

Specified by:
clearLocators in interface KAoSEntityDescription

modifyProperties

public void modifyProperties(java.util.List properties)
                      throws ModificationException
Modify key-value pairs of this KAoSEntityDescription as specified by the Property objects containted in the given list.

Specified by:
modifyProperties in interface KAoSEntityDescription
Parameters:
propertiesToModify - List containing Property objects specifying the modifcations.
Throws:
ModificationException - containing Properties, whose modifications failed. Each failed property includes the description of the failure.

toString

public java.lang.String toString()
A utility method to create a String representation of the DefaultKAoSEntityDescription.

Returns:
String representing the DefaultKAoSEntityDescription.

logMessage

protected void logMessage(java.lang.String msg)

initialize

protected void initialize()