View Javadoc

    1   //========================================================================
    2   //Copyright 2006 Mort Bay Consulting Pty. Ltd.
    3   //------------------------------------------------------------------------
    4   //Licensed under the Apache License, Version 2.0 (the "License");
    5   //you may not use this file except in compliance with the License.
    6   //You may obtain a copy of the License at
    7   //http://www.apache.org/licenses/LICENSE-2.0
    8   //Unless required by applicable law or agreed to in writing, software
    9   //distributed under the License is distributed on an "AS IS" BASIS,
    10  //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11  //See the License for the specific language governing permissions and
    12  //limitations under the License.
    13  //========================================================================
    14
    15  package org.mortbay.jetty.ajp;
    16
    17  import org.mortbay.io.Buffer;
    18  import org.mortbay.io.BufferCache;
    19
    20  /**
    21   * @author Markus Kobler
    22   */
    23  public class Ajp13PacketMethods
    24  {
    25
    26      // TODO - this can probably be replaced by HttpMethods or at least an
    27      // extension of it.
    28      // It is probably most efficient if "GET" ends up as the same instance
    29
    30      public final static String OPTIONS="OPTIONS", GET="GET", HEAD="HEAD", POST="POST", PUT="PUT", DELETE="DELETE", TRACE="TRACE", PROPFIND="PROPFIND",
    31              PROPPATCH="PROPPATCH", MKCOL="MKCOL", COPY="COPY", MOVE="MOVE", LOCK="LOCK", UNLOCK="UNLOCK", ACL="ACL", REPORT="REPORT",
    32              VERSION_CONTROL="VERSION-CONTROL", CHECKIN="CHECKIN", CHECKOUT="CHECKOUT", UNCHCKOUT="UNCHECKOUT", SEARCH="SEARCH", MKWORKSPACE="MKWORKSPACE",
    33              UPDATE="UPDATE", LABEL="LABEL", MERGE="MERGE", BASELINE_CONTROL="BASELINE-CONTROL", MKACTIVITY="MKACTIVITY";
    34
    35      public final static int OPTIONS_ORDINAL=1, GET_ORDINAL=2, HEAD_ORDINAL=3, POST__ORDINAL=4, PUT_ORDINAL=5, DELETE_ORDINAL=6, TRACE_ORDINAL=7,
    36              PROPFIND_ORDINAL=8, PROPPATCH_ORDINAL=9, MKCOL_ORDINAL=10, COPY_ORDINAL=11, MOVE_ORDINAL=12, LOCK_ORDINAL=13, UNLOCK_ORDINAL=14, ACL_ORDINAL=15,
    37              REPORT_ORDINAL=16, VERSION_CONTROL_ORDINAL=17, CHECKIN_ORDINAL=18, CHECKOUT_ORDINAL=19, UNCHCKOUT_ORDINAL=20, SEARCH_ORDINAL=21,
    38              MKWORKSPACE_ORDINAL=22, UPDATE_ORDINAL=23, LABEL_ORDINAL=24, MERGE_ORDINAL=25, BASELINE_CONTROL_ORDINAL=26, MKACTIVITY_ORDINAL=27;
    39
    40      public final static BufferCache CACHE=new BufferCache();
    41
    42      public final static Buffer
    43          OPTIONS_BUFFER=CACHE.add(OPTIONS,OPTIONS_ORDINAL),
    44          GET_BUFFER=CACHE.add(GET,GET_ORDINAL),
    45          HEAD_BUFFER=CACHE.add(HEAD, HEAD_ORDINAL),
    46          POST__BUFFER=CACHE.add(POST,POST__ORDINAL),
    47          PUT_BUFFER=CACHE.add(PUT,PUT_ORDINAL),
    48          DELETE_BUFFER=CACHE.add(DELETE,DELETE_ORDINAL),
    49          TRACE_BUFFER=CACHE.add(TRACE,TRACE_ORDINAL),
    50          PROPFIND_BUFFER=CACHE.add(PROPFIND,PROPFIND_ORDINAL),
    51          PROPPATCH_BUFFER=CACHE.add(PROPPATCH, PROPPATCH_ORDINAL),
    52          MKCOL_BUFFER=CACHE.add(MKCOL,MKCOL_ORDINAL),
    53          COPY_BUFFER=CACHE.add(COPY,COPY_ORDINAL),
    54          MOVE_BUFFER=CACHE.add(MOVE,MOVE_ORDINAL),
    55          LOCK_BUFFER=CACHE.add(LOCK,LOCK_ORDINAL),
    56          UNLOCK_BUFFER=CACHE.add(UNLOCK,UNLOCK_ORDINAL),
    57          ACL_BUFFER=CACHE.add(ACL,ACL_ORDINAL),
    58          REPORT_BUFFER=CACHE.add(REPORT,REPORT_ORDINAL),
    59          VERSION_CONTROL_BUFFER=CACHE.add(VERSION_CONTROL,VERSION_CONTROL_ORDINAL),
    60          CHECKIN_BUFFER=CACHE.add(CHECKIN,CHECKIN_ORDINAL),
    61          CHECKOUT_BUFFER=CACHE.add(CHECKOUT,CHECKOUT_ORDINAL),
    62          UNCHCKOUT_BUFFER=CACHE.add(UNCHCKOUT,UNCHCKOUT_ORDINAL),
    63          SEARCH_BUFFER=CACHE.add(SEARCH,SEARCH_ORDINAL),
    64          MKWORKSPACE_BUFFER=CACHE.add(MKWORKSPACE,MKWORKSPACE_ORDINAL),
    65          UPDATE_BUFFER=CACHE.add(UPDATE,UPDATE_ORDINAL),
    66          LABEL_BUFFER=CACHE.add(LABEL,LABEL_ORDINAL),
    67          MERGE_BUFFER=CACHE.add(MERGE,MERGE_ORDINAL),
    68          BASELINE_CONTROL_BUFFER=CACHE.add(BASELINE_CONTROL,BASELINE_CONTROL_ORDINAL),
    69          MKACTIVITY_BUFFER=CACHE.add(MKACTIVITY,MKACTIVITY_ORDINAL);
    70  }