Search in sources :

Example 1 with ConnectionUID

use of com.sun.messaging.jmq.jmsserver.service.ConnectionUID in project openmq by eclipse-ee4j.

the class GetConsumersHandler method getConnectionInfo.

public static ConnectionInfo getConnectionInfo(long id) {
    ConnectionManager cm = Globals.getConnectionManager();
    ConnectionInfo cxnInfo = null;
    IMQConnection cxn = null;
    cxn = (IMQConnection) cm.getConnection(new ConnectionUID(id));
    if (cxn == null) {
        return (null);
    }
    cxnInfo = cxn.getConnectionInfo();
    return (cxnInfo);
}
Also used : ConnectionManager(com.sun.messaging.jmq.jmsserver.service.ConnectionManager) IMQConnection(com.sun.messaging.jmq.jmsserver.service.imq.IMQConnection) ConnectionUID(com.sun.messaging.jmq.jmsserver.service.ConnectionUID) ConnectionInfo(com.sun.messaging.jmq.util.admin.ConnectionInfo)

Example 2 with ConnectionUID

use of com.sun.messaging.jmq.jmsserver.service.ConnectionUID in project openmq by eclipse-ee4j.

the class GetConsumersHandler method getServiceName.

private static String getServiceName(ConsumerUID cid) {
    ConnectionUID cxnId = getConnectionUID(cid);
    if (cxnId == null) {
        return (null);
    }
    String serviceName = getServiceOfConnection(cxnId.longValue());
    return (serviceName);
}
Also used : ConnectionUID(com.sun.messaging.jmq.jmsserver.service.ConnectionUID)

Example 3 with ConnectionUID

use of com.sun.messaging.jmq.jmsserver.service.ConnectionUID in project openmq by eclipse-ee4j.

the class DebugHandler method getDebugInfo.

public Hashtable getDebugInfo(String arg, String target, String targetType, Properties p) throws Exception {
    if (arg.equals("cxn")) {
        if (target == null) {
            return getAllCxnInfo(null);
        } else {
            ConnectionUID uid = new ConnectionUID(Long.parseLong(target));
            return getCxnInfo(uid);
        }
    } else if (arg.equals("config")) {
        return getConfig();
    } else if (arg.equals("memory")) {
        return getMemory();
    } else if (arg.equals("dst")) {
        if (target == null) {
            return DL.getAllDebugState();
        } else {
            boolean isQueue = false;
            if (targetType == null) {
                throw new Exception("topic or queue not " + "specified with -t [t|q]");
            } else if (targetType.equals("t")) {
                isQueue = false;
            } else if (targetType.equals("q")) {
                isQueue = true;
            } else {
                throw new Exception("Unknown -t argument " + targetType + " expected t or q");
            }
            DestinationUID uid = DestinationUID.getUID(target, isQueue);
            return getDestinationInfo(uid);
        }
    } else if (arg.equals("ses")) {
        if (target == null) {
            return Session.getAllDebugState();
        } else {
            SessionUID uid = new SessionUID(Long.parseLong(target));
            return getSession(uid);
        }
    } else if (arg.equals("prd")) {
        if (target == null) {
            return Producer.getAllDebugState();
        } else {
            ProducerUID uid = new ProducerUID(Long.parseLong(target));
            return getProducerInfo(uid);
        }
    } else if (arg.equals("con")) {
        if (target == null) {
            return Consumer.getAllDebugState();
        } else {
            ConsumerUID uid = new ConsumerUID(Long.parseLong(target));
            return getConInfo(uid);
        }
    } else if (arg.equals("svc")) {
        if (target == null) {
            logger.log(Logger.INFO, "XXX - target of null " + "not implemented for " + arg);
        } else {
            return getSvcInfo(target);
        }
    } else if (arg.equals("db")) {
        return getDBInfo();
    } else if (arg.equals("trans")) {
        if (target == null) {
            return getTransactionInfo(null);
        } else {
            TransactionUID uid = new TransactionUID(Long.parseLong(target));
            return getTransactionInfo(uid);
        }
    } else if (arg.equals("pool")) {
        if (target == null) {
            logger.log(Logger.INFO, "XXX - target of null " + "not implemented for " + arg);
        } else {
            return getThreadPoolInfo(target);
        }
    } else if (arg.equals("threads")) {
        return SupportUtil.getAllStackTracesAsMap();
    } else if (arg.equals("cls")) {
        return getClusterInfo();
    } else if (arg.equals("bkr")) {
        return getBrokerInfo();
    } else if (arg.equals("pkt")) {
        String full = p.getProperty("full");
        boolean fullDump = false;
        if (full != null && full.equalsIgnoreCase("True")) {
            fullDump = true;
        }
        return getPktInfo(target, targetType, fullDump);
    }
    logger.log(Logger.INFO, "Unknown dump arg " + arg);
    return null;
}
Also used : TransactionUID(com.sun.messaging.jmq.jmsserver.data.TransactionUID) DestinationUID(com.sun.messaging.jmq.jmsserver.core.DestinationUID) SessionUID(com.sun.messaging.jmq.jmsserver.core.SessionUID) ProducerUID(com.sun.messaging.jmq.jmsserver.core.ProducerUID) ConsumerUID(com.sun.messaging.jmq.jmsserver.core.ConsumerUID) ConnectionUID(com.sun.messaging.jmq.jmsserver.service.ConnectionUID)

Example 4 with ConnectionUID

use of com.sun.messaging.jmq.jmsserver.service.ConnectionUID in project openmq by eclipse-ee4j.

the class DebugHandler method getPktInfo.

private Hashtable getPktInfo(String target, String type, boolean full) throws Exception {
    Hashtable ht = new Hashtable();
    if (type == null || type.length() == 0 || type.equals("bkr")) {
        Hashtable dest = new Hashtable();
        Iterator[] itrs = DL.getAllDestinations(null);
        Iterator itr = itrs[0];
        while (itr.hasNext()) {
            Destination d = (Destination) itr.next();
            dest.put(d.getDestinationUID().toString(), d.getDebugMessages(full));
        }
        ht.put("Destinations", dest);
    // XXX LKS 1/8/2004
    // add entries for sessions, etc
    // 
    } else if (type.equals("q") || type.equals("t")) {
        boolean isQueue = false;
        if (type.equals("t")) {
            isQueue = false;
        } else if (type.equals("q")) {
            isQueue = true;
        }
        DestinationUID uid = DestinationUID.getUID(target, isQueue);
        Destination[] ds = DL.getDestination(null, uid);
        Destination d = ds[0];
        if (d == null) {
            throw new Exception("Unknown destination " + uid);
        } else {
            ht.putAll(d.getDebugMessages(full));
        }
    } else if (type.equals("con")) {
        if (target == null) {
            throw new Exception("Please specify consumerUID");
        } else {
            ConsumerUID uid = new ConsumerUID(Long.parseLong(target));
            Consumer c = Consumer.getConsumer(uid);
            if (c == null) {
                throw new Exception("Unknown consumer " + uid);
            } else {
                ht.put(uid.toString(), c.getDebugMessages(full));
            }
        }
    } else if (type.equals("cxn")) {
        if (target == null) {
            throw new Exception("Please specify connectionUID");
        }
        ConnectionUID uid = new ConnectionUID(Long.parseLong(target));
        IMQConnection cxn = (IMQConnection) Globals.getConnectionManager().getConnection(uid);
        if (cxn == null) {
            throw new Exception("Can not find connection " + uid);
        }
        ht.put(target, cxn.getDebugMessages(full));
    } else if (type.equals("ses")) {
        ht.put("Dump acks ", target);
        if (target == null) {
            throw new Exception("Please specify SessionUID");
        }
        SessionUID uid = new SessionUID(Long.parseLong(target));
        Session sess = Session.getSession(uid);
        if (sess == null) {
            throw new Exception("Can not find session " + uid);
        }
        ht.put(target, sess.getDebugMessages(full));
    } else {
        ht.put("Error", "Unknown pkt type " + type);
    }
    return ht;
}
Also used : Destination(com.sun.messaging.jmq.jmsserver.core.Destination) DestinationUID(com.sun.messaging.jmq.jmsserver.core.DestinationUID) Consumer(com.sun.messaging.jmq.jmsserver.core.Consumer) ConsumerUID(com.sun.messaging.jmq.jmsserver.core.ConsumerUID) IMQConnection(com.sun.messaging.jmq.jmsserver.service.imq.IMQConnection) SessionUID(com.sun.messaging.jmq.jmsserver.core.SessionUID) Hashtable(java.util.Hashtable) Iterator(java.util.Iterator) ConnectionUID(com.sun.messaging.jmq.jmsserver.service.ConnectionUID) Session(com.sun.messaging.jmq.jmsserver.core.Session)

Example 5 with ConnectionUID

use of com.sun.messaging.jmq.jmsserver.service.ConnectionUID in project openmq by eclipse-ee4j.

the class GetConsumersHandler method getHost.

private static String getHost(ConsumerUID cid) {
    ConnectionUID cxnId = getConnectionUID(cid);
    if (cxnId == null) {
        return (null);
    }
    ConnectionInfo cxnInfo = getConnectionInfo(cxnId.longValue());
    if (cxnInfo == null) {
        return (null);
    }
    String host = null;
    if (cxnInfo.remoteIP != null) {
        host = String.valueOf(IPAddress.rawIPToString(cxnInfo.remoteIP, true, true));
    }
    return (host);
}
Also used : ConnectionUID(com.sun.messaging.jmq.jmsserver.service.ConnectionUID) ConnectionInfo(com.sun.messaging.jmq.util.admin.ConnectionInfo)

Aggregations

ConnectionUID (com.sun.messaging.jmq.jmsserver.service.ConnectionUID)46 IMQConnection (com.sun.messaging.jmq.jmsserver.service.imq.IMQConnection)14 ConnectionManager (com.sun.messaging.jmq.jmsserver.service.ConnectionManager)9 ConnectionInfo (com.sun.messaging.jmq.util.admin.ConnectionInfo)9 Producer (com.sun.messaging.jmq.jmsserver.core.Producer)5 Consumer (com.sun.messaging.jmq.jmsserver.core.Consumer)4 ConsumerUID (com.sun.messaging.jmq.jmsserver.core.ConsumerUID)4 Connection (com.sun.messaging.jmq.jmsserver.service.Connection)4 Iterator (java.util.Iterator)4 Destination (com.sun.messaging.jmq.jmsserver.core.Destination)3 DestinationUID (com.sun.messaging.jmq.jmsserver.core.DestinationUID)3 SessionUID (com.sun.messaging.jmq.jmsserver.core.SessionUID)3 IMQBasicConnection (com.sun.messaging.jmq.jmsserver.service.imq.IMQBasicConnection)3 BrokerException (com.sun.messaging.jmq.jmsserver.util.BrokerException)3 ArrayList (java.util.ArrayList)3 Hashtable (java.util.Hashtable)3 List (java.util.List)3 HAMonitorService (com.sun.messaging.jmq.jmsserver.cluster.api.ha.HAMonitorService)2 BrokerAddress (com.sun.messaging.jmq.jmsserver.core.BrokerAddress)2 ProducerUID (com.sun.messaging.jmq.jmsserver.core.ProducerUID)2