withAction(action);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAction() == null) ? 0 : getAction().hashCode()); hashCode = prime * hashCode + ((getResourceRecordSet() == null) ? 0 : getResourceRecordSet().hashCode()); return hashCode; }
private boolean createResourceRecordSet(ResourceRecordSetWithHostedZone rrs) throws InterruptedException { rrs.getResourceRecordSet().setResourceRecords(Arrays.asList(new ResourceRecord(registrationHostname))); Change change = new Change(ChangeAction.UPSERT, rrs.getResourceRecordSet()); if (executeChangeWithRetry(change, rrs.getHostedZone())) { Thread.sleep(1000); // check change not overwritten ResourceRecordSet resourceRecordSet = getResourceRecordSet(rrs.getResourceRecordSet().getName(), rrs.getHostedZone()); return resourceRecordSet.getResourceRecords().equals(rrs.getResourceRecordSet().getResourceRecords()); } return false; }
public Change unmarshall(StaxUnmarshallerContext context) throws Exception { Change change = new Change(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return change; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Action", targetDepth)) { change.setAction(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ResourceRecordSet", targetDepth)) { change.setResourceRecordSet(ResourceRecordSetStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return change; } } } }
.withHostedZoneId(zoneId) .withChangeBatch(new ChangeBatch() .withChanges(new Change() .withAction(ChangeAction.UPSERT) .withResourceRecordSet(resourceRecordSet)
class Entity{ @PrePersist public void logChanges(){ Change c = new Change() c.setEverythingXouLikeToLog(); entityManager.persist(c); // don't forget ExceptionHandling } }
//an Object of A created and its reference is set to a A a = new A(); //instance of Change is created and its reference is set to change Change change = new Change(); //it passes reference's (a) 's value to the changeSomething method //which invokes `setA()` on instance referred by a (which is the same instance that waas crated in line 1 change.changeSomething(a); //so you will get the changed value here System.out.println(a.getA());
private void unbindFromDomain(String domain) throws InterruptedException { ResourceRecordSetWithHostedZone resourceRecordSetWithHostedZone = getResourceRecordSetWithHostedZone(domain); if (hasValue(resourceRecordSetWithHostedZone, registrationHostname)) { resourceRecordSetWithHostedZone.getResourceRecordSet().getResourceRecords().get(0).setValue(NULL_DOMAIN); executeChangeWithRetry(new Change(ChangeAction.UPSERT, resourceRecordSetWithHostedZone.getResourceRecordSet()), resourceRecordSetWithHostedZone.getHostedZone()); } }
Change c = new Change ((int)(price * 100 + 0.5), (int)(cash * 100 + 0.5));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Change == false) return false; Change other = (Change) obj; if (other.getAction() == null ^ this.getAction() == null) return false; if (other.getAction() != null && other.getAction().equals(this.getAction()) == false) return false; if (other.getResourceRecordSet() == null ^ this.getResourceRecordSet() == null) return false; if (other.getResourceRecordSet() != null && other.getResourceRecordSet().equals(this.getResourceRecordSet()) == false) return false; return true; }
List<Change> saisieToStrings = new ArrayList<Change>(); for (Object object : saisieIHM) { saisieIHMToStrings.add( new Change( object.toString())); }
/** * 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 (getAction() != null) sb.append("Action: ").append(getAction()).append(","); if (getResourceRecordSet() != null) sb.append("ResourceRecordSet: ").append(getResourceRecordSet()); sb.append("}"); return sb.toString(); }
private void unbindFromDomain(String domain) throws InterruptedException { ResourceRecordSetWithHostedZone resourceRecordSetWithHostedZone = getResourceRecordSetWithHostedZone(domain); if (hasValue(resourceRecordSetWithHostedZone, registrationHostname)) { resourceRecordSetWithHostedZone.getResourceRecordSet().getResourceRecords().get(0).setValue(NULL_DOMAIN); executeChangeWithRetry(new Change(ChangeAction.UPSERT, resourceRecordSetWithHostedZone.getResourceRecordSet()), resourceRecordSetWithHostedZone.getHostedZone()); } }
xmlWriter.startElement("Change"); if (changeBatchChangesListValue.getAction() != null) { xmlWriter.startElement("Action").value(changeBatchChangesListValue.getAction()).endElement(); ResourceRecordSet resourceRecordSet = changeBatchChangesListValue.getResourceRecordSet(); if (resourceRecordSet != null) { xmlWriter.startElement("ResourceRecordSet");
private boolean createResourceRecordSet(ResourceRecordSetWithHostedZone rrs) throws InterruptedException { rrs.getResourceRecordSet().setResourceRecords(Arrays.asList(new ResourceRecord(registrationHostname))); Change change = new Change(ChangeAction.UPSERT, rrs.getResourceRecordSet()); if (executeChangeWithRetry(change, rrs.getHostedZone())) { Thread.sleep(1000); // check change not overwritten ResourceRecordSet resourceRecordSet = getResourceRecordSet(rrs.getResourceRecordSet().getName(), rrs.getHostedZone()); return resourceRecordSet.getResourceRecords().equals(rrs.getResourceRecordSet().getResourceRecords()); } return false; }
@TaskAction public void changeResourceRecordSets() { // to enable conventionMappings feature String hostedZoneId = getHostedZoneId(); String rrsName = getRrsName(); String resourceRecord = getResourceRecord(); AmazonRoute53PluginExtension ext = getProject().getExtensions().getByType(AmazonRoute53PluginExtension.class); AmazonRoute53 route53 = ext.getClient(); route53.changeResourceRecordSets(new ChangeResourceRecordSetsRequest() .withHostedZoneId(hostedZoneId) .withChangeBatch(new ChangeBatch() .withChanges(new Change(ChangeAction.CREATE, new ResourceRecordSet(rrsName, RRType.CNAME) .withResourceRecords(new ResourceRecord(resourceRecord)))))); getLogger().info("change {} requested", hostedZoneId); } }