Example usage for org.springframework.web.socket CloseStatus TOO_BIG_TO_PROCESS

List of usage examples for org.springframework.web.socket CloseStatus TOO_BIG_TO_PROCESS

Introduction

In this page you can find the example usage for org.springframework.web.socket CloseStatus TOO_BIG_TO_PROCESS.

Prototype

CloseStatus TOO_BIG_TO_PROCESS

To view the source code for org.springframework.web.socket CloseStatus TOO_BIG_TO_PROCESS.

Click Source Link

Document

"1009 indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process."

Usage

From source file:com.company.project.config.StompDisconnectEvent.java

@Override
public void onApplicationEvent(SessionDisconnectEvent event) {
    StompHeaderAccessor sha = StompHeaderAccessor.wrap(event.getMessage());
    CloseStatus status = event.getCloseStatus();

    if (status.equals(CloseStatus.BAD_DATA)) {
        System.out.println("CloseStatus.BAD_DATA");
    }//from ww  w.j  a  v  a2  s .  c om
    if (status.equals(CloseStatus.GOING_AWAY)) {
        System.out.println("CloseStatus.GOING_AWAY");
    }
    if (status.equals(CloseStatus.NORMAL)) {
        System.out.println("CloseStatus.NORMAL");
    }
    if (status.equals(CloseStatus.NOT_ACCEPTABLE)) {
        System.out.println("CloseStatus.NOT_ACCEPTABLE");
    }
    if (status.equals(CloseStatus.NO_CLOSE_FRAME)) {
        System.out.println("CloseStatus.NO_CLOSE_FRAME");
    }
    if (status.equals(CloseStatus.NO_STATUS_CODE)) {
        System.out.println("CloseStatus.NO_STATUS_CODE");
    }
    if (status.equals(CloseStatus.POLICY_VIOLATION)) {
        System.out.println("CloseStatus.POLICY_VIOLATION");
    }
    if (status.equals(CloseStatus.PROTOCOL_ERROR)) {
        System.out.println("CloseStatus.PROTOCOL_ERROR");
    }
    if (status.equals(CloseStatus.REQUIRED_EXTENSION)) {
        System.out.println("CloseStatus.REQUIRED_EXTENSION");
    }
    if (status.equals(CloseStatus.SERVER_ERROR)) {
        System.out.println("CloseStatus.SERVER_ERROR");
    }
    if (status.equals(CloseStatus.SERVICE_RESTARTED)) {
        System.out.println("CloseStatus.SERVICE_RESTARTED");
    }
    if (status.equals(CloseStatus.SESSION_NOT_RELIABLE)) {
        System.out.println("CloseStatus.SESSION_NOT_RELIABLE");
    }
    if (status.equals(CloseStatus.TLS_HANDSHAKE_FAILURE)) {
        System.out.println("CloseStatus.TLS_HANDSHAKE_FAILURE");
    }
    if (status.equals(CloseStatus.TOO_BIG_TO_PROCESS)) {
        System.out.println("CloseStatus.TOO_BIG_TO_PROCESS");
    }

    System.out.println("CloseStatus: " + status);

    logger.debug("Disconnect event [sessionId: " + sha.getSessionId() + " ]");
    System.out.println("Disconnect event [sessionId: " + event.getSessionId() + " ]");
}