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 environment the entity is running in.

Author:
KAoS Team $Revision: 1.40 $

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 addDirProxy(KAoSAgentDirectoryServiceProxy dirProxy)
           
 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<java.lang.String> getDomainNames()
          Obtain the names of the domains a given entity 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 entity's name as String.
 java.lang.String getEntityOntologicalType()
          Obtain the ontological type of KAoS entity described by this KAoSEntityDescription.
 java.util.Set<java.lang.String> 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 that is described by this KAoSEntityDescription.
 java.lang.String getExecutionEnv()
          Obtain the id of the execution environment of this entity.
 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()
           
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 KAoSEntityDescription.
 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 execution environment the entity is running in.
 void setHostAddress(java.lang.String address)
          Set the address of the host the entity is running on.
 void setHostName(java.lang.String name)
          Set the name of the host the entity 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()
           
 
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()
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
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<java.lang.String> getDomainNames()
Description copied from interface: KAoSEntityDescription
Obtain the names of the domains a given entity is member of.

Specified by:
getDomainNames in interface KAoSEntityDescription
Returns:
List of domain names contained by this KAoSEntityDescription.

setDomainNames

public void setDomainNames(java.util.List domainNames)
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
Remove a domain name from the collection of domain names held by the KAoSEntityDescription.

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)
Description copied from interface: KAoSEntityDescription
Set the execution environment the entity is running in.

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

getExecutionEnv

public java.lang.String getExecutionEnv()
Description copied from interface: KAoSEntityDescription
Obtain the id of the execution environment of this entity.

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

removeExecutionEnv

public java.lang.String removeExecutionEnv()
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
Set the address of the host the entity is running on.

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

removeHostAddress

public java.lang.String removeHostAddress()
Description copied from interface: KAoSEntityDescription
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()
Description copied from interface: KAoSEntityDescription
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 entity is running on.

setHostName

public void setHostName(java.lang.String name)
Description copied from interface: KAoSEntityDescription
Set the name of the host the entity is running on.

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

getHostName

public java.lang.String getHostName()
Description copied from interface: KAoSEntityDescription
Obtain the host name property contained by this KAoSEntityDescription.

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

removeHostName

public java.lang.String removeHostName()
Description copied from interface: KAoSEntityDescription
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()
Description copied from interface: KAoSEntityDescription
Obtain the entity's name as String.

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

setEntityNameAsString

public void setEntityNameAsString(java.lang.String name)
Description copied from interface: KAoSEntityDescription
Set the name of the entity as String, which is the String representation of AgentName.

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

setEntityType

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

Specified by:
setEntityType in interface KAoSEntityDescription
Parameters:
type - The type of the entity.

getEntityType

public java.lang.String getEntityType()
Description copied from interface: KAoSEntityDescription
Obtain the type of entity that is described by this KAoSEntityDescription.

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

setEntityOntologicalType

public void setEntityOntologicalType(java.lang.String type)
Description copied from interface: KAoSEntityDescription
Set the ontological type of KAoS entity. Presently, the types are defined by constants in kaos.ontology.jena.ActorConcepts.

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()
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
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:
typeName - 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)
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
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 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()
Description copied from interface: KAoSEntityDescription
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 -> OWL descriptions of the types or null, if ontological types have not been set.

getEntityOntologicalTypeNames

public java.util.Set<java.lang.String> getEntityOntologicalTypeNames()
Description copied from interface: KAoSEntityDescription
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 no types specified in the KAoSEntityDescription.

addEntityDAMLSType

public void addEntityDAMLSType(java.lang.String type,
                               java.lang.String damlSInterface)
Description copied from interface: KAoSEntityDescription
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.

removeEntityDAMLSType

public boolean removeEntityDAMLSType(java.lang.String type)
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
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()
Description copied from interface: KAoSEntityDescription
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()
Description copied from interface: KAoSEntityDescription
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()
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
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()
Description copied from interface: KAoSEntityDescription
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)
Description copied from interface: KAoSEntityDescription
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()

clearLocators

public void clearLocators()
Description copied from interface: KAoSEntityDescription
Clear the locators property contained by this KAoSEntityDescription.

Specified by:
clearLocators in interface KAoSEntityDescription

modifyProperties

public void modifyProperties(java.util.List properties)
                      throws ModificationException
Description copied from interface: KAoSEntityDescription
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:
properties - 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()

logMessage

protected void logMessage(java.lang.String msg)

initialize

protected void initialize()

addDirProxy

public void addDirProxy(KAoSAgentDirectoryServiceProxy dirProxy)
Specified by:
addDirProxy in interface KAoSEntityDescription