Search in sources :

Example 1 with Producer

use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.

the class ProducerManagerMonitor method getNumWildcardProducers.

public Integer getNumWildcardProducers(String wildcard) throws MBeanException {
    int numWildcardProducers = Producer.getNumWildcardProducers();
    if (numWildcardProducers <= 0) {
        return (Integer.valueOf(0));
    }
    Iterator producers = Producer.getWildcardProducers();
    if (producers == null) {
        return (Integer.valueOf(0));
    }
    int count = 0;
    while (producers.hasNext()) {
        ProducerUID pid = (ProducerUID) producers.next();
        Producer oneProd = (Producer) Producer.getProducer(pid);
        /*
             * If wildcard param is not null, check for matches If it is null, return total count of wildcards
             */
        if (wildcard != null) {
            DestinationUID id = oneProd.getDestinationUID();
            if (id.getName().equals(wildcard)) {
                count++;
            }
        } else {
            count++;
        }
    }
    return (Integer.valueOf(count));
}
Also used : DestinationUID(com.sun.messaging.jmq.jmsserver.core.DestinationUID) Producer(com.sun.messaging.jmq.jmsserver.core.Producer) ProducerUID(com.sun.messaging.jmq.jmsserver.core.ProducerUID) Iterator(java.util.Iterator)

Example 2 with Producer

use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.

the class ProducerUtil method getConnectionUID.

public static ConnectionUID getConnectionUID(ProducerUID pid) {
    Producer p = (Producer) Producer.getProducer(pid);
    ConnectionUID cxnId;
    if (p == null) {
        return (null);
    }
    cxnId = p.getConnectionUID();
    return (cxnId);
}
Also used : Producer(com.sun.messaging.jmq.jmsserver.core.Producer) ConnectionUID(com.sun.messaging.jmq.jmsserver.service.ConnectionUID)

Example 3 with Producer

use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.

the class ProducerUtil method getDestinationNames.

private static String[] getDestinationNames(ProducerUID pid) {
    Producer p = (Producer) Producer.getProducer(pid);
    String[] ret = null;
    if (p == null) {
        return (null);
    }
    ArrayList<String> al = new ArrayList<>();
    Set dests = p.getDestinations();
    Iterator itr = dests.iterator();
    while (itr.hasNext()) {
        DestinationUID duid = (DestinationUID) itr.next();
        al.add(duid.getName());
    }
    if (al.size() > 0) {
        ret = new String[al.size()];
        ret = al.toArray(ret);
    }
    return (ret);
}
Also used : Set(java.util.Set) DestinationUID(com.sun.messaging.jmq.jmsserver.core.DestinationUID) Producer(com.sun.messaging.jmq.jmsserver.core.Producer) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Example 4 with Producer

use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.

the class ProducerUtil method getServiceName.

public static String getServiceName(ProducerUID pid) {
    Producer p = (Producer) Producer.getProducer(pid);
    ConnectionUID cxnId = null;
    if (p == null) {
        return (null);
    }
    cxnId = p.getConnectionUID();
    if (cxnId == null) {
        return (null);
    }
    return (ConnectionUtil.getServiceOfConnection(cxnId.longValue()));
}
Also used : Producer(com.sun.messaging.jmq.jmsserver.core.Producer) ConnectionUID(com.sun.messaging.jmq.jmsserver.service.ConnectionUID)

Example 5 with Producer

use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.

the class ProducerUtil method getUser.

public static String getUser(ProducerUID pid) {
    Producer p = (Producer) Producer.getProducer(pid);
    ConnectionUID cxnId = null;
    if (p == null) {
        return (null);
    }
    cxnId = p.getConnectionUID();
    if (cxnId == null) {
        return (null);
    }
    ConnectionInfo cxnInfo = ConnectionUtil.getConnectionInfo(cxnId.longValue());
    return (cxnInfo.user);
}
Also used : Producer(com.sun.messaging.jmq.jmsserver.core.Producer) ConnectionUID(com.sun.messaging.jmq.jmsserver.service.ConnectionUID) ConnectionInfo(com.sun.messaging.jmq.util.admin.ConnectionInfo)

Aggregations

Producer (com.sun.messaging.jmq.jmsserver.core.Producer)18 DestinationUID (com.sun.messaging.jmq.jmsserver.core.DestinationUID)9 Iterator (java.util.Iterator)7 Destination (com.sun.messaging.jmq.jmsserver.core.Destination)6 ProducerUID (com.sun.messaging.jmq.jmsserver.core.ProducerUID)5 ConnectionUID (com.sun.messaging.jmq.jmsserver.service.ConnectionUID)5 BrokerException (com.sun.messaging.jmq.jmsserver.util.BrokerException)5 ArrayList (java.util.ArrayList)3 Hashtable (java.util.Hashtable)3 Consumer (com.sun.messaging.jmq.jmsserver.core.Consumer)2 MessageDeliveryTimeInfo (com.sun.messaging.jmq.jmsserver.core.MessageDeliveryTimeInfo)2 PacketReference (com.sun.messaging.jmq.jmsserver.core.PacketReference)2 Session (com.sun.messaging.jmq.jmsserver.core.Session)2 SessionUID (com.sun.messaging.jmq.jmsserver.core.SessionUID)2 ConnectionInfo (com.sun.messaging.jmq.util.admin.ConnectionInfo)2 SelectorFormatException (com.sun.messaging.jmq.util.selector.SelectorFormatException)2 IOException (java.io.IOException)2 Set (java.util.Set)2 Packet (com.sun.messaging.jmq.io.Packet)1 FaultInjection (com.sun.messaging.jmq.jmsserver.FaultInjection)1