Package org.apache.qpid.qmf2.common

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


        }
        else if (target == QmfQueryTarget.SCHEMA)
        {
            List<Map> results = new ArrayList<Map>(1);
            // Look up a SchemaClass object by the SchemaClassId obtained from the query
            SchemaClassId classId = query.getSchemaClassId();
            SchemaClass schema = _schemaCache.get(classId);
            if (schema != null)
            {
                results.add(schema.mapEncode());
            }
View Full Code Here


     *
     * @param schema the SchemaObjectClass to be registered
     */
    public final void registerObjectClass(final SchemaObjectClass schema)
    {
        SchemaClassId classId = schema.getClassId();
        _schemaCache.put(classId, schema);
    }
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 schema the SchemaEventClass to be registered
     */
    public final void registerEventClass(final SchemaEventClass schema)
    {
        SchemaClassId classId = schema.getClassId();
        _schemaCache.put(classId, schema);
    }
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

        // 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);
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

        _values = (values == null) ? m : values;

        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;
View Full Code Here

TOP

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

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.