@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; }
/** * Constructs a new DeleteAttributesRequest 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. Similar to rows on a spreadsheet, items represent individual objects that contain * one or more value-attribute pairs. * @param attributes * A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that * can be assigned to items. * @param expected * The update condition which, if specified, determines whether the specified attributes will be deleted or * not. The update condition must be satisfied in order for this request to be processed and the attributes * to be deleted. */ public DeleteAttributesRequest(String domainName, String itemName, java.util.List<Attribute> attributes, UpdateCondition expected) { setDomainName(domainName); setItemName(itemName); setAttributes(attributes); setExpected(expected); }
/** * Constructs a new DeleteAttributesRequest 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. Similar to rows on a spreadsheet, items represent individual objects that contain * one or more value-attribute pairs. */ public DeleteAttributesRequest(String domainName, String itemName) { setDomainName(domainName); setItemName(itemName); }
/** * Constructs a new DeleteAttributesRequest 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. Similar to rows on a spreadsheet, items represent individual objects that contain * one or more value-attribute pairs. * @param attributes * A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that * can be assigned to items. */ public DeleteAttributesRequest(String domainName, String itemName, java.util.List<Attribute> attributes) { setDomainName(domainName); setItemName(itemName); setAttributes(attributes); }
@Override public void deleteExpectedState(UUID slotId) { Preconditions.checkNotNull(slotId, "id is null"); if (isDomainCreated()) { List<Attribute> attributes = newArrayList(); attributes.add(new Attribute("state", null)); attributes.add(new Attribute("binary", null)); attributes.add(new Attribute("config", null)); try { simpleDb.deleteAttributes(new DeleteAttributesRequest().withDomainName(domainName).withItemName(slotId.toString()).withAttributes(attributes)); expectedStateStoreUp(); } catch (Exception e) { expectedStateStoreDown(e); } } }
public Object call() throws Exception { String domainName = em.getOrCreateDomain(toDelete.getClass()); if(logger.isLoggable(Level.FINE)) logger.fine("deleting item with id: " + id); em.invokeEntityListener(toDelete, PreRemove.class); this.em.getSimpleDb().deleteAttributes(new DeleteAttributesRequest() .withDomainName(domainName) .withItemName(id)); em.invokeEntityListener(toDelete, PostRemove.class); return toDelete; } }
/** * Deregister instance (same as delete) * * @param instance * @throws AmazonServiceException */ public void deregisterInstance(PriamInstance instance) throws AmazonServiceException { AmazonSimpleDB simpleDBClient = getSimpleDBClient(); DeleteAttributesRequest delReq = new DeleteAttributesRequest( DOMAIN, getKey(instance), createAttributesToDeRegister(instance)); simpleDBClient.deleteAttributes(delReq); }
/** * A list of Attributes. Similar to columns on a spreadsheet, attributes * represent categories of data that can be assigned to items. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param attributes A list of Attributes. Similar to columns on a spreadsheet, attributes * represent categories of data that can be assigned to items. * * @return A reference to this updated object so that method calls can be chained * together. */ public DeleteAttributesRequest withAttributes(Attribute... attributes) { if (getAttributes() == null) setAttributes(new java.util.ArrayList<Attribute>(attributes.length)); for (Attribute value : attributes) { getAttributes().add(value); } return this; }
/** * A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that can be * assigned to items. * * @param attributes * A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that * can be assigned to items. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteAttributesRequest withAttributes(java.util.Collection<Attribute> attributes) { setAttributes(attributes); return this; }
/** * The name of the domain in which to perform the operation. * * @param domainName * The name of the domain in which to perform the operation. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteAttributesRequest withDomainName(String domainName) { setDomainName(domainName); return this; }
@Override public void deleteExpectedState(UUID slotId) { Preconditions.checkNotNull(slotId, "id is null"); if (isDomainCreated()) { List<Attribute> attributes = newArrayList(); attributes.add(new Attribute("state", null)); attributes.add(new Attribute("binary", null)); attributes.add(new Attribute("config", null)); try { simpleDb.deleteAttributes(new DeleteAttributesRequest().withDomainName(domainName).withItemName(slotId.toString()).withAttributes(attributes)); expectedStateStoreUp(); } catch (Exception e) { expectedStateStoreDown(e); } } }
/** * Constructs a new DeleteAttributesRequest 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. Similar to rows on a * spreadsheet, items represent individual objects that contain one or * more value-attribute pairs. * @param attributes A list of Attributes. Similar to columns on a * spreadsheet, attributes represent categories of data that can be * assigned to items. */ public DeleteAttributesRequest(String domainName, String itemName, java.util.List<Attribute> attributes) { setDomainName(domainName); setItemName(itemName); setAttributes(attributes); }
/** * Constructs a new DeleteAttributesRequest 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. Similar to rows on a * spreadsheet, items represent individual objects that contain one or * more value-attribute pairs. */ public DeleteAttributesRequest(String domainName, String itemName) { setDomainName(domainName); setItemName(itemName); }
/** * A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that can be * assigned to items. * <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 * A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that * can be assigned to items. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteAttributesRequest withAttributes(Attribute... attributes) { if (this.attributes == null) { setAttributes(new com.amazonaws.internal.SdkInternalList<Attribute>(attributes.length)); } for (Attribute ele : attributes) { this.attributes.add(ele); } return this; }
/** * The name of the domain in which to perform the operation. * * @param domainName * The name of the domain in which to perform the operation. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteAttributesRequest withDomainName(String domainName) { setDomainName(domainName); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteAttributesRequest == false) return false; DeleteAttributesRequest other = (DeleteAttributesRequest) 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; }
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)); } } }
/** * Constructs a new DeleteAttributesRequest 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. Similar to rows on a * spreadsheet, items represent individual objects that contain one or * more value-attribute pairs. * @param attributes A list of Attributes. Similar to columns on a * spreadsheet, attributes represent categories of data that can be * assigned to items. * @param expected The update condition which, if specified, determines * whether the specified attributes will be deleted or not. The update * condition must be satisfied in order for this request to be processed * and the attributes to be deleted. */ public DeleteAttributesRequest(String domainName, String itemName, java.util.List<Attribute> attributes, UpdateCondition expected) { setDomainName(domainName); setItemName(itemName); setAttributes(attributes); setExpected(expected); }
/** * Constructs a new DeleteAttributesRequest 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. Similar to rows on a spreadsheet, items represent individual objects that contain * one or more value-attribute pairs. * @param attributes * A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that * can be assigned to items. */ public DeleteAttributesRequest(String domainName, String itemName, java.util.List<Attribute> attributes) { setDomainName(domainName); setItemName(itemName); setAttributes(attributes); }
/** * Constructs a new DeleteAttributesRequest 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. Similar to rows on a spreadsheet, items represent individual objects that contain * one or more value-attribute pairs. */ public DeleteAttributesRequest(String domainName, String itemName) { setDomainName(domainName); setItemName(itemName); }