@Override public ServiceResponse<KieContainerResource> createContainer(String id, KieContainerResource resource) { if( config.isRest() ) { return makeHttpPutRequestAndCreateServiceResponse( baseURI + "/containers/" + id, resource, KieContainerResource.class ); } else { CommandScript script = new CommandScript( Collections.singletonList( (KieServerCommand) new CreateContainerCommand( resource ) ) ); return (ServiceResponse<KieContainerResource>) executeJmsCommand( script ).getResponses().get( 0 ); } }
@Override public ServiceResponse<KieContainerResource> createContainer(String id, KieContainerResource resource) { CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new CreateContainerCommand(resource))); ServiceResponse<KieContainerResource> response = (ServiceResponse<KieContainerResource>) sendCommandToAllSessions(script, new WebSocketServiceResponse(true, (message) -> { ServiceResponsesList list = WebSocketUtils.unmarshal(message, ServiceResponsesList.class); return list.getResponses().get(0); })).getResponses().get(0); return response; }
@Override public ServiceResponse<KieContainerResource> createContainer(String id, KieContainerResource resource) { if( config.isRest() ) { return makeHttpPutRequestAndCreateServiceResponse( loadBalancer.getUrl() + "/containers/" + id, resource, KieContainerResource.class ); } else { CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new CreateContainerCommand(resource))); ServiceResponse<KieContainerResource> response = (ServiceResponse<KieContainerResource>) executeJmsCommand(script, null, null, id).getResponses().get(0); return getResponseOrNullIfNoResponse(response); } }