Examples of MapMessage


Examples of javax.jms.MapMessage

    public final void methodResponse(final String methodName, final Handle handle,
                                     final QmfData outArgs, final QmfData error)
    {
        try
        {
            MapMessage response = _syncSession.createMapMessage();
            response.setJMSCorrelationID(handle.getCorrelationId());
            response.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            response.setStringProperty("method", "response");
            response.setStringProperty("qmf.opcode", "_method_response");
            response.setStringProperty("qmf.agent", _name);
            response.setStringProperty("qpid.subject", handle.getRoutingKey());

            if (error == null)
            {
                if (outArgs != null)
                {
                    response.setObject("_arguments", outArgs.mapEncode());
                    if (outArgs.getSubtypes() != null)
                    {
                        response.setObject("_subtypes", outArgs.getSubtypes());
                    }
                }
            }
            else
            {
                Map<String, Object> errorMap = error.mapEncode();
                for (Map.Entry<String, Object> entry : errorMap.entrySet())
                {
                    response.setObject(entry.getKey(), entry.getValue());
                }
            }
            sendResponse(handle, response);
        }
        catch (JMSException jmse)
View Full Code Here

Examples of javax.jms.MapMessage

    public final void subscriptionResponse(final Handle handle, final Handle consoleHandle, final String subscriptionId,
                                           final long lifetime, final long publishInterval, final QmfData error)
    {
        try
        {
            MapMessage response = _syncSession.createMapMessage();
            response.setJMSCorrelationID(handle.getCorrelationId());
            response.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            response.setStringProperty("method", "response");
            response.setStringProperty("qmf.opcode", "_subscribe_response");
            response.setStringProperty("qmf.agent", _name);
            response.setStringProperty("qpid.subject", handle.getRoutingKey());
   
            if (error == null)
            {
                response.setObject("_subscription_id", subscriptionId);
                response.setObject("_duration", lifetime);
                response.setObject("_interval", publishInterval);
            }
            else
            {
                Map<String, Object> errorMap = error.mapEncode();
                for (Map.Entry<String, Object> entry : errorMap.entrySet())
                {
                    response.setObject(entry.getKey(), entry.getValue());
                }
            }
            sendResponse(handle, response);
        }
        catch (JMSException jmse)
View Full Code Here

Examples of javax.jms.MapMessage

                String vendorKey = _vendor.replace(".", "_");
                String productKey = _product.replace(".", "_");
                String instanceKey = _instance.replace(".", "_");
                String subject = "agent.ind.heartbeat." + vendorKey + "." + productKey + "." + instanceKey;

                MapMessage response = _syncSession.createMapMessage();
                response.setStringProperty("x-amqp-0-10.app-id", "qmf2");
                response.setStringProperty("method", "indication");
                response.setStringProperty("qmf.opcode", "_agent_heartbeat_indication");
                response.setStringProperty("qmf.agent", _name);
                response.setStringProperty("qpid.subject", subject);
                setValue("_timestamp", System.currentTimeMillis()*1000000l);
                response.setObject("_values", mapEncode());
           
                // Send heartbeat messages with a Time To Live (in msecs) set to two times the _heartbeatInterval
                // to prevent stale heartbeats from getting to the consoles.
                _broadcaster.send(response, Message.DEFAULT_DELIVERY_MODE, Message.DEFAULT_PRIORITY,
                                  _heartbeatInterval*2000);
 
View Full Code Here

Examples of javax.jms.MapMessage

        timeout = (timeout < 1) ? _replyTimeout : timeout;
        List<QmfConsoleData> results = Collections.emptyList();
        try
        {
            Destination destination = (replyHandle == null) ? _replyAddress : _asyncReplyAddress;
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(destination);
            request.setJMSCorrelationID(replyHandle);
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
            request.setStringProperty("qmf.opcode", "_query_request");
            request.setStringProperty("qpid.subject", agentName);

            // Create a QMF Query for an "OBJECT" target using either a schema ID or object ID
            String queryType = (query instanceof SchemaClassId) ? "_schema_id" : "_object_id";
            request.setObject("_what", "OBJECT");
            request.setObject(queryType, query.mapEncode());

            // Wrap request & response in synchronized block in case any other threads invoke a request
            // it would be somewhat unfortunate if their response got interleaved with ours!!
            synchronized(this)
            {
View Full Code Here

Examples of javax.jms.MapMessage

        String agentName = agent.getName();
        timeout = (timeout < 1) ? _replyTimeout : timeout;
        try
        {
            Destination destination = (replyHandle == null) ? _replyAddress : _asyncReplyAddress;
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(destination);
            request.setJMSCorrelationID(replyHandle);
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
            request.setStringProperty("qmf.opcode", "_method_request");
            request.setStringProperty("qpid.subject", agentName);

            for (Map.Entry<String, Object> entry : content.entrySet())
            {
                request.setObject(entry.getKey(), entry.getValue());
            }

            // Wrap request & response in synchronized block in case any other threads invoke a request
            // it would be somewhat unfortunate if their response got interleaved with ours!!
            synchronized(this)
View Full Code Here

Examples of javax.jms.MapMessage

        String agentName = agent.getName();
        results = new ArrayList<SchemaClassId>();
        try
        {
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(_replyAddress);
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
            request.setStringProperty("qmf.opcode", "_query_request");
            request.setStringProperty("qpid.subject", agentName);

            // Create a QMF Query for an "SCHEMA_ID" target
            request.setObject("_what", "SCHEMA_ID");
            // Wrap request & response in synchronized block in case any other threads invoke a request
            // it would be somewhat unfortunate if their response got interleaved with ours!!
            synchronized(this)
            {
                _requester.send(request);
View Full Code Here

Examples of javax.jms.MapMessage

        String agentName = agent.getName();
//System.out.println("getSchema for agent " + agentName);
        results = new ArrayList<SchemaClass>();
        try
        {
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(_replyAddress);
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
            request.setStringProperty("qmf.opcode", "_query_request");
            request.setStringProperty("qpid.subject", agentName);

            // Create a QMF Query for an "SCHEMA" target
            request.setObject("_what", "SCHEMA");
            request.setObject("_schema_id", schemaClassId.mapEncode());

            // Wrap request & response in synchronized block in case any other threads invoke a request
            // it would be somewhat unfortunate if their response got interleaved with ours!!
            synchronized(this)
            {
View Full Code Here

Examples of javax.jms.MapMessage

            }
        }

        try
        {
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(_asyncReplyAddress)// Deliberately forcing all replies to the _asyncReplyAddress
            request.setJMSCorrelationID(consoleHandle); // Deliberately using consoleHandle not replyHandle here
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
            request.setStringProperty("qmf.opcode", "_subscribe_request");
            request.setStringProperty("qpid.subject", agentName);

            request.setObject("_query", query.mapEncode());
            request.setObject("_interval", publishInterval);
            request.setObject("_duration", lifetime);

            SubscriptionManager subscription =
                new SubscriptionManager(agent, query, consoleHandle, replyHandle, publishInterval, lifetime);
            _subscriptionByHandle.put(consoleHandle, subscription);
            _timer.schedule(subscription, 0, publishInterval);
View Full Code Here

Examples of javax.jms.MapMessage

        }

        try
        {
            Destination destination = (replyHandle == null) ? _replyAddress : _asyncReplyAddress;
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(destination);
            request.setJMSCorrelationID(replyHandle);
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
            request.setStringProperty("qmf.opcode", "_subscribe_refresh_indication");
            request.setStringProperty("qpid.subject", agentName);

            request.setObject("_subscription_id", subscriptionId);
            if (lifetime > 0)
            {
                request.setObject("_duration", lifetime);
            }

            // Wrap request & response in synchronized block in case any other threads invoke a request
            // it would be somewhat unfortunate if their response got interleaved with ours!!
            synchronized(this)
View Full Code Here

Examples of javax.jms.MapMessage

        }
        String agentName = agent.getName();

        try
        {
            MapMessage request = _syncSession.createMapMessage();
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
            request.setStringProperty("qmf.opcode", "_subscribe_cancel_indication");
            request.setStringProperty("qpid.subject", agentName);
            request.setObject("_subscription_id", subscriptionId);

            synchronized(this)
            {
                if (!_subscriptionEmulationEnabled || !agentName.equals(_brokerAgentName))
                {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.