Search in sources :

Example 1 with EzyPluginInfoParams

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

the class EzyPluginInfoController method handle.

@Override
public void handle(EzyServerContext ctx, EzyPluginInfoRequest request) {
    EzyUser user = request.getUser();
    EzySession session = request.getSession();
    EzyPluginInfoParams params = request.getParams();
    EzyZoneContext zoneCtx = ctx.getZoneContext(user.getZoneId());
    EzyPluginContext pluginCtx = zoneCtx.getPluginContext(params.getPluginName());
    if (pluginCtx != null) {
        EzyPluginSetting setting = pluginCtx.getPlugin().getSetting();
        EzyResponse response = newPluginInfoResponse(setting);
        ctx.send(response, session, false);
    }
}
Also used : EzyUser(com.tvd12.ezyfoxserver.entity.EzyUser) EzyZoneContext(com.tvd12.ezyfoxserver.context.EzyZoneContext) EzyPluginInfoParams(com.tvd12.ezyfoxserver.request.EzyPluginInfoParams) EzyPluginContext(com.tvd12.ezyfoxserver.context.EzyPluginContext) EzyResponse(com.tvd12.ezyfoxserver.response.EzyResponse) EzySession(com.tvd12.ezyfoxserver.entity.EzySession) EzyPluginSetting(com.tvd12.ezyfoxserver.setting.EzyPluginSetting)

Example 2 with EzyPluginInfoParams

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

the class EzyPluginInfoResponseTest method test.

@Test
public void test() {
    EzySimplePluginSetting setting = new EzySimplePluginSetting();
    setting.setName("test");
    EzyPluginInfoParams params = new EzyPluginInfoParams();
    params.setPlugin(setting);
    assert params.getPlugin() == setting;
    EzyPluginInfoResponse response = new EzyPluginInfoResponse(params);
    assert response.getParams() == params;
    response.serialize();
    response.release();
}
Also used : EzyPluginInfoResponse(com.tvd12.ezyfoxserver.response.EzyPluginInfoResponse) EzyPluginInfoParams(com.tvd12.ezyfoxserver.response.EzyPluginInfoParams) EzySimplePluginSetting(com.tvd12.ezyfoxserver.setting.EzySimplePluginSetting) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Aggregations

EzyPluginContext (com.tvd12.ezyfoxserver.context.EzyPluginContext)1 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)1 EzySession (com.tvd12.ezyfoxserver.entity.EzySession)1 EzyUser (com.tvd12.ezyfoxserver.entity.EzyUser)1 EzyPluginInfoParams (com.tvd12.ezyfoxserver.request.EzyPluginInfoParams)1 EzyPluginInfoParams (com.tvd12.ezyfoxserver.response.EzyPluginInfoParams)1 EzyPluginInfoResponse (com.tvd12.ezyfoxserver.response.EzyPluginInfoResponse)1 EzyResponse (com.tvd12.ezyfoxserver.response.EzyResponse)1 EzyPluginSetting (com.tvd12.ezyfoxserver.setting.EzyPluginSetting)1 EzySimplePluginSetting (com.tvd12.ezyfoxserver.setting.EzySimplePluginSetting)1 BaseTest (com.tvd12.test.base.BaseTest)1 Test (org.testng.annotations.Test)1