/**
 * 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.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.ws.wsaddressing.W3CEndpointReference;

/**
 * @author Dmitry Repchesvky
 */

@XmlRootElement(namespace="http://biomoby.org/")
public class SubmitResponseWrapper
{
    private Body body;
    
    public SubmitResponseWrapper()
    {
        body = new Body();
    }

    public SubmitResponseWrapper(W3CEndpointReference wsa)
    {
        body = new Body(wsa);
    }

    @XmlElement(name="body", namespace="http://biomoby.org/")
    Body getBody()
    {
        return body;
    }
    
    void setBody(Body body)
    {
        this.body = body;
    }
    
    @XmlTransient
    public W3CEndpointReference getEndpointReference()
    {
        return body.getEndpointReference();
    }
    
    public void setEndpointReference(W3CEndpointReference wsa)
    {
        body.setEndpointReference(wsa);
    }

    @XmlRootElement(name="body", namespace="http://biomoby.org/")
    public static class Body
    {
        private W3CEndpointReference wsa;
        
        public Body() {}

        Body(W3CEndpointReference wsa)
        {
            this.wsa = wsa;
        }

        @XmlElement(name="EndpointReference", namespace="http://www.w3.org/2005/08/addressing")
        public W3CEndpointReference getEndpointReference()
        {
            return wsa;
        }

        void setEndpointReference(W3CEndpointReference wsa)
        {
            this.wsa = wsa;
        }
    }
}
