|
Joram ${version} | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.mom.dest.DestinationImpl
The DestinationImpl
class implements the common behaviour of
MOM destinations.
Field Summary | |
static java.lang.String[] |
_rights
|
protected java.util.Hashtable |
clients
Table of the destination readers and writers. |
long |
creationDate
date of creation. |
protected fr.dyade.aaa.agent.AgentId |
destId
Identifier of the agent hosting the destination. |
protected fr.dyade.aaa.agent.AgentId |
dmqId
Identifier of the dead message queue this destination must send its dead messages to, if any. |
protected boolean |
freeReading
true if the READ access is granted to everybody. |
protected boolean |
freeWriting
true if the WRITE access is granted to everybody. |
protected long |
nbMsgsDeliverSinceCreation
|
protected long |
nbMsgsReceiveSinceCreation
|
protected long |
nbMsgsSendToDMQSinceCreation
|
static int |
READ
READ access value. |
static int |
READWRITE
READ and WRITE access value. |
static int |
WRITE
WRITE access value. |
Constructor Summary | |
DestinationImpl(fr.dyade.aaa.agent.AgentId destId,
fr.dyade.aaa.agent.AgentId adminId)
Constructs a DestinationImpl . |
Method Summary | |
boolean |
canBeDeleted()
Returns true if the destination might be deleted. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
ClientMessages not)
Method implementing the reaction to a ClientMessages
notification holding messages sent by a client. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
fr.dyade.aaa.agent.DeleteNot not)
Method implementing the reaction to a DeleteNot
notification requesting the deletion of the destination. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_FreeAccess not)
Method implementing the reaction to a Monit_FreeAccess
notification requesting the free access status of this destination. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_GetDMQSettings not)
Method implementing the reaction to a Monit_GetDMQSettings
notification requesting the destination's DMQ settings. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_GetReaders not)
Method implementing the reaction to a Monit_GetReaders
notification requesting the identifiers of the destination's readers. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_GetStat not)
Method implementing the reaction to a Monit_GetStat
notification requesting to get statistic of this destination. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_GetWriters not)
Method implementing the reaction to a Monit_GetWriters
notification requesting the identifiers of the destination's writers. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
SetDMQRequest not)
Method implementing the reaction to a SetDMQRequest
notification setting the dead message queue identifier for this
destination. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
SetRightRequest not)
Method implementing the reaction to a SetRightRequest
notification requesting rights to be set for a user. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
SpecialAdminRequest not)
Method implementing the reaction to a SpecialAdminRequest
notification requesting the special administration of the destination. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
fr.dyade.aaa.agent.UnknownAgent not)
Method implementing the reaction to an UnknownAgent
notification. |
java.lang.String |
getCreationDate()
Returns this destination creation time through a String of
the form: dow mon dd hh:mm:ss zzz yyyy . |
long |
getCreationTimeInMillis()
Returns this destination creation time as a long. |
java.lang.String |
getDestinationId()
Returns the unique identifier of the destination. |
java.lang.String |
getDMQId()
Return the unique identifier of DMQ set for this destnation if any. |
long |
getNbMsgsDeliverSinceCreation()
Returns the number of messages delivered since creation time of this destination. |
long |
getNbMsgsReceiveSinceCreation()
Returns the number of messages received since creation time of this destination. |
long |
getNbMsgsSendToDMQSinceCreation()
Returns the number of erroneous messages forwarded to the DMQ since creation time of this destination.. |
java.lang.String |
getRight(java.lang.String userid)
Returns a string representation of rights set on this destination for a particular user. |
java.lang.String[] |
getRights()
Returns a string representation of the rights set on this destination. |
protected boolean |
isAdministrator(fr.dyade.aaa.agent.AgentId client)
Checks the administering permission of a given client agent. |
boolean |
isFreeReading()
Tests if this destination is free for reading. |
boolean |
isFreeWriting()
Tests if this destination is free for writing. |
protected boolean |
isReader(fr.dyade.aaa.agent.AgentId client)
Checks the reading permission of a given client agent. |
protected boolean |
isWriter(fr.dyade.aaa.agent.AgentId client)
Checks the writing permission of a given client agent. |
protected void |
processSetRight(fr.dyade.aaa.agent.AgentId user,
int right)
set user right. |
void |
react(fr.dyade.aaa.agent.AgentId from,
fr.dyade.aaa.agent.Notification not)
Distributes the received notifications to the appropriate reactions. |
protected void |
sendToDMQ(ClientMessages deadMessages,
fr.dyade.aaa.agent.AgentId dmqId)
Sends dead messages to the appropriate dead message queue. |
void |
setFreeReading(boolean on)
Sets the FreeReading attribute for this destination. |
void |
setFreeWriting(boolean on)
Sets the FreeWriting attribute for this destination. |
protected java.lang.Object |
specialAdminProcess(SpecialAdminRequest not)
|
protected abstract void |
specialProcess(fr.dyade.aaa.agent.Notification not)
Abstract method to be implemented by subclasses for specifically processing notifications. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationImplMBean |
toString |
Field Detail |
protected fr.dyade.aaa.agent.AgentId destId
protected boolean freeReading
true
if the READ access is granted to everybody.
protected boolean freeWriting
true
if the WRITE access is granted to everybody.
protected java.util.Hashtable clients
protected fr.dyade.aaa.agent.AgentId dmqId
public static int READ
public static int WRITE
public static int READWRITE
public long creationDate
protected long nbMsgsReceiveSinceCreation
protected long nbMsgsDeliverSinceCreation
protected long nbMsgsSendToDMQSinceCreation
public static java.lang.String[] _rights
Constructor Detail |
public DestinationImpl(fr.dyade.aaa.agent.AgentId destId, fr.dyade.aaa.agent.AgentId adminId)
DestinationImpl
.
destId
- Identifier of the agent hosting the destination.adminId
- Identifier of the administrator of the destination.Method Detail |
public boolean canBeDeleted()
true
if the destination might be deleted.
public void react(fr.dyade.aaa.agent.AgentId from, fr.dyade.aaa.agent.Notification not) throws fr.dyade.aaa.agent.UnknownNotificationException
fr.dyade.aaa.agent.UnknownNotificationException
- If a received notification is
unexpected by the destination.protected void doReact(fr.dyade.aaa.agent.AgentId from, SetRightRequest not) throws AccessException
SetRightRequest
notification requesting rights to be set for a user.
AccessException
- If the requester is not the administrator.protected void processSetRight(fr.dyade.aaa.agent.AgentId user, int right) throws RequestException
RequestException
protected void doReact(fr.dyade.aaa.agent.AgentId from, SetDMQRequest not) throws AccessException
SetDMQRequest
notification setting the dead message queue identifier for this
destination.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetReaders not) throws AccessException
Monit_GetReaders
notification requesting the identifiers of the destination's readers.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetWriters not) throws AccessException
Monit_GetWriters
notification requesting the identifiers of the destination's writers.
AccessException
- If the requester is not the administrator.public java.lang.String[] getRights()
getRights
in interface DestinationImplMBean
public java.lang.String getRight(java.lang.String userid)
getRight
in interface DestinationImplMBean
userid
- The user's unique identifier.
protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_FreeAccess not) throws AccessException
Monit_FreeAccess
notification requesting the free access status of this destination.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetDMQSettings not) throws AccessException
Monit_GetDMQSettings
notification requesting the destination's DMQ settings.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetStat not) throws AccessException
Monit_GetStat
notification requesting to get statistic of this destination.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, ClientMessages not) throws AccessException
ClientMessages
notification holding messages sent by a client.
If the sender is not a writer on the destination the messages are sent to the DMQ and an exception is thrown. Otherwise, the processing of the received messages is performed in subclasses.
AccessException
- If the sender is not a WRITER on the
destination.protected void doReact(fr.dyade.aaa.agent.AgentId from, fr.dyade.aaa.agent.UnknownAgent not)
UnknownAgent
notification.
If the unknown agent is the DMQ, its identifier is set to null. If it is a client of the destination, it is removed. Specific processing is also done in subclasses.
protected void doReact(fr.dyade.aaa.agent.AgentId from, fr.dyade.aaa.agent.DeleteNot not)
DeleteNot
notification requesting the deletion of the destination.
The processing is done in subclasses if the sender is an administrator.
protected void doReact(fr.dyade.aaa.agent.AgentId from, SpecialAdminRequest not)
SpecialAdminRequest
notification requesting the special administration of the destination.
protected java.lang.Object specialAdminProcess(SpecialAdminRequest not) throws RequestException
RequestException
protected boolean isReader(fr.dyade.aaa.agent.AgentId client)
client
- AgentId of the client requesting a reading permission.protected boolean isWriter(fr.dyade.aaa.agent.AgentId client)
client
- AgentId of the client requesting a writing permission.protected boolean isAdministrator(fr.dyade.aaa.agent.AgentId client)
client
- AgentId of the client requesting an admin permission.protected void sendToDMQ(ClientMessages deadMessages, fr.dyade.aaa.agent.AgentId dmqId)
deadMessages
- The dead messages.dmqId
- Identifier of the dead message queue to use,
null
if not provided.protected abstract void specialProcess(fr.dyade.aaa.agent.Notification not)
public java.lang.String getDestinationId()
getDestinationId
in interface DestinationImplMBean
public boolean isFreeReading()
isFreeReading
in interface DestinationImplMBean
public void setFreeReading(boolean on)
FreeReading
attribute for this destination.
setFreeReading
in interface DestinationImplMBean
on
- if true anyone can receive message from this destination.public boolean isFreeWriting()
isFreeWriting
in interface DestinationImplMBean
public void setFreeWriting(boolean on)
FreeWriting
attribute for this destination.
setFreeWriting
in interface DestinationImplMBean
on
- if true anyone can send message to this destination.public java.lang.String getDMQId()
getDMQId
in interface DestinationImplMBean
public long getCreationTimeInMillis()
getCreationTimeInMillis
in interface DestinationImplMBean
public java.lang.String getCreationDate()
String
of
the form: dow mon dd hh:mm:ss zzz yyyy
.
getCreationDate
in interface DestinationImplMBean
public long getNbMsgsReceiveSinceCreation()
getNbMsgsReceiveSinceCreation
in interface DestinationImplMBean
public long getNbMsgsDeliverSinceCreation()
getNbMsgsDeliverSinceCreation
in interface DestinationImplMBean
public long getNbMsgsSendToDMQSinceCreation()
getNbMsgsSendToDMQSinceCreation
in interface DestinationImplMBean
|
Joram ${version} | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |