kaos.core.csi
Class BasicKAoSActorImpl

java.lang.Object
  extended by kaos.core.csi.BasicKAoSActorImpl
All Implemented Interfaces:
KAoSActor

public class BasicKAoSActorImpl
extends java.lang.Object
implements KAoSActor

$Revision: 1.3 $


Field Summary
protected  KAoSAgentDescription _actorDesc
           
protected  Logger _logger
           
protected  boolean _registered
           
protected  java.util.Hashtable _transports
           
 
Constructor Summary
BasicKAoSActorImpl(KAoSAgentDescription desc)
          Instantiates a description of a KAoSActor.
 
Method Summary
 KAoSAgentDescription getAgentDescription()
           
 java.util.List getCapabilities()
          Obtain the collection of AgentCapabilities of this KAoSActor.
 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()
          Returns a List of String containing the names of domains the actor is registered in.
 java.util.Enumeration getEntityOntologicalTypeNames()
          Obtain the collection of just names of ontological types of KAoS entity described by this KAoSActor.
 java.util.Map getEntityOntologicalTypes()
          Obtain the collection of ontological types of this KAoSActor.
 java.lang.String getGUID()
          Obtain the actor's globally unique identifier.
 java.lang.String getName()
          Obtain the actor's name.
 java.util.Hashtable getProperties()
          Returns a Hashtable containing a mapping of actor properties.
 Property getProperty(java.lang.String name)
          Return the property, whose name is specified
 java.lang.Object getPropertyValue(Property property)
          Return the value of the given property
 Transport getTransport(java.lang.String name)
          Return the Transport, whose name is specified.
 java.util.List getTransports()
          Return the List of valid Transports.
 boolean isGuarded()
          Obtain guarded/unguarded status of this KAoSActor.
 boolean isRegistered()
          Obtain registered/unregistered status of this KAoSActor.
protected  void logMessage(java.lang.String msg, java.lang.Exception e, int logLevel)
           
protected  void logMessage(java.lang.String msg, int logLevel)
           
 void receiveMessage(java.io.Serializable messageContent, KAoSActor sender)
          Receive the specified message content from the given KAoSActor.
 void sendMessage(java.io.Serializable messageContent, KAoSActor receiver)
          Send the specified message content to the given KAoSActor.
 void setRegistered(boolean registered)
          Set the registered/unregistered status of this KAoSActor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_actorDesc

protected KAoSAgentDescription _actorDesc

_logger

protected Logger _logger

_transports

protected java.util.Hashtable _transports

_registered

protected boolean _registered
Constructor Detail

BasicKAoSActorImpl

public BasicKAoSActorImpl(KAoSAgentDescription desc)
Instantiates a description of a KAoSActor.

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 KAoSActor
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.

getDomainNames

public java.util.List getDomainNames()
Returns a List of String containing the names of domains the actor is registered in. Note: When the actor first registers with the DS, this List is checked and, if not empty, the actor will be registered in the specified domains. Subsequently, if the actor wants to register in additional domains, then the actor has to lookup the desired domain and register in it via the Domain.registerAgent() method, which will update this List after successful registration.

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

getGUID

public java.lang.String getGUID()
Obtain the actor's globally unique identifier.

Specified by:
getGUID in interface KAoSActor
Returns:
String representing the actor's guid.

getName

public java.lang.String getName()
Obtain the actor's name.

Specified by:
getName in interface KAoSActor
Returns:
String representing the actor's name.

getEntityOntologicalTypes

public java.util.Map getEntityOntologicalTypes()
Obtain the collection of ontological types of this KAoSActor. Presently, the types are defined by constants in kaos.ontology.vocabulary.ActorConcepts.

Specified by:
getEntityOntologicalTypes in interface KAoSActor
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.Enumeration getEntityOntologicalTypeNames()
Obtain the collection of just names of ontological types of KAoS entity described by this KAoSActor. Presently, the types are defined by constants in kaos.ontology.jena.ActorConcepts.

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

isGuarded

public boolean isGuarded()
Obtain guarded/unguarded status of this KAoSActor.

Specified by:
isGuarded in interface KAoSActor
Returns:
boolean indicating whether the KAoSActor is guarded.

setRegistered

public void setRegistered(boolean registered)
Set the registered/unregistered status of this KAoSActor.

Specified by:
setRegistered in interface KAoSActor
Parameters:
registered - boolean indicating whether the KAoSActor has been registered in the KAoS DS.

isRegistered

public boolean isRegistered()
Obtain registered/unregistered status of this KAoSActor.

Specified by:
isRegistered in interface KAoSActor
Returns:
boolean indicating whether the KAoSActor has been registered in the KAoS DS.

getCapabilities

public java.util.List getCapabilities()
Obtain the collection of AgentCapabilities of this KAoSActor.

Specified by:
getCapabilities in interface KAoSActor
Returns:
List of AgentCapability describing the capabilities of the actor.

getProperties

public java.util.Hashtable getProperties()
Returns a Hashtable containing a mapping of actor properties. The key is the Property name, the value is the Property. These properties are stored in the Directory Service.

Specified by:
getProperties in interface KAoSActor
Returns:
Hashtable of actor's properties.

getProperty

public Property getProperty(java.lang.String name)
Return the property, whose name is specified

Specified by:
getProperty in interface KAoSActor
Parameters:
name - String containing the name of the property to be returned.

getPropertyValue

public java.lang.Object getPropertyValue(Property property)
Return the value of the given property

Specified by:
getPropertyValue in interface KAoSActor
Parameters:
property - Property, whose value is to be returned.
Returns:
Object containing the given Property value.

sendMessage

public void sendMessage(java.io.Serializable messageContent,
                        KAoSActor receiver)
                 throws NotLocatableException,
                        TransportFailure
Send the specified message content to the given KAoSActor.

Specified by:
sendMessage in interface KAoSActor
Parameters:
messageContent - Serializable containing the message to be sent out.
receiverdesc - KAoSAgentDescription containing the description of the receiver.
Throws:
NotLocatableException - when the receiver cannot be located.
TransportFailureto - when the transport system fails.
TransportFailure

receiveMessage

public void receiveMessage(java.io.Serializable messageContent,
                           KAoSActor sender)
Receive the specified message content from the given KAoSActor.

Specified by:
receiveMessage in interface KAoSActor
Parameters:
messageContent - Serializable containing the received message.
senderDesc - KAoSAgentDescription containing the description of the sender.

getTransports

public java.util.List getTransports()
Return the List of valid Transports.

Specified by:
getTransports in interface KAoSActor
Returns:
List containing the supported Transports.

getTransport

public Transport getTransport(java.lang.String name)
Return the Transport, whose name is specified.

Specified by:
getTransport in interface KAoSActor
Parameters:
name - String containing the Transport name to be retrieved.
Returns:
Transport whose name was specified.

getAgentDescription

public KAoSAgentDescription getAgentDescription()

logMessage

protected void logMessage(java.lang.String msg,
                          int logLevel)

logMessage

protected void logMessage(java.lang.String msg,
                          java.lang.Exception e,
                          int logLevel)