@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode()); return hashCode; }
/** * Constructs a new CreateDomainRequest object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param domainName * The name of the domain to create. The name can range between 3 and 255 characters and can contain the * following characters: a-z, A-Z, 0-9, '_', '-', and '.'. */ public CreateDomainRequest(String domainName) { setDomainName(domainName); }
public void select_no1(View view) { new Thread(new Runnable() { @Override public void run() { AWSCredentials credentials = new BasicAWSCredentials("MY_KEY_ID","MY_SECRET_ACCESS_KEY"); AmazonSimpleDBClient sdbClient = new AmazonSimpleDBClient(credentials); sdbClient.setEndpoint("us-east-1"); sdbClient.listDomains(); CreateDomainRequest cdr = new CreateDomainRequest("test_from_and"); sdbClient.createDomain(cdr); } }).start(); }
public synchronized void setupDbDomain(String domainName) { try { if (!doesDomainExist(domainName)) { logger.info("creating domain: " + domainName); AmazonSimpleDB db = getSimpleDb(); db.createDomain(new CreateDomainRequest().withDomainName(domainName)); domainSet.add(domainName); } } catch (AmazonClientException e) { throw new PersistenceException("Could not create SimpleDB domain.", e); } }
private synchronized boolean isDomainCreated() { if (!domainCreated) { try { simpleDb.createDomain(new CreateDomainRequest(domainName)); domainCreated = true; } catch (AmazonClientException e) { expectedStateStoreDown(e); } } return domainCreated; }
private synchronized boolean isDomainCreated() { if (!domainCreated) { try { simpleDb.createDomain(new CreateDomainRequest(domainName)); domainCreated = true; } catch (AmazonClientException e) { expectedStateStoreDown(e); } } return domainCreated; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateDomainRequest == false) return false; CreateDomainRequest other = (CreateDomainRequest) obj; if (other.getDomainName() == null ^ this.getDomainName() == null) return false; if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == false) return false; return true; }
/** * The name of the domain to create. The name can range between 3 and 255 characters and can contain the following * characters: a-z, A-Z, 0-9, '_', '-', and '.'. * * @param domainName * The name of the domain to create. The name can range between 3 and 255 characters and can contain the * following characters: a-z, A-Z, 0-9, '_', '-', and '.'. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDomainRequest withDomainName(String domainName) { setDomainName(domainName); return this; }
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) { // ... }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDomainName() != null) sb.append("DomainName: ").append(getDomainName()); sb.append("}"); return sb.toString(); }
/** * Constructs a new CreateDomainRequest object. * Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param domainName The name of the domain to create. The name can range * between 3 and 255 characters and can contain the following characters: * a-z, A-Z, 0-9, '_', '-', and '.'. */ public CreateDomainRequest(String domainName) { setDomainName(domainName); }
@Override public void createDomain(String domainName) throws TranslatorException { try { this.client.createDomain(new CreateDomainRequest(domainName)); } catch (AmazonServiceException e) { throw new TranslatorException(e); } catch (AmazonClientException e) { throw new TranslatorException(e); } }
public Request<CreateDomainRequest> marshall(CreateDomainRequest createDomainRequest) { if (createDomainRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<CreateDomainRequest> request = new DefaultRequest<CreateDomainRequest>(createDomainRequest, "AmazonSimpleDB"); request.addParameter("Action", "CreateDomain"); request.addParameter("Version", "2009-04-15"); request.setHttpMethod(HttpMethodName.POST); if (createDomainRequest.getDomainName() != null) { request.addParameter("DomainName", StringUtils.fromString(createDomainRequest.getDomainName())); } return request; }
/** * Constructs a new CreateDomainRequest object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param domainName * The name of the domain to create. The name can range between 3 and 255 characters and can contain the * following characters: a-z, A-Z, 0-9, '_', '-', and '.'. */ public CreateDomainRequest(String domainName) { setDomainName(domainName); }
public static void createDomain(AmazonSimpleDBClient client, String domainName) throws InterruptedException { client.createDomain(new CreateDomainRequest(domainName)); // Unfortunatly, there is no waiters for domain create int retries = 10; List<String> domainNames = client.listDomains().getDomainNames(); while (!domainNames.contains(domainName) && 0 < retries--) { Thread.sleep(500); domainNames = client.listDomains().getDomainNames(); } Assert.assertTrue(domainNames.contains(domainName)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateDomainRequest == false) return false; CreateDomainRequest other = (CreateDomainRequest)obj; if (other.getDomainName() == null ^ this.getDomainName() == null) return false; if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == false) return false; return true; }
/** * The name of the domain to create. The name can range between 3 and 255 characters and can contain the following * characters: a-z, A-Z, 0-9, '_', '-', and '.'. * * @param domainName * The name of the domain to create. The name can range between 3 and 255 characters and can contain the * following characters: a-z, A-Z, 0-9, '_', '-', and '.'. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDomainRequest withDomainName(String domainName) { setDomainName(domainName); return this; }
public static void createDomain(AmazonSimpleDBClient client, String domainName) throws InterruptedException { client.createDomain(new CreateDomainRequest(domainName)); // Unfortunatly, there is no waiters for domain create int retries = 10; List<String> domainNames = client.listDomains().getDomainNames(); while (!domainNames.contains(domainName) && 0 < retries--) { Thread.sleep(500); domainNames = client.listDomains().getDomainNames(); } Assert.assertTrue(domainNames.contains(domainName)); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode()); return hashCode; }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDomainName() != null) sb.append("DomainName: " + getDomainName() ); sb.append("}"); return sb.toString(); }