@Test( expected = ManagementWsException.class ) public void testDeleteApplication_failure() throws Exception { this.client.getManagementDelegate().deleteApplication( "inexisting" ); }
public void deleteApplication( String applicationName ) throws ManagementWsException { this.logger.finer( "Removing application " + applicationName + "..." ); WebResource path = this.resource.path( UrlConstants.APPLICATIONS ).path( applicationName ); 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 deleteApplication( String applicationName ) throws ManagementWsException { this.logger.finer( "Removing application " + applicationName + "..." ); WebResource path = this.resource.path( UrlConstants.APPLICATIONS ).path( applicationName ); 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 deleteApplication( String applicationName ) throws ManagementWsException { this.logger.finer( "Removing application " + applicationName + "..." ); WebResource path = this.resource.path( UrlConstants.APPLICATIONS ).path( applicationName ); 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 deleteApplication( String applicationName ) throws ManagementWsException { this.logger.finer( "Removing application " + applicationName + "..." ); WebResource path = this.resource.path( UrlConstants.APPLICATIONS ).path( applicationName ); 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 deleteApplication( String applicationName ) throws ManagementWsException { this.logger.finer( "Removing application " + applicationName + "..." ); WebResource path = this.resource.path( UrlConstants.APPLICATIONS ).path( applicationName ); 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 );  }