private void validateCreateRequest(MpackRequest mpackRequest) {
    final String mpackName = mpackRequest.getMpackName();
    final String mpackUrl = mpackRequest.getMpackUri();
    final Long registryId = mpackRequest.getRegistryId();
    final String mpackVersion = mpackRequest.getMpackVersion();

    if (registryId == null) {
      Validate.isTrue(mpackUrl != null);
      LOG.info("Received a createMpack request"
        + ", mpackUrl=" + mpackUrl);
    } else {
      Validate.notNull(mpackName, "MpackName should not be null");
      Validate.notNull(mpackVersion, "MpackVersion should not be null");
      LOG.info("Received a createMpack request"
        + ", mpackName=" + mpackName
        + ", mpackVersion=" + mpackVersion
        + ", registryId=" + registryId);
    }
    try {
      URI uri = new URI(mpackUrl);
      URL url = uri.toURL();
    } catch (Exception e) {
      Validate.isTrue(e == null,
        e.getMessage() + " is an invalid mpack uri. Please check the download link for the mpack again.");
    }
  }
Validates the request body for the required properties in order to create an Mpack resource.

@param mpackRequest
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MpackResourceProvider.java