Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.dirigible.runtime.websockets.service;
import java.util.HashMap;
import java.util.Map;
import javax.websocket.CloseReason;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import org.eclipse.dirigible.api.v4.websockets.WebsocketsFacade;
import org.eclipse.dirigible.commons.config.StaticObjects;
import org.eclipse.dirigible.core.websockets.api.WebsocketsException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Websockets Service.
*/
@ServerEndpoint("/websockets/v4/service/{endpoint}")
public class WebsocketsService {
/** The Constant logger. */
private static final Logger logger = LoggerFactory.getLogger(WebsocketsService.class);
/** The handler. */
private WebsocketHandler handler = null;
/**
* On open callback.
*
* @param session
* the session
* @param endpoint
* the endpoint
*/
@OnOpen
public void onOpen(Session session, @PathParam("endpoint") String endpoint) {
logger.debug(String.format("[websocket] Endpoint '%s' openned.", endpoint));
Map