Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
894 additions
and
734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
mpush-api/src/main/java/com/shinemo/mpush/api/MessageHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package com.shinemo.mpush.api; | ||
|
||
import com.shinemo.mpush.api.connection.Connection; | ||
import com.shinemo.mpush.api.protocol.Packet; | ||
|
||
/** | ||
* Created by ohun on 2015/12/22. | ||
*/ | ||
public interface MessageHandler<T extends Message> { | ||
void handle(T message); | ||
public interface MessageHandler { | ||
void handle(Packet packet, Connection connection); | ||
} |
1 change: 1 addition & 0 deletions
1
mpush-api/src/main/java/com/shinemo/mpush/api/PacketReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
mpush-api/src/main/java/com/shinemo/mpush/api/PushSender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.shinemo.mpush.api; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* Created by ohun on 2015/12/30. | ||
*/ | ||
public interface PushSender { | ||
void send(String content, Collection<String> userIds, Callback callback); | ||
|
||
interface Callback { | ||
void onSuccess(String userId); | ||
|
||
void onFailure(String userId); | ||
|
||
void onLose(String userId); | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
mpush-api/src/main/java/com/shinemo/mpush/api/Request.java
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
mpush-api/src/main/java/com/shinemo/mpush/api/Response.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
* Created by ohun on 2015/12/24. | ||
*/ | ||
public interface Server { | ||
void init(); | ||
|
||
void start(); | ||
|
||
void stop(); | ||
|
2 changes: 1 addition & 1 deletion
2
...in/java/com/shinemo/mpush/api/Cipher.java → .../shinemo/mpush/api/connection/Cipher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.shinemo.mpush.api; | ||
package com.shinemo.mpush.api.connection; | ||
|
||
/** | ||
* Created by ohun on 2015/12/28. | ||
|
22 changes: 7 additions & 15 deletions
22
...ava/com/shinemo/mpush/api/Connection.java → ...nemo/mpush/api/connection/Connection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,31 @@ | ||
package com.shinemo.mpush.api; | ||
package com.shinemo.mpush.api.connection; | ||
|
||
import io.netty.channel.Channel; | ||
|
||
import com.shinemo.mpush.api.protocol.Packet; | ||
import io.netty.channel.ChannelFuture; | ||
import io.netty.channel.ChannelFutureListener; | ||
|
||
/** | ||
* Created by ohun on 2015/12/22. | ||
*/ | ||
public interface Connection { | ||
|
||
void init(Channel channel); | ||
void init(Channel channel, boolean security); | ||
|
||
SessionContext getSessionContext(); | ||
|
||
void setSessionContext(SessionContext context); | ||
|
||
void send(Packet packet); | ||
ChannelFuture send(Packet packet); | ||
|
||
void send(Packet packet, ChannelFutureListener listener); | ||
|
||
Channel channel(); | ||
|
||
String getId(); | ||
|
||
boolean isClosed(); | ||
|
||
boolean isOpen(); | ||
|
||
int getHbTimes(); | ||
|
||
void close(); | ||
|
||
boolean isConnected(); | ||
|
||
boolean isEnable(); | ||
|
||
String remoteIp(); | ||
|
||
|
||
} |
14 changes: 14 additions & 0 deletions
14
mpush-api/src/main/java/com/shinemo/mpush/api/connection/ConnectionManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.shinemo.mpush.api.connection; | ||
|
||
import io.netty.channel.Channel; | ||
|
||
/** | ||
* Created by ohun on 2015/12/30. | ||
*/ | ||
public interface ConnectionManager { | ||
Connection get(Channel channel); | ||
|
||
void remove(Channel channel); | ||
|
||
void add(Connection connection); | ||
} |
2 changes: 1 addition & 1 deletion
2
...com/shinemo/mpush/api/SessionContext.java → .../mpush/api/connection/SessionContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.shinemo.mpush.api; | ||
package com.shinemo.mpush.api.connection; | ||
|
||
import com.google.common.base.Strings; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
mpush-api/src/main/java/com/shinemo/mpush/api/event/HandshakeEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
mpush-api/src/main/java/com/shinemo/mpush/api/exception/SendMessageException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.shinemo.mpush.api.exception; | ||
|
||
/** | ||
* Created by ohun on 2015/12/30. | ||
*/ | ||
public class SendMessageException extends RuntimeException { | ||
} |
59 changes: 0 additions & 59 deletions
59
mpush-api/src/main/java/com/shinemo/mpush/api/message/NettyRequest.java
This file was deleted.
Oops, something went wrong.
68 changes: 0 additions & 68 deletions
68
mpush-api/src/main/java/com/shinemo/mpush/api/message/NettyResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.