Tabnine Logo
IllegalUpdateException
Code IndexAdd Tabnine to your IDE (free)

How to use
IllegalUpdateException
in
com.foilen.infra.plugin.v1.core.exception

Best Java code snippets using com.foilen.infra.plugin.v1.core.exception.IllegalUpdateException (Showing top 20 results out of 315)

origin: com.foilen/foilen-infra-plugin-core

public void resourceRefresh(Long resourceId) {
  if (resourceId == null) {
    throw new IllegalUpdateException("Cannot delete a resource without id");
  }
  if (!resourcesToRefresh.contains(resourceId)) {
    resourcesToRefresh.add(resourceId);
  }
}
origin: com.foilen/foilen-infra-plugins-core

private void validate(MariaDBDatabase resource) {
  if (blacklisted.contains(resource.getName().toLowerCase())) {
    throw new IllegalUpdateException("That database name is blacklisted");
  }
}
origin: com.foilen/foilen-infra-plugins-core

private void validate(MariaDBUser resource) {
  if (blacklisted.contains(resource.getName().toLowerCase())) {
    throw new IllegalUpdateException("That user name is blacklisted");
  }
}
origin: com.foilen/foilen-infra-plugin-core

public void resourceUpdate(Long resourceId, IPResource updatedResource) {
  if (resourceId == null) {
    throw new IllegalUpdateException("Cannot modify a resource without id");
  }
  // Remove previous update
  resourcesToUpdate.removeIf(it -> it.getA() == resourceId);
  resourcesToDelete.removeIf(it -> it == resourceId);
  resourcesToRefresh.removeIf(it -> it == resourceId);
  resourcesToUpdate.add(new Tuple2<>(resourceId, updatedResource));
}
origin: com.foilen/foilen-infra-plugins-core

throw new IllegalUpdateException("Can only use a single certificate");
throw new IllegalUpdateException("Can only use a single database server");
throw new IllegalUpdateException("Can only use a single database");
throw new IllegalUpdateException("Can only use a single database user");
throw new IllegalUpdateException("Can only use a single unix user");
MariaDBUser mariaDBUser = mariaDBUsers.get(0);
if (!resourceService.linkExistsByFromResourceAndLinkTypeAndToResource(mariaDBDatabase, LinkTypeConstants.INSTALLED_ON, mariaDBServer)) {
  throw new IllegalUpdateException("The database is not installed on the database server");
  throw new IllegalUpdateException("The database user is not an ADMIN on the database");
  throw new IllegalUpdateException("The database user is not a READER on the database");
  throw new IllegalUpdateException("The database user is not a WRITER on the database");
origin: com.foilen/foilen-infra-resource-infraconfig

throw new IllegalUpdateException("Can only use a single certificate");
throw new IllegalUpdateException("Can only use a single database server");
throw new IllegalUpdateException("Can only use a single database");
throw new IllegalUpdateException("Can only use a single database user");
throw new IllegalUpdateException("Can only use a single unix user");
MariaDBUser mariaDBUser = mariaDBUsers.get(0);
if (!resourceService.linkExistsByFromResourceAndLinkTypeAndToResource(mariaDBDatabase, LinkTypeConstants.INSTALLED_ON, mariaDBServer)) {
  throw new IllegalUpdateException("The database is not installed on the database server");
  throw new IllegalUpdateException("The database user is not an ADMIN on the database");
  throw new IllegalUpdateException("The database user is not a READER on the database");
  throw new IllegalUpdateException("The database user is not a WRITER on the database");
origin: com.foilen/foilen-infra-plugin-core

public void resourceDelete(Long resourceId) {
  if (resourceId == null) {
    throw new IllegalUpdateException("Cannot delete a resource without id");
  }
  resourcesToDelete.add(resourceId);
  // Remove in add and update
  Optional<IPResource> resourceOptional = resourceService.resourceFind(resourceId);
  if (resourceOptional.isPresent()) {
    IPResource resource = resourceOptional.get();
    resourcesToAdd.removeIf(it -> resourceService.resourceEqualsPk(resource, it));
  }
  resourcesToUpdate.removeIf(it -> it.getA() == resourceId);
}
origin: com.foilen/foilen-infra-plugins-core

private void checkUniqueName(CommonServicesContext services, String name) {
  IPResourceService resourceService = services.getResourceService();
  List<UnixUser> unixUsers = resourceService.resourceFindAll(resourceService.createResourceQuery(UnixUser.class) //
      .propertyEquals(UnixUser.PROPERTY_NAME, name));
  if (unixUsers.size() > 1) {
    throw new IllegalUpdateException("Unix User name " + name + " is already used");
  }
}
origin: com.foilen/foilen-infra-resource-unixuser

private void checkUniqueName(CommonServicesContext services, String name) {
  IPResourceService resourceService = services.getResourceService();
  List<UnixUser> unixUsers = resourceService.resourceFindAll(resourceService.createResourceQuery(UnixUser.class) //
      .propertyEquals(UnixUser.PROPERTY_NAME, name));
  if (unixUsers.size() > 1) {
    throw new IllegalUpdateException("Unix User name " + name + " is already used");
  }
}
origin: com.foilen/foilen-infra-plugins-core

@Override
protected void commonHandlerExecute(CommonServicesContext services, ChangesContext changes, CommonMethodUpdateEventHandlerContext<EmailDomain> context) {
  EmailDomain emailDomain = context.getResource();
  // Ensure all account names are unique per account and per redirection (can be shared)
  Set<String> accountNames = new HashSet<>();
  services.getResourceService().linkFindAllByFromResourceClassAndLinkTypeAndToResource(EmailAccount.class, LinkTypeConstants.INSTALLED_ON, emailDomain).forEach(account -> {
    if (!accountNames.add(account.getAccountName())) {
      throw new IllegalUpdateException("The email account [" + account.getAccountName() + "@" + emailDomain.getDomainName() + "] exists multiple times");
    }
  });
  accountNames.clear();
  services.getResourceService().linkFindAllByFromResourceClassAndLinkTypeAndToResource(EmailRedirection.class, LinkTypeConstants.INSTALLED_ON, emailDomain).forEach(redirection -> {
    if (!accountNames.add(redirection.getAccountName())) {
      throw new IllegalUpdateException("The email redirection [" + redirection.getAccountName() + "@" + emailDomain.getDomainName() + "] exists multiple times");
    }
  });
  // Ensure only linked to one EmailServer
  if (services.getResourceService().linkFindAllByFromResourceAndLinkTypeAndToResourceClass(emailDomain, LinkTypeConstants.INSTALLED_ON, EmailServer.class).size() > 1) {
    throw new IllegalUpdateException("The email domain [" + emailDomain.getDomainName() + "] is installed on more than one Email server");
  }
}
origin: com.foilen/foilen-infra-plugins-core

static protected void validate(CommonServicesContext services, DnsEntry dnsEntry) {
  if (!Strings.isNullOrEmpty(dnsEntry.getName())) {
    if (typesWithDomain.contains(dnsEntry.getType()) && !DomainValidator.getInstance().isValid(dnsEntry.getName())) {
      throw new IllegalUpdateException(services.getTranslationService().translate("error.notADomainName"));
    }
    if (strictTypesWithDomain.contains(dnsEntry.getType()) && !startWithLetterValidationRegex.matcher(dnsEntry.getName()).matches()) {
      throw new IllegalUpdateException(services.getTranslationService().translate("error.notStartingWithLetter"));
    }
    if (dnsEntry.getType() == DnsEntryType.A && !validIp(dnsEntry.getDetails())) {
      throw new IllegalUpdateException(services.getTranslationService().translate("error.notAnIp"));
    }
    if (dnsEntry.getName().contains(" ")) {
      throw new IllegalUpdateException(services.getTranslationService().translate("error.notADomainName"));
    }
  }
}
origin: com.foilen/foilen-infra-resource-dns

static protected void validate(CommonServicesContext services, DnsEntry dnsEntry) {
  if (!Strings.isNullOrEmpty(dnsEntry.getName())) {
    if (typesWithDomain.contains(dnsEntry.getType()) && !DomainValidator.getInstance().isValid(dnsEntry.getName())) {
      throw new IllegalUpdateException(services.getTranslationService().translate("error.notADomainName"));
    }
    if (strictTypesWithDomain.contains(dnsEntry.getType()) && !startWithLetterValidationRegex.matcher(dnsEntry.getName()).matches()) {
      throw new IllegalUpdateException(services.getTranslationService().translate("error.notStartingWithLetter"));
    }
    if (dnsEntry.getType() == DnsEntryType.A && !validIp(dnsEntry.getDetails())) {
      throw new IllegalUpdateException(services.getTranslationService().translate("error.notAnIp"));
    }
    if (dnsEntry.getName().contains(" ")) {
      throw new IllegalUpdateException(services.getTranslationService().translate("error.notADomainName"));
    }
  }
}
origin: com.foilen/foilen-infra-plugins-core

@Override
public void attachTo(AttachablePartContext context) {
  // Command
  IPApplicationDefinitionService service = new IPApplicationDefinitionService(name, command);
  service.setWorkingDirectory(workingDirectory);
  // Unix user
  List<UnixUser> unixUsers = context.getServices().getResourceService().linkFindAllByFromResourceAndLinkTypeAndToResourceClass(this, LinkTypeConstants.RUN_AS, UnixUser.class);
  if (unixUsers.size() > 1) {
    throw new IllegalUpdateException("Must have a singe unix user to run as. Got " + unixUsers.size());
  }
  if (!unixUsers.isEmpty()) {
    service.setRunAs(unixUsers.get(0).getId());
  }
  context.getApplicationDefinition().getServices().add(service);
}
origin: com.foilen/foilen-infra-plugins-core

@Override
public void attachTo(AttachablePartContext context) {
  // Get the MongoDBServer (fail if more than one)
  CommonServicesContext services = context.getServices();
  List<MongoDBServer> servers = services.getResourceService().linkFindAllByFromResourceAndLinkTypeAndToResourceClass(this, LinkTypeConstants.POINTS_TO, MongoDBServer.class);
  if (servers.size() > 1) {
    throw new IllegalUpdateException("There cannot be more than 1 MongoDB Server. Has " + servers.size());
  }
  if (servers.isEmpty()) {
    return;
  }
  MongoDBServer server = servers.get(0);
  // Get the Machines on the MongoDBServer
  List<Machine> machines = services.getResourceService().linkFindAllByFromResourceAndLinkTypeAndToResourceClass(server, LinkTypeConstants.INSTALLED_ON, Machine.class);
  if (machines.isEmpty()) {
    return;
  }
  // Add the infra on the Application
  Machine machine = machines.get(0);
  context.getApplicationDefinition().addPortRedirect(localPort, machine.getName(), server.getName(), "MONGODB_TCP");
}
origin: com.foilen/foilen-infra-plugins-core

@Override
public void attachTo(AttachablePartContext context) {
  // Get the PostgreSqlServer (fail if more than one)
  CommonServicesContext services = context.getServices();
  List<PostgreSqlServer> servers = services.getResourceService().linkFindAllByFromResourceAndLinkTypeAndToResourceClass(this, LinkTypeConstants.POINTS_TO, PostgreSqlServer.class);
  if (servers.size() > 1) {
    throw new IllegalUpdateException("There cannot be more than 1 PostgreSql Server. Has " + servers.size());
  }
  if (servers.isEmpty()) {
    return;
  }
  PostgreSqlServer server = servers.get(0);
  // Get the Machines on the PostgreSqlServer
  List<Machine> machines = services.getResourceService().linkFindAllByFromResourceAndLinkTypeAndToResourceClass(server, LinkTypeConstants.INSTALLED_ON, Machine.class);
  if (machines.isEmpty()) {
    return;
  }
  // Add the infra on the Application
  Machine machine = machines.get(0);
  context.getApplicationDefinition().addPortRedirect(localPort, machine.getName(), server.getName(), "POSTGRESQL_TCP");
}
origin: com.foilen/foilen-infra-plugins-core

@Override
public void attachTo(AttachablePartContext context) {
  // Get the MariaDBServer (fail if more than one)
  CommonServicesContext services = context.getServices();
  List<MariaDBServer> servers = services.getResourceService().linkFindAllByFromResourceAndLinkTypeAndToResourceClass(this, LinkTypeConstants.POINTS_TO, MariaDBServer.class);
  if (servers.size() > 1) {
    throw new IllegalUpdateException("There cannot be more than 1 MariaDB Server. Has " + servers.size());
  }
  if (servers.isEmpty()) {
    return;
  }
  MariaDBServer server = servers.get(0);
  // Get the Machines on the MariaDBServer
  List<Machine> machines = services.getResourceService().linkFindAllByFromResourceAndLinkTypeAndToResourceClass(server, LinkTypeConstants.INSTALLED_ON, Machine.class);
  if (machines.isEmpty()) {
    return;
  }
  // Add the infra on the Application
  Machine machine = machines.get(0);
  context.getApplicationDefinition().addPortRedirect(localPort, machine.getName(), server.getName(), DockerContainerEndpoints.MYSQL_TCP);
}
origin: com.foilen/foilen-infra-plugin-core

throw new IllegalUpdateException("The resource " + createdOrFoundNeededManagedResource.getResourceName() + " of type " + createdOrFoundNeededManagedResource.getClass()
    + " is already managed by another resource");
  throw new IllegalUpdateException("The resource " + createdOrFoundNeededManagedResource.getResourceName() + " of type " + createdOrFoundNeededManagedResource.getClass()
      + " is already managed by another resource");
origin: com.foilen/foilen-infra-plugin-core

throw new IllegalUpdateException(
    "The resource " + desiredManagedResource.getResourceName() + " of type " + desiredManagedResource.getClass() + " is already managed by another resource");
  throw new IllegalUpdateException(
      "The resource " + desiredManagedResource.getResourceName() + " of type " + desiredManagedResource.getClass() + " is already managed by another resource");
origin: com.foilen/foilen-infra-system-core-system-junits

throw new IllegalUpdateException("The tag name cannot be empty for resource " + resourceTypeAndName);
throw new IllegalUpdateException("The link type cannot be em");
origin: com.foilen/foilen-infra-plugins-core

  config = configOptional.get();
} else {
  throw new IllegalUpdateException("Could not find a LetsencryptConfig. Create one first");
  throw new IllegalUpdateException("The LetsencryptConfig does not have a tag name");
com.foilen.infra.plugin.v1.core.exceptionIllegalUpdateException

Most used methods

  • <init>

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
  • getSupportFragmentManager (FragmentActivity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Github Copilot alternatives
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