// Path: idobata4j-core/src/main/java/com/uphyca/idobata/event/ConnectionEvent.java
// public interface ConnectionEvent extends Serializable {
// 
//     public static final int CLOSED = 0;
//     public static final int OPENED = 1;
// 
//     int getType();
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/event/MemberStatusChangedEvent.java
// public interface MemberStatusChangedEvent extends Serializable {
//     long getId();
// 
//     String getStatus();
// 
//     String getType();
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/event/MessageCreatedEvent.java
// public interface MessageCreatedEvent extends Serializable {
//     long getId();
// 
//     String getBody();
// 
//     String getBodyPlain();
// 
//     List<String> getImageUrls();
// 
//     boolean isMultiline();
// 
//     List<Long> getMentions();
// 
//     String getCreatedAt();
// 
//     long getRoomId();
// 
//     String getRoomName();
// 
//     String getOrganizationSlug();
// 
//     String getSenderType();
// 
//     long getSenderId();
// 
//     String getSenderName();
// 
//     String getSenderIconUrl();
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/event/RoomTouchedEvent.java
// public interface RoomTouchedEvent extends Serializable {
// 
//     long getRoomId();
// }


import com.uphyca.idobata.event.ConnectionEvent;
import com.uphyca.idobata.event.MemberStatusChangedEvent;
import com.uphyca.idobata.event.MessageCreatedEvent;
import com.uphyca.idobata.event.RoomTouchedEvent;
import java.io.Closeable;
/*
 * Copyright (C) 2014 uPhyca 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.
 */

package com.uphyca.idobata;



/**
 * Represents <a href="https://idobata.io/">Idobata</a> WebSocket API.
 * 
 * @author Sosuke Masui (masui@uphyca.com)
 */
public interface IdobataStream extends Closeable {

    public interface Listener<T> {
        void onEvent(T event);
    }

    public interface ConnectionListener {
        void closed(ConnectionEvent event);

        void opened(ConnectionEvent event);
    }

    void open();

    /**
     * event: message_created
     */
    IdobataStream subscribeMessageCreated(Listener<MessageCreatedEvent> listener);

    /**
     * event: member_status_changed
     */
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/event/ConnectionEvent.java
// public interface ConnectionEvent extends Serializable {
// 
//     public static final int CLOSED = 0;
//     public static final int OPENED = 1;
// 
//     int getType();
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/event/MemberStatusChangedEvent.java
// public interface MemberStatusChangedEvent extends Serializable {
//     long getId();
// 
//     String getStatus();
// 
//     String getType();
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/event/MessageCreatedEvent.java
// public interface MessageCreatedEvent extends Serializable {
//     long getId();
// 
//     String getBody();
// 
//     String getBodyPlain();
// 
//     List<String> getImageUrls();
// 
//     boolean isMultiline();
// 
//     List<Long> getMentions();
// 
//     String getCreatedAt();
// 
//     long getRoomId();
// 
//     String getRoomName();
// 
//     String getOrganizationSlug();
// 
//     String getSenderType();
// 
//     long getSenderId();
// 
//     String getSenderName();
// 
//     String getSenderIconUrl();
// }
// 
// Path: idobata4j-core/src/main/java/com/uphyca/idobata/event/RoomTouchedEvent.java
// public interface RoomTouchedEvent extends Serializable {
// 
//     long getRoomId();
// }


// Path: idobata4j-core/src/main/java/com/uphyca/idobata/IdobataStream.java
import com.uphyca.idobata.event.ConnectionEvent;
import com.uphyca.idobata.event.MemberStatusChangedEvent;
import com.uphyca.idobata.event.MessageCreatedEvent;
import com.uphyca.idobata.event.RoomTouchedEvent;
import java.io.Closeable;

/*
 * Copyright (C) 2014 uPhyca 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.
 */

package com.uphyca.idobata;



/**
 * Represents <a href="https://idobata.io/">Idobata</a> WebSocket API.
 * 
 * @author Sosuke Masui (masui@uphyca.com)
 */
public interface IdobataStream extends Closeable {

    public interface Listener<T> {
        void onEvent(T event);
    }

    public interface ConnectionListener {
        void closed(ConnectionEvent event);

        void opened(ConnectionEvent event);
    }

    void open();

    /**
     * event: message_created
     */
    IdobataStream subscribeMessageCreated(Listener<MessageCreatedEvent> listener);

    /**
     * event: member_status_changed
     */
    IdobataStream subscribeMemberStatusChanged(Listener<MemberStatusChangedEvent> listener);