Package org.objectweb.joram.mom.util
Class JoramHelper
- java.lang.Object
-
- org.objectweb.joram.mom.util.JoramHelper
-
public class JoramHelper extends Object
Administration stuff for internal use.The functions use the AdminTopic to perform the operations. The AdminTopic agent is called directly from the calling agent, so special care should be taken to ensure consistency. JoramHelper functions should be called from an agent reaction, and they should save the state of the AdminTopic agent so that the new state is committed with the current reaction.
-
-
Field Summary
Fields Modifier and Type Field Description static intCLIENT_CONTEXT_CLASS_IDstatic intCLIENT_MESSAGES_CLASS_IDstatic intCLIENT_SUBSCRIPTION_CLASS_IDprivate static booleanDEBUGstatic intENCODABLE_CLASS_ID_AREAstatic StringJNDI_HOSTstatic StringJNDI_INITIALstatic StringJNDI_PORTprivate static Loggerloggerclass specific loggerstatic intMESSAGE_CLASS_IDstatic intMESSAGE_ID_LIST_IMPL_CLASS_IDstatic intQUEUE_ARRIVAL_STATE_CLASS_IDstatic intQUEUE_CLASS_IDstatic intQUEUE_DELIVERY_TABLE_CLASS_IDstatic intTOPIC_FWD_NOT_CLASS_IDstatic intUSER_AGENT_ARRIVAL_STATE_CLASS_IDstatic intUSER_AGENT_CLASS_ID
-
Constructor Summary
Constructors Constructor Description JoramHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanclearQueue(String queueName)Clears all pending message of a queuestatic booleanclearSubscription(String userName, String subName)Clears all pending message of a subscriptionstatic AgentIdcreateDestination(String destName, AgentId adminId, String destClassName, byte type, Properties properties, boolean freerw)Instantiating the destination class or retrieving the destination.static AgentIdcreateDestination(String destName, AgentId adminId, String destClassName, byte type, Properties properties, boolean freeReading, boolean freeWriting)Instantiating the destination class or retrieving the destination.static voidcreateUser(String userName, String userPass)Create user.static booleandeleteQueueMessage(String queueName, String msgId)Delete a message in a queuestatic booleandeleteSubMessage(String userName, String subName, String msgId)Deletes a message in a subscription
-
-
-
Field Detail
-
logger
private static final Logger logger
class specific logger
-
DEBUG
private static final boolean DEBUG
-
JNDI_INITIAL
public static final String JNDI_INITIAL
- See Also:
- Constant Field Values
-
JNDI_HOST
public static final String JNDI_HOST
- See Also:
- Constant Field Values
-
JNDI_PORT
public static final String JNDI_PORT
- See Also:
- Constant Field Values
-
ENCODABLE_CLASS_ID_AREA
public static final int ENCODABLE_CLASS_ID_AREA
- See Also:
- Constant Field Values
-
MESSAGE_CLASS_ID
public static final int MESSAGE_CLASS_ID
- See Also:
- Constant Field Values
-
QUEUE_CLASS_ID
public static final int QUEUE_CLASS_ID
- See Also:
- Constant Field Values
-
USER_AGENT_CLASS_ID
public static final int USER_AGENT_CLASS_ID
- See Also:
- Constant Field Values
-
CLIENT_SUBSCRIPTION_CLASS_ID
public static final int CLIENT_SUBSCRIPTION_CLASS_ID
- See Also:
- Constant Field Values
-
CLIENT_CONTEXT_CLASS_ID
public static final int CLIENT_CONTEXT_CLASS_ID
- See Also:
- Constant Field Values
-
MESSAGE_ID_LIST_IMPL_CLASS_ID
public static final int MESSAGE_ID_LIST_IMPL_CLASS_ID
- See Also:
- Constant Field Values
-
USER_AGENT_ARRIVAL_STATE_CLASS_ID
public static final int USER_AGENT_ARRIVAL_STATE_CLASS_ID
- See Also:
- Constant Field Values
-
QUEUE_DELIVERY_TABLE_CLASS_ID
public static final int QUEUE_DELIVERY_TABLE_CLASS_ID
- See Also:
- Constant Field Values
-
QUEUE_ARRIVAL_STATE_CLASS_ID
public static final int QUEUE_ARRIVAL_STATE_CLASS_ID
- See Also:
- Constant Field Values
-
TOPIC_FWD_NOT_CLASS_ID
public static final int TOPIC_FWD_NOT_CLASS_ID
- See Also:
- Constant Field Values
-
CLIENT_MESSAGES_CLASS_ID
public static final int CLIENT_MESSAGES_CLASS_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
createUser
public static final void createUser(String userName, String userPass)
Create user.- Parameters:
userName- user nameuserPass- user password
-
createDestination
public static final AgentId createDestination(String destName, AgentId adminId, String destClassName, byte type, Properties properties, boolean freerw) throws Exception
Instantiating the destination class or retrieving the destination.- Parameters:
destName- destination nameadminId- Agent Id. of the administrator (null for TopicAdmin)destClassName- destination class nametype- destination typeproperties- destination propertiesfreerw- if true rights all users can read and write the destination.- Returns:
- destination AgentId
- Throws:
Exception
-
createDestination
public static final AgentId createDestination(String destName, AgentId adminId, String destClassName, byte type, Properties properties, boolean freeReading, boolean freeWriting) throws Exception
Instantiating the destination class or retrieving the destination.- Parameters:
destName- destination nameadminId- Agent Id. of the administrator (null for TopicAdmin)destClassName- destination class nametype- destination typeproperties- destination propertiesfreeReading- if true rights all users can read and write the destination.freeWriting- if true rights all users can read and write the destination.- Returns:
- destination AgentId
- Throws:
Exception
-
deleteQueueMessage
public static final boolean deleteQueueMessage(String queueName, String msgId)
Delete a message in a queue- Parameters:
queueName- Name of the queuemsgId- ID of the message to be deleted- Returns:
-
deleteSubMessage
public static final boolean deleteSubMessage(String userName, String subName, String msgId)
Deletes a message in a subscription- Parameters:
userName- Subscriber's namesubName- Subscription namemsgId- ID of the message to be deleted- Returns:
-
clearQueue
public static final boolean clearQueue(String queueName)
Clears all pending message of a queue- Parameters:
queueName- Name of the queue- Returns:
-
-