// Path: action/src/main/java/org/atmosphere/vibe/platform/action/Action.java
// public interface Action<T> {
// 
//     /**
//      * Some action is taken.
//      */
//     void on(T object);
// 
// }


import java.nio.ByteBuffer;
import org.atmosphere.vibe.platform.action.Action;
/*
 * Copyright 2014 The Vibe Project
 *
 * 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.
 */
package org.atmosphere.vibe.platform.websocket;



/**
 * Represents a server-side WebSocket.
 * <p/>
 * Implementations are not thread-safe.
 *
 * @author Donghwan Kim
 * @see <a href="http://tools.ietf.org/html/rfc6455">RFC6455 - The WebSocket
 *      Protocol</a>
 */
public interface ServerWebSocket {

    /**
     * The URI used to connect.
     */
    String uri();

    /**
     * Closes the connection. This method has no side effect if called more than
     * once.
     */
    void close();

    /**
     * Sends a text frame through the connection.
     */
    ServerWebSocket send(String data);

    /**
     * Sends a binary frame through the connection.
     */
// Path: action/src/main/java/org/atmosphere/vibe/platform/action/Action.java
// public interface Action<T> {
// 
//     /**
//      * Some action is taken.
//      */
//     void on(T object);
// 
// }


// Path: websocket/src/main/java/org/atmosphere/vibe/platform/websocket/ServerWebSocket.java
import java.nio.ByteBuffer;
import org.atmosphere.vibe.platform.action.Action;

/*
 * Copyright 2014 The Vibe Project
 *
 * 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.
 */
package org.atmosphere.vibe.platform.websocket;



/**
 * Represents a server-side WebSocket.
 * <p/>
 * Implementations are not thread-safe.
 *
 * @author Donghwan Kim
 * @see <a href="http://tools.ietf.org/html/rfc6455">RFC6455 - The WebSocket
 *      Protocol</a>
 */
public interface ServerWebSocket {

    /**
     * The URI used to connect.
     */
    String uri();

    /**
     * Closes the connection. This method has no side effect if called more than
     * once.
     */
    void close();

    /**
     * Sends a text frame through the connection.
     */
    ServerWebSocket send(String data);

    /**
     * Sends a binary frame through the connection.
     */
    ServerWebSocket send(ByteBuffer byteBuffer);