|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaos.core.csi.registration.RegistrationImpl
public class RegistrationImpl
This class implements the Registration interface, which efines the operations to register and deregister entities and entity hosting environments in the KAoS Directory Service and operations to modify the registration information. It also defines operations to register entitites in KAoS Domains and to maintain domain hierarchy. $Revision: 1.42 $
Method Summary | |
---|---|
void |
addChildToDomain(DomainDescription domain,
DomainDescription childDomain)
Add the childDomain as a child of the specified domain. |
void |
addEventListener(DirectoryEventListener listener)
|
ModificationType |
addGroupLeader(java.lang.String actorId,
java.lang.String groupURI)
Adds the specified actor as a leader of the given group. |
void |
addRemoteEventListener(Locator l)
|
KAoSAgentDescription |
createKAoSAgentDescription(java.lang.String guid,
java.lang.String nickname,
java.util.List<java.lang.String> domainNames,
java.util.List<AgentCapability> agentCapabilities,
java.lang.String transportName,
JasBean agentInitInfo)
Create an instance of the KAoSAgentDescription as simpler method createKAoSAgentDescription but additionally specifies agent capabilities |
KAoSAgentDescription |
createKAoSAgentDescription(java.lang.String guid,
java.lang.String nickname,
java.util.List<java.lang.String> domainNames,
java.lang.String transportName,
JasBean agentInitInfo)
Create an instance of the KAoSAgentDescription using the given parameters. |
void |
deregisterEntity(AgentDescription entityDescription)
Deregister the entity described by the given AgentDescription from the KAoS Directory Service. |
KAoSEntityDescription |
deregisterEntityFromDomain(DomainDescription domain,
KAoSEntityDescription entityDesc)
Deregister the entity described by the given KAoSEntityDescription from the specified domain. |
void |
deregisterEntityHostingEnv(EntityHostEnvDescription eheDescription)
Deregister the entity hosting environment described by the given EntityHostEnvDescription from the KAoS Directory Service. |
void |
deregisterObjectWithSpatialProperties(java.lang.String objectID)
Deregister object identified by the given objectID and its spatial properties in the SpatialReasoner. |
AgentConfiguration |
getAgentConfiguration()
|
AgentConfiguration |
getAgentConfiguration(java.lang.String configFile)
|
static Registration |
getInstance()
|
static Registration |
getInstance(java.lang.String transportName)
|
protected void |
logMessage(java.lang.String msg,
java.lang.Exception e,
int logLevel)
|
protected void |
logMessage(java.lang.String msg,
int logLevel)
|
static void |
main(java.lang.String[] args)
|
void |
modifyEntityProperties(java.lang.String entityGUID,
java.util.List properties)
Modify properties of the entity identified by the given entityGUID. |
void |
modifyEntitySpatialProperties(java.lang.String entityGUID,
Location3D objectLocation,
Orientation3D objectOrientation,
Block3D objectOccupiedSpace)
Modify given spatial properties of the entity identified by the given entityGUID in the KAoS Directory Service *AND* the SpatialReasoner. |
void |
modifyObjectSpatialProperties(java.lang.String objectID,
Location3D objectLocation,
Orientation3D objectOrientation,
Block3D objectOccupiedSpace)
Modify spatial properties of the object identified by the given objectID in the SpatialReasoner. |
void |
registerDomain(java.lang.String domainName)
Register domain with the given name in the KAoS Directory Service. |
void |
registerDomain(java.lang.String domainName,
java.lang.String modality)
Register domain with the given name in the KAoS Directory Service. |
void |
registerEntity(AgentDescription entityDescription,
boolean guarded,
boolean replace)
Register the entity described by the given AgentDescription in the KAoS Directory Service. |
void |
registerEntityHostingEnv(EntityHostEnvDescription eheDescription,
boolean guarded,
boolean replace)
Register the entity hosting environment described by the given EntityHostEnvDescription in the KAoS Directory Service. |
KAoSEntityDescription |
registerEntityInDomain(DomainDescription domain,
KAoSEntityDescription entityDesc)
Register the entity described by the given KAoSEntityDescription in the specified domain. |
void |
registerEntityWithProperties(AgentDescription entityDescription,
java.util.List properties,
boolean guarded,
boolean replace)
Register the entity described as simpler method registerEntity but also register properties of this agent |
void |
registerEntityWithSpatialProperties(AgentDescription entityDescription,
Location3D objectLocation,
Orientation3D objectOrientation,
Block3D objectOccupiedSpace,
boolean guarded,
boolean replace)
Register the entity as the simpler method registerEntity but also its spatial properties in the KAoS Directory Service *AND* the SpatialReasoner. |
void |
registerObjectWithSpatialProperties(java.lang.String objectID,
java.util.Set objectOntologyTypes,
Location3D objectLocation,
Orientation3D objectOrientation,
Block3D objectOccupiedSpace)
Register object identified by the given objectID and its spatial properties in the SpatialReasoner. |
void |
registerObjectWithSpatialProperties(java.lang.String objectID,
java.util.Set objectOntologyTypes,
Orientation3D objectOrientation,
java.util.Vector<Location3D> boundingPoints)
Register object identified by the given objectID and its spatial properties in the SpatialReasoner. |
void |
removeChildFromDomain(DomainDescription domain,
DomainDescription childDomain)
Add the childDomain as a child of the specified domain. |
void |
removeEventListener(DirectoryEventListener listener)
|
ModificationType |
removeGroupLeader(java.lang.String actorId,
java.lang.String groupURI)
Remove the specified actor as a leader of the given group. |
void |
removeRemoteEventListener(Locator l)
|
void |
setParentForDomain(DomainDescription domain,
DomainDescription parentDomain)
Set as a the parent the given parentDomain for the specified domain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Registration getInstance(java.lang.String transportName) throws java.lang.Exception
java.lang.Exception
public static Registration getInstance() throws java.lang.Exception
java.lang.Exception
public void registerDomain(java.lang.String domainName, java.lang.String modality) throws DirectoryFailure, AlreadyRegisteredException
DirectoryRegistration
registerDomain
in interface DirectoryRegistration
domainName
- String containing the name of domain to register.modality
- String containing the default policy authorization result if no policies apply [PolicyConcepts.PosAuthorizationPolicy()=laissez-faire or
PolicyConcepts.NegAuthorizationPolicy()=tyrannical].
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering domain has been already registered in the DSpublic void registerDomain(java.lang.String domainName) throws DirectoryFailure, AlreadyRegisteredException
DirectoryRegistration
registerDomain
in interface DirectoryRegistration
registerDomain
in interface DomainRegistration
domainName
- String containing the name of domain to register.
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering domain has been already registered in the DSpublic void registerEntity(AgentDescription entityDescription, boolean guarded, boolean replace) throws DirectoryFailure, AlreadyRegisteredException, GuardInstantiationException
DirectoryRegistration
registerEntity
in interface DirectoryRegistration
entityDescription
- AgentDescription is the JAS AgentDescription, whose subclasses describe the various types of entities to be registered in KAoS: agents, guards,
domains, containers. Those entities are subjects to policies or potential subjects to policies, or the entities are using KAoS for messaging.guarded
- boolean indicating the guarded/unguarded status for agents and containers. If the entity is to be guarded, the implementation of this method will instantiate a
guard, or check if a guard already exists and proceed with the registration via the guard.replace
- boolean indicating whether to replace existing AgentDescription.
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering entity has been already registered in the DS (if the replace = false and there is already registration for the specified
AgentDescription).
GuardInstantiationException
public void registerEntityWithSpatialProperties(AgentDescription entityDescription, Location3D objectLocation, Orientation3D objectOrientation, Block3D objectOccupiedSpace, boolean guarded, boolean replace) throws DirectoryFailure, AlreadyRegisteredException, GuardInstantiationException
SpatialRegistration
registerEntityWithSpatialProperties
in interface SpatialRegistration
objectLocation
- Location3D containing the X,Y,Z coordinates of the registering entity.objectOrientation
- Orientation3D containing the X,Y,Z radius of the registering entity.objectOccupiedSpace
- Block3D containing corner locations determining the occupied space of the registering entity.
DirectoryFailure
AlreadyRegisteredException
GuardInstantiationException
public void registerObjectWithSpatialProperties(java.lang.String objectID, java.util.Set objectOntologyTypes, Location3D objectLocation, Orientation3D objectOrientation, Block3D objectOccupiedSpace) throws DirectoryFailure, AlreadyRegisteredException
SpatialRegistration
registerObjectWithSpatialProperties
in interface SpatialRegistration
objectID
- String uniquely identifying registering object in the SpatialReasoner.objectOntologyTypes
- Set containing Strings describing the ontological types of the registering object in the SpatialReasoner.objectLocation
- Location3D containing the X,Y,Z coordinates of the registering object.objectOrientation
- Orientation3D containing the X,Y,Z radius of the registering object.objectOccupiedSpace
- Block3D containing corner locations determining the occupied space of the registering object.
DirectoryFailure
- if the connection to the SpatialReasoner cannot be established.
AlreadyRegisteredException
- if the registering object has been already registered in the SpatialReasoner.public void registerObjectWithSpatialProperties(java.lang.String objectID, java.util.Set objectOntologyTypes, Orientation3D objectOrientation, java.util.Vector<Location3D> boundingPoints) throws DirectoryFailure, AlreadyRegisteredException
SpatialRegistration
registerObjectWithSpatialProperties
in interface SpatialRegistration
objectID
- String uniquely identifying registering object in the SpatialReasoner.objectOrientation
- Orientation3D containing the X,Y,Z radius of the registering object.boundingPoints
- An ordered List of points used to define the objects boundary. Location should then be defined as the average of the points.
Occupied Space should be the max and min of the points along each axis.
DirectoryFailure
- if the connection to the SpatialReasoner cannot be established.
AlreadyRegisteredException
- if the registering object has been already registered in the SpatialReasoner.public void deregisterObjectWithSpatialProperties(java.lang.String objectID) throws DirectoryFailure, NotRegisteredException
SpatialRegistration
deregisterObjectWithSpatialProperties
in interface SpatialRegistration
objectID
- String uniquely identifying registering object in the SpatialReasoner.
DirectoryFailure
- if the connection to the SpatialReasoner cannot be established.
NotRegisteredException
- if the registering object has not been registered in the SpatialReasoner.public void registerEntityWithProperties(AgentDescription entityDescription, java.util.List properties, boolean guarded, boolean replace) throws DirectoryFailure, AlreadyRegisteredException, GuardInstantiationException
DirectoryRegistration
registerEntityWithProperties
in interface DirectoryRegistration
properties
- List of Property objects further describing the registering entity.
DirectoryFailure
AlreadyRegisteredException
GuardInstantiationException
public void registerEntityHostingEnv(EntityHostEnvDescription eheDescription, boolean guarded, boolean replace) throws DirectoryFailure, AlreadyRegisteredException, GuardInstantiationException
DomainRegistration
registerEntityHostingEnv
in interface DomainRegistration
eheDescription
- EntityHostEnvDescription describes the hosting environment for agents and guards.guarded
- boolean indicating the guarded/unguarded status for the environment. If the hosted environemnt is to be guarded, the implementation of this method will
instantiate a guard, or check if a guard already exists and proceed with the registration via the guard.replace
- boolean indicating whether to replace existing EntityHostEnvDescription.
DirectoryFailure
- if the connection to the DS cannot be established.
AlreadyRegisteredException
- if the registering hosting environment has been already registered in the DS (if the replace = false and there is already registration for
the specified EntityHostEnvDescription).
GuardInstantiationException
public void modifyEntityProperties(java.lang.String entityGUID, java.util.List properties) throws DirectoryFailure, NotRegisteredException, ModificationException
DirectoryRegistration
modifyEntityProperties
in interface DirectoryRegistration
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.
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.public void modifyEntitySpatialProperties(java.lang.String entityGUID, Location3D objectLocation, Orientation3D objectOrientation, Block3D objectOccupiedSpace) throws DirectoryFailure, NotRegisteredException, ModificationException
SpatialRegistration
modifyEntitySpatialProperties
in interface SpatialRegistration
entityGUID
- String containing the entity GUID.objectLocation
- modified Location3D containing the X,Y,Z coordinates of the entity.objectOrientation
- modified Orientation3D containing the X,Y,Z radius of the entity.objectOccupiedSpace
- modified Block3D containing corner locations determining the occupied space of the entity.
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.public void modifyObjectSpatialProperties(java.lang.String objectID, Location3D objectLocation, Orientation3D objectOrientation, Block3D objectOccupiedSpace) throws DirectoryFailure, NotRegisteredException
SpatialRegistration
modifyObjectSpatialProperties
in interface SpatialRegistration
objectID
- String uniquely identifying object, whose spatial properties will be modified in the SpatialReasoner.objectLocation
- modified Location3D containing the X,Y,Z coordinates of the entity.objectOrientation
- modified Orientation3D containing the X,Y,Z radius of the entity.objectOccupiedSpace
- modified Block3D containing corner locations determining the occupied space of the entity.
DirectoryFailure
- if the connection to the SpatialReasoner cannot be established.
NotRegisteredException
- if the object, whose properties are to be modified has not been registered in the SpatialReasoner.public void deregisterEntity(AgentDescription entityDescription) throws DirectoryFailure, NotRegisteredException
DirectoryRegistration
deregisterEntity
in interface DirectoryRegistration
entityDescription
- AgentDescription of the entity to be deregistered.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the entity to be deregistered has not been registered in the DS.public void deregisterEntityHostingEnv(EntityHostEnvDescription eheDescription) throws DirectoryFailure, NotRegisteredException
DomainRegistration
deregisterEntityHostingEnv
in interface DomainRegistration
eheDescription
- EntityHostEnvDescription of the entity hosting environment to be deregistered.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the entity to be deregistered has not been registered in the DS.public AgentConfiguration getAgentConfiguration()
getAgentConfiguration
in interface Registration
public AgentConfiguration getAgentConfiguration(java.lang.String configFile)
getAgentConfiguration
in interface Registration
public KAoSAgentDescription createKAoSAgentDescription(java.lang.String guid, java.lang.String nickname, java.util.List<java.lang.String> domainNames, java.lang.String transportName, JasBean agentInitInfo)
DirectoryRegistration
createKAoSAgentDescription
in interface DirectoryRegistration
guid
- String containing the globally unique identifier for the agent, or null. If null is passed, then the Agent Naming Service will create the identifier.nickname
- String containing agent's nickname.domainNames
- Vector containing the names of the domains the agent will become a member of.transportName
- String specifying the name of the transport the agent wants to use, or null. If null is specified, then the Locators will be empty.public KAoSAgentDescription createKAoSAgentDescription(java.lang.String guid, java.lang.String nickname, java.util.List<java.lang.String> domainNames, java.util.List<AgentCapability> agentCapabilities, java.lang.String transportName, JasBean agentInitInfo)
DirectoryRegistration
createKAoSAgentDescription
in interface DirectoryRegistration
public KAoSEntityDescription registerEntityInDomain(DomainDescription domain, KAoSEntityDescription entityDesc) throws DirectoryFailure
DomainRegistration
registerEntityInDomain
in interface DomainRegistration
domain
- DomainDescription describing the domain, in which to register the given entity.entityDesc
- KAoSEntityDescription describes the entity to be registered in the given domain.
DirectoryFailure
- if the connection to the DS cannot be established.public KAoSEntityDescription deregisterEntityFromDomain(DomainDescription domain, KAoSEntityDescription entityDesc) throws DirectoryFailure, NotRegisteredException
DomainRegistration
deregisterEntityFromDomain
in interface DomainRegistration
domain
- DomainDescription describing the domain, from which to deregister the given entity.entityDesc
- KAoSEntityDescription describes the entity to be deregistered from the given domain.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the deregistering entity has not been registered in the the given domain.public void setParentForDomain(DomainDescription domain, DomainDescription parentDomain) throws DirectoryFailure, HasParentException
DomainHierarchyConfiguration
setParentForDomain
in interface DomainHierarchyConfiguration
domain
- DomainDescription describes the domain, whose parent is to be updated.parentDomain
- DomainDescription describes the parent domain.
DirectoryFailure
- if the connection to the DS cannot be established.
HasParentException
- if the specified domain has already a parent.public void addChildToDomain(DomainDescription domain, DomainDescription childDomain) throws DirectoryFailure, HasParentException
DomainHierarchyConfiguration
addChildToDomain
in interface DomainHierarchyConfiguration
domain
- DomainDescription describes the domain, to which the childDomain will be added.childDomain
- DomainDescription describes the child domain.
DirectoryFailure
- if the connection to the DS cannot be established.
HasParentException
- if the specified child domain has already a parent.public void removeChildFromDomain(DomainDescription domain, DomainDescription childDomain) throws DirectoryFailure, NotRegisteredException
DomainHierarchyConfiguration
removeChildFromDomain
in interface DomainHierarchyConfiguration
domain
- DomainDescription describes the domain, from which to remove the child domain.childDomain
- DomainDescription describes the child domain to be removed.
DirectoryFailure
- if the connection to the DS cannot be established.
NotRegisteredException
- if the specified domain does not have the specified child domain as a child.public ModificationType addGroupLeader(java.lang.String actorId, java.lang.String groupURI) throws NotRegisteredException, DirectoryFailure, ModificationException
GroupRegistration
addGroupLeader
in interface GroupRegistration
actorId
- - unique identifier of the Actor (Agent) individual to be set as the leader
NotRegisteredException
DirectoryFailure
ModificationException
public ModificationType removeGroupLeader(java.lang.String actorId, java.lang.String groupURI) throws NotRegisteredException, DirectoryFailure, ModificationException
GroupRegistration
removeGroupLeader
in interface GroupRegistration
actorId
- - unique identifier of the Actor (Agent) individual to be removed as the leader
NotRegisteredException
DirectoryFailure
ModificationException
protected void logMessage(java.lang.String msg, int logLevel)
protected void logMessage(java.lang.String msg, java.lang.Exception e, int logLevel)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public void addEventListener(DirectoryEventListener listener) throws DirectoryFailure
addEventListener
in interface DirectoryEventNotifier
DirectoryFailure
public void addRemoteEventListener(Locator l) throws DirectoryFailure
addRemoteEventListener
in interface DirectoryEventNotifier
DirectoryFailure
public void removeEventListener(DirectoryEventListener listener) throws DirectoryFailure
removeEventListener
in interface DirectoryEventNotifier
DirectoryFailure
public void removeRemoteEventListener(Locator l) throws DirectoryFailure
removeRemoteEventListener
in interface DirectoryEventNotifier
DirectoryFailure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |