kaos.domain
Class KAoSDomainImpl

java.lang.Object
  extended by kaos.domain.KAoSDomainImpl
All Implemented Interfaces:
KAoSDomain

public class KAoSDomainImpl
extends java.lang.Object
implements KAoSDomain

Defines the operations to define and access information about a KAoS domain. The information includes the name of the domain begin described, the name of the parent domain and a collection containing the names of immediate children domains.


Field Summary
protected  Logger _logger
           
 
Constructor Summary
KAoSDomainImpl(DomainDescription desc)
           
KAoSDomainImpl(java.lang.String name)
           
KAoSDomainImpl(java.lang.String name, Transport transport)
           
 
Method Summary
 void addChild(KAoSDomain childDomain)
          Add the specified child KAoSDomain as a child of this KAoSDomain.
 void degisterAgent(KAoSActor agent)
          Deregister agent represented by the given KAoSActor from this KAoSDomain.
 java.util.List getChildren()
          Return a List of KAoSDomain, the immediate children of this KAoSDomain.
 java.lang.String getModality()
          Obtain the authorization modality of the domain described by this description.
 java.lang.String getName()
          Obtain the name of this KAoSDomain.
 KAoSDomain getParent()
          Obtain the parent domain.
 java.lang.String getPriority()
          Obtain the priority of the domain described by this description.
 void registerAgent(KAoSActor agent)
          Register the specified KAoSActor in this domain.
 void removeChild(KAoSDomain childDomain)
          Remove the specified childDomain from the collection of children of this KAoSDomain.
 void removeParent(KAoSDomain parent)
          Remove the parent KAoSDomain.
 void setModality(java.lang.String modality)
          Set the authorization modality of the domain described by this description.
 void setName(java.lang.String name)
          Set the name of this KAoSDomain.
 void setParent(KAoSDomain parent)
          Set the parent domain of this domain.
 void setPriority(java.lang.String priority)
          Set the priority of the domain described by this description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected Logger _logger
Constructor Detail

KAoSDomainImpl

public KAoSDomainImpl(DomainDescription desc)

KAoSDomainImpl

public KAoSDomainImpl(java.lang.String name)

KAoSDomainImpl

public KAoSDomainImpl(java.lang.String name,
                      Transport transport)
               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getChildren

public java.util.List getChildren()
Return a List of KAoSDomain, the immediate children of this KAoSDomain.

Specified by:
getChildren in interface KAoSDomain
Returns:
List containing the immediate children of this domain.

addChild

public void addChild(KAoSDomain childDomain)
              throws HasParentException
Add the specified child KAoSDomain as a child of this KAoSDomain.

Specified by:
addChild in interface KAoSDomain
Parameters:
childDomain - KAoSDomain to be added to this KAoSDomain as a child.
Throws:
HasParentException - will be thrown if the childDomain has already a parent.

removeChild

public void removeChild(KAoSDomain childDomain)
                 throws NotRegisteredException
Remove the specified childDomain from the collection of children of this KAoSDomain.

Specified by:
removeChild in interface KAoSDomain
Parameters:
childDomain - KAoSDomain to be removed from the collection of children of this domain.
Throws:
NotRegisteredException - will be thrown if this KAoSDomain does not have the specified childDomain as a child.

setName

public void setName(java.lang.String name)
Set the name of this KAoSDomain.

Specified by:
setName in interface KAoSDomain
Parameters:
name - The name of this KAoSDomain.

getName

public java.lang.String getName()
Obtain the name of this KAoSDomain.

Specified by:
getName in interface KAoSDomain
Returns:
String containing the name of this KAoSDomain.

setParent

public void setParent(KAoSDomain parent)
               throws HasParentException
Set the parent domain of this domain.

Specified by:
setParent in interface KAoSDomain
Parameters:
parent - KAoSDomain, the parent of this domain.
Throws:
HasParentException - will be thrown, if this domain has already a parent.

getParent

public KAoSDomain getParent()
Obtain the parent domain.

Specified by:
getParent in interface KAoSDomain
Returns:
KAoSDomain representing the parent domain.

removeParent

public void removeParent(KAoSDomain parent)
                  throws NotRegisteredException
Remove the parent KAoSDomain.

Specified by:
removeParent in interface KAoSDomain
Parameters:
parent - KAoSDomain to be removed as the parent.
Throws:
NotRegisteredException - will be thrown if this KAoSDomain does not have the specified childDomain as the parent.

getModality

public java.lang.String getModality()
Obtain the authorization modality of the domain described by this description.

Specified by:
getModality in interface KAoSDomain
Returns:
String containing the authorization modality of the domain this description refers to.

setModality

public void setModality(java.lang.String modality)
Set the authorization modality of the domain described by this description.

Specified by:
setModality in interface KAoSDomain
Parameters:
modality - The modality of the domain described by this description.

getPriority

public java.lang.String getPriority()
Obtain the priority of the domain described by this description.

Specified by:
getPriority in interface KAoSDomain
Returns:
String containing the priority of the domain this description refers to.

setPriority

public void setPriority(java.lang.String priority)
Set the priority of the domain described by this description.

Specified by:
setPriority in interface KAoSDomain
Parameters:
priority - The priority of the domain described by this description.

registerAgent

public void registerAgent(KAoSActor agent)
                   throws DomainFailure,
                          AlreadyRegisteredException
Register the specified KAoSActor in this domain.

Specified by:
registerAgent in interface KAoSDomain
Parameters:
agent - KAoSActor to be registered in this domain.
Throws:
DomainFailure - if domain registration mechanism fails.
AlreadyRegistered - if the registering agent has been already registered in the domain.
AlreadyRegisteredException

degisterAgent

public void degisterAgent(KAoSActor agent)
                   throws DomainFailure,
                          NotRegisteredException
Deregister agent represented by the given KAoSActor from this KAoSDomain.

Specified by:
degisterAgent in interface KAoSDomain
Parameters:
agent - KAoSActor to be deregistered from this domain.
Throws:
DomainFailure - if domain deregistration mechanism fails.
NotRegisteredException - if the deregistering agent has not been registered in this domain.