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 ) ; }
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 .