@Override public ServiceResponse<KieScannerResource> updateScanner(String id, KieScannerResource resource) { if( config.isRest() ) { return makeHttpPostRequestAndCreateServiceResponse( baseURI + "/containers/" + id + "/scanner", resource, KieScannerResource.class ); } else { CommandScript script = new CommandScript( Collections.singletonList( (KieServerCommand) new UpdateScannerCommand( id, resource ) ) ); return (ServiceResponse<KieScannerResource>) executeJmsCommand( script ).getResponses().get( 0 ); } }
@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; }
@Override public ServiceResponse<KieScannerResource> updateScanner(String id, KieScannerResource resource) { if (config.isRest()) { return makeHttpPostRequestAndCreateServiceResponse( loadBalancer.getUrl() + "/containers/" + id + "/scanner", resource, KieScannerResource.class ); } else { CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new UpdateScannerCommand(id, resource))); ServiceResponse<KieScannerResource> response = (ServiceResponse<KieScannerResource>) executeJmsCommand(script, null, null, id).getResponses().get(0); return getResponseOrNullIfNoResponse(response); } }