Package org.apache.qpid.qmf2.common

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


     * @param agentList if this parameter is supplied then the query is sent to only those Agents.
     * @return a List of QMF Objects describing that class.
     */
    public List<QmfConsoleData> getObjects(final String className, final List<Agent> agentList)
    {
        return getObjects(new SchemaClassId(className), agentList);
    }
View Full Code Here


     * @param agentList if this parameter is supplied then the query is sent to only those Agents.
     * @return a List of QMF Objects describing that class.
     */
    public List<QmfConsoleData> getObjects(final String className, final int timeout, final List<Agent> agentList)
    {
        return getObjects(new SchemaClassId(className), timeout, agentList);
    }
View Full Code Here

     * @param className the schema class name we're looking up objects for.
     * @return a List of QMF Objects describing that class
     */
    public List<QmfConsoleData> getObjects(final String packageName, final String className)
    {
        return getObjects(new SchemaClassId(packageName, className));
    }
View Full Code Here

     * @param timeout overrides the default replyTimeout.
     * @return a List of QMF Objects describing that class.
     */
    public List<QmfConsoleData> getObjects(final String packageName, final String className, final int timeout)
    {
        return getObjects(new SchemaClassId(packageName, className), timeout);
    }
View Full Code Here

     * @param agentList if this parameter is supplied then the query is sent to only those Agents.
     * @return a List of QMF Objects describing that class.
     */
    public List<QmfConsoleData> getObjects(final String packageName, final String className, final List<Agent> agentList)
    {
        return getObjects(new SchemaClassId(packageName, className), agentList);
    }
View Full Code Here

     * @return a List of QMF Objects describing that class.
     */
    public List<QmfConsoleData> getObjects(final String packageName, final String className,
                                           final int timeout, final List<Agent> agentList)
    {
        return getObjects(new SchemaClassId(packageName, className), timeout, agentList);
    }
View Full Code Here

     */
    private void createQueueSubscription()
    {
        try
        {   // This QmfQuery simply does an ID query for objects with the className "queue"
            QmfQuery query = new QmfQuery(QmfQueryTarget.OBJECT, new SchemaClassId("queue"));
            SubscribeParams params = _console.createSubscription(_broker, query, "queueStatsHandle");
            _subscriptionId = params.getSubscriptionId();
            _subscriptionDuration = params.getLifetime() - 10; // Subtract 10 as we want to refresh before it times out
            _startTime = System.currentTimeMillis();
        }
View Full Code Here

            query = new QmfQuery(QmfQueryTarget.OBJECT, wasp.getObjectId());
            results = evaluateDataQuery(query);
            displayResults(results);

            System.out.println("\nlooking up mammal objects");
            query = new QmfQuery(QmfQueryTarget.OBJECT, new SchemaClassId("mammal"));
            results = evaluateDataQuery(query);
            displayResults(results);

            System.out.println("\nlooking up everything in package com.fadams.qmf2");
            query = new QmfQuery(QmfQueryTarget.OBJECT, new SchemaClassId("com.fadams.qmf2", null));
            results = evaluateDataQuery(query);
            displayResults(results);


            System.out.println("\nQuery for all mammals with more than two legs");
View Full Code Here

        }
    }

    public void registerObjectClass(SchemaObjectClass schema)
    {
        SchemaClassId classId = schema.getClassId();
        _schemaCache.put(classId, schema);
    }
View Full Code Here

        _schemaCache.put(classId, schema);
    }

    public void addObject(QmfAgentData object) throws QmfException
    {
        SchemaClassId classId = object.getSchemaClassId();
        SchemaClass schema = _schemaCache.get(classId);

        // Try to create an objectName using the set of property names that have been specified as idNames in the schema
        StringBuilder buf = new StringBuilder();
        if (schema != null && schema instanceof SchemaObjectClass)
        {
            String[] idNames = ((SchemaObjectClass)schema).getIdNames();
            for (String name : idNames)
            {
                buf.append(object.getStringValue(name));
            }
        }
        String objectName = buf.toString();

        // If the schema hasn't given any help we use a UUID
        if (objectName.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 it's ObjectId and add that to the object
        ObjectId addr = new ObjectId("test"/*name*/, objectName, 0/*epoch*/);
        object.setObjectId(addr);

View Full Code Here

TOP

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

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.