use of org.kie.server.controller.websocket.common.handlers.WebSocketServiceResponse in project droolsjbpm-integration by kiegroup.
the class WebSocketKieServerClient method getReleaseId.
@Override
public ServiceResponse<ReleaseId> getReleaseId(String containerId) {
CommandScript script = new CommandScript(Collections.singletonList(new GetReleaseIdCommand(containerId)));
ServiceResponse<ReleaseId> response = (ServiceResponse<ReleaseId>) sendCommand(script, new WebSocketServiceResponse(true, (message) -> {
ServiceResponsesList list = WebSocketUtils.unmarshal(message, ServiceResponsesList.class);
return list.getResponses().get(0);
})).getResponses().get(0);
return response;
}
use of org.kie.server.controller.websocket.common.handlers.WebSocketServiceResponse in project droolsjbpm-integration by kiegroup.
the class WebSocketKieServerClient method updateReleaseId.
@Override
public ServiceResponse<ReleaseId> updateReleaseId(String id, ReleaseId releaseId, boolean resetBeforeUpdate) {
CommandScript script = new CommandScript(Collections.singletonList(new UpdateReleaseIdCommand(id, releaseId, resetBeforeUpdate)));
ServiceResponse<ReleaseId> response = (ServiceResponse<ReleaseId>) sendCommandToAllSessions(script, new WebSocketServiceResponse(true, (message) -> {
ServiceResponsesList list = WebSocketUtils.unmarshal(message, ServiceResponsesList.class);
return list.getResponses().get(0);
})).getResponses().get(0);
return response;
}
use of org.kie.server.controller.websocket.common.handlers.WebSocketServiceResponse in project droolsjbpm-integration by kiegroup.
the class WebSocketKieServerClient method updateScanner.
@Override
public ServiceResponse<KieScannerResource> updateScanner(String id, KieScannerResource resource) {
CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new UpdateScannerCommand(id, resource)));
ServiceResponse<KieScannerResource> response = (ServiceResponse<KieScannerResource>) sendCommandToAllSessions(script, new WebSocketServiceResponse(true, (message) -> {
ServiceResponsesList list = WebSocketUtils.unmarshal(message, ServiceResponsesList.class);
return list.getResponses().get(0);
})).getResponses().get(0);
return response;
}
use of org.kie.server.controller.websocket.common.handlers.WebSocketServiceResponse in project droolsjbpm-integration by kiegroup.
the class WebSocketKieServerClient method getServerInfo.
@Override
public ServiceResponse<KieServerInfo> getServerInfo() {
CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new GetServerInfoCommand()));
ServiceResponse<KieServerInfo> response = (ServiceResponse<KieServerInfo>) sendCommand(script, new WebSocketServiceResponse(true, (message) -> {
ServiceResponsesList list = WebSocketUtils.unmarshal(message, ServiceResponsesList.class);
return list.getResponses().get(0);
})).getResponses().get(0);
return response;
}
use of org.kie.server.controller.websocket.common.handlers.WebSocketServiceResponse in project droolsjbpm-integration by kiegroup.
the class WebSocketKieServerClient method listContainers.
@Override
public ServiceResponse<KieContainerResourceList> listContainers(KieContainerResourceFilter containerFilter) {
CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new ListContainersCommand(containerFilter)));
ServiceResponse<KieContainerResourceList> response = (ServiceResponse<KieContainerResourceList>) sendCommand(script, new WebSocketServiceResponse(true, (message) -> {
ServiceResponsesList list = WebSocketUtils.unmarshal(message, ServiceResponsesList.class);
return list.getResponses().get(0);
})).getResponses().get(0);
return response;
}
Aggregations