@Test public void testDeleteApplicationTemplate() throws Exception { File directory = TestUtils.findApplicationDirectory( "lamp" ); Assert.assertTrue( directory.exists()); Assert.assertEquals( 0, this.client.getManagementDelegate().listApplicationTemplates().size()); this.client.getManagementDelegate().loadUnzippedApplicationTemplate( directory.getAbsolutePath()); Assert.assertEquals( 1, this.client.getManagementDelegate().listApplicationTemplates().size()); this.client.getManagementDelegate().deleteApplicationTemplate( "Legacy LAMP", "1.0.1-SNAPSHOT" ); Assert.assertEquals( 0, this.client.getManagementDelegate().listApplicationTemplates().size()); }
public void deleteApplicationTemplate( String templateName, String templateQualifier ) throws ManagementWsException { this.logger.finer( "Removing application template " + templateName + "..." ); WebResource path = this.resource .path( UrlConstants.APPLICATIONS ).path( "templates" ) .path( templateName ).path( templateQualifier ); ClientResponse response = this.wsClient.createBuilder( path ).delete( ClientResponse.class ); String text = response.getEntity( String.class ); this.logger.finer( text ); if( Family.SUCCESSFUL != response.getStatusInfo().getFamily()) throw new ManagementWsException( response.getStatusInfo().getStatusCode(), text ); }
ManagementWsDelegate { public void deleteApplicationTemplate( String templateName, String templateQualifier ) throws ManagementWsException { this.logger.finer( "Removing application template " + templateName + "..." ); WebResource path = this.resource .path( UrlConstants.APPLICATIONS ).path( "templates" ) .path( templateName ).path( templateQualifier ); ClientResponse response = this.wsClient.createBuilder( path ).delete( ClientResponse.class ); String text = response.getEntity( String.class ); this.logger.finer( text ); if( Family.SUCCESSFUL != response.getStatusInfo().getFamily()) throw new ManagementWsException( response.getStatusInfo().getStatusCode(), text ); } }
ManagementWsDelegate { public void deleteApplicationTemplate( String templateName, String templateQualifier ) throws ManagementWsException { this.logger.finer( "Removing application template " + templateName + "..." ); WebResource path = this.resource .path( UrlConstants.APPLICATIONS ).path( "templates" ) .path( templateName ).path( templateQualifier ); ClientResponse response = this.wsClient.createBuilder( path ).delete( ClientResponse.class ); String text = response.getEntity( String.class ); this.logger.finer( text ); if( Family.SUCCESSFUL != response.getStatusInfo().getFamily()) throw new ManagementWsException( response.getStatusInfo().getStatusCode(), text ); } ManagementWsDelegate( WebResource resource, WsClient wsClient ); }
ManagementWsDelegate { public void deleteApplicationTemplate( String templateName, String templateQualifier ) throws ManagementWsException { this.logger.finer( "Removing application template " + templateName + "..." ); WebResource path = this.resource .path( UrlConstants.APPLICATIONS ).path( "templates" ) .path( templateName ).path( templateQualifier ); ClientResponse response = this.wsClient.createBuilder( path ).delete( ClientResponse.class ); String text = response.getEntity( String.class ); this.logger.finer( text ); if( Family.SUCCESSFUL != response.getStatusInfo().getFamily()) throw new ManagementWsException( response.getStatusInfo().getStatusCode(), text ); } ManagementWsDelegate( WebResource resource, WsClient wsClient ); void uploadZippedApplicationTemplate( File applicationFile ); void loadUnzippedApplicationTemplate( String localFilePath ); void loadZippedApplicationTemplate( String url ); List<ApplicationTemplate> listApplicationTemplates( String exactName, String exactQualifier ); List<ApplicationTemplate> listApplicationTemplates(); void deleteApplicationTemplate( String templateName, String templateQualifier ); Application createApplication( String applicationName, String templateName, String templateQualifier ); List<Application> listApplications( String exactName ); List<Application> listApplications(); void shutdownApplication( String applicationName ); void deleteApplication( String applicationName ); }
ManagementWsDelegate { public void deleteApplicationTemplate( String templateName, String templateQualifier ) throws ManagementWsException { this.logger.finer( "Removing application template " + templateName + "..." ); WebResource path = this.resource .path( UrlConstants.APPLICATIONS ).path( "templates" ) .path( templateName ).path( templateQualifier ); ClientResponse response = this.wsClient.createBuilder( path ).delete( ClientResponse.class ); String text = response.getEntity( String.class ); this.logger.finer( text ); if( Family.SUCCESSFUL != response.getStatusInfo().getFamily()) throw new ManagementWsException( response.getStatusInfo().getStatusCode(), text ); } ManagementWsDelegate( WebResource resource, WsClient wsClient ); void uploadZippedApplicationTemplate( File applicationFile ); void loadUnzippedApplicationTemplate( String localFilePath ); void loadZippedApplicationTemplate( String url ); List<ApplicationTemplate> listApplicationTemplates( String exactName, String exactQualifier ); List<ApplicationTemplate> listApplicationTemplates(); void deleteApplicationTemplate( String templateName, String templateQualifier ); Application createApplication( String applicationName, String templateName, String templateQualifier ); List<Application> listApplications( String exactName ); List<Application> listApplications(); void shutdownApplication( String applicationName ); void deleteApplication( String applicationName );  }