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