code: public void defineApplication(Tenant tenant, ApplicationDefinition appDef) {
          checkServiceState();
          appDef.setTenantName(tenant.getName());
          ApplicationDefinition currAppDef = checkApplicationKey(appDef);
          StorageService storageService = verifyStorageServiceOption(currAppDef, appDef);
          storageService.validateSchema(appDef);
          initializeApplication(currAppDef, appDef);
      }
docs: Create the application with the given name in the given Tenant. If the given
  application already exists, the request is treated as an application update. If the
  update is successfully validated, its schema is stored in the database, and the
  appropriate storage service is notified to implement required physical database
  changes, if any.
  
  @param tenant    {@link Tenant} in which application is being created or updated.
  @param appDef    {@link ApplicationDefinition} of application to create or update.
  Note that appDef is updated with the "Tenant" option.