kaos.core.service.directory
Class KAoSDirectoryService

java.lang.Object
  extended by kaos.core.service.directory.KAoSDirectoryService
All Implemented Interfaces:
KAoSObservable, KAoSObserver, DirectoryEventNotifier, DirectoryService, DomainDirectoryService, DomainManagerEventNotifier, KAoSOntologyQueryService, OntologyRepositoryService, GuardSynchronization, OntologyInterfaces, PolicyAnalyzes, PolicyDirectory, PolicyModification, PolicySetDirectory, AuthorizationPolicyDisclosure, ObligationPolicyDisclosure, PolicyDisclosure, XMLRepository
Direct Known Subclasses:
GridDirectoryServicePolicyCert

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

$Revision: 1.188 $


Nested Class Summary
protected static class KAoSDirectoryService.OperationWaiter
          This class is used as a helper class to block Thread registering the Directory service.
 
Field Summary
protected  boolean _allowReregistration
           
protected  boolean _guarded
           
protected  boolean _guardRegistered
           
protected  Locator _locator
           
protected  MessageReceiver _messageReceiver
           
protected  MessageTransportService _mts
           
protected  AgentName _name
           
protected  java.lang.String _nickName
           
protected  java.util.Hashtable _observers
           
protected  TransportSystem _transportSystem
           
protected  java.util.Hashtable _userDescHashtable
           
static java.lang.String AGENTS
           
static java.lang.String ALL_UPDATES
           
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 java.lang.String LOCATOR_NAME
           
static java.lang.String MY_DESCRIPTION
          Private constants.
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 addEventListener(DirectoryEventListener listener)
           
 void addEventListener(DomainManagerEventListener listener)
          Add an event listener to the collection of objects to be notified by the Directory Service about a domain event.
 void addFilteredNamespace(java.lang.String namespace)
          This method add a nemaspace to the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.
 void addPolicies(java.util.Vector policies)
          Each element of the Vector is a definition of a policy to be added to the collection of policies of the entity associated with that policy.
 void addPolicy(Msg policy)
          Add policy to the collection of policies of the entity associated with that policy.
 java.lang.String addPolicy(PolicyInformation policy, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to add the given policy object to its database.
 void addPolicySet(Msg policySet)
          BEGIN - kaos.policy.management.PolicySetDirectory interface implementation
 void addPolicySets(java.util.Vector policySets)
          Each element of the Vector is an instance of a Msg class specifying an individual policy set fields
 void addRemoteEventListener(Locator l)
           
 void allowReregistration(boolean allow)
           
 java.lang.String analyzeWorkflow(java.lang.String owlsWorkflow)
          Modify the given OWL-S workflow based on policies that apply the actions in workflow.
 java.lang.String analyzeWorkflow(java.net.URL owlsWorkflow)
          Modify the given OWL-S workflow based on policies that apply the actions in workflow.
 boolean areClassesDisjoint(java.lang.String firstClass, java.lang.String secondClass)
          Test if two provided classes are disjoint
 java.util.Set askQuery(java.lang.String variableName, java.lang.String multiplyVariablesQuery)
          Get values of the selected variable satisfing the KIF query with possibly many variable.
protected  Locator bindToMessageTransportService(MessageTransportService mts)
           
protected  void bindToMTS()
           
protected  java.lang.String callWorkflowChecker(java.lang.Object workflowParam)
          Uses reflection to invoke the WorkflowChecker.analyzeWorkflow() method *if* the class is present, otherwise just returns null
 java.lang.String changeComponentEnabledStatus(java.lang.String repType, java.lang.String associatedOntType, java.lang.Boolean state, java.lang.String guardRepMgrID)
          changes the 'enabled' status of the given component
 void changedPriority(java.lang.String policyId, int newPriority)
          Method allowing to modify priority of a policy to either eliminate conflict or to alter policy precedence relation
 void changePolicies(java.util.Vector policies)
          Each element of the Vector is a definition of a policy to replace its current definition in the collection of policies of the entity associated with that policy.
 void changePolicy(Msg policy)
          Change policy of the entity associated with that policy.
 void changePolicySet(Msg policySet)
           
 void changePolicySets(java.util.Vector policySets)
           
 void checkAbsolutePermission(java.lang.String checkedActionClass)
          The method check if the given action class is absolutly permitted according to the current set of policies
 void checkDeepPermission(java.security.Permission perm, java.lang.Object context)
          The method checks if the given action is permitted according to the current set of policies.
 void checkPermission(java.security.Permission perm, java.lang.Object context)
          The method check if the given action is permitted according to the current set of policies
 AgentDescription createAgentDescription()
          Create an empty AgentDescription suitable for attribute population and use.
protected  java.lang.String createMyDomain()
          subclasses may override this if they want to join a domain other than "Policy Management"
 void declareInstance(java.lang.String instanceName, java.lang.String className)
           
 void declareInstance(java.lang.String instanceName, java.lang.String className, boolean rehydrating)
           
 java.lang.String deleteAllLogs(java.lang.String historyMonitorID)
          Ask the specified HistoryMonitor to delete all the events logged so far.
 java.lang.String deleteLogsforActionType(java.lang.String actionType, java.lang.String historyMonitorID)
          Ask the specified HistoryMonitor to delete all logged events that contain the given action type.
 java.lang.String deleteLogsforActor(java.lang.String actorID, java.lang.String historyMonitorID)
          Ask the specified HistoryMonitor to delete all logged events that contain the given actor.
 java.lang.String deleteSpecifiedLogs(java.lang.String actionType, java.lang.String actorID, java.lang.String startTime, java.lang.String endTime, java.lang.Boolean latest, java.lang.String historyMonitorID)
          This method internally calls 'getSpecifiedLogs' with its input parameters and then deletes the logs returned by that call.
 void deregister(AgentDescription desc)
          Remove the AgentDescription from the collection of domain entities registered in the directory.
 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 addedPolicies, java.util.List changedPolicies, java.util.List removedPolicies, boolean setPolicies)
          Distributes a policy to the guard(s) possessing interest registration to which the policy applies
 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 findPoliciesMadeRedundant(java.lang.String policyId)
          Method find all the policies with higher priority making the specified policy redundant
 java.util.List findPoliciesMakingRedundant(java.lang.String policyId)
          Method find all the policies with higher priority making the specified policy redundant
 java.util.Vector findPolicyDecision(java.security.Permission perm, java.lang.Object context)
          The method checks if the given action is permitted according to the current set of policies, or if the given action is a trigger for some obligation policy.
 java.util.Vector getAbsoluteObligationsForTriggerConditionForAC(java.lang.String triggerAC)
          Based on the specified trigger ActionClassDescription, select all absolute classes of obligations
 java.util.Set getActions(java.lang.String forActor)
          Get descriptions of the Action classes the specified Actor class or instance can perfom based on its class.
protected  AgentName getAgentName(ServiceRoot sr)
           
 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.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.lang.String getAllKAoSExtensionComponents(java.lang.String repType, java.lang.String guardRepMgrID)
          Ask the specified GuardRepositoryManager to get all components contained in this repository.
 java.lang.String getAllLogs(java.lang.String historyMonitorID)
          Ask the specified HistoryMonitor to get all the events logged so far.
 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)
          In this case, there are NO properties specified.
 java.util.Vector getAllowableValuesForActionProperties(java.util.Vector propertyNames, ActionInstanceDescription actionDesc, boolean tight)
          This function is used when the agent/enforcer has only partial information about an action and would like to determine what range of properties can be allowed by the policy set.
 java.util.Vector getAllowableValuesForActionProperties(java.util.Vector propertyNames, ActionInstanceDescription actionDesc, java.lang.Boolean tight)
           
 java.util.Set getAllowableValuesForActionProperty(java.lang.String origPropertyName, ActionInstanceDescription origActionDesc, java.util.Set allTargetValues, boolean tight)
          This function is used when the enforcer has only partial information about an action and needs to determine what range of a property can be allowed by the policy.
 java.lang.String getAllPolicies(java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to get all policy objects contained in its database.
 java.util.List getAllSchema()
          to retrieve all schemas in the repositiry.
 java.util.Vector getApplicablePoliciesForEntity(java.lang.String entityId)
          Obtain the set of policies directly and indirectly applicable to a specified entity.
 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.lang.String getComponentEnabledStatus(java.lang.String repType, java.lang.String associatedOntType, java.lang.String guardRepMgrID)
          get the 'enabled' status of the given component
 java.util.Vector getConditionalPolicies()
           
 java.util.List getConstructedOntologyStructures()
          This method retrieves all user defined ontlogy structures in the repositiry.
 DomainDescription getDomainDescription(java.lang.String domainName)
          Get the description of a domain
 java.util.List getDomainDescriptionsForGuard(java.lang.String guardGUID)
          Obtain a List containing DomainDescriptions of all domains the guard, whose GUID is specified, registered in.
 java.util.Vector getDomainNames()
          Obtain a List of the names of all registered domains.
 java.util.Map getDomainStructure(java.lang.String domainName)
          Obtain a Map containing the structure of a domain.
 java.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 getGuardDescriptionsForEntity(java.lang.String entityID)
          method to return a vector of guard descriptions of the guards for the given entity
 java.util.Map getGuardInfo(java.lang.String guardId)
          Auxiliary methods /
 java.util.Enumeration getGuards()
           
 java.lang.String getGuardStateFor(java.lang.String guardID)
          method for getting the state of the specified guard
 java.lang.String getID()
          Return the unique identifier of this observer.
 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.
 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.lang.String getKAoSExtensionComponents(java.lang.String repType, java.lang.String associatedOntType, java.lang.String guardRepMgrID)
          Ask the specified GuardRepositoryManager a request to get the KAoSExtensionComponents object for the given type.
 KAoSUserDescription getKAoSUserDescription(java.lang.String userid)
          Obtain the user's KAoSUserDescription from a hashtable.
 java.util.Set getListOfLoadedOntologies()
          This method returns a set of urls depicting ontologies loaded into the JTP.
 java.lang.String getLogsforActionType(java.lang.String actionType, java.lang.String historyMonitorID)
          Ask the specified HistoryMonitor to get all events logged that contain the given action type.
 java.lang.String getLogsforActor(java.lang.String actorID, java.lang.String historyMonitorID)
          Ask the specified HistoryMonitor to get all logged events that contain the given actor.
 java.util.Set getNamspacesImportedByNamespace(java.lang.String namespaceName)
          Get set of namspaces imported by the given namespace.
 java.util.Vector getObligationsForTriggerCondition(ActionInstanceDescription triggerAID)
          Based on the specified trigger ActionInstanceDescription, select all matching control BasicActionDescription, which define the obligations for the trigger.
 java.util.Set getOntologyDefinitionForConcept(java.lang.String conceptName)
          Get set of namspaces imported by the given namespace.
 java.util.List getPolicies()
          Obtain a Vector over all policies.
 java.util.Map getPoliciesByEntities()
          Obtain a table of all original policies (pre-deconfliction and Ontology->XML conversion) in the system, indexed by the id(s) of the entity(s) to which they apply
 java.util.List getPoliciesForActionType(java.lang.String actionType)
          Get policies for the specified action type.
 java.util.Vector getPoliciesForEntity(java.lang.String id)
          Obtain a Vector over all policies associated with an entity whose id is specified.
 Msg getPolicy(java.lang.String policyId)
          Obtain a policy based on id
 java.lang.String getPolicy(java.lang.String policyID, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to get the policy for the given policy id.
 PolicySetMsg getPolicySet(java.lang.String policySetId)
           
 java.util.List getPolicySets()
          Obtain an Vector over all policy sets.
 java.lang.Integer getPolicyUpdateCount()
          Returns count of the number of times the policy has been updated.
 java.util.Vector getPropertiesApplicableTo(java.lang.String className)
          Get set of properties defined in the given namespace.
 java.util.Set getPropertiesDefInNamespace(java.lang.String namespaceName)
          Get set of properties defined in the given namespace.
 java.lang.String 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.lang.String getRepositoryTableInformation(java.lang.String repType, java.lang.String guardRepMgrID)
          This method returns the concepts names and their corresponding component names in a Hashtable.
 java.util.Set getResourcesWithValueForProperty(java.lang.String propertyName, java.lang.String value)
          Get values of the variable satisfing the KIF query: (property ?subject value).
 java.util.Vector getRootDomains()
          Obtain an Enumeration of the names of the root domains (domains with no parent)
 java.util.Vector getSchema(java.lang.String dataName)
          to retrieve the schema for the given data type.
 ServiceProperties getServiceProperties()
          Obtain the properties of the service.
 java.lang.String getSpecifiedLogs(java.lang.String actionType, java.lang.String actorID, java.lang.String startTime, java.lang.String endTime, java.lang.Boolean latest, java.lang.String historyMonitorID)
          Ask the specified HistoryMonitor for the logged events specified by the given parameters.
 java.util.Set getSubClassesOf(java.lang.String className)
          Get set of subclasses of the given class.
 java.util.Vector getSubdomains(java.lang.String domainName)
          Obtain an Enumeration of the names of subdomains of a particular domain (returns immediate children only)
 java.util.Set getSubPropertiesOf(java.lang.String propertyName)
          Get set of subproperties of the given property.
 java.util.Set getSuperClassesOf(java.lang.String className)
          Get set of superclasses of the given class.
 java.util.Set getSuperPropertiesOf(java.lang.String propertyName)
          Get set of superproperties of the given property.
 java.util.Set getUltimateOntologyTypesOfIndividual(java.lang.String individualName)
          Finds the ultimate Ontology type of the provided individual
 java.lang.String getUniqueValueForProperty(java.lang.String propertyName, java.lang.String subjectName)
          Get a single value of the variable satisfing the KIF query: (property subject ?val).
 java.util.Set getValuesForProperty(java.lang.String propertyName, java.lang.String subjectName)
          Get values of the variable satisfing 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)
           
 void initLogDomainEvents()
           
 void instancesSetSynchronizationRequest(java.util.List myCurrentInstancesClassesURL, java.util.List 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 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
 java.lang.String isGuardLoggingActive(java.lang.String historyMonitorID)
           
 boolean isMadeFullyRedundantByPolicyUnion(java.lang.String firstPolicyId, java.util.List listOfPolicies)
          Method finds out if the specified policy is beign made redundant (fully coverd) by the union of specified policies with higher priority in the repository
 boolean isMadeFullyRedundantBySecond(java.lang.String firstPolicyId, java.lang.String secondPolicyId)
          Method finds out if the specified policy is beign made redundant (fully coverd) by the second specified policy with higher priority in the repository
 boolean isMadeParitallyRedundantBySecond(java.lang.String firstPolicyId, java.lang.String secondPolicyId)
          Method finds out if the specified policy is beign made partially redundant (partially coverd) by the second specified policy with higher priority in the repository
 boolean isPartiallyOverlappedBySecondPolicy(java.lang.String firstPolicyId, java.lang.String secondPolicyId)
          Method finds out if the specified policy is partially overlapped by the second specified policy, the necessary condition is that the two policies have the same modality
 boolean isPolicyInConflict(java.lang.String policyId)
          Method finds out if the specified policy is in conflict with some policies with the same priority in the repository
 boolean isPolicyMakingRedundantSomeOtherPolicy(java.lang.String policyId)
          Method finds out if the specified policy makes redundant (fully or partially) some policies with lower priority in the repository
 boolean isPolicyRedundant(java.lang.String policyId)
          Method finds out if the specified policy is beign made redundant (fully or partially) by some policies with higher priority in the repository
 boolean isSynchronizationNeeded(java.lang.Long myLastUpdateTimeStamp)
          Check with DS if synchronization is needed by providing the timstamp of the last update.
 boolean isUserRegistered(java.lang.String userid, java.lang.String password)
          Check if the user is already registered with KAoS
 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)
          This is a fix to support remote invocation via MethodCallRequestMsg.
 void loadOntology(SerializableOntModelImpl myOntModel, boolean recursiveLoad, boolean rehydrating)
           
 void loadOntology(java.lang.String myURL, boolean recursiveLoad)
          Loads ontology from the provided url.
 void loadOntology(java.lang.String myURL, java.lang.Boolean recursiveLoad)
          This is a fix to support remote invocation via MethodCallRequestMsg.
 void loadSchema(java.lang.String fileName)
          to load schema definitions of data types from a file.
static void main(java.lang.String[] args)
          Main program.
 void modify(AgentDescription desc)
          Replace the AgentDescription in the collection of registered domain entities with the new AgentDescription.
 void modifyEntityProperties(java.lang.String entityGUID, java.util.List properties)
          Modify properties of the entity identified by the given entityGUID.
 void 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 myCurrentPoliciesIds, java.util.List myCurrentPoliciesTimeStamps)
          Send a list of the current policies ids and associated with them timestamps in the second list.
 void putConstructedOntologyStructures(java.util.List ontologyStructureList)
          This method stores multiple ontology structures in the repositiry.
 void putMultipleSchema(java.util.List schemaList)
          to store multiple schemas in the repositiry.
 void putSchema(java.lang.String dataName, java.lang.String dataSchema)
          to store the given schema definition under the name of that user defined data type
 void receiveMessage(TransportMessage msg)
          javax.agent.service.transport.MessageListener interface implementation - begin
 java.lang.String refreshAllPoliciesComplete(java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to refresh all cached property values for all policies in this database.
 java.lang.String refreshAllPoliciesPartial(java.util.Vector properties, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to refresh cached values of only those properties that are specified for all the policies in this database.
 java.lang.String refreshPolicyComplete(java.lang.String policyID, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to refresh all cached property values for the given policy.
 java.lang.String refreshPolicyPartial(java.lang.String policyID, java.util.Vector properties, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to refresh cached values of only those properties that are specified for the given policy.
 java.lang.String refreshSpecifiedPoliciesComplete(java.util.Vector policyIDs, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to refresh cached values of all properties of the specified policies.
 java.lang.String refreshSpecifiedPoliciesPartial(java.util.Vector policyIDs, java.util.Vector properties, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to refresh cached values of only those properties that are specified for only specified policies.
 void register(AgentDescription desc)
           
 void register(AgentDescription desc, boolean rehydrating)
          Add the AgentDescription to the collection of domain entities registered in the directory.
 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 policies)
          kaos.domain.management.DomainDirectoryService interface implementation - end /****************************************************************************************** /** Rehydrate policies Adds the policies to the directory service, but does not distribute them.
 java.lang.String removeAllKAoSExtensionComponents(java.lang.String repType, java.lang.String guardRepMgrID)
          Ask the specified GuardRepositoryManager to remove all components contained in this repository.
 java.lang.String removeAllPolicies(java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to to remove all policy objects contained in this database.
 void removeEventListener(DirectoryEventListener listener)
           
 void removeEventListener(DomainManagerEventListener listener)
          Remove an event listener from the collection of objects to be notified by the Directory Service about a domain event.
 void removeExecEnv(java.lang.String execEnvID)
          Retrieve a Hashtable containing information about a VM with the specified id from the _executionEnvs table and remove it.
 void removeFilteredNamespace(java.lang.String namespace)
          This method remove a nemaspace from the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.
 java.lang.String removeKAoSExtensionComponent(java.lang.String repType, java.lang.String extCompName, java.lang.String guardRepMgrID)
          Ask the specified GuardRepositoryManager to remove from this repository the KAoSExtensionComponent specified by the given reference.
 void removePolicies(java.util.List policies)
          Each element of the List is a definition of a policy to be removed from the collection of policies of the entity associated with that policy.
 void removePolicy(Msg policy)
          Remove policy from the collection of policies of the entity associated with that policy.
 java.lang.String removePolicy(java.lang.String policyID, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to remove from its database the policy object for the given policy id.
 void removePolicySet(Msg policySet)
           
 void removePolicySets(java.util.Vector policySets)
           
 void removeRemoteEventListener(Locator l)
           
 void removeSchema(java.lang.String dataName)
          to remove the schema for the given data type from this repository.
 AgentDescription[] search(AgentDescription desc)
          Search the collection of AgentDescriptions for all matching descriptions.
 AgentDescription[] search(AgentDescription desc, int maxResults)
          Search the collection of AgentDescriptions for all matching descriptions.
 AgentDescription[] search(AgentDescription desc, java.lang.Integer maxResults)
          This is a temporary fix for being able to use Reflection in invoking the search (AgentDescription desc, int maxResults) method.
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)
          Sends a policy update to a guard
 void sendStatusUpdate(java.lang.String methodName, java.lang.String status)
           
 void setConditionalPolicies(java.util.Vector condPols)
           
 void setGuarded(boolean guarded)
          Methods implementing Guarded KAoSDirectoryService
 java.lang.String setGuardLoggingState(java.lang.Boolean logging, java.lang.String historyMonitorID)
          kaos.policy.history.HistoryMonitorrForwarder interface implementation - begin
 void setGuardRegistered(boolean registered)
           
 java.lang.String setKAoSExtensionComponent(java.lang.String repType, java.lang.String associatedOntType, KAoSExtensionComponent extComp, java.lang.String guardRepMgrID)
          Ask the specified GuardRepositoryManager to set KAoSExtensionComponent for the given ontology type.
 java.lang.String setPolicy(java.lang.String policyID, PolicyInformation policy, java.lang.String policyDBManagerID)
          Ask the specified PolicyDBManager to set the policy object for the given policy id.
 void setServiceProperties(ServiceProperties props)
          Set the properties of the service.
 void setUsePolCert(boolean usePolCert)
           
 java.util.List splitPolicy(java.lang.String splitPolicy, java.lang.String secondPolicy)
          Method spliting the controlled action of the selected policy one part that overlaps with the second policy and the other part which does not.
 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 myCurrentSubpropertiesPropertyURL, java.util.List 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 myCurrentSuperclassesClassesURL, java.util.List 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 myCurrentSuperpropertiesPropertyURL, java.util.List 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 updatePolicies(java.util.List addedPolicies, java.util.List changedPolicies, java.util.List removedPolicies)
           
 
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

ALL_UPDATES

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

_nickName

protected java.lang.String _nickName

_name

protected AgentName _name

_transportSystem

protected TransportSystem _transportSystem

_allowReregistration

protected boolean _allowReregistration

_guarded

protected boolean _guarded

_guardRegistered

protected boolean _guardRegistered

_locator

protected Locator _locator

_messageReceiver

protected MessageReceiver _messageReceiver

_mts

protected MessageTransportService _mts

_userDescHashtable

protected java.util.Hashtable _userDescHashtable

_observers

protected java.util.Hashtable _observers

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
Private constants. /

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
Constructor Detail

KAoSDirectoryService

public KAoSDirectoryService()
Method Detail

allowReregistration

public void allowReregistration(boolean allow)

initLogDomainEvents

public void initLogDomainEvents()

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)

getAgentName

protected AgentName getAgentName(ServiceRoot sr)
                          throws java.lang.Exception
Throws:
java.lang.Exception

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)

receiveMessage

public void receiveMessage(TransportMessage msg)
javax.agent.service.transport.MessageListener interface implementation - begin


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
Obtain the properties of the service.

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

setServiceProperties

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

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

createAgentDescription

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

This method may return null.

Returns:
a new AgentDescription

deregister

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

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

modify

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

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

register

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

register

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

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

registerNodeEnforcer

public void registerNodeEnforcer(java.lang.String guardId)

search

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

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

search

public AgentDescription[] search(AgentDescription desc,
                                 java.lang.Integer maxResults)
                          throws SearchException,
                                 DirectoryFailure
This is a temporary fix for being able to use Reflection in invoking the search (AgentDescription desc, int maxResults) method. We coud not use Reflection with int as arguments.

Throws:
SearchException
DirectoryFailure

search

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

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

modifyEntityProperties

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

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

getAllAgentsInDirectory

public java.util.List getAllAgentsInDirectory()
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 domain.

getAllGuardsInDirectory

public java.util.List getAllGuardsInDirectory()
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)
method to return a vector of guard descriptions of the guards for the given entity

Parameters:
entityID - A String indicating the guid of the entity.
Returns:
A Vector containing the guard descriptions (if any)

getAllDomainsInDirectory

public java.util.Vector getAllDomainsInDirectory()
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)
Search for the domain entity with the specified id.

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

getDomainDescription

public DomainDescription getDomainDescription(java.lang.String domainName)
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)
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)
Obtain a Map containing the structure of a domain.

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

removeExecEnv

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

Specified by:
removeExecEnv in interface DomainDirectoryService
Parameters:
execEnvID - the id of the VM to be removed from the _executionEnvs table.

getRootDomains

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

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

getDomainNames

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

Returns:
Vector of Strings of the names of domains.

getSubdomains

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

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

getKAoSUserDescription

public KAoSUserDescription getKAoSUserDescription(java.lang.String userid)
                                           throws NotRegisteredException
Obtain the user's KAoSUserDescription from a hashtable.

Parameters:
userid - the user id
Returns:
KAoSUserDescription representing the user password and role list.
Throws:
NotRegisteredException

isUserRegistered

public boolean isUserRegistered(java.lang.String userid,
                                java.lang.String password)
                         throws NotRegisteredException
Check if the user is already registered with KAoS

Parameters:
userid - the user id
password - the user password
Returns:
true if the user is already registered. False otherwise.
Throws:
NotRegisteredException

rehydratePolicies

public void rehydratePolicies(java.util.List policies)
                       throws OntologyPolicyIncorrect,
                              PoliciesHarmonizedException,
                              PrecedenceUndeterminedException
kaos.domain.management.DomainDirectoryService interface implementation - end /****************************************************************************************** /** 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:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

updatePolicies

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

addPolicy

public void addPolicy(Msg policy)
               throws OntologyPolicyIncorrect,
                      PoliciesHarmonizedException,
                      PrecedenceUndeterminedException
Add policy to the collection of policies of the entity associated with that policy.

Specified by:
addPolicy in interface PolicyDirectory
Parameters:
policy - The Msg containing policy definition for a given entity.
Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

addPolicies

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

Specified by:
addPolicies in interface PolicyDirectory
Parameters:
policies - The Vector of policies to be added to policies of their corresponding entities.
Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

removePolicy

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

Specified by:
removePolicy in interface PolicyDirectory
Parameters:
policy - The Msg containing policy definition to be removed.

removePolicies

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

Specified by:
removePolicies in interface PolicyDirectory
Parameters:
policies - The List of policies to be removed from policies of their corresponding entities.

changePolicy

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

Specified by:
changePolicy in interface PolicyDirectory
Parameters:
policy - The Msg containing policy definition to be changed for a given entity.
Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

changePolicies

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

Specified by:
changePolicies in interface PolicyDirectory
Parameters:
policies - The Vector of policies to replace their current definitions.
Throws:
OntologyPolicyIncorrect
PoliciesHarmonizedException
PrecedenceUndeterminedException

getPolicies

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

Specified by:
getPolicies in interface PolicyDirectory
Returns:
Vector of policy Msgs.

getPolicy

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

Specified by:
getPolicy in interface PolicyDirectory
Returns:
the requested policy

getPoliciesByEntities

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

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

getPoliciesForEntity

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

Specified by:
getPoliciesForEntity in interface PolicyDirectory
Parameters:
id - The String containing the id of entity whose policies are being requested.
Returns:
Vector of policy Msgs.

getApplicablePoliciesForEntity

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

Specified by:
getApplicablePoliciesForEntity in interface PolicyDirectory
Parameters:
entityId - id of the entity
Returns:
Vector of PolicyMsg
Throws:
DirectoryFailure

getConditionalPolicies

public java.util.Vector getConditionalPolicies()
Specified by:
getConditionalPolicies in interface PolicyDirectory

setConditionalPolicies

public void setConditionalPolicies(java.util.Vector condPols)
Specified by:
setConditionalPolicies in interface PolicyDirectory

addPolicySet

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

Specified by:
addPolicySet in interface PolicySetDirectory

addPolicySets

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

Specified by:
addPolicySets in interface PolicySetDirectory
Parameters:
policySets - The Vector of policies set to be added to the collection of all policies.

removePolicySet

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

removePolicySets

public void removePolicySets(java.util.Vector policySets)
Specified by:
removePolicySets in interface PolicySetDirectory

changePolicySet

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

changePolicySets

public void changePolicySets(java.util.Vector policySets)
Specified by:
changePolicySets in interface PolicySetDirectory

getPolicySets

public java.util.List getPolicySets()
Obtain an Vector over all policy sets. Each element of the Enumeration is an instance of a Msg class specifying an individual policy set fields.

Specified by:
getPolicySets in interface PolicySetDirectory
Returns:
Vector 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)
Method finds out if the specified policy is in conflict with some policies with the same priority in the repository

Specified by:
isPolicyInConflict in interface PolicyAnalyzes
Parameters:
policyId - id of the policy
Returns:
true if in conflict, false if not

findConflictingPolicies

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

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 PriorityConditionNotMet
Method finds out if the specified policy is fully overlapped by the second specified policy, the necessary condition is that the two policies have the same modality

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:
PriorityConditionNotMet

isPartiallyOverlappedBySecondPolicy

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

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:
PriorityConditionNotMet

isFullyOverlappedByUnionOfPolicies

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

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:
PriorityConditionNotMet

isPolicyRedundant

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

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)
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)
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)
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 PriorityConditionNotMet
Method finds out if the specified policy is beign made redundant (fully coverd) by the second specified policy with higher priority in the repository

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:
PriorityConditionNotMet

isMadeParitallyRedundantBySecond

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

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:
PriorityConditionNotMet

isMadeFullyRedundantByPolicyUnion

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

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

changedPriority

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

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

harmonizePolicy

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

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 containg ids of policies representing the result of harmonization

splitPolicy

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

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 containg ids of policies representing the result of process

checkPermission

public void checkPermission(java.security.Permission perm,
                            java.lang.Object context)
                     throws KAoSSecurityException,
                            java.lang.NullPointerException,
                            ServiceFailure
The method check if the given action is permitted according to the current set of policies

Specified by:
checkPermission in interface AuthorizationPolicyDisclosure
Parameters:
perm - Permission to be checked by the Guard in order to allow/disallow an action.
context - An Object describing the context of the action.
Throws:
KAoSSecurityException - if the action is not allowed.
java.lang.NullPointerException - if the Permission argument is null.
ServiceFailure

getPoliciesForActionType

public java.util.List getPoliciesForActionType(java.lang.String actionType)
                                        throws ServiceFailure
Get policies for the specified action type.

Specified by:
getPoliciesForActionType in interface AuthorizationPolicyDisclosure
Parameters:
actionType - String specifying the action type for the requested policies.
Returns:
List Contains policies defined for the specified action.
Throws:
ServiceFailure

getAllowableValuesForActionProperties

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

getAllowableValuesForActionProperties

public java.util.Vector getAllowableValuesForActionProperties(java.util.Vector propertyNames,
                                                              ActionInstanceDescription actionDesc,
                                                              boolean tight)
                                                       throws ServiceFailure
This function is used when the agent/enforcer has only partial information about an action and would like to determine what range of properties can be allowed by the policy set. The agent/enforcer partially fills an ActionInstanceDescription object and sends it to the method, which finds those policies that are applicable to this action and contain the given property. The method will then select only those values for the given properties that will not conflict with higher priority policies containing the given properties.

Specified by:
getAllowableValuesForActionProperties in interface AuthorizationPolicyDisclosure
Parameters:
propertyName - Vector containing the properties for which values are to be found.
actionDesc - ActionInstanceDescription object which will be used to find applicable policies.
tight - boolean, if set to 'true', will result in returning only these values for the missing specified property which would satisfy some policy if used alone.
Returns:
Vector The Vector containing multiple ActionInstanceDescription objects which contain the allowed values for those properties.
Throws:
ServiceFailure

getAllowableValuesForActionProperties

public java.util.Vector getAllowableValuesForActionProperties(ActionInstanceDescription actionDesc)
                                                       throws ServiceFailure
In this case, there are NO properties specified. The function uses the given, partially filled, ActionInstanceDescription object to find those policies that are applicable to this action, and then it selects all the properties from those policies which are not originally contained in the provided ActionInstanceDescription object. It then chooses only those values for the given properties which do not conflict with their higher priority selves, and returns all those properties in the ActionInstanceDescription object.

Specified by:
getAllowableValuesForActionProperties in interface AuthorizationPolicyDisclosure
Parameters:
actionDesc - ActionInstanceDescription object which will be used to find applicable policies.
Returns:
Vector The Vector containing multiple ActionInstanceDescription objects which contain the allowed values for those properties.
Throws:
ServiceFailure

getObligationsForTriggerCondition

public java.util.Vector getObligationsForTriggerCondition(ActionInstanceDescription triggerAID)
                                                   throws ServiceFailure
Based on the specified trigger ActionInstanceDescription, select all matching control BasicActionDescription, which define the obligations for the trigger. For each control BasicActionDescription create an ActionInstanceDescription. Sort the ActionInstanceDescriptions in descending order by the priority of the obligation policy, in which the BasicActionDescription was defined.

Specified by:
getObligationsForTriggerCondition in interface ObligationPolicyDisclosure
Parameters:
triggerACD - ActionInstanceDescription describes an instance of the trigger condition sent by the trigger condition monitor.
Returns:
A Vector of control ActionInstanceDescriptions, whose BasicActionDescriptions are contained in policies matching the parameter triggerAID. The returned control ActionInstanceDescriptions are sorted in descending sequence by their policy priority. Or, the method returns null, if the ObligationSelector is a concurrent object and a Thread waiting to complete execution of this method has been interrupted. The Thread's interrupted status will be re-established.
Throws:
ServiceFailure

getAllowableValuesForActionProperty

public java.util.Set getAllowableValuesForActionProperty(java.lang.String origPropertyName,
                                                         ActionInstanceDescription origActionDesc,
                                                         java.util.Set allTargetValues,
                                                         boolean tight)
                                                  throws ServiceFailure
Description copied from interface: AuthorizationPolicyDisclosure
This function is used when the enforcer has only partial information about an action and needs to determine what range of a property can be allowed by the policy. The enforcer partially fills an ActionInstanceDescription object and sends it to the PolicyDisclosure object to find those policies that are applicable to this action and contain the given property. PolicyDisclosure will then select only those values for the given property that will not conflict with higher priority policies containing the given property. This is a complex function and needs to be understood in the context of how it is used - this is getting written elsewhere and will be included here at a later time.

Specified by:
getAllowableValuesForActionProperty in interface AuthorizationPolicyDisclosure
allTargetValues - Set of possible property values - now it is a fake argument, which should really be calculated by the directory service and passed to the entity disclosing the policy (PolicyDisclosure).
tight - boolean, if set to 'true', will result in returning only these values for the missing specified property which would satisfy some policy if used alone.
Returns:
Set The Set containing allowed values for the given property, or null, if a thread waiting to complete execution of this method has been interrupted. The interrupted status will be propagated.
Throws:
ServiceFailure

getPolicyUpdateCount

public java.lang.Integer getPolicyUpdateCount()
                                       throws ServiceFailure
Returns count of the number of times the policy has been updated. This function is important when a policy disclosure client needs to cache results for performance reasons. The traditional case occurs when the caller is asking permission for access and will cache the result if the mediation succeeds. The logic would look something like this - getPolicyUpdateCount - check if permission is permitted based on the cache using the policy update count - if the permission is cached return success - otherwise call checkPermission - if checkPermission succeeeds - get PolicyUpdateCount - if the policy update count before the call is the same as it is after the call, cache the fact that access is allowed. - return success - otherwise return exception

Specified by:
getPolicyUpdateCount in interface PolicyDisclosure
Throws:
ServiceFailure

findPolicyDecision

public java.util.Vector findPolicyDecision(java.security.Permission perm,
                                           java.lang.Object context)
                                    throws KAoSSecurityException,
                                           java.lang.NullPointerException,
                                           ServiceFailure,
                                           ObligationViolationException
The method checks if the given action is permitted according to the current set of policies, or if the given action is a trigger for some obligation policy. If the action is not permitted, the method throws an exception; but if the action is permitted, the method checks if it's a trigger and if it a trigger, the method returns a vector containing all those obligation policies for whom the action is a trigger.

Specified by:
findPolicyDecision in interface PolicyDisclosure
Parameters:
perm - Permission to be checked by the Guard in order to allow/disallow an action; or the trigger to be checked for obligation policies.
context - An Object describing the context of the action.
Throws:
KAoSSecurityException - if the action is not allowed.
java.lang.NullPointerException - if the Permission argument is null.
ServiceFailure
ObligationViolationException

checkDeepPermission

public void checkDeepPermission(java.security.Permission perm,
                                java.lang.Object context)
                         throws java.lang.NullPointerException,
                                ServiceFailure,
                                KAoSSecurityException
The method checks if the given action is permitted according to the current set of policies. However, if the given action is not permitted by a policy, instead of stopping there, it goes on to find all those policies that forbid the given action, and then returns a vector that contains their ids inside the kaos security exception that is finally thrown.

Specified by:
checkDeepPermission in interface PolicyDisclosure
Parameters:
perm - Permission to be checked by the Guard in order to allow/disallow an action.
context - An Object describing the context of the action.
Throws:
java.lang.NullPointerException - if the Permission argument is null.
KAoSSecurityException - containing the ids of forbidding policies, if any.
ServiceFailure

getListOfLoadedOntologies

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

Specified by:
getListOfLoadedOntologies in interface OntologyRepositoryService

getAllNamespaces

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

Specified by:
getAllNamespaces in interface OntologyRepositoryService

getFilteredNamespaces

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

Specified by:
getFilteredNamespaces in interface OntologyRepositoryService

addFilteredNamespace

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

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

removeFilteredNamespace

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

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

getConstructedOntologyStructures

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

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

putConstructedOntologyStructures

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

Specified by:
putConstructedOntologyStructures in interface OntologyRepositoryService
Parameters:
ontologyStructureList - a list containing SerializableOntModelImpl objects.
Throws:
jtp.ReasoningException - or IOException when loading of the ontology failed.
java.io.IOException

loadOntology

public void loadOntology(java.lang.String myURL,
                         java.lang.Boolean recursiveLoad)
                  throws jtp.ReasoningException,
                         java.io.IOException
This is a fix to support remote invocation via MethodCallRequestMsg. Arguments must be serializable, so we handle boolean as Boolean.

Throws:
jtp.ReasoningException
java.io.IOException

loadOntology

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

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:
jtp.ReasoningException - when loading of the ontology failed.
java.io.IOException

loadOntology

public void loadOntology(SerializableOntModelImpl myOntModel,
                         java.lang.Boolean recursiveLoad)
                  throws jtp.ReasoningException,
                         java.io.IOException
This is a fix to support remote invocation via MethodCallRequestMsg. Arguments must be serializable, so we handle boolean as Boolean.

Throws:
jtp.ReasoningException
java.io.IOException

loadOntology

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

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

loadOntology

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

getInstancesOf

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

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

getUltimateOntologyTypesOfIndividual

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

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:
individualName - if concept unknow or any problem with JTP approached
UnknownConceptException - if concept unknow or any problem with JTP approached

getSuperClassesOf

public java.util.Set getSuperClassesOf(java.lang.String className)
                                throws UnknownConceptException
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 unknow for the ontology repository

getSubClassesOf

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

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

getSuperPropertiesOf

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

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

getSubPropertiesOf

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

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

testTrue

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

Specified by:
testTrue in interface OntologyRepositoryService
Specified by:
testTrue in interface OntologyInterfaces
Parameters:
statement - string containing the added ontologOnt *
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
Get a single value of the variable satisfing 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
Get values of the variable satisfing the KIF query: (property subject ?val).

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
Get values of the variable satisfing 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.Vector getPropertiesApplicableTo(java.lang.String className)
                                           throws UnknownConceptException
Get set of properties defined in the given namespace.

Specified by:
getPropertiesApplicableTo in interface OntologyRepositoryService
Specified by:
getPropertiesApplicableTo in interface OntologyInterfaces
Parameters:
className - the name of the namespace
Returns:
set of properties names
Throws:
UnknownConceptException - if className is unknow for the ontology repository

getRangeOnPropertyForClass

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

Specified by:
getRangeOnPropertyForClass in interface OntologyRepositoryService
Specified by:
getRangeOnPropertyForClass in interface OntologyInterfaces
Parameters:
className - the name of the class
propertyName - the name of the property
Returns:
the name of the class defining the range
Throws:
UnknownConceptException - if reasoning failed.

askQuery

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

Specified by:
askQuery in interface OntologyRepositoryService
Parameters:
variableName - the neame ofthe selected variable
multiplyVariablesQuery - the query
Throws:
QueryFailure - if reasoning failed.

areClassesDisjoint

public boolean areClassesDisjoint(java.lang.String firstClass,
                                  java.lang.String secondClass)
                           throws QueryFailure,
                                  DirectoryFailure
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
Throws:
QueryFailure - if reasoning failed.
DirectoryFailure

getClassesDefInNamespace

public java.util.Set getClassesDefInNamespace(java.lang.String namespaceName)
                                       throws UnknownNamespaceException
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 unknow for the ontology repository

getPropertiesDefInNamespace

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

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 unknow for the ontology repository

getInstancesDefInNamespace

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

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 unknow for the ontology repository

getNamspacesImportedByNamespace

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

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

getOntologyDefinitionForConcept

public java.util.Set getOntologyDefinitionForConcept(java.lang.String conceptName)
Get set of namspaces imported by the given namespace. Curently it tries to match the concept name with the local name of the ontology definitions url

Specified by:
getOntologyDefinitionForConcept in interface OntologyInterfaces
Parameters:
conceptName - The name of the namespace in the Jena format
Returns:
Set of ontology definition url potentially matching the search concept

getIndividualActors

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

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

getClassesOfActors

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

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

getIndividualPlaces

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

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

getClassesOfPlaces

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

Specified by:
getClassesOfPlaces in interface KAoSOntologyQueryService
Parameters:
baseActorClass - 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 Actors subclasses
Throws:
UnknownConceptException - if basePlaceClass is unknow for the ontology repository

getIndividualGroups

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

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

getClassesOfGroups

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

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

getIndividualTargets

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

Specified by:
getIndividualTargets in interface KAoSOntologyQueryService
Parameters:
baseTargetClass - The name of the targets (Actors or Entities) 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 unknow for the ontology repository

getClassesOfTargets

public java.util.Set getClassesOfTargets(java.lang.String baseTargetClass)
                                  throws UnknownConceptException
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 KAoSOntologyQueryService
Parameters:
baseTargetClass - The name of the targets (Actors or Entities) 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 unknow 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
Get descriptions of the Action classes the specified Actor class or instance can perfom based on its class.

Specified by:
getActions in interface KAoSOntologyQueryService
Parameters:
forActor - The name of the Actor class or instance
Returns:
Set of ActionDescription(s)
Throws:
UnknownConceptException - if forActor is unknow for the ontology repository

getClassesOfActorsCapableOfPerformingActions

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

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

putSchema

public void putSchema(java.lang.String dataName,
                      java.lang.String dataSchema)
               throws DirectoryFailure
to store the given schema definition under the name of that user defined data type

Specified by:
putSchema in interface XMLRepository
Parameters:
dataName - the name of the defined data type
Throws:
DirectoryFailure

getSchema

public java.util.Vector getSchema(java.lang.String dataName)
                           throws DirectoryFailure
to retrieve the schema for the given data type. please note that a derived data type can have as its parent a data type which is also dervied from some other data type. hence the method returns a vector, containing schema definitions for all such data types in the hierarchy.

Specified by:
getSchema in interface OntologyInterfaces
Specified by:
getSchema in interface XMLRepository
Parameters:
dataName - the name of the data type to be retrieved
Returns:
a vector containing all the data type definitions in the chain of inheritance.
Throws:
DirectoryFailure

removeSchema

public void removeSchema(java.lang.String dataName)
                  throws DirectoryFailure
Description copied from interface: XMLRepository
to 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
to 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 schemaList)
                       throws DirectoryFailure
Description copied from interface: XMLRepository
to store multiple schemas in the repositiry.

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
to retrieve all schemas in the repositiry.

Specified by:
getAllSchema in interface XMLRepository
Throws:
DirectoryFailure

addEventListener

public void addEventListener(DomainManagerEventListener listener)
Add an event listener to the collection of objects to be notified by the Directory Service about a domain event.

Those listeners must establish a trust relationship with the Directory Service 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)
Remove an event listener from the collection of objects to be notified by the Directory Service about a domain event.

Those listeners have established a trust relationship with the Directory Service 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

getPolicy

public java.lang.String getPolicy(java.lang.String policyID,
                                  java.lang.String policyDBManagerID)
                           throws java.lang.Exception
Ask the specified PolicyDBManager to get the policy for the given policy id.

Parameters:
policyID - A String indicating the policy id.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

removePolicy

public java.lang.String removePolicy(java.lang.String policyID,
                                     java.lang.String policyDBManagerID)
                              throws java.lang.Exception
Ask the specified PolicyDBManager to remove from its database the policy object for the given policy id.

Parameters:
policyID - A String indicating the policy id.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

setPolicy

public java.lang.String setPolicy(java.lang.String policyID,
                                  PolicyInformation policy,
                                  java.lang.String policyDBManagerID)
                           throws java.lang.Exception
Ask the specified PolicyDBManager to set the policy object for the given policy id.

Parameters:
policyID - A String indicating the policy id.
policy - The policy object to be set for the given id.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

addPolicy

public java.lang.String addPolicy(PolicyInformation policy,
                                  java.lang.String policyDBManagerID)
                           throws java.lang.Exception
Ask the specified PolicyDBManager to add the given policy object to its database. If the policy for the policy id contained in this object already exists, it will be replaced by this object. If not, a new entry will be created.

Parameters:
policy - The policy object to be added.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

getAllPolicies

public java.lang.String getAllPolicies(java.lang.String policyDBManagerID)
                                throws java.lang.Exception
Ask the specified PolicyDBManager to get all policy objects contained in its database.

Parameters:
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

removeAllPolicies

public java.lang.String removeAllPolicies(java.lang.String policyDBManagerID)
                                   throws java.lang.Exception
Ask the specified PolicyDBManager to to remove all policy objects contained in this database.

Parameters:
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

refreshPolicyComplete

public java.lang.String refreshPolicyComplete(java.lang.String policyID,
                                              java.lang.String policyDBManagerID)
                                       throws java.lang.Exception
Ask the specified PolicyDBManager to refresh all cached property values for the given policy.

Parameters:
policyID - A String indicating the policy id.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

refreshPolicyPartial

public java.lang.String refreshPolicyPartial(java.lang.String policyID,
                                             java.util.Vector properties,
                                             java.lang.String policyDBManagerID)
                                      throws java.lang.Exception
Ask the specified PolicyDBManager to refresh cached values of only those properties that are specified for the given policy.

Parameters:
policyID - A String indicating the policy id.
properties - A Vector containing property names whose values are to be refreshed.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

refreshAllPoliciesComplete

public java.lang.String refreshAllPoliciesComplete(java.lang.String policyDBManagerID)
                                            throws java.lang.Exception
Ask the specified PolicyDBManager to refresh all cached property values for all policies in this database.

Parameters:
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

refreshAllPoliciesPartial

public java.lang.String refreshAllPoliciesPartial(java.util.Vector properties,
                                                  java.lang.String policyDBManagerID)
                                           throws java.lang.Exception
Ask the specified PolicyDBManager to refresh cached values of only those properties that are specified for all the policies in this database.

Parameters:
properties - A Vector containing property names whose values are to be refreshed.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

refreshSpecifiedPoliciesComplete

public java.lang.String refreshSpecifiedPoliciesComplete(java.util.Vector policyIDs,
                                                         java.lang.String policyDBManagerID)
                                                  throws java.lang.Exception
Ask the specified PolicyDBManager to refresh cached values of all properties of the specified policies.

Parameters:
policyIDs - A Vector containing ids of those policies that are to be refreshed.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

refreshSpecifiedPoliciesPartial

public java.lang.String refreshSpecifiedPoliciesPartial(java.util.Vector policyIDs,
                                                        java.util.Vector properties,
                                                        java.lang.String policyDBManagerID)
                                                 throws java.lang.Exception
Ask the specified PolicyDBManager to refresh cached values of only those properties that are specified for only specified policies.

Parameters:
policyIDs - A Vector containing ids of those policies that are to be refreshed.
properties - A Vector containing property names whose values are to be refreshed.
policyDBManagerID - A String identifying the specific PolicyDBManager to forward this request to.
Returns:
String uniquely identifying the forwarded request.
Throws:
java.lang.Exception

getGuardStateFor

public java.lang.String getGuardStateFor(java.lang.String guardID)
                                  throws java.lang.Exception
method for getting the state of the specified guard

Throws:
java.lang.Exception

setGuardLoggingState

public java.lang.String setGuardLoggingState(java.lang.Boolean logging,
                                             java.lang.String historyMonitorID)
                                      throws java.lang.Exception
kaos.policy.history.HistoryMonitorrForwarder interface implementation - begin

Throws:
java.lang.Exception

isGuardLoggingActive

public java.lang.String isGuardLoggingActive(java.lang.String historyMonitorID)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getAllLogs

public java.lang.String getAllLogs(java.lang.String historyMonitorID)
                            throws java.lang.Exception
Ask the specified HistoryMonitor to get all the events logged so far.

Parameters:
historyMonitorID - A String identifying the specific HistoryMonitor to forward this request to.
Returns:
A Vector containing aid objects logged so far.
Throws:
java.lang.Exception

deleteAllLogs

public java.lang.String deleteAllLogs(java.lang.String historyMonitorID)
                               throws java.lang.Exception
Ask the specified HistoryMonitor to delete all the events logged so far.

Parameters:
historyMonitorID - A String identifying the specific HistoryMonitor to forward this request to.
Throws:
java.lang.Exception

getLogsforActionType

public java.lang.String getLogsforActionType(java.lang.String actionType,
                                             java.lang.String historyMonitorID)
                                      throws java.lang.Exception
Ask the specified HistoryMonitor to get all events logged that contain the given action type.

Parameters:
actionType - A String indicating the action type.
historyMonitorID - A String identifying the specific HistoryMonitor to forward this request to.
Returns:
A vector containing aid objects logged for that action.
Throws:
java.lang.Exception

deleteLogsforActionType

public java.lang.String deleteLogsforActionType(java.lang.String actionType,
                                                java.lang.String historyMonitorID)
                                         throws java.lang.Exception
Ask the specified HistoryMonitor to delete all logged events that contain the given action type.

Parameters:
actionType - A String indicating the action type.
historyMonitorID - A String identifying the specific HistoryMonitor to forward this request to.
Throws:
java.lang.Exception

getLogsforActor

public java.lang.String getLogsforActor(java.lang.String actorID,
                                        java.lang.String historyMonitorID)
                                 throws java.lang.Exception
Ask the specified HistoryMonitor to get all logged events that contain the given actor.

Parameters:
actorID - A String indicating the actor id.
historyMonitorID - A String identifying the specific HistoryMonitor to forward this request to.
Returns:
A vector containing aid objects logged for that actor.
Throws:
java.lang.Exception

deleteLogsforActor

public java.lang.String deleteLogsforActor(java.lang.String actorID,
                                           java.lang.String historyMonitorID)
                                    throws java.lang.Exception
Ask the specified HistoryMonitor to delete all logged events that contain the given actor.

Parameters:
actorID - A String indicating the actor id.
historyMonitorID - A String identifying the specific HistoryMonitor to forward this request to.
Throws:
java.lang.Exception

getSpecifiedLogs

public java.lang.String getSpecifiedLogs(java.lang.String actionType,
                                         java.lang.String actorID,
                                         java.lang.String startTime,
                                         java.lang.String endTime,
                                         java.lang.Boolean latest,
                                         java.lang.String historyMonitorID)
                                  throws java.lang.Exception
Ask the specified HistoryMonitor for the logged events specified by the given parameters. The input parameters are interpreted as follows:

Parameters:
actionType - A String indicating the action type of requested logs. If it is null, 'all action types' would be assumed.
actorID - A String indicating the actor of requested logs. If null, 'all actors' would be assumed.
startTime - A long, indicating the start of time period for which logs are requested. If null, 'the begining of logs' time would be assumed.
endTime - A long, indicating the end of time period for which logs are requested. If null, 'time of the latest log' would be assumed.
latest - A boolean, indicating if only latest logs are requested. If it is set: a) start and end time parameters are ignored. b) If actionType is null, and actorID is null, the latest log for each actor is returned. c) If actorID is null and actionType is not null the latest logs for each actor for the given actionType are returned. d) If actorID is not null, the latest log for that actor is returned. If actionType also is not null, the latest log for that actor and that action is returned. If this boolean is not set, log are retrieved based on preceding parameters.
historyMonitorID - A String identifying the specific HistoryMonitor to forward this request to.
Throws:
java.lang.Exception

deleteSpecifiedLogs

public java.lang.String deleteSpecifiedLogs(java.lang.String actionType,
                                            java.lang.String actorID,
                                            java.lang.String startTime,
                                            java.lang.String endTime,
                                            java.lang.Boolean latest,
                                            java.lang.String historyMonitorID)
                                     throws java.lang.Exception
This method internally calls 'getSpecifiedLogs' with its input parameters and then deletes the logs returned by that call. For method documentation, see the heading for 'getSpecifiedLogs'.

Throws:
java.lang.Exception

getKAoSExtensionComponents

public java.lang.String getKAoSExtensionComponents(java.lang.String repType,
                                                   java.lang.String associatedOntType,
                                                   java.lang.String guardRepMgrID)
                                            throws java.lang.Exception
Ask the specified GuardRepositoryManager a request to get the KAoSExtensionComponents object for the given type.

Parameters:
repType - A String identifying the specific RepositoryManager within a collection of managers.
associatedOntType - A String indicating the ontology type associated with that component.
guardRepMgrID - A String identifying the Guard storing the collection of Repository Managers.
Returns:
A Vector containing KAoSExtensionComponents.
Throws:
java.lang.Exception

removeKAoSExtensionComponent

public java.lang.String removeKAoSExtensionComponent(java.lang.String repType,
                                                     java.lang.String extCompName,
                                                     java.lang.String guardRepMgrID)
                                              throws java.lang.Exception
Ask the specified GuardRepositoryManager to remove from this repository the KAoSExtensionComponent specified by the given reference.

Parameters:
repType - A String identifying the specific RepositoryManager within a collection of managers.
extCompName - the name of KAoSExtensionComponent to be removed.
guardRepMgrID - A String identifying the Guard storing the collection of Repository Managers.
Returns:
The removed component.
Throws:
java.lang.Exception

setKAoSExtensionComponent

public java.lang.String setKAoSExtensionComponent(java.lang.String repType,
                                                  java.lang.String associatedOntType,
                                                  KAoSExtensionComponent extComp,
                                                  java.lang.String guardRepMgrID)
                                           throws java.lang.Exception
Ask the specified GuardRepositoryManager to set KAoSExtensionComponent for the given ontology type.

Parameters:
repType - A String identifying the specific RepositoryManager within a collection of managers.
associatedOntType - A String indicating the ontology type associated with that component.
extComp - The KAoSExtensionComponent to be set for the given type.
guardRepMgrID - A String identifying the Guard storing the collection of Repository Managers.
Throws:
java.lang.Exception

changeComponentEnabledStatus

public java.lang.String changeComponentEnabledStatus(java.lang.String repType,
                                                     java.lang.String associatedOntType,
                                                     java.lang.Boolean state,
                                                     java.lang.String guardRepMgrID)
                                              throws java.lang.Exception
changes the 'enabled' status of the given component

Parameters:
repType - A String identifying the specific RepositoryManager within a collection of managers.
associatedOntType - A String indicating the ontology type associated with that component.
state - A boolean parameter to which the status would change
guardRepMgrID - A String identifying the Guard storing the collection of Repository Managers.
Throws:
java.lang.Exception

getComponentEnabledStatus

public java.lang.String getComponentEnabledStatus(java.lang.String repType,
                                                  java.lang.String associatedOntType,
                                                  java.lang.String guardRepMgrID)
                                           throws java.lang.Exception
get the 'enabled' status of the given component

Parameters:
repType - A String identifying the specific RepositoryManager within a collection of managers.
associatedOntType - A String indicating the ontology type associated with that component.
guardRepMgrID - A String identifying the Guard storing the collection of Repository Managers.
Returns:
Boolean 'true' if enabled, 'false' if not.
Throws:
java.lang.Exception

getAllKAoSExtensionComponents

public java.lang.String getAllKAoSExtensionComponents(java.lang.String repType,
                                                      java.lang.String guardRepMgrID)
                                               throws java.lang.Exception
Ask the specified GuardRepositoryManager to get all components contained in this repository.

Parameters:
repType - A String identifying the specific RepositoryManager within a collection of managers.
guardRepMgrID - A String identifying the Guard storing the collection of Repository Managers.
Returns:
A Vector containing all components.
Throws:
java.lang.Exception

removeAllKAoSExtensionComponents

public java.lang.String removeAllKAoSExtensionComponents(java.lang.String repType,
                                                         java.lang.String guardRepMgrID)
                                                  throws java.lang.Exception
Ask the specified GuardRepositoryManager to remove all components contained in this repository.

Parameters:
repType - A String identifying the specific RepositoryManager within a collection of managers.
guardRepMgrID - A String identifying the Guard storing the collection of Repository Managers.
Throws:
java.lang.Exception

getRepositoryTableInformation

public java.lang.String getRepositoryTableInformation(java.lang.String repType,
                                                      java.lang.String guardRepMgrID)
                                               throws java.lang.Exception
This method returns the concepts names and their corresponding component names in a Hashtable. The keys in this table are Strings specifying concept names and values are Strings specifying corresponding component names

Parameters:
repType - A String identifying the specific RepositoryManager within a collection of managers.
guardRepMgrID - A String identifying the Guard storing the collection of Repository Managers.
Returns:
Hashtable as specified in this method heading.
Throws:
java.lang.Exception

getAbsoluteObligationsForTriggerConditionForAC

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

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

checkAbsolutePermission

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

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

registerObserver

public 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.

Specified by:
registerObserver in interface KAoSObservable
Parameters:
updateType - String, indicating the type of update a KAoSObserver is interested in. For now the DS allows only for a KAoSConstants.REGISTRATION_UPDATE. As a consequence of this, these observers are automatically sent KAoSConstants.DEREGISTRATION_UPDATE as well when that agent deregisters, i.e. they are sent the description of the agent who deregistered, and they are supposed to understand and handle this update too.
updateCondition - Object, describing the conditions for which to send an update. For now this is a Hashtable object. Keys from this hashtable are names of the properties in an agent's description, and are Strings. Values of those keys are objects. They together specify the kind of agents this observer is interested in. These key-value pairs are matched with the key-value pairs from an agent's description to see if that agent matches the search criteria. The observer is updated with agent descriptions of all agents that match the update condition. These descriptions are sent seperately, not as all in one. Also, when new agents come online later on, they too, are matched for the update conditions of the observer, and the observer is updated with their descriptions if they are a match. If an observer is interested in not just one specific agent, but all agents in the DS, then that observer adds a 'KAoSConstants.AGENT_LIST' key to update condition object. The value for this key is ignored. Thus DS will know that this observer wants information of all the agents and will send it their list initially. Afterwards, it will send each new description to the observer as new agents register. Hence the observer should check if the update is a List of, or a single, agent description. This observer too will get DEREGISTRATION_UPDATEs without explicit request, and is supposed to handle them.
observer - KAoSObserver registering with for updates.

deregisterObserver

public 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.

Specified by:
deregisterObserver in interface KAoSObservable
Parameters:
updateType - String indicating type of update the KAoSObserver is no longer interested in. For now the DS would handle only KAoSConstants.REGISTRATION_UPDATE.
updateCondition - See the same in the method heading for registerObserver.
observer - the KAoSObserver deregistering.

notify

public 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.

Specified by:
notify in interface KAoSObservable
Parameters:
updateType - String describing the type of update to perform. For now the DS would handle only KAoSConstants.REGISTRATION_UPDATE.
updateCondition - See the same in the method heading for registerObserver.
update - Object containing the update. For now this is the agent description of the matching agent. Please note that if the observer has registered for 'AGENT_LIST', then it will initially get a list of all agent descriptions, and afterwards will keep getting individual descriptions as new agents come online. If it has not registered for AGENT_LIST, then it will descriptions of all matching agents seperately (i.e. not all in one list) and then will keep getting individual descriptions as new agents come online.

policiesSynchronizationRequest

public void policiesSynchronizationRequest(java.util.List myCurrentPoliciesIds,
                                           java.util.List myCurrentPoliciesTimeStamps)
                                    throws DirectoryFailure
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 myCurrentInstancesClassesURL,
                                               java.util.List myCurrentInstancesSetsTimeStamps)
                                        throws DirectoryFailure
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 intances set timestamps.
Throws:
DirectoryFailure

subclassesSetSynchronizationRequest

public void subclassesSetSynchronizationRequest(java.util.List myCurrentSubclassesClassesURL,
                                                java.util.List myCurrentSubclassesSetsTimeStamps)
                                         throws DirectoryFailure
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 myCurrentSuperclassesClassesURL,
                                                  java.util.List myCurrentSuperclassesSetsTimeStamps)
                                           throws DirectoryFailure
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 myCurrentSubpropertiesPropertyURL,
                                                   java.util.List myCurrentSubpropertiesSetsTimeStamps)
                                            throws DirectoryFailure
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 myCurrentSuperpropertiesPropertyURL,
                                                     java.util.List myCurrentSuperpropertiesSetsTimeStamps)
                                              throws DirectoryFailure
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
Check with DS if synchronization is needed by providing the timstamp 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)
Methods implementing Guarded KAoSDirectoryService


setGuardRegistered

public void setGuardRegistered(boolean registered)

establishAgentDescription

protected DefaultKAoSAgentDescription establishAgentDescription(KAoSServiceRoot ksr)

createMyDomain

protected java.lang.String createMyDomain()
                                   throws AlreadyRegisteredException,
                                          DirectoryFailure
subclasses may override this if they want to join a domain other than "Policy Management"

Returns:
the name of the domain that was created
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)
Auxiliary methods /


getGuards

public java.util.Enumeration getGuards()

distributePolicyUpdate

protected void distributePolicyUpdate(java.util.List addedPolicies,
                                      java.util.List changedPolicies,
                                      java.util.List removedPolicies,
                                      boolean setPolicies)
Distributes a policy to the guard(s) possessing interest registration to which the policy applies

Parameters:
addedPolicies - the list of policyMsgs to be added
changedPolicies - the list of policyMsgs to be removed
removedPolicies - the list of policyMsgs to be changed
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)
Sends a policy update to a guard

Parameters:
Locator - locator for the guard

analyzeWorkflow

public java.lang.String analyzeWorkflow(java.lang.String owlsWorkflow)
                                 throws java.lang.Exception
Modify the given OWL-S workflow based on policies that apply the actions in workflow. Only works if the owls libraries are present, otherwise null is returned.

Parameters:
owlsWorkflow - - the OWL-S workflow to analyze/modify (xml text)
Returns:
- the OWL-S workflow (xml text) with policy information added (e.g. obliged actions inserted as processes)
Throws:
java.lang.Exception

analyzeWorkflow

public java.lang.String analyzeWorkflow(java.net.URL owlsWorkflow)
                                 throws java.lang.Exception
Modify the given OWL-S workflow based on policies that apply the actions in workflow. Only works if the owls libraries are present, otherwise null is returned.

Parameters:
owlsWorkflow - - URL to an existing OWL-S workflow to analyze/modify
Returns:
- the OWL-S workflow (xml text) with policy information added (e.g. obliged actions inserted as processes)
Throws:
java.lang.Exception

callWorkflowChecker

protected java.lang.String callWorkflowChecker(java.lang.Object workflowParam)
                                        throws java.lang.Exception
Uses reflection to invoke the WorkflowChecker.analyzeWorkflow() method *if* the class is present, otherwise just returns null

Parameters:
workflowParam - - URI or String parameter for the analyzeWorkflow method
Returns:
- OWL-S result of calling analyzeWorkflow()
Throws:
java.lang.Exception

main

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


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.
update - Object containing the update.
Throws:
NotificationException