/* Generated by Together */

package cobalt.deployment.descriptor.dist;

import java.util.HashMap;
import java.util.Iterator;

import cobalt.deployment.descriptor.MethodDescriptor;

/*************************************************************
 * @author : YeonJun, Choi
 * @version : 1.0
 *
 * Isolation-level / MethodDescriptor Set pair
*/
public class Websphere30MethodControl {
    class MethodControl {
        String isolationLevel;
        String runMode;
        String runId;
    }
    Websphere30MethodControl() {
		elements = new HashMap();
    }
    public void setMethodIsolationLevel(MethodDescriptor method, String isolationLevel) {
        MethodControl mc = (MethodControl)elements.get(method);
        if ( mc == null ) {
            mc = new MethodControl();
            elements.put(method, mc);
        }
        mc.isolationLevel = isolationLevel;
    }
    public String getMethodIsolationLevel(MethodDescriptor method) {
        MethodControl mc = (MethodControl)elements.get(method);
        if ( mc == null )
            return null;
        return mc.isolationLevel;
    }
    public void setMethodRunMode(MethodDescriptor method, String runMode) {
        MethodControl mc = (MethodControl)elements.get(method);
        if ( mc == null ) {
            mc = new MethodControl();
            elements.put(method, mc);
        }
        mc.runMode = runMode;
    }
    public String getMethodRunMode(MethodDescriptor method) {
        MethodControl mc = (MethodControl)elements.get(method);
        if ( mc == null )
            return null;
        return mc.runMode;
    }
    public void setMethodRunId(MethodDescriptor method, String runId) {
        MethodControl mc = (MethodControl)elements.get(method);
        if ( mc == null ) {
            mc = new MethodControl();
            elements.put(method, mc);
        }
        mc.runId = runId;
    }
    public String getMethodRunId(MethodDescriptor method) {
        MethodControl mc = (MethodControl)elements.get(method);
        if ( mc == null )
            return null;
        return mc.runId;
    }
    public Iterator getMethodIterator() {
        return elements.keySet().iterator();
    }

    public static final String[] ISOLATION_LEVEL = {
        "", "SERIALIZABLE", "READ_COMMITTED",
        "READ_UNCOMMITTED", "REPEATABLE_READ",
    };
    private HashMap elements;
}
