Package org.apache.qpid.qmf2.common

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


            if (correlationId.equals("queueStatsHandle"))
            { // If it is (and it should be!!) then it's our queue object Subscription
                List<QmfConsoleData> data = indication.getData();
                for (QmfConsoleData record : data)
                {
                    ObjectId id = record.getObjectId();
                    if (record.isDeleted())
                    { // If the object was deleted by the Agent we remove it from out Map
                        _objects.remove(id);
                    }
                    else
View Full Code Here


                    System.out.printf("--ive ");
                }

                if (exchange.hasValue("altExchange"))
                {
                    ObjectId altExchangeRef = exchange.getRefValue("altExchange");
                    QmfConsoleData altExchange = findById(exchanges, altExchangeRef);
                    if (altExchange != null)
                    {
                        System.out.printf("--alternate-exchange=%s", altExchange.getStringValue("name"));
                    }
View Full Code Here

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

        for (QmfConsoleData exchange : exchanges)
        {
            ObjectId exchangeId = exchange.getObjectId();
            String name = exchange.getStringValue("name");

            if (filter.equals("") || filter.equals(name))
            {
                System.out.printf("Exchange '%s' (%s)\n", name, exchange.getStringValue("type"));
                for (QmfConsoleData binding : bindings)
                {
                    ObjectId exchangeRef = binding.getRefValue("exchangeRef");

                    if (exchangeRef.equals(exchangeId))
                    {
                        ObjectId queueRef = binding.getRefValue("queueRef");
                        QmfConsoleData queue = findById(queues, queueRef);

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

                    System.out.printf("--generate-queue-events=%d ", QmfData.getLong(args.get(QUEUE_EVENT_GENERATION)));
                }
                if (queue.hasValue("altExchange"))
                {
                    ObjectId altExchangeRef = queue.getRefValue("altExchange");
                    List<QmfConsoleData> altExchanges = _console.getObjects(altExchangeRef);
                    if (altExchanges.size() == 1)
                    {
                        QmfConsoleData altExchange = altExchanges.get(0);
                        System.out.printf("--alternate-exchange=%s", altExchange.getStringValue("name"));
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();
            String name = queue.getStringValue("name");

            if (filter.equals("") || filter.equals(name))
            {
                System.out.printf("Queue '%s'\n", name);

                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

        if (_ifEmpty || _ifUnused)
        { // Check the selected queue object to see if it is not empty or is in use
            List<QmfConsoleData> queues = _console.getObjects("org.apache.qpid.broker", "queue");
            for (QmfConsoleData queue : queues)
            {
                ObjectId queueId = queue.getObjectId();
                String name = queue.getStringValue("name");
                if (name.equals(args[0]))
                {
                    long msgDepth = queue.getLongValue("msgDepth");
                    if (_ifEmpty == true && msgDepth > 0)
View Full Code Here

                //qmfContentType = "_data";
                if (query.getObjectId() != null)
                {
                    List<Map> results = new ArrayList<Map>(1);
                    // Look up a QmfAgentData object by the ObjectId obtained from the query
                    ObjectId objectId = query.getObjectId();
                    QmfAgentData object = _objectIndex.get(objectId);
                    if (object != null && !object.isDeleted())
                    {
                        results.add(object.mapEncode());
                    }
View Full Code Here

        { // Note that we don't include objects marked as deleted in the results here, because if an object gets
          // destroyed we asynchronously publish its new state to subscribers, see QmfAgentData.destroy() method.
            if (query.getObjectId() != null)
            {
                // Look up a QmfAgentData object by the ObjectId obtained from the query
                ObjectId objectId = query.getObjectId();
                QmfAgentData object = _objectIndex.get(objectId);
                if (object != null && !object.isDeleted())
                {
                    results.add(object);
                }
View Full Code Here

    public void addObject(final QmfAgentData object) throws QmfException
    {
        // There are some cases where a QmfAgentData Object might have already set its ObjectId, for example where
        // it may need to have a "well known" ObjectId. This is the case with the Java Broker Management Agent
        // where tools such as qpid-config might have made assumptions about its ObjectId rather than doing "discovery".
        ObjectId addr = object.getObjectId();
        if (addr == null)
        {
            SchemaClassId classId = object.getSchemaClassId();
            SchemaClass schema = _schemaCache.get(classId);

            // Try to create an objectName using the property names that have been specified as idNames in the schema
            StringBuilder buf = new StringBuilder();
            // Initialise idNames as an empty array as we want to check if a key has been used to construct the name.
            String[] idNames = {};
            if (schema != null && schema instanceof SchemaObjectClass)
            {
                idNames = ((SchemaObjectClass)schema).getIdNames();
                for (String property : idNames)
                {
                    buf.append(object.getStringValue(property));
                }
            }
            String objectName = buf.toString();

            // If the schema hasn't given any help we use a UUID. Note that we check the length of idNames too
            // as a given named key property might legitimately be an empty string (e.g. the default direct
            // exchange has name == "")
            if (objectName.length() == 0 && idNames.length == 0) objectName = UUID.randomUUID().toString();

            // Finish up the name by incorporating package and class names
            objectName = classId.getPackageName() + ":" + classId.getClassName() + ":" + objectName;

            // Now we've got a good name for the object we create its ObjectId and add that to the object
            addr = new ObjectId(_name, objectName, _epoch);

            object.setObjectId(addr);
        }

        QmfAgentData foundObject = _objectIndex.get(addr);
View Full Code Here

     * @param objectName the name of the QmfAgentData being managed.
     * @return a new ObjectId based on the objectName passed as a parameter.
     */
    public ObjectId allocObjectId(final String objectName)
    {
        return new ObjectId(getName(), objectName, getEpoch());
    }
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.