congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
KieServerControllerIllegalArgumentException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.kie.server.controller.api.KieServerControllerIllegalArgumentException
constructor

Best Java code snippets using org.kie.server.controller.api.KieServerControllerIllegalArgumentException.<init> (Showing top 20 results out of 315)

origin: org.kie.server/kie-server-controller-impl

protected KieServicesClient getClient(final String url) {
  KieServicesClientProvider clientProvider = clientProviders.stream().filter(provider -> provider.supports(url)).findFirst().orElseThrow(() -> new KieServerControllerIllegalArgumentException("Kie Services Client Provider not found for url: " + url));
  logger.debug("Using client provider {}", clientProvider);
  KieServicesClient client = clientProvider.get(url);
  logger.debug("Using client {}", client);
  if(client == null){
    throw new KieServerControllerIllegalArgumentException("Kie Services Client not found for url: " + url);
  }
  return client;
}
origin: org.kie.server/kie-server-controller-impl

protected ServerTemplate getServerTemplate(final String serverTemplateId){
  final ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  return serverTemplate;
}
origin: org.kie.server/kie-server-controller-impl

@Override
public ServerTemplate getServerTemplate(String serverTemplateId) {
  final ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  return serverTemplate;
}
origin: org.kie.server/kie-server-controller-impl

@Override
public ContainerSpec getContainerInfo(String serverTemplateId,
                   String containerId) {
  final ServerTemplate serverTemplate = getServerTemplate(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  final ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerId);
  if (containerSpec == null) {
    throw new KieServerControllerIllegalArgumentException("Server template " + serverTemplateId + " does not have container with id " + containerId);
  }
  return containerSpec;
}
origin: org.kie.server/kie-server-controller-impl

@Override
public ContainerSpecList listContainerSpec(String serverTemplateId) {
  ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  return new ContainerSpecList(serverTemplate.getContainersSpec());
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void copyServerTemplate(String serverTemplateId,
                      String newServerTemplateId,
                      String newServerTemplateName) {
  final ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  final Map<Capability, ServerConfig> configMap = new HashMap<Capability, ServerConfig>(serverTemplate.getConfigs().size());
  for (final Map.Entry<Capability, ServerConfig> entry : serverTemplate.getConfigs().entrySet()) {
    configMap.put(entry.getKey(), copy(entry.getValue()));
  }
  final Collection<ContainerSpec> containerSpecs = new ArrayList<ContainerSpec>(serverTemplate.getContainersSpec().size());
  for (final ContainerSpec entry : serverTemplate.getContainersSpec()) {
    containerSpecs.add(copy(entry, newServerTemplateId, newServerTemplateName));
  }
  final ServerTemplate copy = new ServerTemplate(newServerTemplateId,
                          newServerTemplateName,
                          serverTemplate.getCapabilities(),
                          configMap,
                          containerSpecs);
  templateStorage.store(copy);
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void deleteServerTemplate(String serverTemplateId) {
  if (!templateStorage.exists(serverTemplateId)) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  templateStorage.delete(serverTemplateId);
  notificationService.notify(new ServerTemplateDeleted(serverTemplateId));
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void deleteContainerSpec(String serverTemplateId,
                       String containerSpecId) {
  ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  if (serverTemplate.hasContainerSpec(containerSpecId)) {
    ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecId);
    kieServerInstanceManager.stopContainer(serverTemplate, containerSpec);
    serverTemplate.deleteContainerSpec(containerSpecId);
    templateStorage.update(serverTemplate);
    notificationService.notify(new ServerTemplateUpdated(serverTemplate));
  } else {
    throw new KieServerControllerIllegalArgumentException("Container " + containerSpecId + " not found");
  }
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void updateServerTemplateConfig(String serverTemplateId,
                          Capability capability,
                          ServerConfig serverTemplateConfig) {
  ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  Map<Capability, ServerConfig> configs = serverTemplate.getConfigs();
  configs.put(capability, serverTemplateConfig);
  serverTemplate.setConfigs(configs);
  templateStorage.update(serverTemplate);
  notificationService.notify(new ServerTemplateUpdated(serverTemplate));
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void updateContainerConfig(final String serverTemplateId,
                        final String containerSpecId,
                        final Capability capability,
                        final ContainerConfig containerConfig) {
  final ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  final ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecId);
  if (containerSpec == null) {
    throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecId + " within server template with id " + serverTemplateId);
  }
  final List<Container> affectedContainers = updateContainerConfig(capability, containerConfig, serverTemplate, containerSpec);
  if (affectedContainers.isEmpty()) {
    logInfo("Update of container configuration resulted in no changes to containers running on kie-servers");
  }
  affectedContainers.forEach(ac -> {
    logDebug("Container {} on server {} was affected by a change in the scanner", ac.getContainerSpecId(), ac.getServerInstanceKey());
  });
  containerSpec.getConfigs().put(capability, containerConfig);
  templateStorage.update(serverTemplate);
  notificationService.notify(new ServerTemplateUpdated(serverTemplate));
}
origin: org.kie.server/kie-server-controller-impl

public ContainerList getServerTemplateContainers(final String serverTemplateId,
                          final String containerSpecId) {
  final ServerTemplate serverTemplate = getServerTemplate(serverTemplateId);
  if (serverTemplate.hasContainerSpec(containerSpecId) == false) {
    throw new KieServerControllerIllegalArgumentException("Server template with id " + serverTemplateId + " has no container with id " + containerSpecId);
  }
  final ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecId);
  Collection<Container> containers = kieServerInstanceManager.getContainers(serverTemplate,
                                       containerSpec);
  return new ContainerList(containers);
}
origin: org.kie.server/kie-server-controller-impl

public ContainerList getServerInstanceContainers(final String serverTemplateId,
                          final String serverInstanceId) {
  final ServerTemplate serverTemplate = getServerTemplate(serverTemplateId);
  if (serverTemplate.hasServerInstanceId(serverInstanceId) == false) {
    throw new KieServerControllerIllegalArgumentException("Server template with id " + serverTemplateId + " has no instance with id " + serverInstanceId);
  }
  final ServerInstanceKey serverInstanceKey = serverTemplate.getServerInstance(serverInstanceId);
  Collection<Container> containers = kieServerInstanceManager.getContainers(serverInstanceKey);
  return new ContainerList(containers);
}
origin: org.kie.server/kie-server-controller-impl

@Override
public void scanNow(final ContainerSpecKey containerSpecKey) {
  ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId());
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId());
  }
  ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId());
  if (containerSpec == null) {
    throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId());
  }
  List<Container> containers = kieServerInstanceManager.scanNow(serverTemplate,
                                 containerSpec);
  notificationService.notify(serverTemplate,
                containerSpec,
                containers);
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void deactivateContainer(ContainerSpecKey containerSpecKey) {
  ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId());
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId());
  }
  ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId());
  if (containerSpec == null) {
    throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId() + " within server template with id " + serverTemplate.getId());
  }
  if (!containerSpec.getStatus().equals(KieContainerStatus.STARTED)) {
    throw new KieServerControllerIllegalArgumentException("Container " + containerSpecKey.getId()
                                + " cannot be deactivated because it's not in started state, actual state " + containerSpec.getStatus());
  }
  containerSpec.setStatus(KieContainerStatus.DEACTIVATED);
  templateStorage.update(serverTemplate);
  List<Container> containers = kieServerInstanceManager.deactivateContainer(serverTemplate, containerSpec);
  notificationService.notify(serverTemplate, containerSpec, containers);
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void activateContainer(ContainerSpecKey containerSpecKey) {
  ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId());
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId());
  }
  final ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId());
  if (containerSpec == null) {
    throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId()
                                + " within server template with id " + serverTemplate.getId());
  }
  if (!containerSpec.getStatus().equals(KieContainerStatus.DEACTIVATED)) {
    throw new KieServerControllerIllegalArgumentException("Container " + containerSpecKey.getId()
                                + " cannot be activated because it's not in deactivated state, actual state " + containerSpec.getStatus());
  }
  containerSpec.setStatus(KieContainerStatus.STARTED);
  templateStorage.update(serverTemplate);
  List<Container> containers = kieServerInstanceManager.activateContainer(serverTemplate, containerSpec);
  notificationService.notify(serverTemplate, containerSpec, containers);
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void stopContainer(ContainerSpecKey containerSpecKey) {
  ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId());
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId());
  }
  ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId());
  if (containerSpec == null) {
    throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId() + " within server template with id " + serverTemplate.getId());
  }
  containerSpec.setStatus(KieContainerStatus.STOPPED);
  templateStorage.update(serverTemplate);
  List<Container> containers = kieServerInstanceManager.stopContainer(serverTemplate, containerSpec);
  notificationService.notify(serverTemplate, containerSpec, containers);
}

origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void startContainer(ContainerSpecKey containerSpecKey) {
  ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId());
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId());
  }
  final ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId());
  if (containerSpec == null) {
    throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId()
                                + " within server template with id " + serverTemplate.getId());
  }
  containerSpec.setStatus(KieContainerStatus.STARTED);
  templateStorage.update(serverTemplate);
  List<Container> containers = kieServerInstanceManager.startContainer(serverTemplate, containerSpec);
  notificationService.notify(serverTemplate, containerSpec, containers);
}
origin: org.kie.server/kie-server-controller-impl

@Override
public void startScanner(final ContainerSpecKey containerSpecKey,
             final Long interval) {
  ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId());
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId());
  }
  ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId());
  if (containerSpec == null) {
    throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId());
  }
  ContainerConfig containerConfig = containerSpec.getConfigs().get(Capability.RULE);
  if (containerConfig == null) {
    containerConfig = new RuleConfig();
    containerSpec.getConfigs().put(Capability.RULE,
                    containerConfig);
  }
  ((RuleConfig) containerConfig).setPollInterval(interval);
  ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.STARTED);
  templateStorage.update(serverTemplate);
  List<Container> containers = kieServerInstanceManager.startScanner(serverTemplate,
                                    containerSpec,
                                    interval);
  notificationService.notify(serverTemplate,
                containerSpec,
                containers);
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void updateContainerSpec(final String serverTemplateId, final String containerId, final ContainerSpec containerSpec) {
  ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  if (!containerSpec.getId().equals(containerId)) {
    throw new KieServerControllerException("Cannot update container " + containerSpec.getId() + " on container " + containerId);
  }
  if (!serverTemplate.hasContainerSpec(containerSpec.getId())) {
    throw new KieServerControllerIllegalArgumentException("Server template with id " + serverTemplateId + " has no container with id " + containerSpec.getId());
  }
  if (!serverTemplate.hasMatchingId(containerSpec.getServerTemplateKey())) {
    throw new KieServerControllerException("Cannot change container template key during update.");
  }
  // make sure correct server template is set
  containerSpec.setServerTemplateKey(new ServerTemplateKey(serverTemplate.getId(), serverTemplate.getName()));
  ContainerSpec currentVersion = serverTemplate.getContainerSpec(containerSpec.getId());
  serverTemplate.deleteContainerSpec(currentVersion.getId());
  serverTemplate.addContainerSpec(containerSpec);
  templateStorage.update(serverTemplate);
  notificationService.notify(new ServerTemplateUpdated(serverTemplate));
  // in case container was started before it was update or update comes with status started update container in running servers
  if (currentVersion.getStatus().equals(KieContainerStatus.STARTED) || containerSpec.getStatus().equals(KieContainerStatus.STARTED)) {
    List<Container> containers = kieServerInstanceManager.upgradeAndStartContainer(serverTemplate, containerSpec);
    notificationService.notify(serverTemplate, containerSpec, containers);
  }
}
origin: org.kie.server/kie-server-controller-impl

@Override
public synchronized void saveContainerSpec(String serverTemplateId,
                      ContainerSpec containerSpec) {
  ServerTemplate serverTemplate = templateStorage.load(serverTemplateId);
  if (serverTemplate == null) {
    throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId);
  }
  if (serverTemplate.hasContainerSpec(containerSpec.getId())) {
    throw new KieServerControllerException("Server template with id " + serverTemplateId + " associated already with container " + containerSpec.getId());
  }
  // make sure correct server template is set
  containerSpec.setServerTemplateKey(new ServerTemplateKey(serverTemplate.getId(), serverTemplate.getName()));
  serverTemplate.addContainerSpec(containerSpec);
  templateStorage.update(serverTemplate);
  notificationService.notify(new ServerTemplateUpdated(serverTemplate));
  if (containerSpec.getStatus().equals(KieContainerStatus.STARTED)) {
    List<Container> containers = kieServerInstanceManager.startContainer(serverTemplate, containerSpec);
    notificationService.notify(serverTemplate, containerSpec, containers);
  }
}
org.kie.server.controller.apiKieServerControllerIllegalArgumentException<init>

Popular methods of KieServerControllerIllegalArgumentException

  • getMessage

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JFrame (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now