@Override public void deleteDomain(String domainName) throws TranslatorException { try { this.client.deleteDomain(new DeleteDomainRequest(domainName)); if (this.domains.contains(domainName)) { this.domains.remove(domainName); } } catch (AmazonServiceException e) { throw new TranslatorException(e); } catch (AmazonClientException e) { throw new TranslatorException(e); } }
BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials( awsAccessId, awsSecretKey); AmazonSimpleDB sdb = new AmazonSimpleDBClient(basicAWSCredentials); Region usWest2 = Region.getRegion(Regions.US_WEST_2); sdb.setRegion(usWest2); try { // Create a domain String myDomain = "MyStore"; System.out.println("Creating domain called " + myDomain + ".\n"); sdb.createDomain(new CreateDomainRequest(myDomain)); // ... // Delete a domain System.out.println("Deleting " + myDomain + " domain.\n"); sdb.deleteDomain(new DeleteDomainRequest(myDomain)); } catch (AmazonServiceException ase) { // ... } catch (AmazonClientException ace) { // ... }