Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 package org.apache.tomcat.bayeux.request;
 import static org.jboss.web.CoyoteMessages.MESSAGES;
Handshake request Bayeux message.

Guy A. Molinari
Filip Hanik
 public class MetaHandshakeRequest extends RequestBase implements BayeuxRequest {
     protected static HashMap<String,ObjectresponseTemplate = new HashMap<String,Object>();
     static {
     public MetaHandshakeRequest(TomcatBayeux tomcatBayeuxHttpEvent eventJSONObject jsReqthrows JSONException {
     public String getVersion() { return ; }
     public String getMinimumVersion() { return ; }

Check client request for validity. Per section 4.1.1 of the Bayuex spec a handshake request must contain: 1) The "/meta/handshake" channel identifier. 2) The version of the protocol supported by the client 3) The client's supported connection types.

HttpError This method returns null if no errors were found
     public HttpError validate() {
         boolean error = (==null || .length()==0);
         if (!errorerror = ==0;
         if (errorreturn new HttpError(400, .invalidBayeuxHandshake(),null);
         else return null;

Generate and return a client identifier. Return a list of supported connection types. Must be a subset of or identical to the list of types supported by the client. See section 4.1.2 of the Bayuex specification.
     public int process(int prevopsthrows BayeuxException {
         prevops = super.process(prevops);
          = (HashMap<StringObject>).clone();
         ClientImpl client = null;
         HttpError error = validate();
         if (error == null) {
             client = (ClientImplgetTomcatBayeux().newClient("http-"nullfalse,getEvent());
              = client.getId();
             client.setUseJsonFiltered(getExt().get(.) != null);
        }else {
            client = TomcatBayeux.getErrorClient();
        try {
            JSONObject obj = new JSONObject();
        } catch (ServletException x) {
            throw new BayeuxException(x);
        } catch (IOException x) {
            throw new BayeuxException(x);
        return 0;
New to GrepCode? Check out our FAQ X