Search in sources :

Example 11 with EzyResponse

use of com.tvd12.ezyfoxserver.response.EzyResponse in project ezyfox-server by youngmonkeys.

the class EzyHandshakeController method handle.

@SuppressWarnings("AbbreviationAsWordInName")
@Override
public void handle(EzyServerContext ctx, EzyHandShakeRequest request) {
    EzySession session = request.getSession();
    EzyHandshakeParams params = request.getParams();
    EzyHandshakeEvent event = newHandshakeEvent(session, params);
    ctx.handleEvent(EzyEventType.CLIENT_HANDSHAKE, event);
    handleSocketSSL(ctx, event);
    updateSession(session, event);
    EzyResponse response = newHandShakeResponse(session, event);
    ctx.send(response, session, false);
    event.release();
}
Also used : EzyHandshakeEvent(com.tvd12.ezyfoxserver.event.EzyHandshakeEvent) EzyHandshakeParams(com.tvd12.ezyfoxserver.request.EzyHandshakeParams) EzyResponse(com.tvd12.ezyfoxserver.response.EzyResponse) EzySession(com.tvd12.ezyfoxserver.entity.EzySession)

Example 12 with EzyResponse

use of com.tvd12.ezyfoxserver.response.EzyResponse in project ezyfox-server by youngmonkeys.

the class EzyHandshakeController method newHandShakeResponse.

protected EzyResponse newHandShakeResponse(EzySession session, EzyHandshakeEvent event) {
    EzyHandShakeParams params = new EzyHandShakeParams();
    params.setServerPublicKey(session.getPublicKey());
    params.setReconnectToken(session.getToken());
    params.setSessionId(session.getId());
    params.setSessionKey(event.getEncryptedSessionKey());
    return new EzyHandShakeResponse(params);
}
Also used : EzyHandShakeResponse(com.tvd12.ezyfoxserver.response.EzyHandShakeResponse) EzyHandShakeParams(com.tvd12.ezyfoxserver.response.EzyHandShakeParams)

Example 13 with EzyResponse

use of com.tvd12.ezyfoxserver.response.EzyResponse in project ezyfox-server by youngmonkeys.

the class EzyAppSendResponseImpl method newResponse.

protected EzyResponse newResponse(EzyData data) {
    EzyAppSetting setting = context.getApp().getSetting();
    EzyRequestAppResponseParams params = new EzyRequestAppResponseParams();
    params.setAppId(setting.getId());
    params.setData(data);
    return new EzyRequestAppResponse(params);
}
Also used : EzyAppSetting(com.tvd12.ezyfoxserver.setting.EzyAppSetting) EzyRequestAppResponse(com.tvd12.ezyfoxserver.response.EzyRequestAppResponse) EzyRequestAppResponseParams(com.tvd12.ezyfoxserver.response.EzyRequestAppResponseParams)

Example 14 with EzyResponse

use of com.tvd12.ezyfoxserver.response.EzyResponse in project ezyfox-server by youngmonkeys.

the class EzyAppSendResponseImpl method execute.

@Override
public void execute(EzyData data, Collection<EzySession> recipients, boolean encrypted, EzyTransportType transportType) {
    EzyResponse response = newResponse(data);
    serverContext.send(response, recipients, encrypted, transportType);
}
Also used : EzyResponse(com.tvd12.ezyfoxserver.response.EzyResponse)

Example 15 with EzyResponse

use of com.tvd12.ezyfoxserver.response.EzyResponse in project ezyfox-server by youngmonkeys.

the class EzyCloseSessionImpl method newResponse.

protected EzyResponse newResponse(EzyConstant reason) {
    EzyDisconnectParams params = new EzyDisconnectParams();
    params.setReason(reason);
    return new EzyDisconnectResponse(params);
}
Also used : EzyDisconnectParams(com.tvd12.ezyfoxserver.response.EzyDisconnectParams) EzyDisconnectResponse(com.tvd12.ezyfoxserver.response.EzyDisconnectResponse)

Aggregations

EzyResponse (com.tvd12.ezyfoxserver.response.EzyResponse)25 EzySession (com.tvd12.ezyfoxserver.entity.EzySession)17 Test (org.testng.annotations.Test)12 EzyResponseApi (com.tvd12.ezyfoxserver.api.EzyResponseApi)11 EzySimpleServer (com.tvd12.ezyfoxserver.EzySimpleServer)9 EzySendResponseImpl (com.tvd12.ezyfoxserver.command.impl.EzySendResponseImpl)8 EzySimpleResponse (com.tvd12.ezyfoxserver.response.EzySimpleResponse)8 EzySimpleSettings (com.tvd12.ezyfoxserver.setting.EzySimpleSettings)8 EzyPackage (com.tvd12.ezyfoxserver.response.EzyPackage)7 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)5 EzyUser (com.tvd12.ezyfoxserver.entity.EzyUser)4 EzyArray (com.tvd12.ezyfox.entity.EzyArray)3 EzyErrorParams (com.tvd12.ezyfoxserver.response.EzyErrorParams)3 EzyAppSetting (com.tvd12.ezyfoxserver.setting.EzyAppSetting)3 EzyApplication (com.tvd12.ezyfoxserver.EzyApplication)2 EzyBroadcastEvent (com.tvd12.ezyfoxserver.command.EzyBroadcastEvent)2 EzyAppContext (com.tvd12.ezyfoxserver.context.EzyAppContext)2 EzySimpleServerContext (com.tvd12.ezyfoxserver.context.EzySimpleServerContext)2 EzySimpleUser (com.tvd12.ezyfoxserver.entity.EzySimpleUser)2 EzySimpleServerReadyEvent (com.tvd12.ezyfoxserver.event.EzySimpleServerReadyEvent)2