001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ServicelistState.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.engine.sequencing.servicelist;
030:
031: /**
032: * This class maintains permitted servicelist states.
033: *
034: * @author Sun Microsystems, Inc.
035: */
036: public final class ServicelistState {
037: /**
038: * Demotes the list is ready.
039: */
040: public static final int READY = 0;
041:
042: /**
043: * Demotes the list is runnning.
044: */
045: public static final int RUNNING = 1;
046:
047: /**
048: * Waiting.
049: */
050: public static final int WAITING = 2;
051:
052: /**
053: * Timed out state.
054: */
055: public static final int TIMED_OUT = 3;
056:
057: /**
058: * Aborted.
059: */
060: public static final int ABORTED = 4;
061:
062: /**
063: * Completed.
064: */
065: public static final int COMPLETED = 5;
066:
067: /**
068: * Error state.
069: */
070: public static final int ERROR = 6;
071:
072: /**
073: * Returns the string representation of the state.
074: *
075: * @param state state
076: *
077: * @return String rep of state.
078: */
079: public static String getStringValue(int state) {
080: switch (state) {
081: case READY:
082: return "READY";
083:
084: case RUNNING:
085: return "RUNNING";
086:
087: case WAITING:
088: return "WAITING";
089:
090: case TIMED_OUT:
091: return "TIMED OUT";
092:
093: case ABORTED:
094: return "ABORTED";
095:
096: case COMPLETED:
097: return "COMPLETED";
098:
099: case ERROR:
100: return "ERROR";
101:
102: default:
103: return "INVALID STATE";
104: }
105: }
106: }
|