|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kaos.brahms.blik.BLIKImpl
public class BLIKImpl
Defines the Brahms Logical Interface to KAoS.
Method Summary | |
---|---|
void |
checkPermission(KAoSActor actionActor,
java.lang.String attemptedActionName,
java.util.HashMap actionProperties,
java.lang.String conceptMappingName)
Check permission for the action described by the given action name and properties. |
void |
deregisterActor(KAoSActor actor)
Deregister the specified KAoSActor from the KAoS Directory Service. |
void |
deregisterAgentHostingEnv(AgentHostingEnvironment env)
Deregister the AgentHostingEnvironment from the KAoS Directory Service. |
void |
deregisterDomain(KAoSDomain domain)
Deregister the KAoSDomain from the KAoS Directory Service. |
void |
deregisterObserver(KAoSObserver observer,
java.lang.String updateType,
java.io.Serializable updateCondition,
java.lang.String observableGUID)
Deregister the given KAoSObserver from the registry of observers associated with the KAoSObservable, whose GUID is given. |
KAoSActor |
getActor(java.lang.String actorGUID)
Return KAoSActor, whose GUID is specified. |
java.util.List |
getActors(QueryState query)
Return a List of KAoSActors satisfying the given query. |
java.util.List |
getActorsWithAttributes(java.util.Hashtable searchAttributes)
Return a List of KAoSActors whose attributes match exactly all specified attributes. |
KAoSDomain |
getDomain(java.lang.String name)
Return a KAoSDomain of the domain, whose name is specified. |
static BLIK |
getInstance(Transport dsTransport)
Retrieve an instance of BLIK. |
java.util.Vector |
getObligationsForTriggerCondition(KAoSActor actionActor,
java.lang.String triggerActionName,
java.util.HashMap triggeraActionProperties,
java.lang.String conceptMappingName)
Based on the specified trigger action actor, name and properties, select all applicable obligation ActionInstanceDescriptions. |
protected void |
logMessage(java.lang.String msg,
java.lang.Exception e,
int logLevel)
|
protected void |
logMessage(java.lang.String msg,
int logLevel)
|
void |
registerActor(KAoSActor actor,
boolean guarded,
boolean replace)
Register the specified KAoSActor in the KAoS Directory Service. |
void |
registerAgentHostingEnv(AgentHostingEnvironment env,
boolean replace)
Register the AgentHostingEnvironmentin the KAoS Directory Service. |
void |
registerDomain(KAoSDomain domain,
boolean replace)
Register the specified KAoSActor in the KAoS Directory Service. |
void |
registerObserver(KAoSObserver observer,
java.lang.String updateType,
java.io.Serializable updateCondition,
java.lang.String observableGUID)
Register the given KAoSObserver with the KAoSObservable, whose GUID is given for updates described by the updateType and updateConditions. |
void |
registerTriggerConditionListener(java.lang.String triggerActionClassName,
TriggerConditionListener listenerRef)
Request registration of the specified TriggerConditionListener in the Guard's registry of trigger listeners. |
java.lang.String |
requestAction(FeedbackReceiver feedbackReceiver,
java.lang.String receiverID,
java.lang.String owlActionDescription)
This method sends a command to an entity identified by the given receiverID to perform an action described by the given String, which is in the OWL format. |
java.lang.String |
requestAction(FeedbackReceiver feedbackReceiver,
java.lang.String receiverID,
java.lang.String actionName,
java.util.HashMap properties)
This method sends a command to an entity identified by the given receiverID to perform an action described by the given action name and properties. |
java.lang.Object |
requestAction(java.lang.String receiverID,
java.lang.String actionName,
java.util.HashMap properties)
This method sends a command to an entity identified by the given receiverID to perform an action described by the given action name and properties. |
boolean |
setMapping(java.lang.String mappingName,
java.lang.String fileNameLoc)
Set the ontology mapping, whose name and location are given. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static BLIK getInstance(Transport dsTransport) throws java.lang.Exception
transportName
- String specifying the name of the transport to use for communication with the KAoS Directory Service.
java.lang.Exception
public void registerActor(KAoSActor actor, boolean guarded, boolean replace) throws DirectoryFailure, AlreadyRegisteredException, GuardInstantiationException
registerActor
in interface BLIK
actor
- KAoSActor containing actor properties to be stored in the KAoS Directory Service.guarded
- boolean indicating whether the registering actor is going to be guarded.replace
- boolean indicating whether to replace existing registration information for the given KAoSActor.
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering KAoSActor has been already registered in the DS
(if the replace = false and there is already registration for the specified KAoSActor).
GuardInstantiationException
public void registerAgentHostingEnv(AgentHostingEnvironment env, boolean replace) throws DirectoryFailure, AlreadyRegisteredException
registerAgentHostingEnv
in interface BLIK
env
- AgentHostingEnvironment containing environment properties to be stored in the KAoS Directory Service.replace
- boolean indicating whether to replace existing registration information for the given AgentHostingEnvironment.
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering AgentHostingEnvironment has been already registered in the DS
(if the replace = false and there is already registration for the specified AgentHostingEnvironment).public void registerDomain(KAoSDomain domain, boolean replace) throws DirectoryFailure, AlreadyRegisteredException
registerDomain
in interface BLIK
actor
- KAoSDomain containing unique domain name, parent/children domain names, modality and priority.replace
- boolean indicating whether to replace existing registration information for the given KAoSDomain.
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering KAoSDomain has been already registered in the DS
(if the replace = false and there is already registration for the specified KAoSDomain).public void deregisterActor(KAoSActor actor) throws DirectoryFailure, NotRegisteredException
deregisterActor
in interface BLIK
actor
- KAoSActor be deregistered.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the KAoSActor to be deregistered has not been registered in the DS.public void deregisterAgentHostingEnv(AgentHostingEnvironment env) throws DirectoryFailure, NotRegisteredException
deregisterAgentHostingEnv
in interface BLIK
env
- AgentHostingEnvironment to be deregistered.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the AgentHostingEnvironment to be deregistered has not been registered in the DS.public void deregisterDomain(KAoSDomain domain) throws DirectoryFailure, NotRegisteredException
deregisterDomain
in interface BLIK
domain
- KAoSDomain to be deregistered.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the KAoSDomain to be deregistered has not been registered in the DS.public KAoSDomain getDomain(java.lang.String name) throws DirectoryFailure, NotRegisteredException
getDomain
in interface BLIK
name
- String specifying the name of the domain to lookup.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the requested KAoSDomain to be looked-up has not been registered in the DS.public KAoSActor getActor(java.lang.String actorGUID) throws DirectoryFailure, NotRegisteredException
getActor
in interface BLIK
actorGUID
- String specifying the guid of the actor to lookup.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the KAoSActor to be looked-up has not been registered in the DS.public java.util.List getActors(QueryState query) throws DirectoryFailure, NoSuchActorException
getActors
in interface BLIK
query
- QueryState formulating the query to retrieve KAoSActors satisfying the query.
DirectoryFailure
- if the connection to the DS cannot be established.
NoSuchActorException
- if no actors matching the query properties could be found.public java.util.List getActorsWithAttributes(java.util.Hashtable searchAttributes) throws DirectoryFailure, NoSuchActorException
getActorsWithAttributes
in interface BLIK
searchAttributes
- Hashtable containing attribute name => attribute value mappings.
DirectoryFailure
- if the connection to the DS cannot be established.
NoSuchActorException
- if no actors matching the query properties could be found.public void checkPermission(KAoSActor actionActor, java.lang.String attemptedActionName, java.util.HashMap actionProperties, java.lang.String conceptMappingName) throws KAoSSecurityException, java.lang.NullPointerException, ServiceFailure
BLIK
checkPermission
in interface BLIK
actionActor
- KAoSActor attempting to perform the action to check permission for.attemptedActionName
- String containing the ontological name of the attempted action.actionProperties
- HashMap containing the ontological names and their values of properties of the attempted action.conceptMappingName
- String containing the mapping of vocabulary between Brahms and KAoS ontologies ("Brahms"
has been used for some of the demo scenarions)
KAoSSecurityException
- if the attempted action is not allowed.
java.lang.NullPointerException
- if any arguments are null.
ServiceFailure
- if the policy service is not available.public void registerTriggerConditionListener(java.lang.String triggerActionClassName, TriggerConditionListener listenerRef) throws TriggerConditionListenerRegistrationException
registerTriggerConditionListener
in interface BLIK
triggerActionClassName
- String containing the name of the action class the given trigger listener is going to monitor.listenerRef
- TriggerConditionListener, an instance of a listener, which will be monitoring the action, whose
name is given. When Guard receives a policy, whose action matches the triggerActionClassName,
Guard will send an update to the listenerRef.
TriggerConditionListenerRegistrationException
- if the listener registration fails.public java.util.Vector getObligationsForTriggerCondition(KAoSActor actionActor, java.lang.String triggerActionName, java.util.HashMap triggeraActionProperties, java.lang.String conceptMappingName) throws ObligationViolationException, ServiceFailure
getObligationsForTriggerCondition
in interface BLIK
actionActor
- KAoSActor performing the trigger action.triggerActionName
- String containing the ontological name of the trigger action.triggeraActionProperties
- HashMap containing the ontological names and their values of properties of the trigger action.conceptMappingName
- String containing the mapping of vocabulary between Brahms and KAoS ontologies ("Brahms"
has been used for some of the demo scenarions).
ObligationViolationException
- if obligation constraints are not satisfied.
ServiceFailure
- if the policy service is not available.public java.lang.String requestAction(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, java.lang.String owlActionDescription) throws ActionFailureException, NotLocatableException, TransportFailure
requestAction
in interface BLIK
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.owlActionDescription
- is an OWL String that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
public java.lang.String requestAction(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, java.lang.String actionName, java.util.HashMap properties) throws ActionFailureException, NotLocatableException, TransportFailure
requestAction
in interface BLIK
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.actionName
- is a String representing the name of the action as defined in
the associated ontology.properties
- is an HashMap of ontological Strings representing
the desired properties of the action and the
associated values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
public java.lang.Object requestAction(java.lang.String receiverID, java.lang.String actionName, java.util.HashMap properties) throws ActionFailureException, NotLocatableException, TransportFailure
requestAction
in interface BLIK
receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.actionName
- is a String representing the name of the action as defined
in the associated ontology.properties
- is a HashMap of Strings representing names of
the desired properties as defined in the associated ontology
and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
public void registerObserver(KAoSObserver observer, java.lang.String updateType, java.io.Serializable updateCondition, java.lang.String observableGUID) throws NotLocatableException, TransportFailure
registerObserver
in interface BLIK
observer
- KAoSObserver requesting registration for updates.updateType
- String indicating type of update the KAoSObserver is interested in.updateCondition
- Serializable describing the conditions under which to send the update.observableGUID
- String containing the GUID of the KAoSObservable to register with.
NotLocatableException
- when the KAoSObservable cannot be located.
TransportFailure
- when transport services fails.public void deregisterObserver(KAoSObserver observer, java.lang.String updateType, java.io.Serializable updateCondition, java.lang.String observableGUID) throws NotLocatableException, TransportFailure
deregisterObserver
in interface BLIK
observer
- KAoSObserver deregistering.updateType
- String indicating type of update the KAoSObserver is no longer interested in.updateCondition
- Serializable containing the condition the KAoSObserver is no longer interested in.observableGUID
- String specifying the GUID of the observable, from which to deregister
for the given update type.
NotLocatableException
- when the KAoSObservable cannot be located.
TransportFailure
- when transport services fail.public boolean setMapping(java.lang.String mappingName, java.lang.String fileNameLoc)
setMapping
in interface BLIK
mappingName
- The String specifying the name of the mapping.
*** Note *** This name has to be passed to
KAoSActorImpl.setConceptMappingName(mappingName) before specifying
the terms from the mappingName ontology.fileNameLoc
- The String specifying the name and path of the file containing the mapping.
protected void logMessage(java.lang.String msg, int logLevel)
protected void logMessage(java.lang.String msg, java.lang.Exception e, int logLevel)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |