Skip to content

Commit 5311550

Browse files
authored
Merge pull request #114 from pusher/provide-client-interface
Provide Client interface
2 parents a979986 + 71086ae commit 5311550

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.pusher.client;
2+
3+
import com.pusher.client.channel.Channel;
4+
import com.pusher.client.channel.ChannelEventListener;
5+
import com.pusher.client.channel.PresenceChannel;
6+
import com.pusher.client.channel.PresenceChannelEventListener;
7+
import com.pusher.client.channel.PrivateChannel;
8+
import com.pusher.client.channel.PrivateChannelEventListener;
9+
import com.pusher.client.connection.Connection;
10+
import com.pusher.client.connection.ConnectionEventListener;
11+
import com.pusher.client.connection.ConnectionState;
12+
13+
/**
14+
* Created by jamiepatel on 09/06/2016.
15+
*/
16+
public interface Client {
17+
Connection getConnection();
18+
void connect();
19+
void connect(final ConnectionEventListener eventListener, ConnectionState... connectionStates);
20+
void disconnect();
21+
Channel subscribe(final String channelName);
22+
Channel subscribe(final String channelName, final ChannelEventListener listener, final String... eventNames);
23+
PrivateChannel subscribePrivate(final String channelName);
24+
PrivateChannel subscribePrivate(final String channelName, final PrivateChannelEventListener listener,
25+
final String... eventNames);
26+
PresenceChannel subscribePresence(final String channelName);
27+
PresenceChannel subscribePresence(final String channelName, final PresenceChannelEventListener listener,
28+
final String... eventNames);
29+
void unsubscribe(final String channelName);
30+
Channel getChannel(String channelName);
31+
PrivateChannel getPrivateChannel(String channelName);
32+
PresenceChannel getPresenceChannel(String channelName);
33+
}

src/main/java/com/pusher/client/Pusher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* {@link Pusher#subscribePresence(String)} or one of the overloads.
3434
* </p>
3535
*/
36-
public class Pusher {
36+
public class Pusher implements Client {
3737

3838
private final PusherOptions pusherOptions;
3939
private final InternalConnection connection;

0 commit comments

Comments
 (0)