public Application createApplication ( String applicationName , String templateName , String templateQualifier ) throws ManagementWsException { this . logger . finer ( "Creating application " + applicationName + " from " + templateName + " - " + templateQualifier + "..." ) ; ApplicationTemplate tpl = new ApplicationTemplate ( templateName ) . version ( templateQualifier ) ; Application app = new Application ( applicationName , tpl ) ; WebResource path = this . resource . path ( UrlConstants . APPLICATIONS ) ; ClientResponse response = this . wsClient . createBuilder ( path ) . type ( MediaType . APPLICATION_JSON ) . post ( ClientResponse . class , app ) ; if ( Family . SUCCESSFUL != response . getStatusInfo ( ) . getFamily ( ) ) throw new ManagementWsException ( response . getStatusInfo ( ) . getStatusCode ( ) , "" ) ; Application result = response . getEntity ( Application . class ) ; return result ; }
Creates an application from a template .