Search in sources :

Example 1 with EzyStreamingRequest

use of com.tvd12.ezyfoxserver.request.EzyStreamingRequest in project ezyfox-server by youngmonkeys.

the class EzyRawBytesInterceptorTest method test2.

@Test(expectedExceptions = EzyNotAuthorizedException.class)
public void test2() throws Exception {
    EzyRawBytesInterceptor interceptor = new EzyRawBytesInterceptor();
    EzyServerContext serverContext = mock(EzyServerContext.class);
    EzyStreamingRequest request = new EzySimpleStreamingRequest();
    interceptor.intercept(serverContext, request);
}
Also used : EzySimpleStreamingRequest(com.tvd12.ezyfoxserver.request.EzySimpleStreamingRequest) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzyRawBytesInterceptor(com.tvd12.ezyfoxserver.interceptor.EzyRawBytesInterceptor) EzyStreamingRequest(com.tvd12.ezyfoxserver.request.EzyStreamingRequest) Test(org.testng.annotations.Test)

Example 2 with EzyStreamingRequest

use of com.tvd12.ezyfoxserver.request.EzyStreamingRequest in project ezyfox-server by youngmonkeys.

the class EzySimpleDataHandler method doHandleReceivedStreaming.

@SuppressWarnings({ "rawtypes", "unchecked" })
protected void doHandleReceivedStreaming(byte[] bytes) {
    try {
        EzyStreamingRequest request = newStreamingRequest(bytes);
        try {
            EzyInterceptor interceptor = controllers.getStreamingInterceptor();
            interceptor.intercept(context, request);
            EzyStreamingController controller = controllers.getStreamingController();
            controller.handle(zoneContext, request);
        } finally {
            request.release();
        }
    } catch (Throwable e) {
        context.handleException(Thread.currentThread(), e);
    }
}
Also used : EzyInterceptor(com.tvd12.ezyfoxserver.interceptor.EzyInterceptor) EzyStreamingController(com.tvd12.ezyfoxserver.controller.EzyStreamingController) EzyStreamingRequest(com.tvd12.ezyfoxserver.request.EzyStreamingRequest)

Example 3 with EzyStreamingRequest

use of com.tvd12.ezyfoxserver.request.EzyStreamingRequest in project ezyfox-server by youngmonkeys.

the class EzyUserDataHandler method newStreamingRequest.

protected EzyStreamingRequest newStreamingRequest(byte[] bytes) {
    EzySimpleStreamingRequest request = new EzySimpleStreamingRequest();
    request.setUser(user);
    request.setSession(session);
    request.setBytes(bytes);
    return request;
}
Also used : EzySimpleStreamingRequest(com.tvd12.ezyfoxserver.request.EzySimpleStreamingRequest)

Example 4 with EzyStreamingRequest

use of com.tvd12.ezyfoxserver.request.EzyStreamingRequest in project ezyfox-server by youngmonkeys.

the class EzySimpleStreamingController method handle.

@Override
public void handle(EzyZoneContext ctx, EzyStreamingRequest request) {
    EzyStreamingEvent event = new EzySimpleStreamingEvent(request.getUser(), request.getSession(), request.getBytes());
    ctx.handleEvent(EzyEventType.STREAMING, event);
}
Also used : EzySimpleStreamingEvent(com.tvd12.ezyfoxserver.event.EzySimpleStreamingEvent) EzyStreamingEvent(com.tvd12.ezyfoxserver.event.EzyStreamingEvent)

Aggregations

EzySimpleStreamingRequest (com.tvd12.ezyfoxserver.request.EzySimpleStreamingRequest)2 EzyStreamingRequest (com.tvd12.ezyfoxserver.request.EzyStreamingRequest)2 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)1 EzyStreamingController (com.tvd12.ezyfoxserver.controller.EzyStreamingController)1 EzySimpleStreamingEvent (com.tvd12.ezyfoxserver.event.EzySimpleStreamingEvent)1 EzyStreamingEvent (com.tvd12.ezyfoxserver.event.EzyStreamingEvent)1 EzyInterceptor (com.tvd12.ezyfoxserver.interceptor.EzyInterceptor)1 EzyRawBytesInterceptor (com.tvd12.ezyfoxserver.interceptor.EzyRawBytesInterceptor)1 Test (org.testng.annotations.Test)1