Package org.apache.qpid.qmf2.common

Examples of org.apache.qpid.qmf2.common.ObjectId


     * @param address the connection address information for the subscription.
     * @param timestamp the timestamp of the subscription.
     */
    private void validateQueue(final String queueName, final String address, final String timestamp)
    {
        ObjectId queueId = null;
        List<QmfConsoleData> queues = _console.getObjects("org.apache.qpid.broker", "queue");
        for (QmfConsoleData queue : queues)
        { // We first have to find the ObjectId of the queue called queueName.
            if (queue.getStringValue("name").equals(queueName))
            {
                queueId = queue.getObjectId();
                break;
            }
        }

        if (queueId == null)
        {
            System.out.printf("%s ERROR ConnectionAudit.validateQueue() %s reference couldn't be found\n",
                              new Date().toString(), queueName);
        }
        else
        { // If we've got the queue's ObjectId we then find the binding that references it.
            List<QmfConsoleData> bindings = _console.getObjects("org.apache.qpid.broker", "binding");
            for (QmfConsoleData binding : bindings)
            {
                ObjectId queueRef = binding.getRefValue("queueRef");
                if (queueRef.equals(queueId))
                { // We've found a binding that matches queue queueName so look up the associated exchange and validate.
                    QmfConsoleData exchange = dereference(binding.getRefValue("exchangeRef"));
                    String exchangeName = exchange.getStringValue("name");
                    validateQueue(queueName, exchangeName, binding, address, timestamp);
                }
View Full Code Here


    public MethodCallParams(final Map m)
    {
        _name = QmfData.getString(m.get("_method_name"));

        Map oid = (Map)m.get("_object_id");
        _objectId = (oid == null) ? null : new ObjectId(oid);

        Map args = (Map)m.get("_arguments");
        if (args == null)
        {
            _args = null;
View Full Code Here

        List<QmfConsoleData> bindings = _console.getObjects("org.apache.qpid.broker", "binding");
        List<QmfConsoleData> exchanges = _console.getObjects("org.apache.qpid.broker", "exchange");

        for (QmfConsoleData queue : queues)
        {
            ObjectId queueId = queue.getObjectId();

            if (ref == null || ref.equals(queueId))
            {
                System.out.printf("    Queue '%s'\n", queue.getStringValue("name"));
                System.out.println("        arguments " + (Map)queue.getValue("arguments"));

                for (QmfConsoleData binding : bindings)
                {
                    ObjectId queueRef = binding.getRefValue("queueRef");

                    if (queueRef.equals(queueId))
                    {
                        ObjectId exchangeRef = binding.getRefValue("exchangeRef");
                        QmfConsoleData exchange = findById(exchanges, exchangeRef);

                        String exchangeName = "<unknown>";
                        if (exchange != null)
                        {
View Full Code Here

                System.out.println(p + ": " + connection.getStringValue(p));
            }

            System.out.println("createTimestamp: " + new Date(connection.getCreateTime()/1000000l));

            ObjectId connectionId = connection.getObjectId();
            for (QmfConsoleData session : sessions)
            { // Iterate through all session objects
                ObjectId connectionRef = session.getRefValue("connectionRef");
                if (connectionRef.equals(connectionId))
                { // But only select sessions that are associated with the connection under consideration.
                    System.out.printf("Session '%s'\n", session.getStringValue("name"));
                    int subscriptionCount = 0;
                    ObjectId sessionId = session.getObjectId();
                    for (QmfConsoleData subscription : subscriptions)
                    { // Iterate through all subscription objects
                        ObjectId sessionRef = subscription.getRefValue("sessionRef");
                        if (sessionRef.equals(sessionId))
                        { // But only select subscriptions that are associated with the session under consideration.
                            subscriptionCount++;
                            ObjectId queueRef = subscription.getRefValue("queueRef");
                            if (_logQueues)
                            {
                                logQueueInformation(queueRef);
                            }
                        }
View Full Code Here

        Map<String, String> subtypes = (Map<String, String>)m.get("_subtypes");
        _subtypes = subtypes;

        setSchemaClassId(new SchemaClassId((Map)m.get("_schema_id")));
        setObjectId(new ObjectId((Map)m.get("_object_id")));

        long currentTime = System.currentTimeMillis()*1000000l;
        _updateTimestamp = m.containsKey("_update_ts") ? getLong(m.get("_update_ts")) : currentTime;
        _createTimestamp = m.containsKey("_create_ts") ? getLong(m.get("_create_ts")) : currentTime;
        _deleteTimestamp = m.containsKey("_delete_ts") ? getLong(m.get("_delete_ts")) : currentTime;
View Full Code Here

        {
            MethodCallWorkItem item = (MethodCallWorkItem)wi;
            MethodCallParams methodCallParams = item.getMethodCallParams();

            String methodName = methodCallParams.getName();
            ObjectId objectId = methodCallParams.getObjectId();

            // Look up QmfAgentData by ObjectId from the Agent's internal Object store.
            QmfAgentData object = _agent.getObject(objectId);
            if (object == null)
            {
View Full Code Here

                             * users of this call should be aware of that in their own code.
                             */
                            path = path.substring(7);

                            // The ObjectId has been passed in the URI, create a real ObjectId
                            ObjectId oid = new ObjectId(path);

                            List<QmfConsoleData> objects = console.getObjects(oid);
                            if (objects.size() == 0)
                            {
                                tx.sendResponse(HTTP_NOT_FOUND, "text/plain", "404 Not Found.");
View Full Code Here

                    if (path.startsWith("object/"))
                    {
                        path = path.substring(7);

                        // The ObjectId has been passed in the URI create an ObjectId and retrieve the Agent Name.
                        ObjectId oid = new ObjectId(path);
                        String agentName = oid.getAgentName();

                        // The qpidd ManagementAgent doesn't populate AgentName, if it's empty assume it's the broker.
                        agentName = agentName.equals("") ? "broker" : agentName;

                        Agent agent = console.getAgent(agentName); // Find the Agent we got the QmfData from.
View Full Code Here

            if (item instanceof Map)
            { // Check if the value part is an ObjectId and serialise appropriately
                Map map = (Map)item;
                if (map.containsKey("_object_name"))
                { // Serialise "ref" properties as String versions of ObjectId to match encoding used in fromQmfData()
                    return "\"" + new ObjectId(map) + "\"";
                }
                else
                {
                    return fromMap(map);
                }
View Full Code Here

        {
            MethodCallWorkItem item = (MethodCallWorkItem)wi;
            MethodCallParams methodCallParams = item.getMethodCallParams();

            String methodName = methodCallParams.getName();
            ObjectId objectId = methodCallParams.getObjectId();

            // Look up QmfAgentData by ObjectId from the Agent's internal Object store.
            QmfAgentData object = _agent.getObject(objectId);
            if (object == null)
            {
View Full Code Here

TOP

Related Classes of org.apache.qpid.qmf2.common.ObjectId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.