/** * Create an instance of {@link StoragePolicySelection } * */ public StoragePolicySelection createStoragePolicySelection() { return new StoragePolicySelection(); }
/** * Validates the storage policy selection. This method also trims the request parameters. * * @param storagePolicySelection the storage policy selection */ private void validateStoragePolicySelection(StoragePolicySelection storagePolicySelection) { Assert.notNull(storagePolicySelection, "A storage policy selection must be specified."); businessObjectDataHelper.validateBusinessObjectDataKey(storagePolicySelection.getBusinessObjectDataKey(), true, true); storagePolicyHelper.validateStoragePolicyKey(storagePolicySelection.getStoragePolicyKey()); Assert.notNull(storagePolicySelection.getStoragePolicyVersion(), "A storage policy version must be specified."); }
public String toString() { final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
public Object clone() { return copyTo(createNewInstance()); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof StoragePolicySelection) { final StoragePolicySelection copy = ((StoragePolicySelection) draftCopy); if (businessObjectDataKeyShouldBeCopiedAndSet == Boolean.TRUE) { BusinessObjectDataKey sourceBusinessObjectDataKey; sourceBusinessObjectDataKey = this.getBusinessObjectDataKey(); BusinessObjectDataKey copyBusinessObjectDataKey = ((BusinessObjectDataKey) strategy.copy(LocatorUtils.property(locator, "businessObjectDataKey", sourceBusinessObjectDataKey), sourceBusinessObjectDataKey, (this.businessObjectDataKey!= null))); copy.setBusinessObjectDataKey(copyBusinessObjectDataKey); } else { if (businessObjectDataKeyShouldBeCopiedAndSet == Boolean.FALSE) { if (storagePolicyKeyShouldBeCopiedAndSet == Boolean.TRUE) { StoragePolicyKey sourceStoragePolicyKey; sourceStoragePolicyKey = this.getStoragePolicyKey(); StoragePolicyKey copyStoragePolicyKey = ((StoragePolicyKey) strategy.copy(LocatorUtils.property(locator, "storagePolicyKey", sourceStoragePolicyKey), sourceStoragePolicyKey, (this.storagePolicyKey!= null))); copy.setStoragePolicyKey(copyStoragePolicyKey); } else { if (storagePolicyKeyShouldBeCopiedAndSet == Boolean.FALSE) { if (storagePolicyVersionShouldBeCopiedAndSet == Boolean.TRUE) { Integer sourceStoragePolicyVersion; sourceStoragePolicyVersion = this.getStoragePolicyVersion(); Integer copyStoragePolicyVersion = ((Integer) strategy.copy(LocatorUtils.property(locator, "storagePolicyVersion", sourceStoragePolicyVersion), sourceStoragePolicyVersion, (this.storagePolicyVersion!= null))); copy.setStoragePolicyVersion(copyStoragePolicyVersion); } else { if (storagePolicyVersionShouldBeCopiedAndSet == Boolean.FALSE) {
public Object copyTo(Object target) { final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE; return copyTo(null, target, strategy); }
public static StoragePolicySelection.Builder<Void> copyOnly(final StoragePolicySelection _other, final PropertyTree _propertyTree) { return copyOf(_other, _propertyTree, PropertyTreeUse.INCLUDE); }
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
public static<_B >StoragePolicySelection.Builder<_B> copyOf(final StoragePolicySelection _other) { final StoragePolicySelection.Builder<_B> _newBuilder = new StoragePolicySelection.Builder<_B>(null, null, false); _other.copyTo(_newBuilder); return _newBuilder; }
public static StoragePolicySelection.Builder<Void> copyExcept(final StoragePolicySelection _other, final PropertyTree _propertyTree) { return copyOf(_other, _propertyTree, PropertyTreeUse.EXCLUDE); }
public Object createNewInstance() { return new StoragePolicySelection(); }
/** * Validates the storage policy selection. This method also trims the request parameters. * * @param storagePolicySelection the storage policy selection */ private void validateStoragePolicySelection(StoragePolicySelection storagePolicySelection) { Assert.notNull(storagePolicySelection, "A storage policy selection must be specified."); businessObjectDataHelper.validateBusinessObjectDataKey(storagePolicySelection.getBusinessObjectDataKey(), true, true); storagePolicyHelper.validateStoragePolicyKey(storagePolicySelection.getStoragePolicyKey()); Assert.notNull(storagePolicySelection.getStoragePolicyVersion(), "A storage policy version must be specified."); }
public static<_B >StoragePolicySelection.Builder<_B> copyOf(final StoragePolicySelection _other, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) { final StoragePolicySelection.Builder<_B> _newBuilder = new StoragePolicySelection.Builder<_B>(null, null, false); _other.copyTo(_newBuilder, _propertyTree, _propertyTreeUse); return _newBuilder; }
@Override public StoragePolicySelection build() { if (_storedValue == null) { return this.init(new StoragePolicySelection()); } else { return ((StoragePolicySelection) _storedValue); } }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { BusinessObjectDataKey theBusinessObjectDataKey; theBusinessObjectDataKey = this.getBusinessObjectDataKey(); strategy.appendField(locator, this, "businessObjectDataKey", buffer, theBusinessObjectDataKey, (this.businessObjectDataKey!= null)); } { StoragePolicyKey theStoragePolicyKey; theStoragePolicyKey = this.getStoragePolicyKey(); strategy.appendField(locator, this, "storagePolicyKey", buffer, theStoragePolicyKey, (this.storagePolicyKey!= null)); } { Integer theStoragePolicyVersion; theStoragePolicyVersion = this.getStoragePolicyVersion(); strategy.appendField(locator, this, "storagePolicyVersion", buffer, theStoragePolicyVersion, (this.storagePolicyVersion!= null)); } return buffer; }
storagePolicySelections.add(new StoragePolicySelection(businessObjectDataKey, storagePolicyKey, storagePolicyEntity.getVersion()));
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { BusinessObjectDataKey theBusinessObjectDataKey; theBusinessObjectDataKey = this.getBusinessObjectDataKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "businessObjectDataKey", theBusinessObjectDataKey), currentHashCode, theBusinessObjectDataKey, (this.businessObjectDataKey!= null)); } { StoragePolicyKey theStoragePolicyKey; theStoragePolicyKey = this.getStoragePolicyKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storagePolicyKey", theStoragePolicyKey), currentHashCode, theStoragePolicyKey, (this.storagePolicyKey!= null)); } { Integer theStoragePolicyVersion; theStoragePolicyVersion = this.getStoragePolicyVersion(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storagePolicyVersion", theStoragePolicyVersion), currentHashCode, theStoragePolicyVersion, (this.storagePolicyVersion!= null)); } return currentHashCode; }
storagePolicySelections.add(new StoragePolicySelection(businessObjectDataKey, storagePolicyKey, storagePolicyEntity.getVersion()));
lhsBusinessObjectDataKey = this.getBusinessObjectDataKey(); BusinessObjectDataKey rhsBusinessObjectDataKey; rhsBusinessObjectDataKey = that.getBusinessObjectDataKey(); if (!strategy.equals(LocatorUtils.property(thisLocator, "businessObjectDataKey", lhsBusinessObjectDataKey), LocatorUtils.property(thatLocator, "businessObjectDataKey", rhsBusinessObjectDataKey), lhsBusinessObjectDataKey, rhsBusinessObjectDataKey, (this.businessObjectDataKey!= null), (that.businessObjectDataKey!= null))) { return false; lhsStoragePolicyKey = this.getStoragePolicyKey(); StoragePolicyKey rhsStoragePolicyKey; rhsStoragePolicyKey = that.getStoragePolicyKey(); if (!strategy.equals(LocatorUtils.property(thisLocator, "storagePolicyKey", lhsStoragePolicyKey), LocatorUtils.property(thatLocator, "storagePolicyKey", rhsStoragePolicyKey), lhsStoragePolicyKey, rhsStoragePolicyKey, (this.storagePolicyKey!= null), (that.storagePolicyKey!= null))) { return false; lhsStoragePolicyVersion = this.getStoragePolicyVersion(); Integer rhsStoragePolicyVersion; rhsStoragePolicyVersion = that.getStoragePolicyVersion(); if (!strategy.equals(LocatorUtils.property(thisLocator, "storagePolicyVersion", lhsStoragePolicyVersion), LocatorUtils.property(thatLocator, "storagePolicyVersion", rhsStoragePolicyVersion), lhsStoragePolicyVersion, rhsStoragePolicyVersion, (this.storagePolicyVersion!= null), (that.storagePolicyVersion!= null))) { return false;
@Test public void testSendStoragePolicySelectionSqsMessageSqsOperationFails() { // Create a business object data key. BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION); // Create a storage policy key. StoragePolicyKey storagePolicyKey = new StoragePolicyKey(STORAGE_POLICY_NAMESPACE_CD, STORAGE_POLICY_NAME); // Try to execute AWS steps when AWS service exception is expected. try { businessObjectDataRetryStoragePolicyTransitionHelper.sendStoragePolicySelectionSqsMessage(MockSqsOperationsImpl.MOCK_SQS_QUEUE_NOT_FOUND_NAME, new StoragePolicySelection(businessObjectDataKey, storagePolicyKey, INITIAL_VERSION)); fail(); } catch (IllegalStateException e) { assertEquals(String.format("AWS SQS queue with \"%s\" name not found.", MockSqsOperationsImpl.MOCK_SQS_QUEUE_NOT_FOUND_NAME), e.getMessage()); } } }