List<ServiceResponse<? extends Object>> responses = new ArrayList<ServiceResponse<? extends Object>>(); for (KieServerCommand command : commands.getCommands()) { if (!(command instanceof DescriptorCommand)) { logger.warn("Unsupported command '{}' given, will not process it", command.getClass().getName());
@Override public String onMessage(String message) { CommandScript script = deserialize(message, CommandScript.class); String capability = TARGET_CAPABILITY; boolean hasBPMCommand = script.getCommands().stream().anyMatch(cmd -> cmd instanceof DescriptorCommand); if (hasBPMCommand) { capability = KieServerConstants.CAPABILITY_BPM; } KieContainerCommandService<?> executor = null; for (KieServerExtension extension : context.getServerExtensions()) { KieContainerCommandService<?> tmp = extension.getAppComponents(KieContainerCommandService.class); if (tmp != null && extension.getImplementedCapability().equalsIgnoreCase(capability)) { executor = tmp; logger.debug("Extension {} returned command executor {} with capability {}", extension, executor, extension.getImplementedCapability()); break; } } if (executor == null) { throw new IllegalStateException("No executor found for script execution"); } // 4. process request ServiceResponsesList response = executor.executeScript(script, MarshallingFormat.JSON, null); String reply = serialize(response); return reply; }
List<ServiceResponse<? extends Object>> responses = new ArrayList<ServiceResponse<? extends Object>>(); for (KieServerCommand command : commands.getCommands()) { if (!(command instanceof DescriptorCommand)) { LOG.warn("Unsupported command '{}' given, will not process it", command.getClass().getName());
List<ServiceResponse<? extends Object>> responses = new ArrayList<ServiceResponse<? extends Object>>(); for (KieServerCommand command : commands.getCommands()) { if (!(command instanceof DescriptorCommand)) { logger.warn("Unsupported command '{}' given, will not process it", command.getClass().getName());
List<ServiceResponse<? extends Object>> responses = new ArrayList<ServiceResponse<? extends Object>>(); for (KieServerCommand command : commands.getCommands()) { if (!(command instanceof DescriptorCommand)) { logger.warn("Unsupported command '{}' given, will not process it", command.getClass().getName());
public static Object wrapSkipPrimitives(Object object) { if (object == null) { return null; } if (object instanceof List) { return new JaxbList((List) object); } else if (object instanceof Map) { return new JaxbMap((Map) object); } else if (object instanceof Date) { return new JaxbDate((Date) object); } else if (object instanceof CommandScript) { for (KieServerCommand cmd : ((CommandScript) object).getCommands()) { if (cmd instanceof DescriptorCommand) { List<Object> arguments = new ArrayList<Object>(); for (Object o : ((DescriptorCommand) cmd).getArguments()) { arguments.add(wrap(o)); } ((DescriptorCommand) cmd).setArguments(arguments); } } } return object; }
List<ServiceResponse<? extends Object>> responses = new ArrayList<ServiceResponse<? extends Object>>(); for (KieServerCommand command : commands.getCommands()) { if (!(command instanceof DescriptorCommand)) { logger.warn("Unsupported command '{}' given, will not process it", command.getClass().getName());
public ServiceResponsesList executeScript(CommandScript commands) { List<ServiceResponse<? extends Object>> responses = new ArrayList<ServiceResponse<? extends Object>>(); if( commands != null ) { for (KieServerCommand command : commands.getCommands()) { if (command instanceof CreateContainerCommand) { responses.add(createContainer(((CreateContainerCommand) command).getContainer().getContainerId(), ((CreateContainerCommand) command).getContainer())); } else if (command instanceof GetServerInfoCommand) { responses.add(getInfo()); } else if (command instanceof ListContainersCommand) { responses.add(listContainers()); } else if (command instanceof CallContainerCommand) { responses.add(callContainer(((CallContainerCommand) command).getContainerId(), ((CallContainerCommand) command).getPayload())); } else if (command instanceof DisposeContainerCommand) { responses.add(disposeContainer(((DisposeContainerCommand) command).getContainerId())); } else if (command instanceof GetContainerInfoCommand ) { responses.add(getContainerInfo(((GetContainerInfoCommand) command).getContainerId())); } else if (command instanceof GetScannerInfoCommand ) { responses.add(getScannerInfo(((GetScannerInfoCommand) command).getContainerId())); } else if (command instanceof UpdateScannerCommand ) { responses.add(updateScanner(((UpdateScannerCommand) command).getContainerId(), ((UpdateScannerCommand) command).getScanner())); } else if (command instanceof UpdateReleaseIdCommand ) { responses.add(updateContainerReleaseId(((UpdateReleaseIdCommand) command).getContainerId(), ((UpdateReleaseIdCommand) command).getReleaseId())); } } } return new ServiceResponsesList(responses); }
List<ServiceResponse<? extends Object>> responses = new ArrayList<ServiceResponse<? extends Object>>(); if( commands != null ) { for (KieServerCommand command : commands.getCommands()) { if (command instanceof CreateContainerCommand) { ServiceResponse<?> forbidden = this.kieServer.checkAccessability();
List<ServiceResponse<?>> responses = new ArrayList<>(); for (KieServerCommand command : commands.getCommands()) { try { ServiceResponse<?> response;