@Override
  public Collection<Container> updateContainers(String accountName, Collection<Container> containers)
      throws AccountServiceException {
    checkOpen();
    // input validation
    if (accountName == null || accountName.isEmpty() || containers == null || containers.isEmpty()) {
      throw new AccountServiceException("Account or container is null or empty", AccountServiceErrorCode.BadRequest);
    }
    Account account = getAccountByName(accountName);
    if (account == null) {
      logger.error("Account {} is not found", accountName);
      throw new AccountServiceException("Account " + accountName + " is not found", AccountServiceErrorCode.NotFound);
    }

    List<Container> resolvedContainers = new ArrayList<>();
    List<Container> existingUnchangedContainers = new ArrayList<>();
    // create a hashmap to map the name to existing containers in account
    Map<String, Container> existingContainersInAccount = new HashMap<>();
    account.getAllContainers().forEach(c -> existingContainersInAccount.put(c.getName(), c));

    // Generate container ids for new containers
    short nextContainerId = account.getAllContainers()
        .stream()
        .map(Container::getId)
        .max(Short::compareTo)
        .map(maxId -> (short) (maxId + 1))
        .orElse(config.containerIdStartNumber);

    for (Container container : containers) {
      if (container.getId() == Container.UNKNOWN_CONTAINER_ID) {
        // new container
        Container existingContainer = existingContainersInAccount.get(container.getName());
        if (existingContainer != null) {
          switch (existingContainer.getStatus()) {
            case INACTIVE:
              throw new AccountServiceException(
                  "The container " + container.getName() + " has gone and cannot be restored",
                  AccountServiceErrorCode.ResourceHasGone);
            case DELETE_IN_PROGRESS:
              if (existingContainer.getDeleteTriggerTime() + TimeUnit.DAYS.toMillis(
                  config.containerDeprecationRetentionDays) > System.currentTimeMillis()) {
                throw new AccountServiceException("Create method is not allowed on container " + container.getName()
                    + " as it's in Delete_In_Progress state", AccountServiceErrorCode.MethodNotAllowed);
              } else {
                throw new AccountServiceException(
                    "The container " + container.getName() + " has gone and cannot be restored",
                    AccountServiceErrorCode.ResourceHasGone);
              }
            case ACTIVE:
              // make sure there is no conflicting container (conflicting means a container with same name but different attributes already exists).
              if (existingContainer.isSameContainer(container)) {
                // If an exactly same container already exists, treat as no-op (may be retry after partial failure).
                // But include it in the list returned to caller to provide the containerId.
                String containerStr;
                try {
                  containerStr = objectMapper.writeValueAsString(existingContainer);
                } catch (IOException e) {
                  containerStr = existingContainer.toString();
                }
                logger.info("Request to create container with existing name and properties: {}", containerStr);
                existingUnchangedContainers.add(existingContainer);
              } else {
                throw new AccountServiceException("There is a conflicting container in account " + accountName,
                    AccountServiceErrorCode.ResourceConflict);
              }
          }
        } else {
          resolvedContainers.add(
              new ContainerBuilder(container).setId(nextContainerId).setParentAccountId(account.getId()).build());
          ++nextContainerId;
        }
      } else {
        // existing container
        Container existingContainer = existingContainersInAccount.get(container.getName());
        if (existingContainer == null) {
          throw new AccountServiceException(
              "In account " + accountName + ", container " + container.getName() + " does not exist (containerId "
                  + container.getId() + " was supplied)", AccountServiceErrorCode.NotFound);
        } else if (existingContainer.getId() != container.getId()) {
          throw new AccountServiceException(
              "In account " + accountName + ", container " + container.getName() + " has containerId "
                  + existingContainer.getId() + " (" + container.getId() + " was supplied)",
              AccountServiceErrorCode.ResourceConflict);
        } else if (!config.ignoreVersionMismatch
            && existingContainer.getSnapshotVersion() != container.getSnapshotVersion()) {
          throw new AccountServiceException(
              "In account " + accountName + ", container " + container.getName() + " has version "
                  + existingContainer.getSnapshotVersion() + " (" + container.getSnapshotVersion() + " was supplied)",
              AccountServiceErrorCode.ResourceConflict);
        } else {
          resolvedContainers.add(container);
        }
      }
    }

    if (!resolvedContainers.isEmpty()) {
      updateResolvedContainers(account, resolvedContainers);
    }

    resolvedContainers.addAll(existingUnchangedContainers);
    return resolvedContainers;
  }
Return the {@link Notifier}.
@return The {@link Notifier}
ambry-account/src/main/java/com/github/ambry/account/AbstractAccountService.java