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

org.fujion.test.MockServerContainer Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
/*
 * #%L
 * fujion
 * %%
 * Copyright (C) 2008 - 2018 Regenstrief Institute, Inc.
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * #L%
 */
package org.fujion.test;

import java.io.IOException;
import java.net.URI;
import java.util.Collections;
import java.util.Set;

import javax.websocket.ClientEndpointConfig;
import javax.websocket.DeploymentException;
import javax.websocket.Endpoint;
import javax.websocket.Extension;
import javax.websocket.Session;
import javax.websocket.server.ServerContainer;
import javax.websocket.server.ServerEndpointConfig;

/**
 * Mock server container.
 */
public class MockServerContainer implements ServerContainer {

    private long defaultAsyncSendTimeout;

    private long defaultMaxSessionIdleTimeout;

    private int defaultMaxBinaryMessageBufferSize;

    private int defaultMaxTextMessageBufferSize;
    
    @Override
    public long getDefaultAsyncSendTimeout() {
        return defaultAsyncSendTimeout;
    }

    @Override
    public void setAsyncSendTimeout(long timeout) {
        defaultAsyncSendTimeout = timeout;
    }

    @Override
    public Session connectToServer(Object endpoint, URI path) throws DeploymentException, IOException {
        return null;
    }

    @Override
    public Session connectToServer(Class annotatedEndpointClass, URI path) throws DeploymentException, IOException {
        return null;
    }

    @Override
    public Session connectToServer(Endpoint endpoint, ClientEndpointConfig clientEndpointConfiguration,
                                   URI path) throws DeploymentException, IOException {
        return null;
    }

    @Override
    public Session connectToServer(Class endpoint, ClientEndpointConfig clientEndpointConfiguration,
                                   URI path) throws DeploymentException, IOException {
        return null;
    }

    @Override
    public long getDefaultMaxSessionIdleTimeout() {
        return defaultMaxSessionIdleTimeout;
    }

    @Override
    public void setDefaultMaxSessionIdleTimeout(long timeout) {
        defaultMaxSessionIdleTimeout = timeout;
    }

    @Override
    public int getDefaultMaxBinaryMessageBufferSize() {
        return defaultMaxBinaryMessageBufferSize;
    }

    @Override
    public void setDefaultMaxBinaryMessageBufferSize(int max) {
        defaultMaxBinaryMessageBufferSize = max;
    }

    @Override
    public int getDefaultMaxTextMessageBufferSize() {
        return defaultMaxTextMessageBufferSize;
    }

    @Override
    public void setDefaultMaxTextMessageBufferSize(int max) {
        defaultMaxTextMessageBufferSize = max;
    }

    @Override
    public Set getInstalledExtensions() {
        return Collections.emptySet();
    }

    @Override
    public void addEndpoint(Class clazz) throws DeploymentException {
    }

    @Override
    public void addEndpoint(ServerEndpointConfig sec) throws DeploymentException {
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy