All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.glassfish.websocket.api.CloseCodes Maven / Gradle / Ivy

The newest version!
/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2011 - 2012 Oracle and/or its affiliates. All rights reserved.
 *
 * The contents of this file are subject to the terms of either the GNU
 * General Public License Version 2 only ("GPL") or the Common Development
 * and Distribution License("CDDL") (collectively, the "License").  You
 * may not use this file except in compliance with the License.  You can
 * obtain a copy of the License at
 * http://glassfish.java.net/public/CDDL+GPL_1_1.html
 * or packager/legal/LICENSE.txt.  See the License for the specific
 * language governing permissions and limitations under the License.
 *
 * When distributing the software, include this License Header Notice in each
 * file and include the License file at packager/legal/LICENSE.txt.
 *
 * GPL Classpath Exception:
 * Oracle designates this particular file as subject to the "Classpath"
 * exception as provided by Oracle in the GPL Version 2 section of the License
 * file that accompanied this code.
 *
 * Modifications:
 * If applicable, add the following below the License Header, with the fields
 * enclosed by brackets [] replaced by your own identifying information:
 * "Portions Copyright [year] [name of copyright owner]"
 *
 * Contributor(s):
 * If you wish your version of this file to be governed by only the CDDL or
 * only the GPL Version 2, indicate your decision by adding "[Contributor]
 * elects to include this software in this distribution under the [CDDL or GPL
 * Version 2] license."  If you don't indicate a single choice of license, a
 * recipient has the option to distribute your version of this file under
 * either the CDDL, the GPL Version 2 or to extend the choice of license to
 * its licensees as provided above.  However, if you add GPL Version 2 code
 * and therefore, elected the GPL Version 2 license, then the option applies
 * only if the new code is made subject to such option by the copyright
 * holder.
 */

package org.glassfish.websocket.api;

/**
 * Allowable codes to supply when closing
 * a web socket connection. 
see * http://tools.ietf.org/html/rfc6455#section-7.4 * * @author dannycoward */ public class CloseCodes { /** * 1000 indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled. */ public static int NORMAL = 1000; /** 1001 indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page. */ public static int GOING_AWAY = 1001; /* 1003 indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message). */ public static int CANNOT_ACCEPT_DATA = 1003; /* * 1008 indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy. */ public static int POLICY_VIOLATION = 1008; /** * 1009 indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process. */ public static int TOO_BIG = 1009; /** * 1010 indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake. The list of extensions that * are needed SHOULD appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead. */ public static int EXTENSION_FAIL = 1010; /** * 1011 indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request. */ public static int UNEXPECTED_CONDITION = 1011; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy