Skip to content

Instantly share code, notes, and snippets.

@Lunaphied
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Lunaphied/561c512b4408a72376d2 to your computer and use it in GitHub Desktop.
Save Lunaphied/561c512b4408a72376d2 to your computer and use it in GitHub Desktop.
Channels
public interface ChannelReciever {
public void sendMessage(String message);
}
public interface ChannelFormatter {
public String formatMessage(ChannelReciever member, String message);
}
public interface Channel {
String getChannelName();
String sendMessage(String message);
void addMember(ChannelReceiver member);
void removeMember(ChannelReceiver member);
List<ChannelReceiver> getMembers();
void setFormatter(ChannelFormater formatter);
ChannelFormater getFormatter();
}
public interface ChannelFilter {
Channel selectChannel(ChannelReceiver member, MultiChannel multiChannel);
}
public interface MultiChannel {
void registerChannel(Channel channel, int priority);
int getPriority(Channel channel);
List<Channel> getRegisteredChannels();
}
@dredhorse
Copy link

removeMember should probably be boolean.
i gather MultiChannel would than be per User?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment