/*
 * JBoss, Home of Professional Open Source
 * Copyright 2007, Red Hat Middleware LLC, and individual contributors
 * as indicated by the @author tags.
 * See the copyright.txt in the distribution for a full listing
 * of individual contributors.
 * This copyrighted material is made available to anyone wishing to use,
 * modify, copy, or redistribute it subject to the terms and conditions
 * of the GNU General Public License, v. 2.0.
 * This program is distributed in the hope that it will be useful, but WITHOUT A
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License,
 * v. 2.0 along with this distribution; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA  02110-1301, USA.
 *
 * (C) 2007,
 * @author JBoss Inc.
 */
package org.jboss.txbridge.ba.service;

import org.jboss.txbridge.ba.annotation.*;

/**
 * This class describes the service in terms of all its requirements related to participation
 * in Business Activities.
 *
 * TODO: Redesign this - this should use a simple map
 *
 * @author Maciej P. Machulak (mmachulak@redhat.com)
 * @version 0.1
 */
public class ServiceDescriptionImpl implements ServiceDescription
{

    /**
     * BA-related information.
     */
    private BAServiceType serviceType;
    private BAAgreementType agreementType;
    private BACompensationType compensationType;
    private BACompensationMode compensationMode;
    private BAParameterMatch parameterMatch;

    /**
     * Information about the original method.
     */
    private MethodDescription originalMethod;

    /**
     * Information about the compensation method.
     */
    private MethodDescription compensationMethod;

    public ServiceDescriptionImpl()
    {
        originalMethod = new MethodDescriptionImpl();
        compensationMethod = new MethodDescriptionImpl();
    }

    public BAServiceType getServiceType()
    {
        return serviceType;
    }

    public void setServiceType(BAServiceType serviceType)
    {
        this.serviceType = serviceType;
    }

    public BAAgreementType getAgreementType()
    {
        return agreementType;
    }

    public void setAgreementType(BAAgreementType agreementType)
    {
        this.agreementType = agreementType;
    }

    public BACompensationType getCompensationType()
    {
        return compensationType;
    }

    public void setCompensationType(BACompensationType compensationType)
    {
        this.compensationType = compensationType;
    }

    public BACompensationMode getCompensationMode()
    {
        return compensationMode;
    }

    public void setCompensationMode(BACompensationMode compensationMode)
    {
        this.compensationMode = compensationMode;
    }

    public BAParameterMatch getParameterMatch()
    {
        return parameterMatch;
    }

    public void setParameterMatch(BAParameterMatch parameterMatch)
    {
        this.parameterMatch = parameterMatch;
    }

    public Class getOriginalClass()
    {
        return originalMethod.getClazz();
    }

    public void setOriginalClass(Class originalClass)
    {
        originalMethod.setClazz(originalClass);
    }

    public String getOriginalMethodName()
    {
        return originalMethod.getMethodName();
    }

    public void setOriginalMethodName(String originalMethodName)
    {
        originalMethod.setMethodName(originalMethodName);
    }

    public String getOriginalWebMethodName()
    {
        return originalMethod.getWebMethodName();
    }

    public void setOriginalWebMethodName(String originalWebMethodName)
    {
        originalMethod.setWebMethodName(originalWebMethodName);
    }

    public Class getOriginalReturnType()
    {
        return originalMethod.getReturnType();
    }

    public void setOriginalReturnType(Class originalReturnType)
    {
        originalMethod.setReturnType(originalReturnType);
    }

    public Class[] getOriginalParameterTypes()
    {
        return originalMethod.getParameterTypes();
    }

    public void setOriginalParameterTypes(Class[] originalParameterTypes)
    {
        originalMethod.setParameterTypes(originalParameterTypes);
    }

    public Object getOriginalReturnId()
    {
        return originalMethod.getReturnId();
    }

    public void setOriginalReturnId(Object originalReturnId)
    {
        originalMethod.setReturnId(originalReturnId);
    }

    public Object[] getOriginalParameterAnnotations()
    {
        return originalMethod.getParameterAnnotations();
    }

    public void setOriginalParameterAnnotations(Object[] originalParameterAnnotation)
    {
        originalMethod.setParameterAnnotations(originalParameterAnnotation);
    }

    public Class getCompensationClass()
    {
        return compensationMethod.getClazz();
    }

    public void setCompensationClass(Class compensationClass)
    {
        compensationMethod.setClazz(compensationClass);
    }

    public String getCompensationMethodName()
    {
        return compensationMethod.getMethodName();
    }

    public void setCompensationMethodName(String compensationMethodName)
    {
        compensationMethod.setMethodName(compensationMethodName);
    }

    public String getCompensationWebMethodName()
    {
        return compensationMethod.getWebMethodName();
    }

    public void setCompensationWebMethodName(String compensationWebMethodName)
    {
        compensationMethod.setWebMethodName(compensationWebMethodName);
    }

    public Class getCompensationReturnType()
    {
        return compensationMethod.getReturnType();
    }

    public void setCompensationReturnType(Class compensationReturnType)
    {
        compensationMethod.setReturnType(compensationReturnType);
    }

    public Class[] getCompensationParameterTypes()
    {
        return compensationMethod.getParameterTypes();
    }

    public void setCompensationParameterTypes(Class[] compensationParameterTypes)
    {
        compensationMethod.setParameterTypes(compensationParameterTypes);
    }

    public Object[] getCompensationParameterAnnotations()
    {
        return compensationMethod.getParameterAnnotations();
    }

    public void setCompensationParameterAnnotations(Object[] compensationParameterAnnotations)
    {
        compensationMethod.setParameterAnnotations(compensationParameterAnnotations);
    }

    public String getCompensationJNDIName()
    {
        return compensationMethod.getJndiName();
    }

    public void setCompensationJNDIName(String jndiName)
    {
        compensationMethod.setJndiName(jndiName);
    }

    public String getCompensationProviderURL()
    {
        return compensationMethod.getProviderURL();
    }

    public void setCompensationProviderURL(String providerURL)
    {
        compensationMethod.setProviderURL(providerURL);
    }

    public boolean isCompensationSingle()
    {
        return compensationMethod.isSingle();
    }

    public void setCompensationSingle(boolean value)
    {
        compensationMethod.setSingle(value);
    }

    public Class getCompensationEjbInterface()
    {
        return compensationMethod.getEjbInterface();
    }

    public void setCompensationEjbInterface(Class ejbInterface)
    {
        compensationMethod.setEjbInterface(ejbInterface);
    }

}
