Tabnine Logo
PutAttributesRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
PutAttributesRequest
in
com.amazonaws.services.simpledb.model

Best Java code snippets using com.amazonaws.services.simpledb.model.PutAttributesRequest (Showing top 20 results out of 315)

origin: aws/aws-sdk-java

/**
 * Constructs a new PutAttributesRequest object. Callers should use the setter or fluent setter (with...) methods to
 * initialize any additional object members.
 * 
 * @param domainName
 *        The name of the domain in which to perform the operation.
 * @param itemName
 *        The name of the item.
 * @param attributes
 *        The list of attributes.
 * @param expected
 *        The update condition which, if specified, determines whether the specified attributes will be updated or
 *        not. The update condition must be satisfied in order for this request to be processed and the attributes
 *        to be updated.
 */
public PutAttributesRequest(String domainName, String itemName, java.util.List<ReplaceableAttribute> attributes, UpdateCondition expected) {
  setDomainName(domainName);
  setItemName(itemName);
  setAttributes(attributes);
  setExpected(expected);
}
origin: aws/aws-sdk-java

@Override
public int hashCode() {
  final int prime = 31;
  int hashCode = 1;
  hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode());
  hashCode = prime * hashCode + ((getItemName() == null) ? 0 : getItemName().hashCode());
  hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode());
  hashCode = prime * hashCode + ((getExpected() == null) ? 0 : getExpected().hashCode());
  return hashCode;
}
origin: aws/aws-sdk-java

/**
 * Constructs a new PutAttributesRequest object. Callers should use the setter or fluent setter (with...) methods to
 * initialize any additional object members.
 * 
 * @param domainName
 *        The name of the domain in which to perform the operation.
 * @param itemName
 *        The name of the item.
 * @param attributes
 *        The list of attributes.
 */
public PutAttributesRequest(String domainName, String itemName, java.util.List<ReplaceableAttribute> attributes) {
  setDomainName(domainName);
  setItemName(itemName);
  setAttributes(attributes);
}
origin: airlift/airship

@Override
public void setExpectedState(ExpectedSlotStatus slotStatus)
{
  Preconditions.checkNotNull(slotStatus, "slotStatus is null");
  if (isDomainCreated()) {
    List<ReplaceableAttribute> attributes = newArrayList();
    attributes.add(new ReplaceableAttribute("state", slotStatus.getStatus().toString(), true));
    if (slotStatus.getAssignment() != null) {
      attributes.add(new ReplaceableAttribute("binary", slotStatus.getAssignment().getBinary(), true));
      attributes.add(new ReplaceableAttribute("config", slotStatus.getAssignment().getConfig(), true));
    }
    try {
      simpleDb.putAttributes(new PutAttributesRequest().withDomainName(domainName).withItemName(slotStatus.getId().toString()).withAttributes(attributes));
      expectedStateStoreUp();
    }
    catch (Exception e) {
      expectedStateStoreDown(e);
    }
  }
}
origin: Netflix/Priam

/**
 * Register a new instance. Registration will fail if a prior entry exists
 *
 * @param instance Instance entry to be registered.
 * @throws AmazonServiceException If unable to write to Simple DB because of any error.
 */
public void registerInstance(PriamInstance instance) throws AmazonServiceException {
  AmazonSimpleDB simpleDBClient = getSimpleDBClient();
  PutAttributesRequest putReq =
      new PutAttributesRequest(
          DOMAIN, getKey(instance), createAttributesToRegister(instance));
  UpdateCondition expected = new UpdateCondition();
  expected.setName(Attributes.INSTANCE_ID);
  expected.setExists(false);
  putReq.setExpected(expected);
  simpleDBClient.putAttributes(putReq);
}
origin: Netflix/Priam

/**
 * Create a new instance entry in SimpleDB
 *
 * @param instance Instance entry to be created.
 * @throws AmazonServiceException If unable to write to Simple DB because of any error.
 */
public void createInstance(PriamInstance instance) throws AmazonServiceException {
  AmazonSimpleDB simpleDBClient = getSimpleDBClient();
  PutAttributesRequest putReq =
      new PutAttributesRequest(
          DOMAIN, getKey(instance), createAttributesToRegister(instance));
  simpleDBClient.putAttributes(putReq);
}
origin: aws-amplify/aws-sdk-android

/**
 * The list of attributes.
 * <p>
 * Returns a reference to this object so that method calls can be chained together.
 *
 * @param attributes The list of attributes.
 *
 * @return A reference to this updated object so that method calls can be chained
 *         together.
 */
public PutAttributesRequest withAttributes(ReplaceableAttribute... attributes) {
  if (getAttributes() == null) setAttributes(new java.util.ArrayList<ReplaceableAttribute>(attributes.length));
  for (ReplaceableAttribute value : attributes) {
    getAttributes().add(value);
  }
  return this;
}

origin: aws/aws-sdk-java

/**
 * The update condition which, if specified, determines whether the specified attributes will be updated or not. The
 * update condition must be satisfied in order for this request to be processed and the attributes to be updated.
 * 
 * @param expected
 *        The update condition which, if specified, determines whether the specified attributes will be updated or
 *        not. The update condition must be satisfied in order for this request to be processed and the attributes
 *        to be updated.
 * @return Returns a reference to this object so that method calls can be chained together.
 */
public PutAttributesRequest withExpected(UpdateCondition expected) {
  setExpected(expected);
  return this;
}
origin: aws/aws-sdk-java

/**
 * The list of attributes.
 * 
 * @param attributes
 *        The list of attributes.
 * @return Returns a reference to this object so that method calls can be chained together.
 */
public PutAttributesRequest withAttributes(java.util.Collection<ReplaceableAttribute> attributes) {
  setAttributes(attributes);
  return this;
}
origin: com.proofpoint.galaxy/galaxy-coordinator

@Override
public void setExpectedState(ExpectedSlotStatus slotStatus)
{
  Preconditions.checkNotNull(slotStatus, "slotStatus is null");
  if (isDomainCreated()) {
    List<ReplaceableAttribute> attributes = newArrayList();
    attributes.add(new ReplaceableAttribute("state", slotStatus.getStatus().toString(), true));
    if (slotStatus.getAssignment() != null) {
      attributes.add(new ReplaceableAttribute("binary", slotStatus.getAssignment().getBinary(), true));
      attributes.add(new ReplaceableAttribute("config", slotStatus.getAssignment().getConfig(), true));
    }
    try {
      simpleDb.putAttributes(new PutAttributesRequest().withDomainName(domainName).withItemName(slotStatus.getId().toString()).withAttributes(attributes));
      expectedStateStoreUp();
    }
    catch (Exception e) {
      expectedStateStoreDown(e);
    }
  }
}
origin: aws-amplify/aws-sdk-android

/**
 * Constructs a new PutAttributesRequest object.
 * Callers should use the setter or fluent setter (with...) methods to
 * initialize any additional object members.
 * 
 * @param domainName The name of the domain in which to perform the
 * operation.
 * @param itemName The name of the item.
 * @param attributes The list of attributes.
 */
public PutAttributesRequest(String domainName, String itemName, java.util.List<ReplaceableAttribute> attributes) {
  setDomainName(domainName);
  setItemName(itemName);
  setAttributes(attributes);
}
origin: appoxy/simplejpa

private void putNewValue(String domainName, List<Item> items, String dtype, String newClassName) throws AmazonClientException {
  AmazonSimpleDB db = factory.getSimpleDb();
  for (Item item : items) {
    List<ReplaceableAttribute> atts = new ArrayList<ReplaceableAttribute>();
    atts.add(new ReplaceableAttribute(dtype, newClassName, true));
    db.putAttributes(new PutAttributesRequest(domainName, item.getName(), atts));
  }
}
origin: com.amazonaws/aws-java-sdk-simpledb

/**
 * The update condition which, if specified, determines whether the specified attributes will be updated or not. The
 * update condition must be satisfied in order for this request to be processed and the attributes to be updated.
 * 
 * @param expected
 *        The update condition which, if specified, determines whether the specified attributes will be updated or
 *        not. The update condition must be satisfied in order for this request to be processed and the attributes
 *        to be updated.
 * @return Returns a reference to this object so that method calls can be chained together.
 */
public PutAttributesRequest withExpected(UpdateCondition expected) {
  setExpected(expected);
  return this;
}
origin: aws/aws-sdk-java

/**
 * The list of attributes.
 * <p>
 * <b>NOTE:</b> This method appends the values to the existing list (if any). Use
 * {@link #setAttributes(java.util.Collection)} or {@link #withAttributes(java.util.Collection)} if you want to
 * override the existing values.
 * </p>
 * 
 * @param attributes
 *        The list of attributes.
 * @return Returns a reference to this object so that method calls can be chained together.
 */
public PutAttributesRequest withAttributes(ReplaceableAttribute... attributes) {
  if (this.attributes == null) {
    setAttributes(new com.amazonaws.internal.SdkInternalList<ReplaceableAttribute>(attributes.length));
  }
  for (ReplaceableAttribute ele : attributes) {
    this.attributes.add(ele);
  }
  return this;
}
origin: appoxy/simplejpa

private void putAndDelete(String domainName, String oldAttributeName, String newAttributeName, List<Item> items) throws AmazonClientException {
  AmazonSimpleDB db = factory.getSimpleDb();
  for (Item item : items) {
    GetAttributesResult getOldResults = db.getAttributes(new GetAttributesRequest().withDomainName(domainName).withConsistentRead(true).withItemName(
        item.getName()).withAttributeNames(oldAttributeName));
    List<Attribute> oldAtts = getOldResults.getAttributes();
    if (oldAtts.size() > 0) {
      Attribute oldAtt = oldAtts.get(0);
      List<ReplaceableAttribute> atts = new ArrayList<ReplaceableAttribute>();
      atts.add(new ReplaceableAttribute(newAttributeName, oldAtt.getValue(), true));
      db.putAttributes(new PutAttributesRequest().withDomainName(domainName).withItemName(item.getName()).withAttributes(atts));
      db.deleteAttributes(new DeleteAttributesRequest().withDomainName(domainName).withItemName(item.getName()).withAttributes(oldAtts));
    }
  }
}
origin: aws/aws-sdk-java

@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (obj instanceof PutAttributesRequest == false)
    return false;
  PutAttributesRequest other = (PutAttributesRequest) obj;
  if (other.getDomainName() == null ^ this.getDomainName() == null)
    return false;
  if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == false)
    return false;
  if (other.getItemName() == null ^ this.getItemName() == null)
    return false;
  if (other.getItemName() != null && other.getItemName().equals(this.getItemName()) == false)
    return false;
  if (other.getAttributes() == null ^ this.getAttributes() == null)
    return false;
  if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false)
    return false;
  if (other.getExpected() == null ^ this.getExpected() == null)
    return false;
  if (other.getExpected() != null && other.getExpected().equals(this.getExpected()) == false)
    return false;
  return true;
}
origin: aws-amplify/aws-sdk-android

/**
 * Constructs a new PutAttributesRequest object.
 * Callers should use the setter or fluent setter (with...) methods to
 * initialize any additional object members.
 * 
 * @param domainName The name of the domain in which to perform the
 * operation.
 * @param itemName The name of the item.
 * @param attributes The list of attributes.
 * @param expected The update condition which, if specified, determines
 * whether the specified attributes will be updated or not. The update
 * condition must be satisfied in order for this request to be processed
 * and the attributes to be updated.
 */
public PutAttributesRequest(String domainName, String itemName, java.util.List<ReplaceableAttribute> attributes, UpdateCondition expected) {
  setDomainName(domainName);
  setItemName(itemName);
  setAttributes(attributes);
  setExpected(expected);
}
origin: com.amazonaws/aws-java-sdk-simpledb

/**
 * Constructs a new PutAttributesRequest object. Callers should use the setter or fluent setter (with...) methods to
 * initialize any additional object members.
 * 
 * @param domainName
 *        The name of the domain in which to perform the operation.
 * @param itemName
 *        The name of the item.
 * @param attributes
 *        The list of attributes.
 */
public PutAttributesRequest(String domainName, String itemName, java.util.List<ReplaceableAttribute> attributes) {
  setDomainName(domainName);
  setItemName(itemName);
  setAttributes(attributes);
}
origin: com.amazonaws/aws-java-sdk-simpledb

/**
 * The list of attributes.
 * 
 * @param attributes
 *        The list of attributes.
 * @return Returns a reference to this object so that method calls can be chained together.
 */
public PutAttributesRequest withAttributes(java.util.Collection<ReplaceableAttribute> attributes) {
  setAttributes(attributes);
  return this;
}
origin: appoxy/simplejpa

if (!attsToPut.isEmpty()) {
  this.em.getSimpleDb().putAttributes(
      new PutAttributesRequest().withDomainName(domainName).withItemName(id).withAttributes(attsToPut)
          .withExpected(expected));
  duration2 = System.currentTimeMillis() - start2;
  if (logger.isLoggable(Level.FINE))
com.amazonaws.services.simpledb.modelPutAttributesRequest

Javadoc

Container for the parameters to the com.amazonaws.services.simpledb.AmazonSimpleDB#putAttributes(PutAttributesRequest).

The PutAttributes operation creates or replaces attributes in an item. The client may specify new attributes using a combination of the Attribute.X.Name and Attribute.X.Value parameters. The client specifies the first attribute by the parameters Attribute.0.Name and Attribute.0.Value , the second attribute by the parameters Attribute.1.Name and Attribute.1.Value , and so on.

Attributes are uniquely identified in an item by their name/value combination. For example, a single item can have the attributes { "first_name", "first_value" } and { "first_name", second_value" } . However, it cannot have two attribute instances where both the Attribute.X.Name and Attribute.X.Value are the same.

Optionally, the requestor can supply the Replace parameter for each individual attribute. Setting this value to true causes the new attribute value to replace the existing attribute value(s). For example, if an item has the attributes { 'a', '1' } , { 'b', '2'} and { 'b', '3' } and the requestor calls PutAttributes using the attributes { 'b', '4' } with the Replace parameter set to true, the final attributes of the item are changed to { 'a', '1' } and { 'b', '4' } , which replaces the previous values of the 'b' attribute with the new value.

NOTE: Using PutAttributes to replace attribute values that do not exist will not result in an error response.

You cannot specify an empty string as an attribute name.

Because Amazon SimpleDB makes multiple copies of client data and uses an eventual consistency update model, an immediate GetAttributes or Select operation (read) immediately after a PutAttributes or DeleteAttributes operation (write) might not return the updated data.

The following limitations are enforced for this operation:

  • 256 total attribute name-value pairs per item
  • One billion attributes per domain
  • 10 GB of total user data storage per domain

Most used methods

  • <init>
    Constructs a new PutAttributesRequest object. Callers should use the setter or fluent setter (with..
  • setExpected
    The update condition which, if specified, determines whether the specified attributes will be update
  • withAttributes
    The list of attributes.NOTE: This method appends the values to the existing list (if any). Use #setA
  • withDomainName
    The name of the domain in which to perform the operation.
  • withItemName
    The name of the item.
  • getAttributes
    The list of attributes.
  • getDomainName
    The name of the domain in which to perform the operation.
  • getExpected
    The update condition which, if specified, determines whether the specified attributes will be update
  • getItemName
    The name of the item.
  • setAttributes
    The list of attributes.
  • setDomainName
    The name of the domain in which to perform the operation.
  • setItemName
    The name of the item.
  • setDomainName,
  • setItemName,
  • withExpected

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • startActivity (Activity)
  • getExternalFilesDir (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Table (org.hibernate.mapping)
    A relational table
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now