public class MOMCommandsImpl extends Object implements MOMCommands
Modifier and Type | Class and Description |
---|---|
private class |
MOMCommandsImpl.QueueNotFoundException |
private class |
MOMCommandsImpl.SubscriptionNotFoundException |
private class |
MOMCommandsImpl.TopicNotFoundException |
private class |
MOMCommandsImpl.UserNotFoundException |
Modifier and Type | Field and Description |
---|---|
private static org.osgi.util.tracker.ServiceTracker |
adminTracker |
private static org.osgi.framework.BundleContext |
bundleContext |
private static org.osgi.util.tracker.ServiceTracker |
clientSubTracker |
static String[] |
COMMANDS
Commands list
|
private static org.osgi.util.tracker.ServiceTracker |
destinationTracker |
private static MOMCommandsImpl |
INSTANCE |
static String |
NAMESPACE |
private static org.osgi.util.tracker.ServiceTracker |
queueTracker |
private static int |
TIMEOUT |
private static org.osgi.util.tracker.ServiceTracker |
topicTracker |
private static org.osgi.util.tracker.ServiceTracker |
userTracker |
Constructor and Description |
---|
MOMCommandsImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear(String[] args)
Deletes all pending messages from a subscription or a queue.
|
void |
create(String[] args)
Creates a destination or a user
Usage: [joram:mom:]create |
private void |
createDestination(String[] args) |
private void |
createUser(String[] args)
Add a new user to the servers
|
void |
delete(String[] args)
Delete a destination or a user
Usage: [joram:mom:]delete (topic|queue|user) |
void |
deleteMsg(String[] args)
Delete a pending message from a queue or subscription
Usage: [joram:mom:]deleteMsg queue [joram:mom:]deleteMsg subscription |
private void |
deleteMsgQueue(String queueName,
String msgId) |
private void |
deleteMsgSub(String userName,
String subName,
String msgId) |
private AdminTopicMBean |
findAdminTopic() |
private ClientSubscriptionMBean |
findClientSubscription(String userName,
String subName) |
private QueueMBean |
findQueue(String name) |
private TopicMBean |
findTopic(String name) |
private UserAgentMBean |
findUser(String userName) |
static MOMCommandsImpl |
getInstance() |
private List<? extends MessageView> |
getMessageRange(List<? extends MessageView> msgs,
int start,
int end) |
private MessageView |
getQueueMessage(String queueName,
String msgId) |
private List<? extends MessageView> |
getQueueMessages(String queueName) |
private MessageView |
getSubscriptionMessage(String userName,
String subName,
String msgId) |
private List<MessageView> |
getSubscriptionMessages(String userName,
String subscriptionName) |
static void |
help()
Prints all MOM commands
|
static void |
help(String command)
Prints the description of the given command
Usage: [joram:mom:]help |
void |
info(String[] args)
Show information about a destination
Usage: [joram:mom:]info (queue|topic) [joram:mom:]info subscription |
void |
infoMsg(String[] args) |
private void |
infoQueue(String name) |
private void |
infoSubscription(String userName,
String subName) |
private void |
infoTopic(String name) |
static void |
init(org.osgi.framework.BundleContext context) |
void |
list(String[] args)
Lists all queues, topics, both or users with useful informations
Usage: [joram:mom:]list Possible categories: destination, topic, queue, user, subscription NB: For the subscription category, you must provide the user name. |
private void |
listDestination() |
private void |
listQueue() |
private void |
listSubscription(String userName) |
private void |
listTopic() |
private void |
listUser() |
void |
lsMsg(String[] args)
Displays pending messages from a destination
Usage: [joram:mom:]lsMsg queue [joram:mom:]lsMsg subscription |
static void |
main(String[] args) |
void |
ping()
Checks whether Joram works
Usage: [joram:mom:]ping |
void |
queueLoad(String[] args)
Shows the pending message count
Usage: [joram:mom:]queueLoad |
void |
receiveMsg(String[] args)
Deprecated.
|
void |
sendMsg(String[] args)
Deprecated.
|
void |
setFreeRead(String[] args) |
void |
setFreeWrite(String[] args) |
void |
subscriptionLoad(String[] args)
Shows the pending message count of the subscription
Usage: [joram:mom:]subscriptionLoad |
private static MOMCommandsImpl INSTANCE
public static final String NAMESPACE
private static final int TIMEOUT
private static org.osgi.framework.BundleContext bundleContext
private static org.osgi.util.tracker.ServiceTracker destinationTracker
private static org.osgi.util.tracker.ServiceTracker queueTracker
private static org.osgi.util.tracker.ServiceTracker topicTracker
private static org.osgi.util.tracker.ServiceTracker userTracker
private static org.osgi.util.tracker.ServiceTracker adminTracker
private static org.osgi.util.tracker.ServiceTracker clientSubTracker
public static String[] COMMANDS
public static void init(org.osgi.framework.BundleContext context)
public static MOMCommandsImpl getInstance() throws Exception
Exception
public static void help()
public static void help(String command)
command
- Name of the command to describepublic void list(String[] args)
list
in interface MOMCommands
args
- Category of item to list: destination, queue, topic, userprivate void listDestination()
private void listQueue()
private void listTopic()
private void listUser()
private void listSubscription(String userName)
public void create(String[] args)
create
in interface MOMCommands
args
- parameters of the commandprivate void createDestination(String[] args)
private void createUser(String[] args)
args
- parameters of the commandpublic void delete(String[] args)
delete
in interface MOMCommands
args
- {category, name}public void setFreeRead(String[] args)
public void setFreeWrite(String[] args)
public void queueLoad(String[] args)
queueLoad
in interface MOMCommands
args
- parameters of the commandprivate QueueMBean findQueue(String name) throws MOMCommandsImpl.QueueNotFoundException
private TopicMBean findTopic(String name) throws MOMCommandsImpl.TopicNotFoundException
private AdminTopicMBean findAdminTopic()
public void subscriptionLoad(String[] args)
subscriptionLoad
in interface MOMCommands
args
- parameters of the commandprivate UserAgentMBean findUser(String userName)
private ClientSubscriptionMBean findClientSubscription(String userName, String subName) throws MOMCommandsImpl.UserNotFoundException, MOMCommandsImpl.SubscriptionNotFoundException
public void info(String[] args)
info
in interface MOMCommands
args
- ???private void infoTopic(String name)
private void infoQueue(String name)
public void lsMsg(String[] args)
lsMsg
in interface MOMCommands
args
- {queue name, message range}public void infoMsg(String[] args)
public void ping()
ping
in interface MOMCommands
public void deleteMsg(String[] args)
deleteMsg
in interface MOMCommands
public void clear(String[] args)
clear
in interface MOMCommands
public void sendMsg(String[] args)
MOMCommands
sendMsg
in interface MOMCommands
public void receiveMsg(String[] args)
MOMCommands
receiveMsg
in interface MOMCommands
private List<? extends MessageView> getQueueMessages(String queueName) throws MOMCommandsImpl.QueueNotFoundException
private MessageView getQueueMessage(String queueName, String msgId) throws MOMCommandsImpl.QueueNotFoundException
private List<MessageView> getSubscriptionMessages(String userName, String subscriptionName) throws MOMCommandsImpl.UserNotFoundException, MOMCommandsImpl.SubscriptionNotFoundException
private MessageView getSubscriptionMessage(String userName, String subName, String msgId) throws MOMCommandsImpl.UserNotFoundException, MOMCommandsImpl.SubscriptionNotFoundException
private List<? extends MessageView> getMessageRange(List<? extends MessageView> msgs, int start, int end)
public static void main(String[] args)
Copyright © 2023 ScalAgent D.T.. All rights reserved.