public static CloseCode getCloseCode()

in geronimo-websockets_1.0_spec/src/main/java/javax/websocket/CloseReason.java [148:181]


        public static CloseCode getCloseCode(int code) {
            switch (code) {
            case 1000:
                return NORMAL_CLOSURE;
            case 1001:
                return GOING_AWAY;
            case 1002:
                return PROTOCOL_ERROR;
            case 1003:
                return CANNOT_ACCEPT;
            case 1005:
                return NO_STATUS_CODE;
            case 1006:
                return CLOSED_ABNORMALLY;
            case 1007:
                return NOT_CONSISTENT;
            case 1008:
                return VIOLATED_POLICY;
            case 1009:
                return TOO_BIG;
            case 1010:
                return NO_EXTENSION;
            case 1011:
                return UNEXPECTED_CONDITION;
            case 1012:
                return SERVICE_RESTART;
            case 1013:
                return TRY_AGAIN_LATER;
            case 1015:
                return TLS_HANDSHAKE_FAILURE;
            default:
                throw new IllegalArgumentException("Unknown Code: " + code);
            }
        }