|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kaos.dfra.dlik.DLIKImpl
public class DLIKImpl
Defines the DFRA Logical Interface to KAoS.
Field Summary |
---|
Fields inherited from interface kaos.dfra.dlik.DLIK |
---|
NEGATIVE_DOMAIN_MODALITY, POSITIVE_DOMAIN_MODALITY |
Method Summary | |
---|---|
protected void |
checkForNullArgument(java.lang.Object arg,
java.lang.String methodName,
java.lang.String argName)
Utility method: if the exp is true, then the arg is null. |
void |
checkPermission(java.lang.String actorGUID,
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 |
deregisterAgent(KAoSAgentDescription desc)
Deregister the agent with the given KAoSAgentDescription from the KAoS Directory Service. |
void |
deregisterDomain(DomainDescription domainDesc)
Deregister a domain with the given description from the KAoS Directory Service. |
KAoSAgentDescription |
getAgentDescriptionForGUID(java.lang.String agentGUID)
Return a KAoSAgentDescription for an agent, whose GUID is specified. |
java.util.List |
getAgentDescriptionForNickname(java.lang.String agentNickname)
Return a List of KAoSAgentDescriptions of agents, whose nickname is specified. |
java.util.List |
getAgentsWithAttributes(java.util.Hashtable searchAttributes)
Return a List of KAoSAgentDescriptions whose attributes match exactly all specified attributes. |
java.util.List |
getAllAgents()
Return a List of guids of all agents registered in the KAoS Directory Service. |
DomainDescription |
getDomain(java.lang.String domainName)
Return a DomainDescription of the domain, whose name is specified. |
static DLIK |
getInstance(Transport dsTransport)
Retrieve an instance of DLIK. |
java.util.Vector |
getObligationsForTriggerCondition(java.lang.String actionActorGUID,
java.lang.String triggerActionName,
java.util.HashMap triggerActionProperties,
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)
|
KAoSAgentDescription |
registerAgent(java.lang.String agentNickname,
boolean guarded,
boolean nicknameAsGuid,
java.util.List domainNames,
java.lang.String transportName,
boolean replace)
Register an agent described by the given attributes in KAoS Directory Service. |
DomainDescription |
registerDomain(java.lang.String domainName,
java.lang.String modality,
java.lang.String priority,
java.lang.String parentName,
java.util.List childrenNames,
boolean replace)
Register domain with the given attributes in the KAoS Directory Service. |
void |
registerTriggerConditionListener(java.lang.String triggerActionClassName,
TriggerConditionListener listenerRef)
Request registration of the specified TriggerConditionListener in the Guard's registry of trigger listeners. |
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 DLIK 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 KAoSAgentDescription registerAgent(java.lang.String agentNickname, boolean guarded, boolean nicknameAsGuid, java.util.List domainNames, java.lang.String transportName, boolean replace) throws DirectoryFailure, AlreadyRegisteredException, GuardInstantiationException
registerAgent
in interface DLIK
agentNickname
- String containing the nickname of the registering agent.guarded
- boolean indicating whether the registering agent is going to be guarded.nicknameAsGuid
- boolean indicating whether to use the nickname as the agent's guid.domainNames
- List containing the names of the domains to join.transportName
- String containing the name of the transport to use. Valid values: corba, tcp, grid.replace
- boolean indicating whether to replace existing registration information for the given agent.
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering agent has been already registered in the DS
(if the replace = false and there is already registration for the specified agent).
GuardInstantiationException
- if Guard was requested and the instantiation of Guard failed.public DomainDescription registerDomain(java.lang.String domainName, java.lang.String modality, java.lang.String priority, java.lang.String parentName, java.util.List childrenNames, boolean replace) throws DirectoryFailure, AlreadyRegisteredException
registerDomain
in interface DLIK
domainName
- String containing unique domain name.modality
- String containing domain modality. Valid values: POSITIVE, NEGATIVE. Those two values will
be mapped to the corresponding concepts in KAoS ontology. If null specified,
then the default is POSITIVE.priority
- String containing the priority of the registering domain. I null specified,
then the default is "0".parentName
- String containing the name of the parent domain. Optional.childrenNames
- List containing the names of the children domains. Optional.replace
- boolean, which indicates whether to replace existing domain registration with the provided info. Required.
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering domain has been already registered in the DS
(if the replace = false and there is already registration for the specified domain).public void deregisterAgent(KAoSAgentDescription desc) throws DirectoryFailure, NotRegisteredException
deregisterAgent
in interface DLIK
desc
- KAoSAgentDescription describing the deregistering agent.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the agent to be deregistered has not been registered in the DS.public void deregisterDomain(DomainDescription domainDesc) throws DirectoryFailure, NotRegisteredException
deregisterDomain
in interface DLIK
domainDesc
- DomainDescription of the domain to deregister.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the domain to be deregistered has not been registered in the DS.public DomainDescription getDomain(java.lang.String domainName) throws DirectoryFailure, NotRegisteredException
getDomain
in interface DLIK
name
- String specifying the name of the domain to lookup.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the requested domain to be looked-up has not been registered in the DS.public KAoSAgentDescription getAgentDescriptionForGUID(java.lang.String agentGUID) throws DirectoryFailure, NotRegisteredException
getAgentDescriptionForGUID
in interface DLIK
agentGUID
- String specifying the guid of the agent to lookup.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the agent to be looked-up has not been registered in the DS.public java.util.List getAgentDescriptionForNickname(java.lang.String agentNickname) throws DirectoryFailure, NotRegisteredException
getAgentDescriptionForNickname
in interface DLIK
agentNickname
- String specifying the agentNickname of the agent(s) to lookup.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if no agents with the given nickname have been registered in the DS.public java.util.List getAgentsWithAttributes(java.util.Hashtable searchAttributes) throws DirectoryFailure, NotRegisteredException
getAgentsWithAttributes
in interface DLIK
searchAttributes
- Hashtable containing attribute name => attribute value mappings.
NOTE: the names of defaul tentity attributes are defined in interfaces:
kaos.core.service.directory.KAoSEntityDescription
kaos.core.service.directory.KAoSAgentDescription
DirectoryFailure
- if the connection to the DS cannot be established.
NoSuchActorException
- if no actors matching the query properties could be found.
NotRegisteredException
public java.util.List getAllAgents() throws DirectoryFailure, SearchException
getAllAgents
in interface DLIK
DirectoryFailure
- if the connection to the DS cannot be established.
SearchException
- if search failed.public void checkPermission(java.lang.String actorGUID, java.lang.String attemptedActionName, java.util.HashMap actionProperties, java.lang.String conceptMappingName) throws KAoSSecurityException, java.lang.NullPointerException, ServiceFailure
checkPermission
in interface DLIK
actorGUID
- String containing the GUID of the agent attempting to perform
the action to check permission for.attemptedActionName
- String containing the ontological name of the attempted action.
NOTE: many ontological names of actions and their properties are defined in:
kaos.ontology.vocabulary.ActionConceptsactionProperties
- HashMap containing the ontological names and their values of properties of the attempted action.conceptMappingName
- String containing the mapping of vocabulary between DFRA and KAoS ontologies. Optional.
KAoSSecurityException
- if the attempted action is not allowed.
java.lang.NullPointerException
- if - will be thrown if any of the required
arguments is null (consistent with the semantics of Java checking permission).
ServiceFailure
- if the policy service is not available.public void registerTriggerConditionListener(java.lang.String triggerActionClassName, TriggerConditionListener listenerRef) throws TriggerConditionListenerRegistrationException
registerTriggerConditionListener
in interface DLIK
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(java.lang.String actionActorGUID, java.lang.String triggerActionName, java.util.HashMap triggerActionProperties, java.lang.String conceptMappingName) throws ObligationViolationException, ServiceFailure
getObligationsForTriggerCondition
in interface DLIK
actionActorGUID
- String containing the GUID of the agent 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 DFRA and KAoS ontologies.
ObligationViolationException
- if obligation constraints are not satisfied.
ServiceFailure
- if the policy service is not available.public boolean setMapping(java.lang.String mappingName, java.lang.String fileNameLoc)
setMapping
in interface DLIK
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)
protected void checkForNullArgument(java.lang.Object arg, java.lang.String methodName, java.lang.String argName) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if arg is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |