/**
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 *
 * Copyright (C)
 * <a href="http://www.inab.org">Spanish National Institute of Bioinformatics (INB)</a>
 * <a href="http://www.bsc.es">Barcelona Supercomputing Center (BSC)</a>
 * <a href="http://inb.bsc.es">Computational Node 6</a>
 */

package org.inb.biomoby.shared.wsrf;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import org.inb.biomoby.shared.message.MobyMessage;
import org.inb.lsae.AnalysisEvent;

/**
 * The property response wrapper class. It holds either MobyMessage or AnalysisEvent response.
 * 
 * @author Dmitry Repchevsky
 */

@XmlRootElement
public class PropertyResponseWrapper
{
    private Object response;
    
    PropertyResponseWrapper() {}
    
    public PropertyResponseWrapper(MobyMessage message)
    {
        this.response = message;
    }

    public PropertyResponseWrapper(AnalysisEvent event)
    {
        this.response = event;
    }

    @XmlElements({
            @XmlElement(name="MOBY", namespace="http://www.biomoby.org/moby", type=MobyMessage.class),
            @XmlElement(name="analysis_event", type=AnalysisEvent.class)
    })
    public Object getResponseObject()
    {
        return response;
    }
    
    void setResponseObject(Object response)
    {
        this.response = response;
    }
}
