All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.staf.STAFQueueMessage Maven / Gradle / Ivy

Go to download

The Software Testing Automation Framework (STAF) is an open source, multi-platform, multi-language framework designed around the idea of reusable components, called services (such as process invocation, resource management, logging, and monitoring). STAF removes the tedium of building an automation infrastructure, thus enabling you to focus on building your automation solution. The STAF framework provides the foundation upon which to build higher level solutions, and provides a pluggable approach supported across a large variety of platforms and languages. This component contains the STAF Java API (http://staf.sourceforge.net/current/STAFJava.htm ) only. For more information see http://staf.sourceforge.net/ .

The newest version!
/*****************************************************************************/
/* Software Testing Automation Framework (STAF)                              */
/* (C) Copyright IBM Corp. 2001                                              */
/*                                                                           */
/* This software is licensed under the Eclipse Public License (EPL) V1.0.    */
/*****************************************************************************/

package com.ibm.staf;

import java.util.Map;

// STAFQueueMessage - This class is used to inspect and manipulate a message
//                    retrieved from the STAF Queue service

public class STAFQueueMessage
{
    public STAFQueueMessage(String qMessage)
    {
        // Unmarshall the result from a QUEUE GET request

        mc = STAFMarshallingContext.unmarshall(qMessage);

        Map queueMap = (Map)mc.getRootObject();

        try
        {
            priority = Integer.parseInt((String)queueMap.get("priority"));
        }
        catch (NumberFormatException e)
        {
            priority =  -1;
        }

        timestamp  = (String)queueMap.get("timestamp");
        machine    = (String)queueMap.get("machine");
        handleName = (String)queueMap.get("handleName");
            
        try
        {
            handle = Integer.parseInt((String)queueMap.get("handle"));
        }
        catch (NumberFormatException e)
        {
            handle =  -1;
        }

        type = (String)queueMap.get("type");
        message = queueMap.get("message");
    }

    public int    priority;
    public String timestamp;
    public String machine;
    public String handleName;
    public int    handle;
    public String type = null;
    public Object message;
    public STAFMarshallingContext mc;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy