kaos.core.service.directory
Class OntologyBasedKAoSDirectory

java.lang.Object
  extended by kaos.core.service.directory.OntologyBasedKAoSDirectory

public class OntologyBasedKAoSDirectory
extends java.lang.Object

$Revision: 1.41 $


Constructor Summary
OntologyBasedKAoSDirectory(KAoSDirectoryService _myKAoSDirectoryService)
           
 
Method Summary
 void addFilteredNamespace(java.lang.String namespace)
          This method add a nemaspace to the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.
 void addPolicies(java.util.Vector policies)
          Each element of the Vector is a definition of a policy to be added to the collection of policies of the entity associated with that policy.
 void addPolicy(Msg _policy)
          Add policy to the PolicyDirectory
 void addPolicySet(Msg policySet)
          BEGIN - kaos.policy.management.PolicySetDirectory interface implementation
 void addPolicySets(java.util.Vector policySets)
          Each element of the Vector is an instance of a Msg class specifying an individual policy set fields
 boolean areClassesDisjoint(java.lang.String firstClass, java.lang.String secondClass)
          Test if two provided classes are disjoint
 java.util.Set askQuery(java.lang.String variableName, java.lang.String multiplyVariablesQuery)
          Get values of the selected variable satisfing the KIF query with possibly many variable.
 void changedPriority(java.lang.String policyId, int newPriority)
          Method allowing to modify priority of a policy to either eliminate conflict or to alter policy precedence relation
 void changePolicies(java.util.Vector policies)
          Each element of the Vector is a definition of a policy to replace its current definition in the collection of policies of the entity associated with that policy.
 void changePolicy(Msg policy)
          Change policy of the entity associated with that policy.
 void changePolicySet(Msg policySet)
           
 void changePolicySets(java.util.Vector policySets)
           
 void checkAbsolutePermission(java.lang.String checkedActionClass)
          The method check if the given action class is absolutly permitted according to the current set of policies
 AgentDescription createAgentDescription()
          Create an empty AgentDescription suitable for attribute population and use.
 void declareInstance(java.lang.String instanceName, java.lang.String className)
          Create an instance of the given class.
 void deregister(AgentDescription desc)
          Remove the AgentDescription from the collection of domain entities registered in the directory.
 java.util.List findConflictingPolicies(java.lang.String policyId)
          Method find all the policies conflicting with the specified policy
 java.util.List findPoliciesMadeRedundant(java.lang.String policyId)
          Method find all the policies with higher priority making the specified policy redundant
 java.util.List findPoliciesMakingRedundant(java.lang.String policyId)
          Method find all the policies with higher priority making the specified policy redundant
 java.util.Vector getAbsoluteObligationsForTriggerConditionForAC(java.lang.String triggerAC)
          Based on the specified trigger ActionClassDescription, select all absolute classes of obligations
 java.util.Set getActions(java.lang.String forActor)
          Get descriptions of the Action classes the specified Actor class or instance can perfom based on its class.
 java.util.Vector getAllAgentsInDirectory()
          Get a Vector of descriptions of all agents in the directory.
 java.util.Vector getAllAgentsInDomain(java.lang.String domainName)
           
 java.util.Vector getAllDomainsInDirectory()
          Get a Vector of descriptions of all of the domains in a directory.
 java.util.Set getAllNamespaces()
          This method returns a set of urls depicting ontologies loaded into the JTP as well namespaces used internally by KAoS.
 java.util.Vector getApplicablePoliciesForEntity(java.lang.String entityId)
          Obtain the set of policies directly and indirectly applicable to a specified entity.
 java.util.Vector getApplicablePoliciesForEntityClass(java.lang.String classOfEntitiesName)
          Obtain the set of policies directly and indirectly applicable to a specified class of entities.
 java.util.Set getClassesDefInNamespace(java.lang.String namespaceName)
          Get set of classes defined in the given namespace.
 java.util.Set getClassesOfActors(java.lang.String baseActorClass)
          Get names of the Actors classes known to the ontology repository being a subclass of the specified base class.
 java.util.Set getClassesOfActorsCapableOfPerformingActions(java.lang.String actionClass)
          Get names of Actor classes capable to perform a given action, without taking into consideration policy restrictions
 java.util.Set getClassesOfGroups(java.lang.String baseGroupClass)
          Get names of the Group classes known to the ontology repository being a subclass of the specified base class.
 java.util.Set getClassesOfPlaces(java.lang.String basePlaceClass)
          Get names of the Places classes known to the ontology repository being a subclass of the specified base class.
 java.util.Set getClassesOfTargets(java.lang.String baseTargetClass)
          Get names of the targets (Actors, Entities, etc.) classes known to the ontology repository being a subclass of the specified base class.
 java.util.Vector getConditionalPolicies()
          Support for conditional policies - not currently present in Ontology
 java.util.List getConstructedOntologyStructures()
          This method retrieves all user defined ontlogy structures in the repository.
 DomainDescription getDomainDescription(java.lang.String domainName)
          Get the description of a domain
 java.util.List getDomainDescriptionsForGuard(java.lang.String guardGUID)
          Obtain a List containing DomainDescriptions of all domains the guard, whose GUID is specified, registered in.
 java.util.Vector getDomainNames()
          Obtain a List of the names of all registered domains.
 java.util.Map getDomainStructure(java.lang.String domainName)
          Obtain a Map containing the structure of a domain.
 java.util.Set getFilteredNamespaces()
          This method returns a set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.
 java.util.Vector getGuardsForActionClass(java.lang.String action)
           
 java.util.Vector getGuardsForActorClass(java.lang.String actorClassName)
          Search for guards, which are interested in policies having this actor class (or its superclasses) as a subject
 java.util.Set getIndividualActors(java.lang.String baseActorClass)
          Get names of the individual Actors known to the ontology repository being an instance of the specified base class.
 java.util.Set getIndividualGroups(java.lang.String baseGroupClass)
          Get names of the individual Groups known to the ontology repository being an instance of the specified base class.
 java.util.Set getIndividualPlaces(java.lang.String basePlaceClass)
          Get names of the individual Places known to the ontology repository being an instance of the specified base class.
 java.util.Set getIndividualTargets(java.lang.String baseTargetClass)
          Get names of the individual targets (Actors, Entities, etc.) known to the ontology repository being an instance of the specified base class.
 java.util.Set getInstancesDefInNamespace(java.lang.String namespaceName)
          Get set of instances defined in the given namespace.
 java.util.Set getInstancesOf(java.lang.String conceptName)
          Get set of instances of the given concept; if the concept is an instance itself the set contains just this instance.
 java.util.Set getListOfLoadedOntologies()
          This method returns a set of urls depicting ontologies loaded into the JTP.
 java.util.Set getNamspacesImportedByNamespace(java.lang.String namespaceName)
          Get set of namspaces imported by the given namespace.
 java.util.Set getOntologyDefinitionForConcept(java.lang.String conceptName)
          Tries to find an ontology definition of the search concept.
 java.util.List getPolicies()
          Obtain an Vector over all policies.
 java.util.Map getPoliciesByEntities()
          Obtain a table of all original policies (pre-deconfliction and Ontology->XML conversion) in the system, indexed by the id(s) of the entity(s) to which they apply
 java.util.Vector getPoliciesForEntity(java.lang.String id)
          Obtain an Vector over all policies associated with an entity whose id is specified.
 Msg getPolicy(java.lang.String policyId)
          Obtain a policy based on id
 PolicySetMsg getPolicySet(java.lang.String policySetId)
           
 java.util.List getPolicySets()
          Obtain a Vector over all policy sets.
 java.util.Vector getPropertiesApplicableTo(java.lang.String className)
          Get set of properties defined in the given namespace.
 java.util.Set getPropertiesDefInNamespace(java.lang.String namespaceName)
          Get set of properties defined in the given namespace.
 java.lang.String getRangeOnPropertyForClass(java.lang.String className, java.lang.String propertyName)
          Get the name of the class defining the range of the specified property for the given class.
 java.util.Set getResourcesWithValueForProperty(java.lang.String property, java.lang.String value)
          Get values of the variable satisfing the KIF query: (property ?subject value).
 java.util.Vector getRootDomains()
          Obtain an Enumeration of the names of the root domains (domains with no parent)
 ServiceProperties getServiceProperties()
          Obtain the properties of the service.
 java.util.Set getSubClassesOf(java.lang.String className)
          Get set of subclasses of the given class.
 java.util.Vector getSubdomains(java.lang.String domainName)
          Obtain an Enumeration of the names of subdomains of a particular domain (returns immediate children only)
 java.util.Set getSubPropertiesOf(java.lang.String propertyName)
          Get set of subproperties of the given property.
 java.util.Set getSuperClassesOf(java.lang.String className)
          Get set of superclasses of the given class.
 java.util.Set getSuperPropertiesOf(java.lang.String propertyName)
          Get set of superproperties of the given property.
 java.util.Set getUltimateOntologyTypesOfIndividual(java.lang.String individualName)
          Finds the ultimate Ontology type of the provided individual
 java.lang.String getUniqueValueForProperty(java.lang.String property, java.lang.String subject)
          Get a single value of the variable satisfing the KIF query: (property subject ?val).
 java.util.Set getValuesForProperty(java.lang.String property, java.lang.String subject)
          Get values of the variable satisfing the KIF query: (property subject ?val).
 java.util.List harmonizePolicy(java.lang.String harmonizedPolicy, java.lang.String harmonizingPolicy)
          Method deconflicting the added policy with policies currently in the Policy Directory
 boolean isEntityInDomain(java.lang.String domainName, java.lang.String entityId)
          Search for the domain entity with the specified id.
 boolean isFullyOverlappedBySecondPolicy(java.lang.String firstPolicyId, java.lang.String secondPolicyId)
          Method finds out if the specified policy is fully overlapped by the second specified policy, the necessary condition is that the two policies have the same modality
 boolean isFullyOverlappedByUnionOfPolicies(java.lang.String firstPolicyId, java.util.List listOfPolicies)
          Method finds out if the specified policy is fully overlapped by the union of specified policies, the necessary condition is that the all policies have the same modality
 boolean isMadeFullyRedundantByPolicyUnion(java.lang.String firstPolicyId, java.util.List listOfPolicies)
          Method finds out if the specified policy is beign made redundant (fully coverd) by the union of specified policies with higher priority in the repository
 boolean isMadeFullyRedundantBySecond(java.lang.String firstPolicyId, java.lang.String secondPolicyId)
          Method finds out if the specified policy is beign made redundant (fully coverd) by the second specified policy with higher priority in the repository
 boolean isMadeParitallyRedundantBySecond(java.lang.String firstPolicyId, java.lang.String secondPolicyId)
          Method finds out if the specified policy is beign made partially redundant (partially coverd) by the second specified policy with higher priority in the repository
 boolean isPartiallyOverlappedBySecondPolicy(java.lang.String firstPolicyId, java.lang.String secondPolicyId)
          Method finds out if the specified policy is partially overlapped by the second specified policy, the necessary condition is that the two policies have the same modality
 boolean isPolicyInConflict(java.lang.String policyId)
          Method finds out if the specified policy is in conflict with some policies with the same priority in the repository
 boolean isPolicyMakingRedundantSomeOtherPolicy(java.lang.String policyId)
          Method finds out if the specified policy makes redundant (fully or partially) some policies with lower priority in the repository
 boolean isPolicyRedundant(java.lang.String policyId)
          Method finds out if the specified policy is beign made redundant (fully or partially) by some policies with higher priority in the repository
 void loadOntology(SerializableOntModelImpl myOntModel, boolean recursiveLoad)
          Adds ontology included in the provide objects into the ontology repository.
 void loadOntology(java.lang.String myURL, boolean recursiveLoad)
          Loads ontology from the provided url.
 void modify(AgentDescription desc)
          Replace the AgentDescription in the collection of registered domain entities with the new AgentDescription.
 void modifyEntityProperties(java.lang.String entityGUID, java.util.List properties)
          Modify properties of the entity identified by the given entityGUID.
 void putConstructedOntologyStructures(java.util.List ontologyStructureList)
          This method stores multiple ontology structures in the repositiry.
 void register(AgentDescription desc)
          Add the AgentDescription to the collection of domain entities registered in the directory.
 void removeExecEnv(java.lang.String execEnvID)
          Retrieve a Hashtable containing information about a VM with the specified id from the _executionEnvs table and remove it.
 void removeFilteredNamespace(java.lang.String namespace)
          This method remove a nemaspace from the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.
 void removePolicies(java.util.List policies)
          Each element of the Vector is a definition of a policy to be removed from the collection of policies of the entity associated with that policy.
 void removePolicy(Msg _policy)
          Remove policy from the collection of policies of the entity associated with that policy.
 void removePolicySet(Msg policySet)
           
 void removePolicySets(java.util.Vector policySets)
           
 AgentDescription[] search(AgentDescription desc)
          Search the collection of AgentDescriptions for all matching descriptions.
 AgentDescription[] search(AgentDescription desc, int maxResults)
          Search the collection of AgentDescriptions for all matching descriptions.
 void setConditionalPolicies(java.util.Vector condPols)
           
 void setServiceProperties(ServiceProperties props)
          Set the properties of the service.
 void setUp()
           
 java.util.List splitPolicy(java.lang.String splitPolicy, java.lang.String secondPolicy)
          Method spliting the controlled action of the selected policy one part that overlaps with the second policy and the other part which does not.
 boolean testTrue(java.lang.String statement)
          Test if the KIF statemant is true according to the ontologies in the ontology repository.
 void updatePolicies(java.util.List addedPolicies, java.util.List changedPolicies, java.util.List removedPolicies)
          Transactional update the state of PolicyDirectory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyBasedKAoSDirectory

public OntologyBasedKAoSDirectory(KAoSDirectoryService _myKAoSDirectoryService)
Method Detail

setUp

public void setUp()
           throws ReasoningException
Throws:
ReasoningException

getServiceProperties

public ServiceProperties getServiceProperties()
                                       throws ServiceException,
                                              ServiceFailure
Obtain the properties of the service.

Returns:
the properties of the service.
Throws:
ServiceException
ServiceFailure

setServiceProperties

public void setServiceProperties(ServiceProperties props)
                          throws ServiceException,
                                 ServiceFailure
Set the properties of the service.

Parameters:
props - containing a set of the properties of the service.
Throws:
ServiceException
ServiceFailure

createAgentDescription

public AgentDescription createAgentDescription()
Create an empty AgentDescription suitable for attribute population and use.

This method may return null.

Returns:
a new AgentDescription

deregister

public void deregister(AgentDescription desc)
                throws NotRegisteredException,
                       DirectoryFailure
Remove the AgentDescription from the collection of domain entities registered in the directory.

Parameters:
desc - the AgentDescription to remove.
Throws:
NotRegisteredException - if the AgentDescription is not registered.
DirectoryFailure - if the directory service is not available.

modify

public void modify(AgentDescription desc)
            throws NotRegisteredException,
                   DirectoryFailure
Replace the AgentDescription in the collection of registered domain entities with the new AgentDescription.

Parameters:
desc - the new AgentDescription to replace the old one.
Throws:
NotRegisteredException - if the AgentDescription is not registered.
DirectoryFailure - if the directory service is not available.

register

public void register(AgentDescription desc)
              throws AlreadyRegisteredException,
                     DirectoryFailure
Add the AgentDescription to the collection of domain entities registered in the directory.

Parameters:
desc - the AgentDescription to add.
Throws:
AlreadyRegisteredException - if the AgentDescription is already registered.
DirectoryFailure - if the directory service is not available.

search

public AgentDescription[] search(AgentDescription desc)
                          throws SearchException,
                                 DirectoryFailure
Search the collection of AgentDescriptions for all matching descriptions. Return all results.

Parameters:
desc - the AgentDescription to use for matching.
Returns:
AgentDescription[] containing matching descriptions.
Throws:
SearchException - if an exception occurs during searching.
DirectoryFailure - if the directory service is unavailable.

search

public AgentDescription[] search(AgentDescription desc,
                                 int maxResults)
                          throws SearchException,
                                 DirectoryFailure
Search the collection of AgentDescriptions for all matching descriptions. Match on agent name, if agent name is null, then use agent nickname. Limit the returned results to the specified number.

Parameters:
desc - the AgentDescription to use for matching.
maxResults - the limit of returned results.
Returns:
AgentDescription[] containing the specified number, or less, of matching descriptions.
Throws:
SearchException - if an exception occurs during searching.
DirectoryFailure - if the directory service is not available.

modifyEntityProperties

public void modifyEntityProperties(java.lang.String entityGUID,
                                   java.util.List properties)
                            throws DirectoryFailure,
                                   NotRegisteredException,
                                   ModificationException
Modify properties of the entity identified by the given entityGUID.

Parameters:
entityGUID - String containing the entity GUID.
properties - List of Properties to be modified. Each Property contains the name, value, value description, modification type (add/remove/set, etc), modification result. Refer to the Property and ModificationResult interfaces for detailed description.
Throws:
DirectoryFailure - if the connection to the DS cannot be established.
NotRegisteredException - if the entity whose properties are to be modified has not been registered in the DS.
ModificationException - if one or more property update failed.

getGuardsForActorClass

public java.util.Vector getGuardsForActorClass(java.lang.String actorClassName)
Search for guards, which are interested in policies having this actor class (or its superclasses) as a subject

Parameters:
actorClassName - the name of the actor class
Returns:
Vector of guards ids

getGuardsForActionClass

public java.util.Vector getGuardsForActionClass(java.lang.String action)

isEntityInDomain

public boolean isEntityInDomain(java.lang.String domainName,
                                java.lang.String entityId)
Search for the domain entity with the specified id.

Parameters:
domainName - the name of the domain to query
entityId - The id of an entity to be searched in this domain directory.
Returns:
true if the entity whose id is specified is found; otherwise return false.
Throws:
java.lang.NullPointerException - if the id is null.

getAllAgentsInDomain

public java.util.Vector getAllAgentsInDomain(java.lang.String domainName)

getAllAgentsInDirectory

public java.util.Vector getAllAgentsInDirectory()
Get a Vector of descriptions of all agents in the directory.

Returns:
Vector of AgentDescriptions of all agents in the directory.

getAllDomainsInDirectory

public java.util.Vector getAllDomainsInDirectory()
Get a Vector of descriptions of all of the domains in a directory.

Returns:
Vector of AgentDescriptions of all agents in the specified domain.

getDomainStructure

public java.util.Map getDomainStructure(java.lang.String domainName)
Obtain a Map containing the structure of a domain.

Returns:
Map of: hosts -> execution environments -> containers -> agents

getDomainDescriptionsForGuard

public java.util.List getDomainDescriptionsForGuard(java.lang.String guardGUID)
Obtain a List containing DomainDescriptions of all domains the guard, whose GUID is specified, registered in.

Parameters:
guardGUID - GUID of the guard registered in all domains, whose descriptions are requested
Returns:
List of DomainDescriptions

removeExecEnv

public void removeExecEnv(java.lang.String execEnvID)
Retrieve a Hashtable containing information about a VM with the specified id from the _executionEnvs table and remove it.

Parameters:
execEnvID - the id of the VM to be removed from the _executionEnvs table.

getDomainNames

public java.util.Vector getDomainNames()
Obtain a List of the names of all registered domains.

Returns:
Vector of Strings of the names of domains registered in this Directory.

getRootDomains

public java.util.Vector getRootDomains()
Obtain an Enumeration of the names of the root domains (domains with no parent)

Returns:
Enumeration of Strings of the names of domains

getSubdomains

public java.util.Vector getSubdomains(java.lang.String domainName)
Obtain an Enumeration of the names of subdomains of a particular domain (returns immediate children only)

Returns:
Enumeration of Strings of the names of domains

getDomainDescription

public DomainDescription getDomainDescription(java.lang.String domainName)
Get the description of a domain

Parameters:
domainName - the name of the domain

getListOfLoadedOntologies

public java.util.Set getListOfLoadedOntologies()
This method returns a set of urls depicting ontologies loaded into the JTP.


getAllNamespaces

public java.util.Set getAllNamespaces()
This method returns a set of urls depicting ontologies loaded into the JTP as well namespaces used internally by KAoS.


getFilteredNamespaces

public java.util.Set getFilteredNamespaces()
This method returns a set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.


addFilteredNamespace

public void addFilteredNamespace(java.lang.String namespace)
This method add a nemaspace to the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.

Parameters:
namespace - The name of the namespace

removeFilteredNamespace

public void removeFilteredNamespace(java.lang.String namespace)
This method remove a nemaspace from the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.

Parameters:
namespace - The name of the namespace

getConstructedOntologyStructures

public java.util.List getConstructedOntologyStructures()
This method retrieves all user defined ontlogy structures in the repository.

Returns:
list containing SerializableOntModelImpl objects.

putConstructedOntologyStructures

public void putConstructedOntologyStructures(java.util.List ontologyStructureList)
                                      throws ReasoningException,
                                             java.io.IOException
This method stores multiple ontology structures in the repositiry.

Parameters:
ontologyStructureList - a list containing SerializableOntModelImpl objects.
Throws:
jtp.ReasoningException - or IOException when loading of the ontology failed.
ReasoningException
java.io.IOException

loadOntology

public void loadOntology(java.lang.String myURL,
                         boolean recursiveLoad)
                  throws ReasoningException,
                         java.io.IOException
Loads ontology from the provided url.

Parameters:
myURL - The url to the ontology
recursiveLoad - Indicates if the imported ontologies (by the ontology depicted by myURL) should also be recursively loaded.
Throws:
jtp.ReasoningException - or IOException when loading of the ontology failed.
ReasoningException
java.io.IOException

loadOntology

public void loadOntology(SerializableOntModelImpl myOntModel,
                         boolean recursiveLoad)
                  throws ReasoningException,
                         java.io.IOException
Adds ontology included in the provide objects into the ontology repository.

Parameters:
myOntModel - The object of type Jena OntModel containing the added ontology
recursiveLoad - Indicates if the imported ontologies (by the ontology contained in myOntModel) should also be recursively loaded.
Throws:
QueryFailure - or IOException when loading of the ontology failed.
ReasoningException
java.io.IOException

getInstancesOf

public java.util.Set getInstancesOf(java.lang.String conceptName)
                             throws UnknownConceptException
Get set of instances of the given concept; if the concept is an instance itself the set contains just this instance.

Parameters:
conceptName - The name of the concept
Returns:
Set of instance ids
Throws:
UnknownConceptException - if forActor is unknow for the ontology repository

getUltimateOntologyTypesOfIndividual

public java.util.Set getUltimateOntologyTypesOfIndividual(java.lang.String individualName)
                                                   throws UnknownConceptException
Finds the ultimate Ontology type of the provided individual

Parameters:
individualName - the name of the individual
Returns:
the set of names of the Ontology classes being the most narrow ones for the given individual
Throws:
individualName - if concept unknow or any problem with JTP approached
UnknownConceptException

getSuperClassesOf

public java.util.Set getSuperClassesOf(java.lang.String className)
                                throws UnknownConceptException
Get set of superclasses of the given class.

Parameters:
className - The name of the class
Returns:
Set of superclasses names
Throws:
UnknownConceptException - if className is unknow for the ontology repository

getSubClassesOf

public java.util.Set getSubClassesOf(java.lang.String className)
                              throws UnknownConceptException
Get set of subclasses of the given class.

Parameters:
className - The name of the class
Returns:
Set of subclasses names
Throws:
UnknownConceptException - if className is unknow for the ontology repository

getSuperPropertiesOf

public java.util.Set getSuperPropertiesOf(java.lang.String propertyName)
                                   throws UnknownConceptException
Get set of superproperties of the given property.

Parameters:
propertyName - The name of the property in Jena format
Returns:
Set of superproperties names in Jena format
Throws:
java.lang.Exception - if propertyName is unknow for the ontology repository
UnknownConceptException

getSubPropertiesOf

public java.util.Set getSubPropertiesOf(java.lang.String propertyName)
                                 throws UnknownConceptException
Get set of subproperties of the given property.

Parameters:
propertyName - The name of the property in Jena format
Returns:
Set of subproperties names in Jena format
Throws:
java.lang.Exception - if propertyName is unknow for the ontology repository
UnknownConceptException

testTrue

public boolean testTrue(java.lang.String statement)
                 throws QueryFailure
Test if the KIF statemant is true according to the ontologies in the ontology repository.

Parameters:
statement - to be tested for thruth
Returns:
true if the statement is true and false in the opposite case
Throws:
QueryFailure - if reasoning failed

getUniqueValueForProperty

public java.lang.String getUniqueValueForProperty(java.lang.String property,
                                                  java.lang.String subject)
                                           throws QueryFailure
Get a single value of the variable satisfing the KIF query: (property subject ?val).

Parameters:
property - the name of the property
subject - the name of the subject
Returns:
a single value for the property on this subject
Throws:
QueryFailure - if reasoning failed.

getValuesForProperty

public java.util.Set getValuesForProperty(java.lang.String property,
                                          java.lang.String subject)
                                   throws QueryFailure
Get values of the variable satisfing the KIF query: (property subject ?val).

Parameters:
property - the name of the property
subject - the name of the subject
Returns:
a set with values for the property on this subject
Throws:
QueryFailure - if reasoning failed.

getResourcesWithValueForProperty

public java.util.Set getResourcesWithValueForProperty(java.lang.String property,
                                                      java.lang.String value)
                                               throws QueryFailure
Get values of the variable satisfing the KIF query: (property ?subject value).

Parameters:
property - the name of the property
value - the value as a string
Returns:
a set with name of subjects which have the specified value for the given property
Throws:
QueryFailure - if reasoning failed.

getPropertiesApplicableTo

public java.util.Vector getPropertiesApplicableTo(java.lang.String className)
                                           throws UnknownConceptException
Get set of properties defined in the given namespace.

Parameters:
className - the name of the class
Returns:
set of properties names
Throws:
UnknownConceptException - if className is unknow for the ontology repository

getRangeOnPropertyForClass

public java.lang.String getRangeOnPropertyForClass(java.lang.String className,
                                                   java.lang.String propertyName)
                                            throws UnknownConceptException
Get the name of the class defining the range of the specified property for the given class.

Parameters:
className - the name of the class
propertyName - the name of the property
Returns:
the name of the class defining the range
Throws:
UnknownConceptException - if reasoning failed.

askQuery

public java.util.Set askQuery(java.lang.String variableName,
                              java.lang.String multiplyVariablesQuery)
                       throws QueryFailure
Get values of the selected variable satisfing the KIF query with possibly many variable.

Parameters:
variableName - the neame ofthe selected variable
multiplyVariablesQuery - the query
Throws:
QueryFailure - if reasoning failed.

areClassesDisjoint

public boolean areClassesDisjoint(java.lang.String firstClass,
                                  java.lang.String secondClass)
                           throws QueryFailure
Test if two provided classes are disjoint

Parameters:
firstClass - the name of the first class
secondClass - the name of the second class
Throws:
QueryFailure - if reasoning failed.

getClassesDefInNamespace

public java.util.Set getClassesDefInNamespace(java.lang.String namespaceName)
                                       throws UnknownNamespaceException
Get set of classes defined in the given namespace.

Parameters:
namespaceName - The name of the namespace
Returns:
Set of classes names
Throws:
UnknownNamespaceException - if namespaceName is unknow for the ontology repository

getPropertiesDefInNamespace

public java.util.Set getPropertiesDefInNamespace(java.lang.String namespaceName)
                                          throws UnknownNamespaceException
Get set of properties defined in the given namespace.

Parameters:
namespaceName - The name of the namespace
Returns:
Set of properties names
Throws:
UnknownNamespaceException - if namespaceName is unknow for the ontology repository

getInstancesDefInNamespace

public java.util.Set getInstancesDefInNamespace(java.lang.String namespaceName)
                                         throws UnknownNamespaceException
Get set of instances defined in the given namespace.

Parameters:
namespaceName - The name of the namespace
Returns:
Set of instances names
Throws:
UnknownNamespaceException - if namespaceName is unknow for the ontology repository

getNamspacesImportedByNamespace

public java.util.Set getNamspacesImportedByNamespace(java.lang.String namespaceName)
                                              throws UnknownNamespaceException
Get set of namspaces imported by the given namespace.

Parameters:
namespaceName - The name of the namespace
Returns:
Set of namspaces names
Throws:
UnknownNamespaceException - if namespaceName is unknow for the ontology repository

getOntologyDefinitionForConcept

public java.util.Set getOntologyDefinitionForConcept(java.lang.String conceptName)
Tries to find an ontology definition of the search concept. Curently it tries to match the concept name with the local name of the ontology definitions url

Parameters:
conceptName - The name of the search concept
Returns:
Set of url depicting ontology concept potentially matching the search concept

getIndividualActors

public java.util.Set getIndividualActors(java.lang.String baseActorClass)
                                  throws UnknownConceptException
Get names of the individual Actors known to the ontology repository being an instance of the specified base class.

Parameters:
baseActorClass - The name of the Actor class which the return elements have to be an instance of If the name is empty uses Actors as a base class
Returns:
Set of names of individual Actors
Throws:
UnknownConceptException - if baseActorClass is unknow for the ontology repository

getClassesOfActors

public java.util.Set getClassesOfActors(java.lang.String baseActorClass)
                                 throws UnknownConceptException
Get names of the Actors classes known to the ontology repository being a subclass of the specified base class.

Parameters:
baseActorClass - The name of the Actor class which the return classes have to be a subclass of If the name is empty uses Actors as a base class
Returns:
Set of names of Actors subclasses
Throws:
UnknownConceptException - if baseActorClass is unknow for the ontology repository

getIndividualPlaces

public java.util.Set getIndividualPlaces(java.lang.String basePlaceClass)
                                  throws UnknownConceptException
Get names of the individual Places known to the ontology repository being an instance of the specified base class.

Parameters:
basePlaceClass - The name of the Place class which the return elements have to be an instance of If the name is empty uses Place as a base class
Returns:
Set of names of individual Places
Throws:
UnknownConceptException - if basePlaceClass is unknow for the ontology repository

getClassesOfPlaces

public java.util.Set getClassesOfPlaces(java.lang.String basePlaceClass)
                                 throws UnknownConceptException
Get names of the Places classes known to the ontology repository being a subclass of the specified base class.

Parameters:
basePlaceClass - The name of the Place class which the return classes have to be a subclass of If the name is empty uses Place as a base class
Returns:
Set of names of Place subclasses
Throws:
UnknownConceptException - if basePlaceClass is unknow for the ontology repository

getIndividualGroups

public java.util.Set getIndividualGroups(java.lang.String baseGroupClass)
                                  throws UnknownConceptException
Get names of the individual Groups known to the ontology repository being an instance of the specified base class.

Parameters:
baseGroupClass - The name of the Group class which the return elements have to be an instance of If the name is empty uses Group as a base class
Returns:
Set of names of individual Groups
Throws:
UnknownConceptException - if baseGroupClass is unknow for the ontology repository

getClassesOfGroups

public java.util.Set getClassesOfGroups(java.lang.String baseGroupClass)
                                 throws UnknownConceptException
Get names of the Group classes known to the ontology repository being a subclass of the specified base class.

Parameters:
baseGroupClass - The name of the Group class which the return elements have to be an instance of If the name is empty uses Group as a base class
Returns:
Set of names of individual Groups
Throws:
UnknownConceptException - if baseGroupClass is unknow for the ontology repository

getIndividualTargets

public java.util.Set getIndividualTargets(java.lang.String baseTargetClass)
                                   throws UnknownConceptException
Get names of the individual targets (Actors, Entities, etc.) known to the ontology repository being an instance of the specified base class.

Parameters:
baseTargetClass - The name of the targets (Actors or Entities) class which the return classes have to be a subclass of If the name is empty uses Target as a base class
Returns:
Set of names of individual targets (Actors or Entities)
Throws:
UnknownConceptException - if baseTargetClass is unknow for the ontology repository

getClassesOfTargets

public java.util.Set getClassesOfTargets(java.lang.String baseTargetClass)
                                  throws UnknownConceptException
Get names of the targets (Actors, Entities, etc.) classes known to the ontology repository being a subclass of the specified base class.

Parameters:
baseTargetClass - The name of the targets (Actors or Entities) class which the return classes have to be a subclass of If the name is empty uses Target as a base class
Returns:
Set of names of targets (Actors or Entities) subclasses
Throws:
UnknownConceptException - if baseTargetClass is unknow for the ontology repository

declareInstance

public void declareInstance(java.lang.String instanceName,
                            java.lang.String className)
                     throws QueryFailure
Create an instance of the given class.

Parameters:
instanceName - The name of the new instance
className - The name of the class
Throws:
QueryFailure - if creation failed

getActions

public java.util.Set getActions(java.lang.String forActor)
                         throws UnknownConceptException
Get descriptions of the Action classes the specified Actor class or instance can perfom based on its class.

Parameters:
forActor - The name of the Actor class or instance
Returns:
Set of ActionClassDescription
Throws:
UnknownConceptException - if forActor is unknow for the ontology repository

getClassesOfActorsCapableOfPerformingActions

public java.util.Set getClassesOfActorsCapableOfPerformingActions(java.lang.String actionClass)
                                                           throws UnknownConceptException,
                                                                  DirectoryFailure
Get names of Actor classes capable to perform a given action, without taking into consideration policy restrictions

Parameters:
actionClass - The name of the Action class
Returns:
Set of Strings containg names of Actor classes
Throws:
UnknownConceptException - if actionClass is unknow for the ontology repository
DirectoryFailure

updatePolicies

public void updatePolicies(java.util.List addedPolicies,
                           java.util.List changedPolicies,
                           java.util.List removedPolicies)
                    throws OntologyPolicyIncorrect,
                           PoliciesHarmonizedException,
                           PrecedenceUndeterminedException
Transactional update the state of PolicyDirectory

Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

addPolicy

public void addPolicy(Msg _policy)
               throws OntologyPolicyIncorrect,
                      PoliciesHarmonizedException,
                      PrecedenceUndeterminedException
Add policy to the PolicyDirectory

Parameters:
policy - The Msg containing policy definition for a given entity.
Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

addPolicies

public void addPolicies(java.util.Vector policies)
                 throws OntologyPolicyIncorrect,
                        PoliciesHarmonizedException,
                        PrecedenceUndeterminedException
Each element of the Vector is a definition of a policy to be added to the collection of policies of the entity associated with that policy.

Parameters:
policies - The Vector of policies to be added to policies of their corresponding entities.
Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

removePolicy

public void removePolicy(Msg _policy)
Remove policy from the collection of policies of the entity associated with that policy.

Parameters:
policy - The Msg containing policy definition to be removed.

removePolicies

public void removePolicies(java.util.List policies)
Each element of the Vector is a definition of a policy to be removed from the collection of policies of the entity associated with that policy.

Parameters:
policies - The Vector of policies to be removed from policies of their corresponding entities.

changePolicy

public void changePolicy(Msg policy)
                  throws OntologyPolicyIncorrect,
                         PoliciesHarmonizedException,
                         PrecedenceUndeterminedException
Change policy of the entity associated with that policy.

Parameters:
policy - The Msg containing policy definition to be changed for a given entity.
Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

changePolicies

public void changePolicies(java.util.Vector policies)
                    throws OntologyPolicyIncorrect,
                           PoliciesHarmonizedException,
                           PrecedenceUndeterminedException
Each element of the Vector is a definition of a policy to replace its current definition in the collection of policies of the entity associated with that policy.

Parameters:
policies - The Vector of policies to replace their current definitions.
Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

getPolicy

public Msg getPolicy(java.lang.String policyId)
Obtain a policy based on id

Returns:
the requested policy

getPolicies

public java.util.List getPolicies()
Obtain an Vector over all policies. Each element of the Vector is an instance of a Msg class specifying an individual policy definition.

Returns:
List of PolicyMsg.

getPoliciesByEntities

public java.util.Map getPoliciesByEntities()
Obtain a table of all original policies (pre-deconfliction and Ontology->XML conversion) in the system, indexed by the id(s) of the entity(s) to which they apply

Returns:
Map of Map of policies key = String representing entity id value = Map of policies that are directly applicable to the entity (see comments for getPoliciesForEntity for the meaning of "directly applicable") key = String representing policy id value = PolicyMsg

getPoliciesForEntity

public java.util.Vector getPoliciesForEntity(java.lang.String id)
Obtain an Vector over all policies associated with an entity whose id is specified. Obtain the original (pre-deconfliction and Ontology->XML conversion) policies directly applicable to the specified entity This method does not return all policies applicable to the entity (e.g., if you specified the id of an agent, it would only return policies for that agent, *not* including policies for the agent container, exec env, host, domain, which apply to the agent)

Parameters:
id - The String containing the id of entity whose policies are being requested.
Returns:
Vector of PolicyMsg.

getApplicablePoliciesForEntity

public java.util.Vector getApplicablePoliciesForEntity(java.lang.String entityId)
Obtain the set of policies directly and indirectly applicable to a specified entity. This method returns all policies applicable to the entity (e.g., if you specified the id of an agent, it would return the policies for the agent, plus policies for the agent container, exec env, host, domain, which apply to the agent), also not in force now.

Parameters:
entityId - id of the entity
Returns:
Vector of PolicyMsg

getApplicablePoliciesForEntityClass

public java.util.Vector getApplicablePoliciesForEntityClass(java.lang.String classOfEntitiesName)
Obtain the set of policies directly and indirectly applicable to a specified class of entities. This method returns all policies applicable to the class of entities (also not in force now).

Parameters:
classOfEntitiesName - name of the class of entities
Returns:
vector of PolicyMsg

getConditionalPolicies

public java.util.Vector getConditionalPolicies()
Support for conditional policies - not currently present in Ontology


setConditionalPolicies

public void setConditionalPolicies(java.util.Vector condPols)

addPolicySet

public void addPolicySet(Msg policySet)
BEGIN - kaos.policy.management.PolicySetDirectory interface implementation


addPolicySets

public void addPolicySets(java.util.Vector policySets)
Each element of the Vector is an instance of a Msg class specifying an individual policy set fields

Parameters:
policySets - The Vector of policies set to be added to the collection of all policies.

removePolicySet

public void removePolicySet(Msg policySet)

removePolicySets

public void removePolicySets(java.util.Vector policySets)

changePolicySet

public void changePolicySet(Msg policySet)

changePolicySets

public void changePolicySets(java.util.Vector policySets)

getPolicySets

public java.util.List getPolicySets()
Obtain a Vector over all policy sets.

Returns:
List of policy set Msgs.

getPolicySet

public PolicySetMsg getPolicySet(java.lang.String policySetId)

isPolicyInConflict

public boolean isPolicyInConflict(java.lang.String policyId)
Method finds out if the specified policy is in conflict with some policies with the same priority in the repository

Parameters:
policyId - id of the policy
Returns:
true if in conflict, false if not

findConflictingPolicies

public java.util.List findConflictingPolicies(java.lang.String policyId)
Method find all the policies conflicting with the specified policy

Parameters:
policyId - id of the policy
Returns:
List of Policy Ids

isFullyOverlappedBySecondPolicy

public boolean isFullyOverlappedBySecondPolicy(java.lang.String firstPolicyId,
                                               java.lang.String secondPolicyId)
                                        throws PriorityConditionNotMet
Method finds out if the specified policy is fully overlapped by the second specified policy, the necessary condition is that the two policies have the same modality

Parameters:
firstPolicyId - id of the policy
secondPolicyId - id of the policy
Returns:
true if fully covered, false is not
Throws:
PriorityConditionNotMet

isPartiallyOverlappedBySecondPolicy

public boolean isPartiallyOverlappedBySecondPolicy(java.lang.String firstPolicyId,
                                                   java.lang.String secondPolicyId)
                                            throws PriorityConditionNotMet
Method finds out if the specified policy is partially overlapped by the second specified policy, the necessary condition is that the two policies have the same modality

Parameters:
firstPolicyId - id of the policy
secondPolicyId - id of the policy
Returns:
true if fully covered, false is not
Throws:
PriorityConditionNotMet

isFullyOverlappedByUnionOfPolicies

public boolean isFullyOverlappedByUnionOfPolicies(java.lang.String firstPolicyId,
                                                  java.util.List listOfPolicies)
                                           throws PriorityConditionNotMet
Method finds out if the specified policy is fully overlapped by the union of specified policies, the necessary condition is that the all policies have the same modality

Parameters:
firstPolicyId - id of the policy
listOfPolicies - list of policies
Returns:
true if fully covered, false is not
Throws:
PriorityConditionNotMet

isPolicyRedundant

public boolean isPolicyRedundant(java.lang.String policyId)
Method finds out if the specified policy is beign made redundant (fully or partially) by some policies with higher priority in the repository

Parameters:
policyId - id of the policy
Returns:
true if redundant, false is not

findPoliciesMakingRedundant

public java.util.List findPoliciesMakingRedundant(java.lang.String policyId)
Method find all the policies with higher priority making the specified policy redundant

Parameters:
policyId - id of the policy
Returns:
List of Policy Ids

isPolicyMakingRedundantSomeOtherPolicy

public boolean isPolicyMakingRedundantSomeOtherPolicy(java.lang.String policyId)
Method finds out if the specified policy makes redundant (fully or partially) some policies with lower priority in the repository

Parameters:
policyId - id of the policy
Returns:
true if redundant, false is not

findPoliciesMadeRedundant

public java.util.List findPoliciesMadeRedundant(java.lang.String policyId)
Method find all the policies with higher priority making the specified policy redundant

Parameters:
policyId - id of the policy
Returns:
List of Policy Ids

isMadeFullyRedundantBySecond

public boolean isMadeFullyRedundantBySecond(java.lang.String firstPolicyId,
                                            java.lang.String secondPolicyId)
                                     throws PriorityConditionNotMet
Method finds out if the specified policy is beign made redundant (fully coverd) by the second specified policy with higher priority in the repository

Parameters:
firstPolicyId - id of the policy
secondPolicyId - id of the policy
Returns:
true if redundant, false is not
Throws:
PriorityConditionNotMet

isMadeParitallyRedundantBySecond

public boolean isMadeParitallyRedundantBySecond(java.lang.String firstPolicyId,
                                                java.lang.String secondPolicyId)
                                         throws PriorityConditionNotMet
Method finds out if the specified policy is beign made partially redundant (partially coverd) by the second specified policy with higher priority in the repository

Parameters:
firstPolicyId - id of the policy
secondPolicyId - id of the policy
Returns:
true if redundant, false is not
Throws:
PriorityConditionNotMet

isMadeFullyRedundantByPolicyUnion

public boolean isMadeFullyRedundantByPolicyUnion(java.lang.String firstPolicyId,
                                                 java.util.List listOfPolicies)
                                          throws PriorityConditionNotMet
Method finds out if the specified policy is beign made redundant (fully coverd) by the union of specified policies with higher priority in the repository

Parameters:
firstPolicyId - id of the policy
listOfPolicies - list of policies
Returns:
true if redundant, false is not
Throws:
PriorityConditionNotMet

changedPriority

public void changedPriority(java.lang.String policyId,
                            int newPriority)
Method allowing to modify priority of a policy to either eliminate conflict or to alter policy precedence relation

Parameters:
policyId - id of the policy
newPriority - new priority of the policy

harmonizePolicy

public java.util.List harmonizePolicy(java.lang.String harmonizedPolicy,
                                      java.lang.String harmonizingPolicy)
Method deconflicting the added policy with policies currently in the Policy Directory

Parameters:
harmonizedPolicy - id of the policy to be harmonized.
harmonizingPolicy - id of the policy harmonizing the first policy
Returns:
List containg ids of policies representing the result of harmonization

splitPolicy

public java.util.List splitPolicy(java.lang.String splitPolicy,
                                  java.lang.String secondPolicy)
Method spliting the controlled action of the selected policy one part that overlaps with the second policy and the other part which does not. Then the priorities of these parts can be modified independently

Parameters:
splitPolicy - id of the policy to be split.
secondPolicy - id of the policy splitting the first policy
Returns:
List containg ids of policies representing the result of process

getAbsoluteObligationsForTriggerConditionForAC

public java.util.Vector getAbsoluteObligationsForTriggerConditionForAC(java.lang.String triggerAC)
                                                                throws ServiceFailure
Based on the specified trigger ActionClassDescription, select all absolute classes of obligations

Parameters:
triggerACD - OWL string describes a class of the trigger condition
Returns:
A Vector of PolicyInformation objects
Throws:
ServiceFailure

checkAbsolutePermission

public void checkAbsolutePermission(java.lang.String checkedActionClass)
                             throws KAoSSecurityException,
                                    java.lang.NullPointerException,
                                    ServiceFailure
The method check if the given action class is absolutly permitted according to the current set of policies

Parameters:
checkedActionClass - String containg OWL defiition of the action to be checked.
Throws:
KAoSSecurityException - if the action is not allowed.
java.lang.NullPointerException - if the submitted argument is null.
ServiceFailure