Search in sources :

Example 21 with EzySession

use of com.tvd12.ezyfoxserver.entity.EzySession in project ezyfox-server by youngmonkeys.

the class EzyAccessAppController method responseAccessAppError.

protected void responseAccessAppError(EzyServerContext ctx, EzySession session, EzyAccessAppException exception) {
    EzyResponse response = newAccessAppErrorResponse(exception.getError());
    ctx.send(response, session, false);
}
Also used : EzyResponse(com.tvd12.ezyfoxserver.response.EzyResponse)

Example 22 with EzySession

use of com.tvd12.ezyfoxserver.entity.EzySession 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 23 with EzySession

use of com.tvd12.ezyfoxserver.entity.EzySession 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 24 with EzySession

use of com.tvd12.ezyfoxserver.entity.EzySession 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 25 with EzySession

use of com.tvd12.ezyfoxserver.entity.EzySession in project ezyfox-server by youngmonkeys.

the class EzyPluginSendResponseImpl method execute.

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

Aggregations

EzySession (com.tvd12.ezyfoxserver.entity.EzySession)112 Test (org.testng.annotations.Test)92 EzyArray (com.tvd12.ezyfox.entity.EzyArray)33 EzyResponseApi (com.tvd12.ezyfoxserver.api.EzyResponseApi)26 EzySimpleServer (com.tvd12.ezyfoxserver.EzySimpleServer)25 EzyResponse (com.tvd12.ezyfoxserver.response.EzyResponse)25 BaseTest (com.tvd12.test.base.BaseTest)25 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)15 EzySimpleServerContext (com.tvd12.ezyfoxserver.context.EzySimpleServerContext)14 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)13 EzyUser (com.tvd12.ezyfoxserver.entity.EzyUser)13 EzySimpleLoginRequest (com.tvd12.ezyfoxserver.request.EzySimpleLoginRequest)13 EzyLoginController (com.tvd12.ezyfoxserver.controller.EzyLoginController)12 EzySimpleSettings (com.tvd12.ezyfoxserver.setting.EzySimpleSettings)11 EzySendResponseImpl (com.tvd12.ezyfoxserver.command.impl.EzySendResponseImpl)8 EzyHandshakeController (com.tvd12.ezyfoxserver.controller.EzyHandshakeController)8 EzyHandshakeParams (com.tvd12.ezyfoxserver.request.EzyHandshakeParams)8 EzySimpleResponse (com.tvd12.ezyfoxserver.response.EzySimpleResponse)8 GreetResponse (com.tvd12.ezyfoxserver.support.test.data.GreetResponse)8 BaseCoreTest (com.tvd12.ezyfoxserver.testing.BaseCoreTest)8