Search in sources :

Example 6 with EzyData

use of com.tvd12.ezyfox.entity.EzyData 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 7 with EzyData

use of com.tvd12.ezyfox.entity.EzyData 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)

Example 8 with EzyData

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

the class EzyPluginSendResponseImpl method newResponse.

protected EzyResponse newResponse(EzyData data) {
    EzyPluginSetting setting = context.getPlugin().getSetting();
    EzyRequestPluginResponseParams params = newResponseParams();
    params.setPluginId(setting.getId());
    params.setData(data);
    return new EzyRequestPluginResponse(params);
}
Also used : EzyRequestPluginResponseParams(com.tvd12.ezyfoxserver.response.EzyRequestPluginResponseParams) EzyRequestPluginResponse(com.tvd12.ezyfoxserver.response.EzyRequestPluginResponse) EzyPluginSetting(com.tvd12.ezyfoxserver.setting.EzyPluginSetting)

Example 9 with EzyData

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

the class EzyAbstractArrayResponse method getResponseData.

@Override
protected EzyData getResponseData() {
    EzyArray array = data != null ? marshaller.marshal(data) : newArrayBuilder().build();
    if (additionalParams != null) {
        for (Object object : additionalParams) {
            Object value = marshaller.marshal(object);
            array.add(value);
        }
    }
    return array;
}
Also used : EzyArray(com.tvd12.ezyfox.entity.EzyArray)

Example 10 with EzyData

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

the class EzyAbstractObjectResponse method getResponseData.

@Override
protected EzyData getResponseData() {
    EzyObject object = data != null ? marshaller.marshal(data) : newObjectBuilder().build();
    if (additionalParams != null) {
        for (Map.Entry<Object, Object> e : additionalParams.entrySet()) {
            Object skey = marshaller.marshal(e.getKey());
            Object svalue = marshaller.marshal(e.getValue());
            object.put(skey, svalue);
        }
    }
    if (excludeParamKeys != null) {
        object.removeAll(excludeParamKeys);
    }
    return object;
}
Also used : EzyObject(com.tvd12.ezyfox.entity.EzyObject) EzyObject(com.tvd12.ezyfox.entity.EzyObject) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

EzyData (com.tvd12.ezyfox.entity.EzyData)12 BaseTest (com.tvd12.test.base.BaseTest)7 Test (org.testng.annotations.Test)7 EzyArray (com.tvd12.ezyfox.entity.EzyArray)4 EzyResponse (com.tvd12.ezyfoxserver.response.EzyResponse)4 EzyApp (com.tvd12.ezyfoxserver.client.entity.EzyApp)3 EzyData (com.tvd12.ezyfoxserver.client.entity.EzyData)3 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)3 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)3 EzyAbstractSession (com.tvd12.ezyfoxserver.entity.EzyAbstractSession)3 EzySimpleAppSetting (com.tvd12.ezyfoxserver.setting.EzySimpleAppSetting)3 EzyBadRequestException (com.tvd12.ezyfox.core.exception.EzyBadRequestException)2 EzyObject (com.tvd12.ezyfox.entity.EzyObject)2 EzySimpleZone (com.tvd12.ezyfoxserver.EzySimpleZone)2 EzyClient (com.tvd12.ezyfoxserver.client.EzyClient)2 EzyClients (com.tvd12.ezyfoxserver.client.EzyClients)2 EzyUTClient (com.tvd12.ezyfoxserver.client.EzyUTClient)2 EzyClientConfig (com.tvd12.ezyfoxserver.client.config.EzyClientConfig)2 EzyAppSetup (com.tvd12.ezyfoxserver.client.setup.EzyAppSetup)2 EzySetup (com.tvd12.ezyfoxserver.client.setup.EzySetup)2