kaos.core.csi
Class KAoSActorImpl

java.lang.Object
  extended by kaos.core.csi.KAoSActorImpl
All Implemented Interfaces:
KAoSActor
Direct Known Subclasses:
BLIKExample, BLIKNotifyEnforcerExample, InfofedAgent, KaaRepositoryTest, LegacySystemClient, LoginAgent, LoginSimulationAgent, ObligationRequestReceiverImpl, SimpleAgent, SpatialUsecase, TestAgent

public class KAoSActorImpl
extends java.lang.Object
implements KAoSActor

$Revision: 1.40 $


Field Summary
protected  KAoSAgentDescription _actorDesc
           
protected  boolean _autoCommit
           
protected  Locator _lctr
           
protected  Logger _logger
           
protected  java.lang.String _preferredTransportName
           
protected  java.util.List _propertiesToModify
           
protected  boolean _registered
           
protected  Registration _registration
           
protected  java.util.Hashtable _transports
           
protected  TransportSupport _transportSupport
           
 
Constructor Summary
KAoSActorImpl()
           
KAoSActorImpl(java.lang.String[] args)
           
KAoSActorImpl(java.lang.String guid, java.lang.String name, java.util.List<java.lang.String> domainNames, Transport transport)
           
KAoSActorImpl(java.lang.String name, java.util.Vector domainNames)
           
 
Method Summary
 void addCapability(AgentCapability capability)
           
 void addOntologicalType(java.lang.String type)
           
 void addOntologicalType(java.lang.String type, java.lang.String owlDesc)
           
 void addProperty(Property property)
           
 void addProperty(Property property, java.lang.Object value)
           
 void addPropertyValue(Property property, java.lang.Object value)
           
 void addTransport(Transport transport)
           
 void commitPropertyValues()
           
 void deregisterFromKAoS()
           
 boolean equals(java.lang.Object obj)
           
 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.Set<java.lang.String> getEntityOntologicalTypeNames()
          Obtain the collection of just names of ontological types of KAoS entity described by this KAoSActorDescription.
 java.util.Map<java.lang.String,java.lang.String> getEntityOntologicalTypes()
          Obtain the collection of ontological types of this KAoSActorDescription.
 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.
 int hashCode()
           
 void initialize(java.lang.String name, java.util.List<java.lang.String> domainNames)
           
 void initialize(java.lang.String guid, java.lang.String name, java.util.List<java.lang.String> domainNames, java.lang.String transport)
           
 void initialize(java.lang.String guid, java.lang.String name, java.util.List<java.lang.String> domainNames, Transport transport)
           
 boolean isAutoPropertyValueCommit()
           
 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)
           
static void main(java.lang.String[] args)
           
protected  void printTransportMessage(TransportMessage tmsg)
           
 void receiveMessage(java.io.Serializable messageContent, KAoSActor sender)
          Receive the specified message content from the given KAoSActor.
 void receiveMessage(TransportMessage tmsg)
           
 void registerWithKAoS()
           
 boolean removeCapability(AgentCapability capability)
           
 boolean removeOntologicalType(java.lang.String type)
           
 void removeProperty(Property property)
           
 void removePropertyValue(Property property, java.lang.Object value)
           
 void removeTransport(Transport transport)
           
 void sendMessage(java.io.Serializable messageContent, KAoSActor receiver)
          Send the specified message content to the given KAoSActor.
 void sendMessage(java.lang.String message, java.lang.String receiverName)
           
 void setAutoPropertyValueCommit(boolean autoCommit)
           
 void setCapabilities(java.util.List capabilities)
           
 void setConceptMappingName(java.lang.String mappingName)
           
 void setGUID(java.lang.String actorGUID)
           
protected  void setMyDescription(KAoSAgentDescription desc)
           
 void setName(java.lang.String name)
           
 void setOntologicalTypes(java.util.Map types)
           
 void setProperties(java.util.Hashtable properties)
           
 void setPropertyValue(Property property, java.lang.Object value)
           
 void setRegistered(boolean registered)
          Set the registered/unregistered status of this KAoSActor.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_actorDesc

protected KAoSAgentDescription _actorDesc

_registration

protected Registration _registration

_transportSupport

protected TransportSupport _transportSupport

_autoCommit

protected boolean _autoCommit

_registered

protected boolean _registered

_preferredTransportName

protected java.lang.String _preferredTransportName

_transports

protected java.util.Hashtable _transports

_propertiesToModify

protected java.util.List _propertiesToModify

_logger

protected Logger _logger

_lctr

protected Locator _lctr
Constructor Detail

KAoSActorImpl

public KAoSActorImpl()

KAoSActorImpl

public KAoSActorImpl(java.lang.String guid,
                     java.lang.String name,
                     java.util.List<java.lang.String> domainNames,
                     Transport transport)
              throws java.lang.Exception
Throws:
java.lang.Exception

KAoSActorImpl

public KAoSActorImpl(java.lang.String name,
                     java.util.Vector domainNames)
              throws java.lang.Exception
Throws:
java.lang.Exception

KAoSActorImpl

public KAoSActorImpl(java.lang.String[] args)
              throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

initialize

public void initialize(java.lang.String guid,
                       java.lang.String name,
                       java.util.List<java.lang.String> domainNames,
                       java.lang.String transport)
                throws java.lang.Exception
Throws:
java.lang.Exception

initialize

public void initialize(java.lang.String name,
                       java.util.List<java.lang.String> domainNames)
                throws java.lang.Exception
Throws:
java.lang.Exception

initialize

public void initialize(java.lang.String guid,
                       java.lang.String name,
                       java.util.List<java.lang.String> domainNames,
                       Transport transport)
                throws java.lang.Exception
Throws:
java.lang.Exception

getConceptMappingName

public java.lang.String getConceptMappingName()
Description copied from interface: KAoSActor
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.

setConceptMappingName

public void setConceptMappingName(java.lang.String mappingName)

getDomainNames

public java.util.List getDomainNames()
Description copied from interface: KAoSActor
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 KAoSActorDescription.

getGUID

public java.lang.String getGUID()
Description copied from interface: KAoSActor
Obtain the actor's globally unique identifier.

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

setGUID

public void setGUID(java.lang.String actorGUID)

getName

public java.lang.String getName()
Description copied from interface: KAoSActor
Obtain the actor's name.

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

setName

public void setName(java.lang.String name)

addOntologicalType

public void addOntologicalType(java.lang.String type,
                               java.lang.String owlDesc)

removeOntologicalType

public boolean removeOntologicalType(java.lang.String type)

addOntologicalType

public void addOntologicalType(java.lang.String type)

setOntologicalTypes

public void setOntologicalTypes(java.util.Map types)

getEntityOntologicalTypes

public java.util.Map<java.lang.String,java.lang.String> getEntityOntologicalTypes()
Description copied from interface: KAoSActor
Obtain the collection of ontological types of this KAoSActorDescription. 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.Set<java.lang.String> getEntityOntologicalTypeNames()
Description copied from interface: KAoSActor
Obtain the collection of just names of ontological types of KAoS entity described by this KAoSActorDescription. 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 KAoSActorDescription.

isGuarded

public boolean isGuarded()
Description copied from interface: KAoSActor
Obtain guarded/unguarded status of this KAoSActor.

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

isRegistered

public boolean isRegistered()
Description copied from interface: KAoSActor
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.

setRegistered

public void setRegistered(boolean registered)
Description copied from interface: KAoSActor
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.

addCapability

public void addCapability(AgentCapability capability)
                   throws ModificationException
Throws:
ModificationException

removeCapability

public boolean removeCapability(AgentCapability capability)
                         throws ModificationException
Throws:
ModificationException

setCapabilities

public void setCapabilities(java.util.List capabilities)
                     throws ModificationException
Throws:
ModificationException

getCapabilities

public java.util.List getCapabilities()
Description copied from interface: KAoSActor
Obtain the collection of AgentCapabilities of this KAoSActor.

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

setProperties

public void setProperties(java.util.Hashtable properties)

getProperties

public java.util.Hashtable getProperties()
Description copied from interface: KAoSActor
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:
Map of actor's properties.

isAutoPropertyValueCommit

public boolean isAutoPropertyValueCommit()

setAutoPropertyValueCommit

public void setAutoPropertyValueCommit(boolean autoCommit)

addProperty

public void addProperty(Property property)

addProperty

public void addProperty(Property property,
                        java.lang.Object value)

removeProperty

public void removeProperty(Property property)

commitPropertyValues

public void commitPropertyValues()
                          throws ModificationException
Throws:
ModificationException

getProperty

public Property getProperty(java.lang.String name)
Description copied from interface: KAoSActor
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.

addPropertyValue

public void addPropertyValue(Property property,
                             java.lang.Object value)
                      throws ModificationException
Throws:
ModificationException

removePropertyValue

public void removePropertyValue(Property property,
                                java.lang.Object value)
                         throws ModificationException
Throws:
ModificationException

setPropertyValue

public void setPropertyValue(Property property,
                             java.lang.Object value)
                      throws ModificationException
Throws:
ModificationException

getPropertyValue

public java.lang.Object getPropertyValue(Property property)
Description copied from interface: KAoSActor
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.lang.String message,
                        java.lang.String receiverName)
                 throws java.lang.Exception
Throws:
java.lang.Exception

sendMessage

public void sendMessage(java.io.Serializable messageContent,
                        KAoSActor receiver)
                 throws NotLocatableException,
                        TransportFailure
Description copied from interface: KAoSActor
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.
receiver - KAoSActor representing the receiver.
Throws:
NotLocatableException - when the receiver cannot be located.
TransportFailure - when the transport system fails.

receiveMessage

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

Specified by:
receiveMessage in interface KAoSActor
Parameters:
messageContent - Serializable containing the received message.
sender - KAoSActor representing the sender.

getTransports

public java.util.List getTransports()
Description copied from interface: KAoSActor
Return the List of valid Transports.

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

addTransport

public void addTransport(Transport transport)
                  throws NoSuchTransportException
Throws:
NoSuchTransportException

removeTransport

public void removeTransport(Transport transport)

getTransport

public Transport getTransport(java.lang.String name)
Description copied from interface: KAoSActor
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.

receiveMessage

public void receiveMessage(TransportMessage tmsg)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getAgentDescription

public KAoSAgentDescription getAgentDescription()

registerWithKAoS

public void registerWithKAoS()
                      throws java.lang.Exception
Throws:
java.lang.Exception

deregisterFromKAoS

public void deregisterFromKAoS()
                        throws java.lang.Exception
Throws:
java.lang.Exception

printTransportMessage

protected void printTransportMessage(TransportMessage tmsg)

logMessage

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

logMessage

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

setMyDescription

protected void setMyDescription(KAoSAgentDescription desc)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception