001: /*
002: * Copyright 1999-2004 The Apache Software Foundation
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.coyote;
018:
019: /**
020: * Enumerated class containing the adapter event codes.
021: *
022: * @author Remy Maucherat
023: */
024: public final class ActionCode {
025:
026: // -------------------------------------------------------------- Constants
027:
028: public static final ActionCode ACTION_ACK = new ActionCode(1);
029:
030: public static final ActionCode ACTION_CLOSE = new ActionCode(2);
031:
032: public static final ActionCode ACTION_COMMIT = new ActionCode(3);
033:
034: /**
035: * A flush() operation originated by the client ( i.e. a flush() on
036: * the servlet output stream or writer, called by a servlet ).
037: */
038: public static final ActionCode ACTION_CLIENT_FLUSH = new ActionCode(
039: 4);
040:
041: public static final ActionCode ACTION_CUSTOM = new ActionCode(5);
042:
043: public static final ActionCode ACTION_RESET = new ActionCode(6);
044:
045: public static final ActionCode ACTION_START = new ActionCode(7);
046:
047: public static final ActionCode ACTION_STOP = new ActionCode(8);
048:
049: public static final ActionCode ACTION_WEBAPP = new ActionCode(9);
050:
051: /** Hook called after request, but before recycling. Can be used
052: for logging, to update counters, custom cleanup - the request
053: is still visible
054: */
055: public static final ActionCode ACTION_POST_REQUEST = new ActionCode(
056: 10);
057:
058: /**
059: * Callback for lazy evaluation - extract the remote host address.
060: */
061: public static final ActionCode ACTION_REQ_HOST_ATTRIBUTE = new ActionCode(
062: 11);
063:
064: /**
065: * Callback for lazy evaluation - extract the remote host infos (address, name, port) and local address.
066: */
067: public static final ActionCode ACTION_REQ_HOST_ADDR_ATTRIBUTE = new ActionCode(
068: 12);
069:
070: /**
071: * Callback for lazy evaluation - extract the SSL-related attributes.
072: */
073: public static final ActionCode ACTION_REQ_SSL_ATTRIBUTE = new ActionCode(
074: 13);
075:
076: /** Chain for request creation. Called each time a new request is created
077: ( requests are recycled ).
078: */
079: public static final ActionCode ACTION_NEW_REQUEST = new ActionCode(
080: 14);
081:
082: /**
083: * Callback for lazy evaluation - extract the SSL-certificate
084: * (including forcing a re-handshake if necessary)
085: */
086: public static final ActionCode ACTION_REQ_SSL_CERTIFICATE = new ActionCode(
087: 15);
088:
089: /**
090: * Callback for lazy evaluation - socket remote port.
091: **/
092: public static final ActionCode ACTION_REQ_REMOTEPORT_ATTRIBUTE = new ActionCode(
093: 16);
094:
095: /**
096: * Callback for lazy evaluation - socket local port.
097: **/
098: public static final ActionCode ACTION_REQ_LOCALPORT_ATTRIBUTE = new ActionCode(
099: 17);
100:
101: /**
102: * Callback for lazy evaluation - local address.
103: **/
104: public static final ActionCode ACTION_REQ_LOCAL_ADDR_ATTRIBUTE = new ActionCode(
105: 18);
106:
107: /**
108: * Callback for lazy evaluation - local address.
109: **/
110: public static final ActionCode ACTION_REQ_LOCAL_NAME_ATTRIBUTE = new ActionCode(
111: 19);
112:
113: // ----------------------------------------------------------- Constructors
114: int code;
115:
116: /**
117: * Private constructor.
118: */
119: private ActionCode(int code) {
120: this .code = code;
121: }
122:
123: /** Action id, useable in switches and table indexes
124: */
125: public int getCode() {
126: return code;
127: }
128:
129: }
|