protected <T> T createResources(Command<T> command)
      throws SystemException, ResourceAlreadyExistsException, NoSuchParentResourceException {
    try {
      return invokeWithRetry(command);
    } catch (ParentObjectNotFoundException e) {
      throw new NoSuchParentResourceException(e.getMessage(), e);
    } catch (DuplicateResourceException e) {
      throw new ResourceAlreadyExistsException(e.getMessage());
    } catch (AmbariException e) {
      if (LOG.isErrorEnabled()) {
        LOG.error("Caught AmbariException when creating a resource", e);
      }
      throw new SystemException("An internal system exception occurred: " + e.getMessage(), e);
    }
  }
Invoke a command against the Ambari backend to create resources and map
any {@link AmbariException} to the types appropriate for the
{@link ResourceProvider} interface.

@param command  the command to invoke
@param <T>      the type of the response

@return the response

@throws SystemException                thrown if a system exception occurred
@throws ResourceAlreadyExistsException thrown if a resource already exists
@throws NoSuchParentResourceException  thrown if a parent of a resource doesn't exist
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java