kaos.core.service.directory
Class KAoSDirectoryService

java.lang.Object
  extended by kaos.core.service.directory.KAoSDirectoryService
All Implemented Interfaces:
KAoSObservable, KAoSObserver, OntologyService, PolicyAdvice, PolicyChecking, PolicyManagement, AuthenticationInterface, DirectoryEventNotifier, DirectoryService, DomainDirectoryService, DomainManagerEventNotifier, DefinedPolicyTemplateInterface, OntologyRepositoryService, QueryKAoSOntologyService, GuardSynchronization, PolicyAnalyzes, PolicyModification, PolicySetDirectory, XMLRepository
Direct Known Subclasses:
GridDirectoryServicePolicyCert

public class KAoSDirectoryService
extends java.lang.Object
implements DirectoryService, DomainManagerEventNotifier, OntologyService, XMLRepository, DirectoryEventNotifier, KAoSObservable, KAoSObserver, GuardSynchronization, AuthenticationInterface, DefinedPolicyTemplateInterface

$Revision: 1.305 $


Nested Class Summary
static class KAoSDirectoryService.OperationWaiter
           
 
Nested classes/interfaces inherited from interface kaos.core.csi.policy.PolicyManagement
PolicyManagement.OntologyPolicyIncorrect, PolicyManagement.PrecedenceUndeterminedException
 
Nested classes/interfaces inherited from interface kaos.policy.management.PolicyAnalyzes
PolicyAnalyzes.PriorityConditionNotMet
 
Field Summary
protected  AgentName _agentName
           
protected static boolean _allowForReregistration
           
protected  boolean _allowReregistration
           
protected  java.util.Map<java.lang.String,KAoSAuthenticationObject> _authenticationDatabase
           
protected  java.util.Map<java.lang.String,PolicyTemplate> _definedTemplateObjectTable
           
protected static boolean _distributed
           
protected static boolean _guarded
           
protected  boolean _guardRegistered
           
protected static boolean _localServlet
           
protected  Locator _locator
           
protected static boolean _logDomainEvents
           
protected  MessageReceiver _messageReceiver
           
protected  MessageTransportService _mts
           
protected static java.lang.String _name
           
protected static java.lang.String _nameOfTransport
           
protected  java.lang.String _nickName
           
protected  java.util.Hashtable _observers
           
protected static java.lang.String _subscribeTo
           
protected  TransportSystem _transportSystem
           
protected static java.lang.String _useForJTP
           
static java.lang.String AGENTS
           
static java.lang.String CONTAINERS
           
static java.lang.String DOMAIN_NAME
           
static java.lang.String FORWARDED_KEY
           
static java.lang.String GUARDED_ACTION_SUBCLASSES_OF_INTEREST
           
static java.lang.String GUARDED_AGENTS
           
static java.lang.String GUARDED_CLASS_RANGES_OF_INTEREST
           
static java.lang.String GUARDED_CONTAINERS
           
static java.lang.String GUARDED_ENTITIES
           
static java.lang.String GUARDED_EXEC_ENVS
           
static java.lang.String GUARDED_HOSTS
           
static OntologyService localOntologyInterfaces
           
static java.lang.String LOCATOR_NAME
           
static java.lang.String MY_DESCRIPTION
           
static java.lang.String MY_GUARDS
           
static java.lang.String REGISTRATION_REPLACE_FLAG
           
static java.lang.String RUNNING_ENTITIES
           
static java.lang.String UNGUARDED_AGENTS
           
static java.lang.String UNGUARDED_CONTAINERS
           
static java.lang.String UNGUARDED_EXEC_ENVS
           
static java.lang.String UNGUARDED_HOSTS
           
 
Constructor Summary
KAoSDirectoryService()
           
 
Method Summary
 void addAuthenticationObject(KAoSAuthenticationObject kao)
          Allows to add an authentication object to the Directory Service database.
 void addDefinedPolicyTemplate(PolicyTemplate definedTemplate)
           
 void addEntityOntologicalType(java.lang.String entityNameAsString, java.lang.String typeName, java.lang.String damlDesc)
           
 void addEventListener(DirectoryEventListener listener)
           
 void addEventListener(DomainManagerEventListener listener)
          Add an event listener to the collection of objects to be notified by the Domain Manager about a domain event.
 void addFilteredNamespace(java.lang.String namespace)
          This method add a namespace 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.List<PolicyMsg> policies)
           
 void addPolicy(PolicyMsg policy)
           
 void addPolicy(java.lang.String owlPolicyDescription)
           
 void addPolicySet(PolicySetMsg policySet)
           
 void addPolicySets(java.util.List<PolicySetMsg> policySets)
           
 void addPolicyUpdateListener(PolicyListener listener)
           
 void addRemoteEventListener(Locator l)
           
 void allowReregistration(boolean allow)
           
 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 satisfying the KIF query with possibly many variable.
protected  Locator bindToMessageTransportService(MessageTransportService mts)
           
protected  void bindToMTS()
           
 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.List<PolicyMsg> policies)
           
 void changePolicy(PolicyMsg policy)
           
 void changePolicy(java.lang.String policyID, java.lang.String owlPolicyDescription)
           
 void changePolicySet(PolicySetMsg policySet)
           
 void changePolicySets(java.util.List<PolicySetMsg> policySets)
           
 void checkAbsolutePermission(java.lang.String checkedActionClass)
           
 void checkDeepPermission(ActionInstanceDescription actionDesc, PolicyDecisionObserver pObserver)
           
 void checkPermission(ActionInstanceDescription actionDesc, PolicyDecisionObserver pObserver)
           
 AgentDescription createAgentDescription()
           
protected  java.lang.String createMyDomain()
           
 void declareInstance(java.lang.String instanceName, java.lang.String className)
           
 void declareInstance(java.lang.String instanceName, java.lang.String className, boolean rehydrating)
           
 void deregister(AgentDescription desc)
           
 void deregisterObserver(java.lang.String updateType, java.lang.Object updateCondition, KAoSObserver observer)
          Deregister the given KAoSObserver for the given update type from the registry of observers associated with this KAoSObservable.
protected  void distributePolicyUpdate(java.util.List<PolicyMsg> addedPolicies, java.util.List<PolicyMsg> changedPolicies, java.util.List<PolicyMsg> removedPolicies, boolean setPolicies)
           
 void editAuthenticationObject(KAoSAuthenticationObject kao)
          Allows to edit an authentication object at the Directory Service database.
 void editDefinedPolicyTemplate(PolicyTemplate definedTemplate)
           
 boolean equals(java.lang.Object obj)
           
protected  DefaultKAoSAgentDescription establishAgentDescription(KAoSServiceRoot ksr)
           
 java.util.List findConflictingPolicies(java.lang.String policyId)
          Method find all the policies conflicting with the specified policy
 java.util.List<PolicyMsg> findPolicies(java.lang.String actionType, java.util.Map<java.util.List<java.lang.String>,java.lang.String> policyRestrictions)
           
 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.List<ActionInstanceDescription> findPolicyDecision(ActionInstanceDescription actionDesc, PolicyDecisionObserver pObserver)
           
 java.util.Vector getAbsoluteObligationsForTriggerConditionForAC(java.lang.String triggerAC)
           
 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.
 AgentDescription getAgentDescription(java.lang.String agentName)
           
 KAoSAgentDescription getAgentDescriptionForAgentID(java.lang.String agentID)
           
 java.util.List getAllAgentsInDirectory()
          Get a Vector of descriptions of all agents in the directory.
 java.util.Vector getAllAgentsInDomain(java.lang.String domainName)
          Get a Vector of descriptions of all of the agents in a domain.
 java.util.Map<java.lang.String,KAoSAuthenticationObject> getAllAuthenticationObjects()
          Allows to get all the authentication objects from the Directory Service database.
 java.util.Map<java.lang.String,PolicyTemplate> getAllDefinedPolicyTemplate()
           
 java.util.Vector getAllDomainsInDirectory()
          Get a Vector of descriptions of all of the domains in a directory.
 java.util.List getAllGuardsInDirectory()
          Get a Vector of descriptions of all guards in the 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 getAllowableValuesForActionProperties(ActionInstanceDescription actionDesc, PolicyDecisionObserver pObserver)
           
 java.util.Vector getAllowableValuesForActionProperties(java.util.Vector propertyNames, ActionInstanceDescription actionDesc, boolean tight, PolicyDecisionObserver pObserver)
           
 java.util.Vector getAllowableValuesForActionProperties(java.util.Vector propertyNames, ActionInstanceDescription actionDesc, java.lang.Boolean tight, PolicyDecisionObserver pObserver)
           
 java.util.Set getAllowableValuesForActionProperty(java.lang.String origPropertyName, ActionInstanceDescription origActionDesc, java.util.Set allTargetValues, boolean tight, PolicyDecisionObserver pObserver)
           
 java.util.List<PolicyMsg> getAllPoliciesFor(java.lang.String conceptId)
           
 java.util.List getAllSchema()
          Retrieve all schemas in the repository.
 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 or Entities) classes known to the ontology repository being a subclass of the specified base class.
 java.util.Vector getConditionalPolicies()
           
 SerializableOntModelImpl getConstructedOntologyStructure(java.lang.String structureId)
          This method get stored ontology structure references by its id in the repository.
 java.util.List getConstructedOntologyStructures()
          This method retrieves all user defined ontology structures in the repository.
 java.util.List<PolicyMsg> getDirectPoliciesFor(java.lang.String id)
           
 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()
           
 java.util.Map getDomainStructure(java.lang.String domainName)
          Obtain a Map containing the structure of a domain.
 java.lang.String getExpandedProperty(java.lang.String key)
           
 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 getForbiddenValuesForActionProperty(java.lang.String origPropertyName, ActionInstanceDescription origActionDesc, PolicyDecisionObserver pObserver)
           
 java.util.Vector getGuardDescriptionsForEntity(java.lang.String entityID)
           
 java.util.Map getGuardInfo(java.lang.String guardId)
           
 java.util.Enumeration getGuards()
           
 java.lang.String getID()
          Return the unique identifier of this observer.
 java.util.Set getImmediateSubClassesOf(java.lang.String className)
          Get set of immediate subclasses of the given class.
 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 or Entities) known to the ontology repository being an instance of the specified base class.
static KAoSDirectoryService getInstance()
           
 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 Ontology Service
 java.util.Set getNamspacesImportedByNamespace(java.lang.String namespaceName)
          Get set of namespaces imported by the given namespace.
 java.util.List<ActionInstanceDescription> getObligationsForTriggerCondition(ActionInstanceDescription triggerAID, PolicyDecisionObserver pObserver)
           
 java.util.Set getOntologyDefinitionForConcept(java.lang.String conceptName)
          Get set of urls for the given short concept name.
 java.util.List getPolicies()
           
 java.util.Map getPoliciesByEntities()
           
 PolicyMsg getPolicy(java.lang.String policyId)
           
 PolicySetMsg getPolicySet(java.lang.String policySetId)
           
 java.util.List<PolicySetMsg> getPolicySets()
          Obtain List over all policy sets.
 java.lang.Integer getPolicyUpdateCount()
           
 java.util.List<java.lang.String> 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 getProperty(java.lang.String key)
           
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
           
 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 propertyName, java.lang.String value)
          Get values of the variable satisfying the KIF query: (property ?subject value).
 java.util.Vector getRootDomains()
          Obtain a Vector of the names of the root domains (domains with no parent)
 java.util.List<java.lang.String> getSchema(java.lang.String dataName)
          Get XML schema of the given concept if such a schema is available
 ServiceProperties getServiceProperties()
           
 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 a Vector 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 propertyName, java.lang.String subjectName)
          Get a single value of the variable satisfying the KIF query: (property subject ?val).
 java.util.Set getValuesForProperty(java.lang.String propertyName, java.lang.String subjectName)
          Get values of the variable satisfying the KIF query: (property subject ?val).
protected  void handleDirectoryEvent(DirectoryEvent event)
           
 java.util.List harmonizePolicy(java.lang.String harmonizedPolicy, java.lang.String harmonizingPolicy)
          Method deconflicting the added policy with policies currently in the Policy Directory
 int hashCode()
           
protected  void initConfig()
           
 void initialize(ServiceRoot sr, java.lang.String nickname, boolean useJTP, java.lang.String ontologySetName)
           
 void initialize(ServiceRoot sr, java.lang.String nickname, boolean useJTP, java.lang.String ontologySetName, JasBean entityEnv, DomainDescription myDomain, java.util.List ontologies, PersistenceManager persistMgr)
           
 java.util.List<OntClassPropertyDescription> initiateActionClassTargets(java.lang.String actionClassName, java.lang.String actorClassName)
          Get properties applicable to the action class
 void instancesSetSynchronizationRequest(java.util.List<java.lang.String> myCurrentInstancesClassesURL, java.util.List<java.lang.Long> myCurrentInstancesSetsTimeStamps)
          Send a list of the current classes for which instances set are stored in the Guard and associated with them timestamps in the second list.
 boolean isEntityInDomain(java.lang.String domainName, java.lang.String id)
          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<java.lang.String> 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<java.lang.String> listOfPolicies)
          Method finds out if the specified policy is being made redundant (fully covered) 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 being made redundant (fully covered) 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 being made partially redundant (partially covered) 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)
           
 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 being made redundant (fully or partially) by some policies with higher priority in the repository
 boolean isSynchronizationNeeded(java.lang.Long myLastUpdateTimeStamp)
          Check with DS if synchronization is needed by providing the timestamp of the last update.
 boolean isUsernameRegistered(java.lang.String userid, java.lang.String password)
          Checks if the username is in the Directory Service database.
 void loadOntologies(java.util.List<SerializableOntModelImpl> myOntModels, boolean recursiveLoad)
          Adds ontology included in the provide objects into the ontology repository.
 void loadOntologies(java.util.List<SerializableOntModelImpl> myOntModels, java.lang.Boolean recursiveLoad)
           
 void loadOntology(SerializableOntModelImpl myOntModel, boolean recursiveLoad)
          Adds ontology included in the provide objects into the ontology repository.
 void loadOntology(SerializableOntModelImpl myOntModel, java.lang.Boolean recursiveLoad)
           
 void loadOntology(SerializableOntModelImpl myOntModel, boolean recursiveLoad, boolean rehydrating)
           
 void loadOntology(java.lang.String loadedOWL)
          Loads ontology in OWL into the repository of the Ontology Service
 void loadOntology(java.lang.String myURL, boolean recursiveLoad)
          Loads ontology from the provided url.
 void loadOntology(java.lang.String myURL, java.lang.Boolean recursiveLoad)
           
 void loadSchema(java.lang.String fileName)
          Load schema definitions of data types from a file.
static void main(java.lang.String[] args)
           
 void modify(AgentDescription desc)
           
 void modifyEntityProperties(java.lang.String entityGUID, java.util.List<Property> properties)
           
 void notify(java.lang.String updateType, java.lang.Object updateCondition, java.lang.Object update)
          Notify observers interested in the given updateType wiht the given update object.
protected  JasBean obtainCoordinatorEnv()
           
protected  JasBean obtainEntityEnv()
           
 void policiesSynchronizationRequest(java.util.List<java.lang.String> myCurrentPoliciesIds, java.util.List<java.lang.Long> myCurrentPoliciesTimeStamps)
          Send a list of the current policies ids and associated with them timestamps in the second list.
 void processForwardingRequest(java.lang.String receiverID, MethodCallRequestMsg rqst, kaos.core.service.directory.KAoSDirectoryService.InvocationInfo info)
           
 void putConstructedOntologyStructures(java.util.List<SerializableOntModelImpl> ontologyStructureList)
          This method stores multiple ontology structures in the repository.
 void putMultipleSchema(java.util.List<XMLSchemaContainer> schemaList)
          Store multiple schemas in the repository.
 void putSchema(java.lang.String dataName, java.lang.String dataSchema)
          Add an XML schema for the given concept
 void receiveMessage(TransportMessage msg)
           
 void register(AgentDescription desc)
           
 void register(AgentDescription desc, boolean rehydrating)
           
 void registerNodeEnforcer(java.lang.String guardId)
           
 void registerObserver(java.lang.String updateType, java.lang.Object updateCondition, KAoSObserver observer)
          Register the given KAoSObserver with this KAoSObservable for updates described by the updateType and updateConstraints.
protected  void registerWithCoordinator()
           
 void rehydratePolicies(java.util.List<PolicyMsg> policies)
          Rehydrate policies Adds the policies to the directory service, but does not distribute them.
 void removeAuthenticationObject(KAoSAuthenticationObject kao)
          Allows to remove an authentication object from the Directory Service database.
 void removeConstructedOntologyStructure(java.lang.String structureId)
          This method removes a user defined ontology structure identified by the id from the repository.
 void removeConstructedOntologyStructures(java.util.List<java.lang.String> structureIds)
          This method removes multiple user defined ontology structure identified by the id from the repository.
 void removeDefinedPolicyTemplate(PolicyTemplate definedTemplate)
           
 void removeEventListener(DirectoryEventListener listener)
           
 void removeEventListener(DomainManagerEventListener listener)
          Remove an event listener from the collection of objects to be notified by the Domain Manager about a domain event.
 void removeExecEnv(java.lang.String execEnvID)
          Remove ExecutionEnvironment with the specified ID from the domain structure.
 void removeFilteredNamespace(java.lang.String namespace)
          This method remove a namespace 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<PolicyMsg> policies)
           
 void removePolicy(PolicyMsg policy)
           
 void removePolicy(java.lang.String policyID)
           
 void removePolicySet(PolicySetMsg policySet)
           
 void removePolicySets(java.util.List<PolicySetMsg> policySets)
           
 void removePolicyUpdateListener(PolicyListener listener)
           
 void removeRemoteEventListener(Locator l)
           
 void removeSchema(java.lang.String dataName)
          Remove the schema for the given data type from this repository.
 AgentDescription[] search(AgentDescription desc)
           
 AgentDescription[] search(AgentDescription desc, int maxResults)
           
 AgentDescription[] search(AgentDescription desc, java.lang.Integer maxResults)
           
protected  void sendPolicyUpdate(java.util.List locators, java.util.List addedPolicies, java.util.List changedPolicies, java.util.List removedPolicies, boolean setPolicies, java.lang.String guardGUID)
           
 void sendStatusUpdate(java.lang.String methodName, java.lang.String status)
           
static void setAllowRegistration(boolean allowForReregistration)
           
 void setConditionalPolicies(java.util.Vector condPols)
           
static void setDirectoryServiceName(java.lang.String name)
           
 void setGuarded(boolean guarded)
           
 void setGuardRegistered(boolean registered)
           
static void setIfDistributed(boolean distributed)
           
static void setLocalServlet(boolean localServlet)
           
static void setLogDomainEvents(boolean logDomainEvents)
           
 void setServiceProperties(ServiceProperties props)
           
static void setSubscribeTo(java.lang.String subscribeTo)
           
static void setTransportName(java.lang.String transportName)
           
static void setUseOfJTP(java.lang.String useJTP)
           
 void setUsePolCert(boolean usePolCert)
           
 java.util.List splitPolicy(java.lang.String splitPolicy, java.lang.String secondPolicy)
          Method splitting the controlled action of the selected policy one part that overlaps with the second policy and the other part which does not.
static void startKAoSDS(java.lang.String[] args)
           
 void subclassesSetSynchronizationRequest(java.util.List myCurrentSubclassesClassesURL, java.util.List myCurrentSubclassesSetsTimeStamps)
          Send a list of the current classes for which subclasses set are stored in the Guard and associated with them timestamps in the second list.
 void subpropertiesSetSynchronizationRequest(java.util.List<java.lang.String> myCurrentSubpropertiesPropertyURL, java.util.List<java.lang.Long> myCurrentSubpropertiesSetsTimeStamps)
          Send a list of the current properties for which subproperties set are stored in the Guard and associated with them timestamps in the second list.
protected  void subscribeAsMirror(KAoSAgentDescription remoteDesc)
           
protected  void subscribeAsMirror(java.lang.String dsName)
           
 void superclassesSetSynchronizationRequest(java.util.List<java.lang.String> myCurrentSuperclassesClassesURL, java.util.List<java.lang.Long> myCurrentSuperclassesSetsTimeStamps)
          Send a list of the current classes for which superclasses set are stored in the Guard and associated with them timestamps in the second list.
 void superpropertiesSetSynchronizationRequest(java.util.List<java.lang.String> myCurrentSuperpropertiesPropertyURL, java.util.List<java.lang.Long> myCurrentSuperpropertiesSetsTimeStamps)
          Send a list of the current properties for which superproperties set are stored in the Guard and associated with them timestamps in the second list.
 boolean testTrue(java.lang.String statement)
          Test if the KIF statemant is true according to the ontologies in the ontology repository.
 void update(java.lang.String observableID, java.lang.String updateType, java.lang.Object updateCondition, java.lang.Object update)
          Receive an update from the KAoSObservable when the KAoSObservable has a change or event to report.
 void updateInForceValue(java.lang.String policyId, boolean inForce)
           
 void updateInForceValue(java.lang.String policyId, java.lang.Boolean inForce)
           
 void updatePolicies(java.util.List<PolicyMsg> addedPolicies, java.util.List<PolicyMsg> changedPolicies, java.util.List<PolicyMsg> removedPolicies)
           
 MethodCallResultMsg waitForForwardingReply(java.lang.String sequenceId)
           
 java.lang.Object waitForForwardingRequest(java.lang.String receiverID, MethodCallRequestMsg rqst)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCATOR_NAME

public static final java.lang.String LOCATOR_NAME
See Also:
Constant Field Values

localOntologyInterfaces

public static OntologyService localOntologyInterfaces

_nickName

protected java.lang.String _nickName

_agentName

protected AgentName _agentName

_transportSystem

protected TransportSystem _transportSystem

_allowReregistration

protected boolean _allowReregistration

_guarded

protected static boolean _guarded

_guardRegistered

protected boolean _guardRegistered

_locator

protected Locator _locator

_messageReceiver

protected MessageReceiver _messageReceiver

_mts

protected MessageTransportService _mts

_observers

protected java.util.Hashtable _observers

_authenticationDatabase

protected java.util.Map<java.lang.String,KAoSAuthenticationObject> _authenticationDatabase

_definedTemplateObjectTable

protected java.util.Map<java.lang.String,PolicyTemplate> _definedTemplateObjectTable

FORWARDED_KEY

public static final java.lang.String FORWARDED_KEY
See Also:
Constant Field Values

MY_DESCRIPTION

public static final java.lang.String MY_DESCRIPTION
See Also:
Constant Field Values

GUARDED_ENTITIES

public static final java.lang.String GUARDED_ENTITIES
See Also:
Constant Field Values

GUARDED_CLASS_RANGES_OF_INTEREST

public static final java.lang.String GUARDED_CLASS_RANGES_OF_INTEREST
See Also:
Constant Field Values

GUARDED_ACTION_SUBCLASSES_OF_INTEREST

public static final java.lang.String GUARDED_ACTION_SUBCLASSES_OF_INTEREST
See Also:
Constant Field Values

CONTAINERS

public static final java.lang.String CONTAINERS
See Also:
Constant Field Values

AGENTS

public static final java.lang.String AGENTS
See Also:
Constant Field Values

UNGUARDED_HOSTS

public static final java.lang.String UNGUARDED_HOSTS
See Also:
Constant Field Values

GUARDED_HOSTS

public static final java.lang.String GUARDED_HOSTS
See Also:
Constant Field Values

GUARDED_AGENTS

public static final java.lang.String GUARDED_AGENTS
See Also:
Constant Field Values

UNGUARDED_AGENTS

public static final java.lang.String UNGUARDED_AGENTS
See Also:
Constant Field Values

GUARDED_CONTAINERS

public static final java.lang.String GUARDED_CONTAINERS
See Also:
Constant Field Values

UNGUARDED_CONTAINERS

public static final java.lang.String UNGUARDED_CONTAINERS
See Also:
Constant Field Values

GUARDED_EXEC_ENVS

public static final java.lang.String GUARDED_EXEC_ENVS
See Also:
Constant Field Values

UNGUARDED_EXEC_ENVS

public static final java.lang.String UNGUARDED_EXEC_ENVS
See Also:
Constant Field Values

REGISTRATION_REPLACE_FLAG

public static final java.lang.String REGISTRATION_REPLACE_FLAG
See Also:
Constant Field Values

RUNNING_ENTITIES

public static final java.lang.String RUNNING_ENTITIES
See Also:
Constant Field Values

MY_GUARDS

public static final java.lang.String MY_GUARDS
See Also:
Constant Field Values

DOMAIN_NAME

public static final java.lang.String DOMAIN_NAME
See Also:
Constant Field Values

_name

protected static java.lang.String _name

_useForJTP

protected static java.lang.String _useForJTP

_nameOfTransport

protected static java.lang.String _nameOfTransport

_distributed

protected static boolean _distributed

_allowForReregistration

protected static boolean _allowForReregistration

_logDomainEvents

protected static boolean _logDomainEvents

_subscribeTo

protected static java.lang.String _subscribeTo

_localServlet

protected static boolean _localServlet
Constructor Detail

KAoSDirectoryService

public KAoSDirectoryService()
Method Detail

main

public static void main(java.lang.String[] args)

startKAoSDS

public static void startKAoSDS(java.lang.String[] args)

setDirectoryServiceName

public static void setDirectoryServiceName(java.lang.String name)

setUseOfJTP

public static void setUseOfJTP(java.lang.String useJTP)

setTransportName

public static void setTransportName(java.lang.String transportName)

setIfDistributed

public static void setIfDistributed(boolean distributed)

setAllowRegistration

public static void setAllowRegistration(boolean allowForReregistration)

setLogDomainEvents

public static void setLogDomainEvents(boolean logDomainEvents)

setSubscribeTo

public static void setSubscribeTo(java.lang.String subscribeTo)

setLocalServlet

public static void setLocalServlet(boolean localServlet)

getInstance

public static KAoSDirectoryService getInstance()

allowReregistration

public void allowReregistration(boolean allow)

initialize

public void initialize(ServiceRoot sr,
                       java.lang.String nickname,
                       boolean useJTP,
                       java.lang.String ontologySetName)
                throws java.lang.Exception
Throws:
java.lang.Exception

initialize

public void initialize(ServiceRoot sr,
                       java.lang.String nickname,
                       boolean useJTP,
                       java.lang.String ontologySetName,
                       JasBean entityEnv,
                       DomainDescription myDomain,
                       java.util.List ontologies,
                       PersistenceManager persistMgr)
                throws java.lang.Exception
Throws:
java.lang.Exception

initConfig

protected void initConfig()

registerWithCoordinator

protected void registerWithCoordinator()

obtainCoordinatorEnv

protected JasBean obtainCoordinatorEnv()

handleDirectoryEvent

protected void handleDirectoryEvent(DirectoryEvent event)

subscribeAsMirror

protected void subscribeAsMirror(java.lang.String dsName)

subscribeAsMirror

protected void subscribeAsMirror(KAoSAgentDescription remoteDesc)

getAgentDescription

public AgentDescription getAgentDescription(java.lang.String agentName)
                                     throws NotRegisteredException
Throws:
NotRegisteredException

bindToMTS

protected void bindToMTS()
                  throws java.lang.Exception
Throws:
java.lang.Exception

setUsePolCert

public void setUsePolCert(boolean usePolCert)

getExpandedProperty

public java.lang.String getExpandedProperty(java.lang.String key)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)

getProperty

public java.lang.String getProperty(java.lang.String key)

addAuthenticationObject

public void addAuthenticationObject(KAoSAuthenticationObject kao)
Description copied from interface: AuthenticationInterface
Allows to add an authentication object to the Directory Service database.

Specified by:
addAuthenticationObject in interface AuthenticationInterface
Parameters:
kao - the authentication object

editAuthenticationObject

public void editAuthenticationObject(KAoSAuthenticationObject kao)
Description copied from interface: AuthenticationInterface
Allows to edit an authentication object at the Directory Service database.

Specified by:
editAuthenticationObject in interface AuthenticationInterface
Parameters:
kao - the authentication object

removeAuthenticationObject

public void removeAuthenticationObject(KAoSAuthenticationObject kao)
Description copied from interface: AuthenticationInterface
Allows to remove an authentication object from the Directory Service database.

Specified by:
removeAuthenticationObject in interface AuthenticationInterface
Parameters:
kao - the authentication object

isUsernameRegistered

public boolean isUsernameRegistered(java.lang.String userid,
                                    java.lang.String password)
Description copied from interface: AuthenticationInterface
Checks if the username is in the Directory Service database.

Specified by:
isUsernameRegistered in interface AuthenticationInterface
Parameters:
userid - the user name
password - the user password

getAllAuthenticationObjects

public java.util.Map<java.lang.String,KAoSAuthenticationObject> getAllAuthenticationObjects()
Description copied from interface: AuthenticationInterface
Allows to get all the authentication objects from the Directory Service database.

Specified by:
getAllAuthenticationObjects in interface AuthenticationInterface

addDefinedPolicyTemplate

public void addDefinedPolicyTemplate(PolicyTemplate definedTemplate)
Specified by:
addDefinedPolicyTemplate in interface DefinedPolicyTemplateInterface

editDefinedPolicyTemplate

public void editDefinedPolicyTemplate(PolicyTemplate definedTemplate)
Specified by:
editDefinedPolicyTemplate in interface DefinedPolicyTemplateInterface

removeDefinedPolicyTemplate

public void removeDefinedPolicyTemplate(PolicyTemplate definedTemplate)
Specified by:
removeDefinedPolicyTemplate in interface DefinedPolicyTemplateInterface

getAllDefinedPolicyTemplate

public java.util.Map<java.lang.String,PolicyTemplate> getAllDefinedPolicyTemplate()
Specified by:
getAllDefinedPolicyTemplate in interface DefinedPolicyTemplateInterface

processForwardingRequest

public void processForwardingRequest(java.lang.String receiverID,
                                     MethodCallRequestMsg rqst,
                                     kaos.core.service.directory.KAoSDirectoryService.InvocationInfo info)

waitForForwardingRequest

public java.lang.Object waitForForwardingRequest(java.lang.String receiverID,
                                                 MethodCallRequestMsg rqst)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

waitForForwardingReply

public MethodCallResultMsg waitForForwardingReply(java.lang.String sequenceId)

receiveMessage

public void receiveMessage(TransportMessage msg)

sendStatusUpdate

public void sendStatusUpdate(java.lang.String methodName,
                             java.lang.String status)

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

getServiceProperties

public ServiceProperties getServiceProperties()
                                       throws ServiceException,
                                              ServiceFailure
Throws:
ServiceException
ServiceFailure

setServiceProperties

public void setServiceProperties(ServiceProperties props)
                          throws ServiceException,
                                 ServiceFailure
Throws:
ServiceException
ServiceFailure

createAgentDescription

public AgentDescription createAgentDescription()

deregister

public void deregister(AgentDescription desc)
                throws NotRegisteredException,
                       DirectoryFailure
Throws:
NotRegisteredException
DirectoryFailure

modify

public void modify(AgentDescription desc)
            throws NotRegisteredException,
                   DirectoryFailure
Throws:
NotRegisteredException
DirectoryFailure

register

public void register(AgentDescription desc)
              throws AlreadyRegisteredException,
                     DirectoryFailure
Throws:
AlreadyRegisteredException
DirectoryFailure

register

public void register(AgentDescription desc,
                     boolean rehydrating)
              throws AlreadyRegisteredException,
                     DirectoryFailure
Throws:
AlreadyRegisteredException
DirectoryFailure

registerNodeEnforcer

public void registerNodeEnforcer(java.lang.String guardId)

search

public AgentDescription[] search(AgentDescription desc)
                          throws SearchException,
                                 DirectoryFailure
Throws:
SearchException
DirectoryFailure

search

public AgentDescription[] search(AgentDescription desc,
                                 java.lang.Integer maxResults)
                          throws SearchException,
                                 DirectoryFailure
Throws:
SearchException
DirectoryFailure

search

public AgentDescription[] search(AgentDescription desc,
                                 int maxResults)
                          throws SearchException,
                                 DirectoryFailure
Throws:
SearchException
DirectoryFailure

modifyEntityProperties

public void modifyEntityProperties(java.lang.String entityGUID,
                                   java.util.List<Property> properties)
                            throws DirectoryFailure,
                                   NotRegisteredException,
                                   ModificationException
Throws:
DirectoryFailure
NotRegisteredException
ModificationException

addEntityOntologicalType

public void addEntityOntologicalType(java.lang.String entityNameAsString,
                                     java.lang.String typeName,
                                     java.lang.String damlDesc)

getAgentDescriptionForAgentID

public KAoSAgentDescription getAgentDescriptionForAgentID(java.lang.String agentID)
                                                   throws SearchException,
                                                          DirectoryFailure
Throws:
SearchException
DirectoryFailure

getAllAgentsInDirectory

public java.util.List getAllAgentsInDirectory()
Description copied from interface: DomainDirectoryService
Get a Vector of descriptions of all agents in the directory.

Specified by:
getAllAgentsInDirectory in interface DomainDirectoryService
Returns:
Vector of AgentDescriptions of all agents in the directory.

getAllAgentsInDomain

public java.util.Vector getAllAgentsInDomain(java.lang.String domainName)
Description copied from interface: DomainDirectoryService
Get a Vector of descriptions of all of the agents in a domain.

Specified by:
getAllAgentsInDomain in interface DomainDirectoryService
Parameters:
domainName - Name of the domain to query
Returns:
Vector of AgentDescriptions of all agents in the specified domain.

getAllGuardsInDirectory

public java.util.List getAllGuardsInDirectory()
Description copied from interface: DomainDirectoryService
Get a Vector of descriptions of all guards in the directory.

Specified by:
getAllGuardsInDirectory in interface DomainDirectoryService
Returns:
Vector of AgentDescriptions of all guards in the directory.

getGuardDescriptionsForEntity

public java.util.Vector getGuardDescriptionsForEntity(java.lang.String entityID)

getAllDomainsInDirectory

public java.util.Vector getAllDomainsInDirectory()
Description copied from interface: DomainDirectoryService
Get a Vector of descriptions of all of the domains in a directory.

Specified by:
getAllDomainsInDirectory in interface DomainDirectoryService
Returns:
Vector of AgentDescriptions of all agents in the specified domain.

isEntityInDomain

public boolean isEntityInDomain(java.lang.String domainName,
                                java.lang.String id)
Description copied from interface: DomainDirectoryService
Search for the domain entity with the specified id.

Specified by:
isEntityInDomain in interface DomainDirectoryService
Parameters:
domainName - The name of the domain to query
id - The id of an entity to be searched in this domain's directory.
Returns:
true if the entity whose id is specified is found; otherwise return false.

getDomainDescription

public DomainDescription getDomainDescription(java.lang.String domainName)
Description copied from interface: DomainDirectoryService
Get the description of a domain

Specified by:
getDomainDescription in interface DomainDirectoryService
Parameters:
domainName - the name of the domain

getDomainDescriptionsForGuard

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

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

getDomainStructure

public java.util.Map getDomainStructure(java.lang.String domainName)
Description copied from interface: DomainDirectoryService
Obtain a Map containing the structure of a domain.

Specified by:
getDomainStructure in interface DomainDirectoryService
Parameters:
domainName - name of the domain to map
Returns:
Map of hosts -> execution environments -> containers -> agents

removeExecEnv

public void removeExecEnv(java.lang.String execEnvID)
Description copied from interface: DomainDirectoryService
Remove ExecutionEnvironment with the specified ID from the domain structure.

Specified by:
removeExecEnv in interface DomainDirectoryService

getRootDomains

public java.util.Vector getRootDomains()
Description copied from interface: DomainDirectoryService
Obtain a Vector of the names of the root domains (domains with no parent)

Specified by:
getRootDomains in interface DomainDirectoryService
Returns:
Vector of Strings of the names of root domains

getDomainNames

public java.util.Vector getDomainNames()

getSubdomains

public java.util.Vector getSubdomains(java.lang.String domainName)
Description copied from interface: DomainDirectoryService
Obtain a Vector of the names of subdomains of a particular domain (returns immediate children only)

Specified by:
getSubdomains in interface DomainDirectoryService
Returns:
Vector of Strings of the names of domains

rehydratePolicies

public void rehydratePolicies(java.util.List<PolicyMsg> policies)
                       throws PolicyManagement.OntologyPolicyIncorrect,
                              PoliciesHarmonizedException,
                              PolicyManagement.PrecedenceUndeterminedException
Rehydrate policies Adds the policies to the directory service, but does not distribute them. Should only be used when restarting the directory service in a running society.

Throws:
PolicyManagement.OntologyPolicyIncorrect
PoliciesHarmonizedException
PolicyManagement.PrecedenceUndeterminedException

updatePolicies

public void updatePolicies(java.util.List<PolicyMsg> addedPolicies,
                           java.util.List<PolicyMsg> changedPolicies,
                           java.util.List<PolicyMsg> removedPolicies)
                    throws PolicyManagement.OntologyPolicyIncorrect,
                           PoliciesHarmonizedException,
                           PolicyManagement.PrecedenceUndeterminedException
Specified by:
updatePolicies in interface PolicyManagement
Throws:
PolicyManagement.OntologyPolicyIncorrect
PoliciesHarmonizedException
PolicyManagement.PrecedenceUndeterminedException

addPolicy

public void addPolicy(PolicyMsg policy)
               throws PolicyManagement.OntologyPolicyIncorrect,
                      PoliciesHarmonizedException,
                      PolicyManagement.PrecedenceUndeterminedException
Specified by:
addPolicy in interface PolicyManagement
Throws:
PolicyManagement.OntologyPolicyIncorrect
PoliciesHarmonizedException
PolicyManagement.PrecedenceUndeterminedException

addPolicies

public void addPolicies(java.util.List<PolicyMsg> policies)
                 throws PolicyManagement.OntologyPolicyIncorrect,
                        PoliciesHarmonizedException,
                        PolicyManagement.PrecedenceUndeterminedException
Specified by:
addPolicies in interface PolicyManagement
Throws:
PolicyManagement.OntologyPolicyIncorrect
PoliciesHarmonizedException
PolicyManagement.PrecedenceUndeterminedException

removePolicy

public void removePolicy(PolicyMsg policy)
Specified by:
removePolicy in interface PolicyManagement

removePolicies

public void removePolicies(java.util.List<PolicyMsg> policies)
Specified by:
removePolicies in interface PolicyManagement

changePolicy

public void changePolicy(PolicyMsg policy)
                  throws PolicyManagement.OntologyPolicyIncorrect,
                         PoliciesHarmonizedException,
                         PolicyManagement.PrecedenceUndeterminedException
Specified by:
changePolicy in interface PolicyManagement
Throws:
PolicyManagement.OntologyPolicyIncorrect
PoliciesHarmonizedException
PolicyManagement.PrecedenceUndeterminedException

changePolicies

public void changePolicies(java.util.List<PolicyMsg> policies)
                    throws PolicyManagement.OntologyPolicyIncorrect,
                           PoliciesHarmonizedException,
                           PolicyManagement.PrecedenceUndeterminedException
Specified by:
changePolicies in interface PolicyManagement
Throws:
PolicyManagement.OntologyPolicyIncorrect
PoliciesHarmonizedException
PolicyManagement.PrecedenceUndeterminedException

getPolicies

public java.util.List getPolicies()
Specified by:
getPolicies in interface PolicyManagement

getPolicy

public PolicyMsg getPolicy(java.lang.String policyId)
Specified by:
getPolicy in interface PolicyManagement

getPoliciesByEntities

public java.util.Map getPoliciesByEntities()
Specified by:
getPoliciesByEntities in interface PolicyManagement

getDirectPoliciesFor

public java.util.List<PolicyMsg> getDirectPoliciesFor(java.lang.String id)
Specified by:
getDirectPoliciesFor in interface PolicyManagement

getAllPoliciesFor

public java.util.List<PolicyMsg> getAllPoliciesFor(java.lang.String conceptId)
                                            throws ServiceFailure
Specified by:
getAllPoliciesFor in interface PolicyManagement
Throws:
ServiceFailure

addPolicy

public void addPolicy(java.lang.String owlPolicyDescription)
               throws PolicyManagement.OntologyPolicyIncorrect,
                      PolicyManagement.PrecedenceUndeterminedException,
                      PoliciesHarmonizedException,
                      ServiceFailure
Specified by:
addPolicy in interface PolicyManagement
Throws:
PolicyManagement.OntologyPolicyIncorrect
PolicyManagement.PrecedenceUndeterminedException
PoliciesHarmonizedException
ServiceFailure

addPolicyUpdateListener

public void addPolicyUpdateListener(PolicyListener listener)
                             throws ServiceFailure
Specified by:
addPolicyUpdateListener in interface PolicyManagement
Throws:
ServiceFailure

changePolicy

public void changePolicy(java.lang.String policyID,
                         java.lang.String owlPolicyDescription)
                  throws PolicyManagement.OntologyPolicyIncorrect,
                         PolicyManagement.PrecedenceUndeterminedException,
                         PoliciesHarmonizedException,
                         ServiceFailure
Specified by:
changePolicy in interface PolicyManagement
Throws:
PolicyManagement.OntologyPolicyIncorrect
PolicyManagement.PrecedenceUndeterminedException
PoliciesHarmonizedException
ServiceFailure

findPolicies

public java.util.List<PolicyMsg> findPolicies(java.lang.String actionType,
                                              java.util.Map<java.util.List<java.lang.String>,java.lang.String> policyRestrictions)
                                       throws ServiceFailure
Specified by:
findPolicies in interface PolicyManagement
Throws:
ServiceFailure

removePolicy

public void removePolicy(java.lang.String policyID)
                  throws ServiceFailure
Specified by:
removePolicy in interface PolicyManagement
Throws:
ServiceFailure

removePolicyUpdateListener

public void removePolicyUpdateListener(PolicyListener listener)
                                throws ServiceFailure
Specified by:
removePolicyUpdateListener in interface PolicyManagement
Throws:
ServiceFailure

getConditionalPolicies

public java.util.Vector getConditionalPolicies()

setConditionalPolicies

public void setConditionalPolicies(java.util.Vector condPols)

addPolicySet

public void addPolicySet(PolicySetMsg policySet)
Specified by:
addPolicySet in interface PolicySetDirectory

addPolicySets

public void addPolicySets(java.util.List<PolicySetMsg> policySets)
Specified by:
addPolicySets in interface PolicySetDirectory

removePolicySet

public void removePolicySet(PolicySetMsg policySet)
Specified by:
removePolicySet in interface PolicySetDirectory

removePolicySets

public void removePolicySets(java.util.List<PolicySetMsg> policySets)
Specified by:
removePolicySets in interface PolicySetDirectory

changePolicySet

public void changePolicySet(PolicySetMsg policySet)
Specified by:
changePolicySet in interface PolicySetDirectory

changePolicySets

public void changePolicySets(java.util.List<PolicySetMsg> policySets)
Specified by:
changePolicySets in interface PolicySetDirectory

getPolicySets

public java.util.List<PolicySetMsg> getPolicySets()
Description copied from interface: PolicySetDirectory
Obtain List over all policy sets.

Specified by:
getPolicySets in interface PolicySetDirectory
Returns:
List of policy set Msgs.

getPolicySet

public PolicySetMsg getPolicySet(java.lang.String policySetId)
Specified by:
getPolicySet in interface PolicySetDirectory

isPolicyInConflict

public boolean isPolicyInConflict(java.lang.String policyId)
Specified by:
isPolicyInConflict in interface PolicyAnalyzes

findConflictingPolicies

public java.util.List findConflictingPolicies(java.lang.String policyId)
Description copied from interface: PolicyAnalyzes
Method find all the policies conflicting with the specified policy

Specified by:
findConflictingPolicies in interface PolicyAnalyzes
Parameters:
policyId - id of the policy
Returns:
List of Policy Ids

isFullyOverlappedBySecondPolicy

public boolean isFullyOverlappedBySecondPolicy(java.lang.String firstPolicyId,
                                               java.lang.String secondPolicyId)
                                        throws PolicyAnalyzes.PriorityConditionNotMet
Description copied from interface: PolicyAnalyzes
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

Specified by:
isFullyOverlappedBySecondPolicy in interface PolicyAnalyzes
Parameters:
firstPolicyId - id of the policy
secondPolicyId - id of the policy
Returns:
true if fully covered, false is not
Throws:
PolicyAnalyzes.PriorityConditionNotMet

isPartiallyOverlappedBySecondPolicy

public boolean isPartiallyOverlappedBySecondPolicy(java.lang.String firstPolicyId,
                                                   java.lang.String secondPolicyId)
                                            throws PolicyAnalyzes.PriorityConditionNotMet
Description copied from interface: PolicyAnalyzes
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

Specified by:
isPartiallyOverlappedBySecondPolicy in interface PolicyAnalyzes
Parameters:
firstPolicyId - id of the policy
secondPolicyId - id of the policy
Returns:
true if fully covered, false is not
Throws:
PolicyAnalyzes.PriorityConditionNotMet

isFullyOverlappedByUnionOfPolicies

public boolean isFullyOverlappedByUnionOfPolicies(java.lang.String firstPolicyId,
                                                  java.util.List<java.lang.String> listOfPolicies)
                                           throws PolicyAnalyzes.PriorityConditionNotMet
Description copied from interface: PolicyAnalyzes
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

Specified by:
isFullyOverlappedByUnionOfPolicies in interface PolicyAnalyzes
Parameters:
firstPolicyId - id of the policy
listOfPolicies - list of policies
Returns:
true if fully covered, false is not
Throws:
PolicyAnalyzes.PriorityConditionNotMet

isPolicyRedundant

public boolean isPolicyRedundant(java.lang.String policyId)
Description copied from interface: PolicyAnalyzes
Method finds out if the specified policy is being made redundant (fully or partially) by some policies with higher priority in the repository

Specified by:
isPolicyRedundant in interface PolicyAnalyzes
Parameters:
policyId - id of the policy
Returns:
true if redundant, false is not

findPoliciesMakingRedundant

public java.util.List findPoliciesMakingRedundant(java.lang.String policyId)
Description copied from interface: PolicyAnalyzes
Method find all the policies with higher priority making the specified policy redundant

Specified by:
findPoliciesMakingRedundant in interface PolicyAnalyzes
Parameters:
policyId - id of the policy
Returns:
List of Policy Ids

isPolicyMakingRedundantSomeOtherPolicy

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

Specified by:
isPolicyMakingRedundantSomeOtherPolicy in interface PolicyAnalyzes
Parameters:
policyId - id of the policy
Returns:
true if redundant, false is not

findPoliciesMadeRedundant

public java.util.List findPoliciesMadeRedundant(java.lang.String policyId)
Description copied from interface: PolicyAnalyzes
Method find all the policies with higher priority making the specified policy redundant

Specified by:
findPoliciesMadeRedundant in interface PolicyAnalyzes
Parameters:
policyId - id of the policy
Returns:
List of Policy Ids

isMadeFullyRedundantBySecond

public boolean isMadeFullyRedundantBySecond(java.lang.String firstPolicyId,
                                            java.lang.String secondPolicyId)
                                     throws PolicyAnalyzes.PriorityConditionNotMet
Description copied from interface: PolicyAnalyzes
Method finds out if the specified policy is being made redundant (fully covered) by the second specified policy with higher priority in the repository

Specified by:
isMadeFullyRedundantBySecond in interface PolicyAnalyzes
Parameters:
firstPolicyId - id of the policy
secondPolicyId - id of the policy
Returns:
true if redundant, false is not
Throws:
PolicyAnalyzes.PriorityConditionNotMet

isMadeParitallyRedundantBySecond

public boolean isMadeParitallyRedundantBySecond(java.lang.String firstPolicyId,
                                                java.lang.String secondPolicyId)
                                         throws PolicyAnalyzes.PriorityConditionNotMet
Description copied from interface: PolicyAnalyzes
Method finds out if the specified policy is being made partially redundant (partially covered) by the second specified policy with higher priority in the repository

Specified by:
isMadeParitallyRedundantBySecond in interface PolicyAnalyzes
Parameters:
firstPolicyId - id of the policy
secondPolicyId - id of the policy
Returns:
true if redundant, false is not
Throws:
PolicyAnalyzes.PriorityConditionNotMet

isMadeFullyRedundantByPolicyUnion

public boolean isMadeFullyRedundantByPolicyUnion(java.lang.String firstPolicyId,
                                                 java.util.List<java.lang.String> listOfPolicies)
                                          throws PolicyAnalyzes.PriorityConditionNotMet
Description copied from interface: PolicyAnalyzes
Method finds out if the specified policy is being made redundant (fully covered) by the union of specified policies with higher priority in the repository

Specified by:
isMadeFullyRedundantByPolicyUnion in interface PolicyAnalyzes
Parameters:
firstPolicyId - id of the policy
listOfPolicies - list of policies
Returns:
true if redundant, false is not
Throws:
PolicyAnalyzes.PriorityConditionNotMet

changedPriority

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

Specified by:
changedPriority in interface PolicyModification
Parameters:
policyId - id of the policy
newPriority - new priority of the policy

updateInForceValue

public void updateInForceValue(java.lang.String policyId,
                               java.lang.Boolean inForce)

updateInForceValue

public void updateInForceValue(java.lang.String policyId,
                               boolean inForce)

harmonizePolicy

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

Specified by:
harmonizePolicy in interface PolicyModification
Parameters:
harmonizedPolicy - id of the policy to be harmonized.
harmonizingPolicy - id of the policy harmonizing the first policy
Returns:
List containing ids of policies representing the result of harmonization

splitPolicy

public java.util.List splitPolicy(java.lang.String splitPolicy,
                                  java.lang.String secondPolicy)
Description copied from interface: PolicyModification
Method splitting 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

Specified by:
splitPolicy in interface PolicyModification
Parameters:
splitPolicy - id of the policy to be split.
secondPolicy - id of the policy splitting the first policy
Returns:
List containing ids of policies representing the result of process

checkPermission

public void checkPermission(ActionInstanceDescription actionDesc,
                            PolicyDecisionObserver pObserver)
                     throws KAoSSecurityException,
                            ServiceFailure
Specified by:
checkPermission in interface PolicyChecking
Throws:
KAoSSecurityException
ServiceFailure

getAllowableValuesForActionProperties

public java.util.Vector getAllowableValuesForActionProperties(java.util.Vector propertyNames,
                                                              ActionInstanceDescription actionDesc,
                                                              java.lang.Boolean tight,
                                                              PolicyDecisionObserver pObserver)
                                                       throws ServiceFailure
Throws:
ServiceFailure

getAllowableValuesForActionProperties

public java.util.Vector getAllowableValuesForActionProperties(java.util.Vector propertyNames,
                                                              ActionInstanceDescription actionDesc,
                                                              boolean tight,
                                                              PolicyDecisionObserver pObserver)
                                                       throws ServiceFailure
Specified by:
getAllowableValuesForActionProperties in interface PolicyAdvice
Throws:
ServiceFailure

getAllowableValuesForActionProperties

public java.util.Vector getAllowableValuesForActionProperties(ActionInstanceDescription actionDesc,
                                                              PolicyDecisionObserver pObserver)
                                                       throws ServiceFailure
Specified by:
getAllowableValuesForActionProperties in interface PolicyAdvice
Throws:
ServiceFailure

getObligationsForTriggerCondition

public java.util.List<ActionInstanceDescription> getObligationsForTriggerCondition(ActionInstanceDescription triggerAID,
                                                                                   PolicyDecisionObserver pObserver)
                                                                            throws ServiceFailure
Specified by:
getObligationsForTriggerCondition in interface PolicyChecking
Throws:
ServiceFailure

getAllowableValuesForActionProperty

public java.util.Set getAllowableValuesForActionProperty(java.lang.String origPropertyName,
                                                         ActionInstanceDescription origActionDesc,
                                                         java.util.Set allTargetValues,
                                                         boolean tight,
                                                         PolicyDecisionObserver pObserver)
                                                  throws ServiceFailure
Specified by:
getAllowableValuesForActionProperty in interface PolicyAdvice
Throws:
ServiceFailure

getForbiddenValuesForActionProperty

public java.util.Vector getForbiddenValuesForActionProperty(java.lang.String origPropertyName,
                                                            ActionInstanceDescription origActionDesc,
                                                            PolicyDecisionObserver pObserver)
                                                     throws ServiceFailure
Specified by:
getForbiddenValuesForActionProperty in interface PolicyAdvice
Throws:
ServiceFailure

getPolicyUpdateCount

public java.lang.Integer getPolicyUpdateCount()
                                       throws ServiceFailure
Specified by:
getPolicyUpdateCount in interface PolicyAdvice
Throws:
ServiceFailure

findPolicyDecision

public java.util.List<ActionInstanceDescription> findPolicyDecision(ActionInstanceDescription actionDesc,
                                                                    PolicyDecisionObserver pObserver)
                                                             throws KAoSSecurityException,
                                                                    ServiceFailure,
                                                                    ObligationViolationException
Specified by:
findPolicyDecision in interface PolicyChecking
Throws:
KAoSSecurityException
ServiceFailure
ObligationViolationException

checkDeepPermission

public void checkDeepPermission(ActionInstanceDescription actionDesc,
                                PolicyDecisionObserver pObserver)
                         throws ServiceFailure,
                                KAoSSecurityException
Specified by:
checkDeepPermission in interface PolicyChecking
Throws:
ServiceFailure
KAoSSecurityException

getListOfLoadedOntologies

public java.util.Set getListOfLoadedOntologies()
Description copied from interface: OntologyService
This method returns a set of urls depicting ontologies loaded into the Ontology Service

Specified by:
getListOfLoadedOntologies in interface OntologyService

getAllNamespaces

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

Specified by:
getAllNamespaces in interface OntologyRepositoryService

getFilteredNamespaces

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

Specified by:
getFilteredNamespaces in interface OntologyRepositoryService

addFilteredNamespace

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

Specified by:
addFilteredNamespace in interface OntologyRepositoryService
Parameters:
namespace - The name of the namespace

removeFilteredNamespace

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

Specified by:
removeFilteredNamespace in interface OntologyRepositoryService
Parameters:
namespace - The name of the namespace

getConstructedOntologyStructures

public java.util.List getConstructedOntologyStructures()
Description copied from interface: OntologyRepositoryService
This method retrieves all user defined ontology structures in the repository.

Specified by:
getConstructedOntologyStructures in interface OntologyService
Specified by:
getConstructedOntologyStructures in interface OntologyRepositoryService
Returns:
list containing SerializableOntModelImpl objects

putConstructedOntologyStructures

public void putConstructedOntologyStructures(java.util.List<SerializableOntModelImpl> ontologyStructureList)
                                      throws OntologyRepository.ReasoningException,
                                             java.io.IOException
Description copied from interface: OntologyRepositoryService
This method stores multiple ontology structures in the repository.

Specified by:
putConstructedOntologyStructures in interface OntologyRepositoryService
Parameters:
ontologyStructureList - a list containing SerializableOntModelImpl objects.
Throws:
OntologyRepository.ReasoningException
java.io.IOException

getConstructedOntologyStructure

public SerializableOntModelImpl getConstructedOntologyStructure(java.lang.String structureId)
                                                         throws OntologyRepository.ReasoningException,
                                                                UnknownConceptException,
                                                                java.io.IOException,
                                                                DirectoryFailure
Description copied from interface: OntologyRepositoryService
This method get stored ontology structure references by its id in the repository.

Specified by:
getConstructedOntologyStructure in interface OntologyService
Specified by:
getConstructedOntologyStructure in interface OntologyRepositoryService
Parameters:
structureId - ontology structure id
Returns:
SerializableOntModelImpl object
Throws:
OntologyRepository.ReasoningException - or IOException when loading of the ontology failed.
UnknownConceptException
java.io.IOException
DirectoryFailure

removeConstructedOntologyStructure

public void removeConstructedOntologyStructure(java.lang.String structureId)
                                        throws DirectoryFailure
Description copied from interface: OntologyService
This method removes a user defined ontology structure identified by the id from the repository.

Specified by:
removeConstructedOntologyStructure in interface OntologyService
Throws:
DirectoryFailure

removeConstructedOntologyStructures

public void removeConstructedOntologyStructures(java.util.List<java.lang.String> structureIds)
                                         throws DirectoryFailure
Description copied from interface: OntologyService
This method removes multiple user defined ontology structure identified by the id from the repository.

Specified by:
removeConstructedOntologyStructures in interface OntologyService
Throws:
DirectoryFailure

loadOntology

public void loadOntology(java.lang.String loadedOWL)
                  throws OntologyRepository.ReasoningException,
                         DirectoryFailure
Description copied from interface: OntologyService
Loads ontology in OWL into the repository of the Ontology Service

Specified by:
loadOntology in interface OntologyService
Parameters:
loadedOWL - string containing a syntactically correctly OWL
Throws:
OntologyRepository.ReasoningException - when loading of the ontology failed.
DirectoryFailure

loadOntology

public void loadOntology(java.lang.String myURL,
                         java.lang.Boolean recursiveLoad)
                  throws OntologyRepository.ReasoningException,
                         java.io.IOException
Throws:
OntologyRepository.ReasoningException
java.io.IOException

loadOntology

public void loadOntology(java.lang.String myURL,
                         boolean recursiveLoad)
                  throws OntologyRepository.ReasoningException,
                         java.io.IOException
Description copied from interface: OntologyRepositoryService
Loads ontology from the provided url.

Specified by:
loadOntology in interface OntologyService
Specified by:
loadOntology in interface OntologyRepositoryService
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:
OntologyRepository.ReasoningException - when loading of the ontology failed.
java.io.IOException

loadOntology

public void loadOntology(SerializableOntModelImpl myOntModel,
                         java.lang.Boolean recursiveLoad)
                  throws OntologyRepository.ReasoningException,
                         java.io.IOException
Throws:
OntologyRepository.ReasoningException
java.io.IOException

loadOntology

public void loadOntology(SerializableOntModelImpl myOntModel,
                         boolean recursiveLoad)
                  throws OntologyRepository.ReasoningException,
                         java.io.IOException
Description copied from interface: OntologyRepositoryService
Adds ontology included in the provide objects into the ontology repository.

Specified by:
loadOntology in interface OntologyService
Specified by:
loadOntology in interface OntologyRepositoryService
Parameters:
myOntModel - The object of type SerializableOntModelImpl containing the added ontology
recursiveLoad - Indicates if the imported ontologies (by the ontology contained in myOntModel) should also be recursively loaded.
Throws:
OntologyRepository.ReasoningException
java.io.IOException

loadOntologies

public void loadOntologies(java.util.List<SerializableOntModelImpl> myOntModels,
                           boolean recursiveLoad)
                    throws OntologyRepository.ReasoningException,
                           java.io.IOException
Description copied from interface: OntologyRepositoryService
Adds ontology included in the provide objects into the ontology repository.

Specified by:
loadOntologies in interface OntologyService
Specified by:
loadOntologies in interface OntologyRepositoryService
recursiveLoad - Indicates if the imported ontologies (by the ontology contained in myOntModel) should also be recursively loaded.
Throws:
OntologyRepository.ReasoningException
java.io.IOException

loadOntologies

public void loadOntologies(java.util.List<SerializableOntModelImpl> myOntModels,
                           java.lang.Boolean recursiveLoad)
                    throws OntologyRepository.ReasoningException,
                           java.io.IOException
Throws:
OntologyRepository.ReasoningException
java.io.IOException

loadOntology

public void loadOntology(SerializableOntModelImpl myOntModel,
                         boolean recursiveLoad,
                         boolean rehydrating)
                  throws OntologyRepository.ReasoningException,
                         java.io.IOException
Throws:
OntologyRepository.ReasoningException
java.io.IOException

getInstancesOf

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

Specified by:
getInstancesOf in interface OntologyService
Specified by:
getInstancesOf in interface OntologyRepositoryService
Parameters:
conceptName - The name of the concept in the Jena format
Returns:
Set of instance ids in the Jena format
Throws:
UnknownConceptException - if conceptName is unknown for the ontology repository

getUltimateOntologyTypesOfIndividual

public java.util.Set getUltimateOntologyTypesOfIndividual(java.lang.String individualName)
                                                   throws UnknownConceptException
Description copied from interface: OntologyRepositoryService
Finds the ultimate Ontology type of the provided individual

Specified by:
getUltimateOntologyTypesOfIndividual in interface OntologyService
Specified by:
getUltimateOntologyTypesOfIndividual in interface OntologyRepositoryService
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:
UnknownConceptException - if concept unknown or any problem with JTP approached

getSuperClassesOf

public java.util.Set getSuperClassesOf(java.lang.String className)
                                throws UnknownConceptException
Description copied from interface: OntologyRepositoryService
Get set of superclasses of the given class.

Specified by:
getSuperClassesOf in interface OntologyRepositoryService
Parameters:
className - The name of the class in the Jena format
Returns:
Set of superclasses names in the Jena format
Throws:
UnknownConceptException - if className is unknown for the ontology repository

getSubClassesOf

public java.util.Set getSubClassesOf(java.lang.String className)
                              throws UnknownConceptException
Description copied from interface: OntologyRepositoryService
Get set of subclasses of the given class.

Specified by:
getSubClassesOf in interface OntologyService
Specified by:
getSubClassesOf in interface OntologyRepositoryService
Parameters:
className - The name of the class in Jena format
Returns:
Set of subclasses names in Jena format
Throws:
UnknownConceptException - if className is unknown for the ontology repository

getImmediateSubClassesOf

public java.util.Set getImmediateSubClassesOf(java.lang.String className)
                                       throws UnknownConceptException
Description copied from interface: OntologyRepositoryService
Get set of immediate subclasses of the given class.

Specified by:
getImmediateSubClassesOf in interface OntologyService
Specified by:
getImmediateSubClassesOf in interface OntologyRepositoryService
Parameters:
className - The name of the class in Jena format
Returns:
Set of subclasses names in Jena format
Throws:
UnknownConceptException - if className is unknown for the ontology repository

getSuperPropertiesOf

public java.util.Set getSuperPropertiesOf(java.lang.String propertyName)
                                   throws UnknownConceptException
Description copied from interface: OntologyRepositoryService
Get set of superproperties of the given property.

Specified by:
getSuperPropertiesOf in interface OntologyService
Specified by:
getSuperPropertiesOf in interface OntologyRepositoryService
Parameters:
propertyName - The name of the property in Jena format
Returns:
Set of superproperties names in Jena format
Throws:
UnknownConceptException

getSubPropertiesOf

public java.util.Set getSubPropertiesOf(java.lang.String propertyName)
                                 throws UnknownConceptException
Description copied from interface: OntologyService
Get set of subproperties of the given property.

Specified by:
getSubPropertiesOf in interface OntologyService
Parameters:
propertyName - The name of the property
Returns:
Set of subproperties names
Throws:
UnknownConceptException

testTrue

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

Specified by:
testTrue in interface OntologyService
Specified by:
testTrue in interface OntologyRepositoryService
Parameters:
statement - to test
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 propertyName,
                                                  java.lang.String subjectName)
                                           throws QueryFailure
Description copied from interface: OntologyRepositoryService
Get a single value of the variable satisfying the KIF query: (property subject ?val).

Specified by:
getUniqueValueForProperty in interface OntologyRepositoryService
Parameters:
propertyName - the name of the property in the Jena format
subjectName - the name of the subject in the Jena format
Returns:
a single value (as string in the Jena format) for the property on this subject
Throws:
QueryFailure - if reasoning failed.

getValuesForProperty

public java.util.Set getValuesForProperty(java.lang.String propertyName,
                                          java.lang.String subjectName)
                                   throws QueryFailure
Description copied from interface: OntologyRepositoryService
Get values of the variable satisfying the KIF query: (property subject ?val).

Specified by:
getValuesForProperty in interface OntologyService
Specified by:
getValuesForProperty in interface OntologyRepositoryService
Parameters:
propertyName - the name of the property in the Jena format
subjectName - the name of the subject in the Jena format
Returns:
a set with values (as string in the Jena format) for the property on this subject
Throws:
QueryFailure - if reasoning failed.

getResourcesWithValueForProperty

public java.util.Set getResourcesWithValueForProperty(java.lang.String propertyName,
                                                      java.lang.String value)
                                               throws QueryFailure
Description copied from interface: OntologyRepositoryService
Get values of the variable satisfying the KIF query: (property ?subject value).

Specified by:
getResourcesWithValueForProperty in interface OntologyRepositoryService
Parameters:
propertyName - the name of the property in the Jena format
value - the value as a string in th Jena format
Returns:
a set with name of subjects (in the Jena format) which have the specified value for the given property
Throws:
QueryFailure - if reasoning failed.

getPropertiesApplicableTo

public java.util.List<java.lang.String> getPropertiesApplicableTo(java.lang.String className)
                                                           throws UnknownConceptException
Description copied from interface: OntologyRepositoryService
Get set of properties defined in the given namespace.

Specified by:
getPropertiesApplicableTo in interface OntologyService
Specified by:
getPropertiesApplicableTo in interface OntologyRepositoryService
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
Description copied from interface: OntologyRepositoryService
Get the name of the class defining the range of the specified property for the given class.

Specified by:
getRangeOnPropertyForClass in interface OntologyService
Specified by:
getRangeOnPropertyForClass in interface OntologyRepositoryService
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
Description copied from interface: OntologyRepositoryService
Get values of the selected variable satisfying the KIF query with possibly many variable.

Specified by:
askQuery in interface OntologyRepositoryService
Parameters:
variableName - the name of the selected variable
multiplyVariablesQuery - the query
Returns:
a set with values satisfying the query
Throws:
QueryFailure - if reasoning failed.

areClassesDisjoint

public boolean areClassesDisjoint(java.lang.String firstClass,
                                  java.lang.String secondClass)
                           throws QueryFailure,
                                  DirectoryFailure
Description copied from interface: OntologyRepositoryService
Test if two provided classes are disjoint

Specified by:
areClassesDisjoint in interface OntologyRepositoryService
Parameters:
firstClass - the name of the first class
secondClass - the name of the second class
Returns:
true if the classes are not disjoint
Throws:
QueryFailure - if reasoning failed.
DirectoryFailure

getClassesDefInNamespace

public java.util.Set getClassesDefInNamespace(java.lang.String namespaceName)
                                       throws UnknownNamespaceException
Description copied from interface: OntologyRepositoryService
Get set of classes defined in the given namespace.

Specified by:
getClassesDefInNamespace in interface OntologyRepositoryService
Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of classes names in the Jena format
Throws:
UnknownNamespaceException - if namespaceName is unknown for the ontology repository

getPropertiesDefInNamespace

public java.util.Set getPropertiesDefInNamespace(java.lang.String namespaceName)
                                          throws UnknownNamespaceException
Description copied from interface: OntologyRepositoryService
Get set of properties defined in the given namespace.

Specified by:
getPropertiesDefInNamespace in interface OntologyRepositoryService
Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of properties names in the Jena format
Throws:
UnknownNamespaceException - if namespaceName is unknown for the ontology repository

getInstancesDefInNamespace

public java.util.Set getInstancesDefInNamespace(java.lang.String namespaceName)
                                         throws UnknownNamespaceException
Description copied from interface: OntologyRepositoryService
Get set of instances defined in the given namespace.

Specified by:
getInstancesDefInNamespace in interface OntologyRepositoryService
Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of instances names in the Jena format
Throws:
UnknownNamespaceException - if namespaceName is unknown for the ontology repository

getNamspacesImportedByNamespace

public java.util.Set getNamspacesImportedByNamespace(java.lang.String namespaceName)
                                              throws UnknownNamespaceException
Description copied from interface: OntologyRepositoryService
Get set of namespaces imported by the given namespace.

Specified by:
getNamspacesImportedByNamespace in interface OntologyRepositoryService
Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of namespaces names in the Jena format
Throws:
UnknownNamespaceException - if namespaceName is unknown for the ontology repository

getOntologyDefinitionForConcept

public java.util.Set getOntologyDefinitionForConcept(java.lang.String conceptName)
Description copied from interface: OntologyService
Get set of urls for the given short concept name. Currently it tries to match the concept name with the local name of the ontology definitions url

Specified by:
getOntologyDefinitionForConcept in interface OntologyService
Parameters:
conceptName - A short name of concept, e.g. "Actor"
Returns:
Set of url containing the short concept name

getIndividualActors

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

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

getClassesOfActors

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

Specified by:
getClassesOfActors in interface QueryKAoSOntologyService
Parameters:
baseActorClass - The name of the Actor class which the return classes have to be a subclass of If the name is empty uses Actor as a base class
Returns:
Set of names of Actor subclasses
Throws:
UnknownConceptException - if baseActorClass is unknown for the ontology repository

getIndividualPlaces

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

Specified by:
getIndividualPlaces in interface QueryKAoSOntologyService
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 unknown for the ontology repository

getClassesOfPlaces

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

Specified by:
getClassesOfPlaces in interface QueryKAoSOntologyService
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
Description copied from interface: QueryKAoSOntologyService
Get names of the individual Groups known to the ontology repository being an instance of the specified base class.

Specified by:
getIndividualGroups in interface QueryKAoSOntologyService
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 unknown for the ontology repository

getClassesOfGroups

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

Specified by:
getClassesOfGroups in interface QueryKAoSOntologyService
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 unknown for the ontology repository

getIndividualTargets

public java.util.Set getIndividualTargets(java.lang.String baseTargetClass)
                                   throws UnknownConceptException
Description copied from interface: QueryKAoSOntologyService
Get names of the individual targets (Actors or Entities) known to the ontology repository being an instance of the specified base class.

Specified by:
getIndividualTargets in interface QueryKAoSOntologyService
Parameters:
baseTargetClass - The name of the targets (Actor or Entity) class which the return classes have to be a subclass of
Returns:
Set of names of individual targets (Actors or Entities)
Throws:
UnknownConceptException - if baseTargetClass is unknown for the ontology repository

initiateActionClassTargets

public java.util.List<OntClassPropertyDescription> initiateActionClassTargets(java.lang.String actionClassName,
                                                                              java.lang.String actorClassName)
                                                                       throws DirectoryFailure
Description copied from interface: OntologyService
Get properties applicable to the action class

Specified by:
initiateActionClassTargets in interface OntologyService
Parameters:
actionClassName - the name of the action class performing
actorClassName - the name of the actor class performing the action
Returns:
vector of TargetClassDescription
Throws:
DirectoryFailure

getClassesOfTargets

public java.util.Set getClassesOfTargets(java.lang.String baseTargetClass)
                                  throws UnknownConceptException
Description copied from interface: QueryKAoSOntologyService
Get names of the targets (Actors or Entities) classes known to the ontology repository being a subclass of the specified base class.

Specified by:
getClassesOfTargets in interface QueryKAoSOntologyService
Parameters:
baseTargetClass - The name of the targets (Actor or Entity) class which the return classes have to be a subclass of
Returns:
Set of names of targets (Actors or Entities) subclasses
Throws:
UnknownConceptException - if baseTargetClass is unknown for the ontology repository

declareInstance

public void declareInstance(java.lang.String instanceName,
                            java.lang.String className)
                     throws QueryFailure
Throws:
QueryFailure

declareInstance

public void declareInstance(java.lang.String instanceName,
                            java.lang.String className,
                            boolean rehydrating)
                     throws QueryFailure
Throws:
QueryFailure

getActions

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

Specified by:
getActions in interface QueryKAoSOntologyService
Parameters:
forActor - The name of the Actor class or instance
Returns:
Set of ActionClassDescription
Throws:
UnknownConceptException - if forActor is unknown for the ontology repository

getClassesOfActorsCapableOfPerformingActions

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

Specified by:
getClassesOfActorsCapableOfPerformingActions in interface QueryKAoSOntologyService
Parameters:
actionClass - The name of the Action class
Returns:
Set of Strings containing names of Actor classes
Throws:
UnknownConceptException - if actionClass is unknown for the ontology repository
DirectoryFailure

putSchema

public void putSchema(java.lang.String dataName,
                      java.lang.String dataSchema)
               throws DirectoryFailure
Description copied from interface: OntologyService
Add an XML schema for the given concept

Specified by:
putSchema in interface OntologyService
Specified by:
putSchema in interface XMLRepository
Parameters:
dataName - uri name of the concept
Throws:
DirectoryFailure

getSchema

public java.util.List<java.lang.String> getSchema(java.lang.String dataName)
                                           throws DirectoryFailure
Description copied from interface: OntologyService
Get XML schema of the given concept if such a schema is available

Specified by:
getSchema in interface OntologyService
Specified by:
getSchema in interface XMLRepository
Parameters:
dataName - uri name of the concept
Returns:
A List containing Strings that define the XML schema of the given concept. The reason it is a vector of strings and not just one string is that the definition can be complex, i.e. derived from multiple more primitive schemas, hence this vector contains definitions for all those schemas too.
Throws:
DirectoryFailure

removeSchema

public void removeSchema(java.lang.String dataName)
                  throws DirectoryFailure
Description copied from interface: XMLRepository
Remove the schema for the given data type from this repository.

Specified by:
removeSchema in interface XMLRepository
Parameters:
dataName - the name of the data type to be removed.
Throws:
DirectoryFailure

loadSchema

public void loadSchema(java.lang.String fileName)
                throws DirectoryFailure
Description copied from interface: XMLRepository
Load schema definitions of data types from a file.

Specified by:
loadSchema in interface XMLRepository
Parameters:
fileName - the name of the file or the url that stores schema definitions
Throws:
DirectoryFailure

putMultipleSchema

public void putMultipleSchema(java.util.List<XMLSchemaContainer> schemaList)
                       throws DirectoryFailure
Description copied from interface: XMLRepository
Store multiple schemas in the repository.

Specified by:
putMultipleSchema in interface XMLRepository
Parameters:
schemaList - a list containing XMLSchemaContainer objects.
Throws:
DirectoryFailure

getAllSchema

public java.util.List getAllSchema()
                            throws DirectoryFailure
Description copied from interface: XMLRepository
Retrieve all schemas in the repository.

Specified by:
getAllSchema in interface XMLRepository
Returns:
list containing XMLSchemaContainer objects.
Throws:
DirectoryFailure

addEventListener

public void addEventListener(DomainManagerEventListener listener)
Description copied from interface: DomainManagerEventNotifier
Add an event listener to the collection of objects to be notified by the Domain Manager about a domain event.

Those listeners must establish a trust relationship with the Domain Manager in order to receive domain events.

Specified by:
addEventListener in interface DomainManagerEventNotifier
Parameters:
listener - The listener to be notified about a domain event.

addEventListener

public void addEventListener(DirectoryEventListener listener)
Specified by:
addEventListener in interface DirectoryEventNotifier

removeEventListener

public void removeEventListener(DirectoryEventListener listener)
Specified by:
removeEventListener in interface DirectoryEventNotifier

removeEventListener

public void removeEventListener(DomainManagerEventListener listener)
Description copied from interface: DomainManagerEventNotifier
Remove an event listener from the collection of objects to be notified by the Domain Manager about a domain event.

Those listeners have established a trust relationship with the Domain Manager prior to receiving domain events.

Specified by:
removeEventListener in interface DomainManagerEventNotifier
Parameters:
listener - The listener to be removed from the collection of domain events listeners.

addRemoteEventListener

public void addRemoteEventListener(Locator l)
Specified by:
addRemoteEventListener in interface DirectoryEventNotifier

removeRemoteEventListener

public void removeRemoteEventListener(Locator l)
Specified by:
removeRemoteEventListener in interface DirectoryEventNotifier

getAbsoluteObligationsForTriggerConditionForAC

public java.util.Vector getAbsoluteObligationsForTriggerConditionForAC(java.lang.String triggerAC)
                                                                throws ServiceFailure
Throws:
ServiceFailure

checkAbsolutePermission

public void checkAbsolutePermission(java.lang.String checkedActionClass)
                             throws KAoSSecurityException,
                                    java.lang.NullPointerException,
                                    ServiceFailure
Throws:
KAoSSecurityException
java.lang.NullPointerException
ServiceFailure

registerObserver

public void registerObserver(java.lang.String updateType,
                             java.lang.Object updateCondition,
                             KAoSObserver observer)
Description copied from interface: KAoSObservable
Register the given KAoSObserver with this KAoSObservable for updates described by the updateType and updateConstraints.

Specified by:
registerObserver in interface KAoSObservable
Parameters:
updateType - String indicating type of update the KAoSObserver is interested in.
updateCondition - Object describing the conditions under which to send the update.
observer - KAoSObserver registering with for updates.

deregisterObserver

public void deregisterObserver(java.lang.String updateType,
                               java.lang.Object updateCondition,
                               KAoSObserver observer)
Description copied from interface: KAoSObservable
Deregister the given KAoSObserver for the given update type from the registry of observers associated with this KAoSObservable.

Specified by:
deregisterObserver in interface KAoSObservable
Parameters:
updateType - String indicating type of update the KAoSObserver is no longer interested in.
observer - KAoSObserver deregistering.

notify

public void notify(java.lang.String updateType,
                   java.lang.Object updateCondition,
                   java.lang.Object update)
Description copied from interface: KAoSObservable
Notify observers interested in the given updateType wiht the given update object.

Specified by:
notify in interface KAoSObservable
Parameters:
updateType - String describing the type of update to perform.
update - Object containing the update.

policiesSynchronizationRequest

public void policiesSynchronizationRequest(java.util.List<java.lang.String> myCurrentPoliciesIds,
                                           java.util.List<java.lang.Long> myCurrentPoliciesTimeStamps)
                                    throws DirectoryFailure
Description copied from interface: GuardSynchronization
Send a list of the current policies ids and associated with them timestamps in the second list. This should allow DS to determine if an update is needed.

Specified by:
policiesSynchronizationRequest in interface GuardSynchronization
Parameters:
myCurrentPoliciesIds - The List of the current policies ids.
myCurrentPoliciesTimeStamps - The List of the current policies timestamps.
Throws:
DirectoryFailure

instancesSetSynchronizationRequest

public void instancesSetSynchronizationRequest(java.util.List<java.lang.String> myCurrentInstancesClassesURL,
                                               java.util.List<java.lang.Long> myCurrentInstancesSetsTimeStamps)
                                        throws DirectoryFailure
Description copied from interface: GuardSynchronization
Send a list of the current classes for which instances set are stored in the Guard and associated with them timestamps in the second list. This should allow DS to determine if an update is needed.

Specified by:
instancesSetSynchronizationRequest in interface GuardSynchronization
Parameters:
myCurrentInstancesClassesURL - The List of the current classes for which instances set are stored in the Guard identified by URLs.
myCurrentInstancesSetsTimeStamps - The List of the current instances set timestamps.
Throws:
DirectoryFailure

subclassesSetSynchronizationRequest

public void subclassesSetSynchronizationRequest(java.util.List myCurrentSubclassesClassesURL,
                                                java.util.List myCurrentSubclassesSetsTimeStamps)
                                         throws DirectoryFailure
Description copied from interface: GuardSynchronization
Send a list of the current classes for which subclasses set are stored in the Guard and associated with them timestamps in the second list. This should allow DS to determine if an update is needed.

Specified by:
subclassesSetSynchronizationRequest in interface GuardSynchronization
Parameters:
myCurrentSubclassesClassesURL - The List of the current classes for which subclasses set are stored in the Guard identified by URLs.
myCurrentSubclassesSetsTimeStamps - The List of the current subclasses set timestamps.
Throws:
DirectoryFailure

superclassesSetSynchronizationRequest

public void superclassesSetSynchronizationRequest(java.util.List<java.lang.String> myCurrentSuperclassesClassesURL,
                                                  java.util.List<java.lang.Long> myCurrentSuperclassesSetsTimeStamps)
                                           throws DirectoryFailure
Description copied from interface: GuardSynchronization
Send a list of the current classes for which superclasses set are stored in the Guard and associated with them timestamps in the second list. This should allow DS to determine if an update is needed.

Specified by:
superclassesSetSynchronizationRequest in interface GuardSynchronization
Parameters:
myCurrentSuperclassesClassesURL - The List of the current classes for which superclasses set are stored in the Guard identified by URLs.
myCurrentSuperclassesSetsTimeStamps - The List of the current superclasses set timestamps.
Throws:
DirectoryFailure

subpropertiesSetSynchronizationRequest

public void subpropertiesSetSynchronizationRequest(java.util.List<java.lang.String> myCurrentSubpropertiesPropertyURL,
                                                   java.util.List<java.lang.Long> myCurrentSubpropertiesSetsTimeStamps)
                                            throws DirectoryFailure
Description copied from interface: GuardSynchronization
Send a list of the current properties for which subproperties set are stored in the Guard and associated with them timestamps in the second list. This should allow DS to determine if an update is needed.

Specified by:
subpropertiesSetSynchronizationRequest in interface GuardSynchronization
Parameters:
myCurrentSubpropertiesPropertyURL - The List of the current properties for which subproperties set are stored in the Guard identified by URLs.
myCurrentSubpropertiesSetsTimeStamps - The List of the current subproperties set timestamps.
Throws:
DirectoryFailure

superpropertiesSetSynchronizationRequest

public void superpropertiesSetSynchronizationRequest(java.util.List<java.lang.String> myCurrentSuperpropertiesPropertyURL,
                                                     java.util.List<java.lang.Long> myCurrentSuperpropertiesSetsTimeStamps)
                                              throws DirectoryFailure
Description copied from interface: GuardSynchronization
Send a list of the current properties for which superproperties set are stored in the Guard and associated with them timestamps in the second list. This should allow DS to determine if an update is needed.

Specified by:
superpropertiesSetSynchronizationRequest in interface GuardSynchronization
Parameters:
myCurrentSuperpropertiesPropertyURL - The List of the current properties for which superproperties set are stored in the Guard identified by URLs.
myCurrentSuperpropertiesSetsTimeStamps - The List of the current superproperties set timestamps.
Throws:
DirectoryFailure

isSynchronizationNeeded

public boolean isSynchronizationNeeded(java.lang.Long myLastUpdateTimeStamp)
                                throws DirectoryFailure
Description copied from interface: GuardSynchronization
Check with DS if synchronization is needed by providing the timestamp of the last update.

Specified by:
isSynchronizationNeeded in interface GuardSynchronization
Parameters:
myLastUpdateTimeStamp - The timestamp of the last update
Throws:
DirectoryFailure

setGuarded

public void setGuarded(boolean guarded)

setGuardRegistered

public void setGuardRegistered(boolean registered)

establishAgentDescription

protected DefaultKAoSAgentDescription establishAgentDescription(KAoSServiceRoot ksr)

createMyDomain

protected java.lang.String createMyDomain()
                                   throws AlreadyRegisteredException,
                                          DirectoryFailure
Throws:
AlreadyRegisteredException
DirectoryFailure

bindToMessageTransportService

protected Locator bindToMessageTransportService(MessageTransportService mts)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

obtainEntityEnv

protected JasBean obtainEntityEnv()

getGuardInfo

public java.util.Map getGuardInfo(java.lang.String guardId)

getGuards

public java.util.Enumeration getGuards()

distributePolicyUpdate

protected void distributePolicyUpdate(java.util.List<PolicyMsg> addedPolicies,
                                      java.util.List<PolicyMsg> changedPolicies,
                                      java.util.List<PolicyMsg> removedPolicies,
                                      boolean setPolicies)

sendPolicyUpdate

protected void sendPolicyUpdate(java.util.List locators,
                                java.util.List addedPolicies,
                                java.util.List changedPolicies,
                                java.util.List removedPolicies,
                                boolean setPolicies,
                                java.lang.String guardGUID)

getID

public java.lang.String getID()
Description copied from interface: KAoSObserver
Return the unique identifier of this observer.

Specified by:
getID in interface KAoSObserver
Returns:
String containing the unique ID of this observer.

update

public void update(java.lang.String observableID,
                   java.lang.String updateType,
                   java.lang.Object updateCondition,
                   java.lang.Object update)
            throws NotificationException
Description copied from interface: KAoSObserver
Receive an update from the KAoSObservable when the KAoSObservable has a change or event to report.

Specified by:
update in interface KAoSObserver
Parameters:
observableID - String identifying the KAoSObservable sending the update.
updateType - String indicating type of update.
updateCondition - String describing the condition of the update.
update - Object containing the update.
Throws:
NotificationException - when the update fails.