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

java.com.graphql_java_generator.client.SubscriptionClientImpl Maven / Gradle / Ivy

There is a newer version: 1.18
Show newest version
/**
 * 
 */
package com.graphql_java_generator.client;

import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.springframework.web.reactive.socket.WebSocketSession;

import com.graphql_java_generator.exception.GraphQLRequestExecutionException;

/**
 * Default implementation for the {@link SubscriptionClient} interface. This implementation is deprecated since release
 * 1.12
 * 
 * @author etienne-sf
 */
@Deprecated
class SubscriptionClientImpl implements SubscriptionClient {

	/** The connected Web Socket */
	WebSocketClient client;

	SubscriptionClientImpl(WebSocketClient client) {
		this.client = client;
	}

	/** {@inheritDoc} */
	@Override
	public void unsubscribe() throws GraphQLRequestExecutionException {
		try {
			client.stop();
		} catch (Exception e) {
			throw new GraphQLRequestExecutionException(e.getMessage(), e);
		}
	}

	@Override
	public WebSocketSession getSession() {
		// No WebSocketSession in this case
		return null;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy