BusinessObjectDataDestroyDto businessObjectDataDestroyDto = new BusinessObjectDataDestroyDto(); businessObjectDataDestroyDto.getBusinessObjectDataKey(), businessObjectDataDestroyDto.getStorageName(), businessObjectDataDestroyDto.getNewStorageUnitStatus(), businessObjectDataDestroyDto.getOldStorageUnitStatus()); businessObjectDataDestroyDto.getBusinessObjectDataKey(), businessObjectDataDestroyDto.getNewBusinessObjectDataStatus(), businessObjectDataDestroyDto.getOldBusinessObjectDataStatus()); businessObjectDataDestroyDto.getBusinessObjectDataKey(), businessObjectDataDestroyDto.getStorageName(), businessObjectDataDestroyDto.getNewStorageUnitStatus(), businessObjectDataDestroyDto.getOldStorageUnitStatus());
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 BusinessObjectDataDestroyDto) { final BusinessObjectDataDestroyDto copy = ((BusinessObjectDataDestroyDto) 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 (storageNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceStorageName; sourceStorageName = this.getStorageName(); String copyStorageName = ((String) strategy.copy(LocatorUtils.property(locator, "storageName", sourceStorageName), sourceStorageName, (this.storageName!= null))); copy.setStorageName(copyStorageName); } else { if (storageNameShouldBeCopiedAndSet == Boolean.FALSE) { if (newBusinessObjectDataStatusShouldBeCopiedAndSet == Boolean.TRUE) { String sourceNewBusinessObjectDataStatus; sourceNewBusinessObjectDataStatus = this.getNewBusinessObjectDataStatus(); String copyNewBusinessObjectDataStatus = ((String) strategy.copy(LocatorUtils.property(locator, "newBusinessObjectDataStatus", sourceNewBusinessObjectDataStatus), sourceNewBusinessObjectDataStatus, (this.newBusinessObjectDataStatus!= null))); copy.setNewBusinessObjectDataStatus(copyNewBusinessObjectDataStatus); } else { if (newBusinessObjectDataStatusShouldBeCopiedAndSet == Boolean.FALSE) { if (oldBusinessObjectDataStatusShouldBeCopiedAndSet == Boolean.TRUE) {
theBusinessObjectDataKey = this.getBusinessObjectDataKey(); strategy.appendField(locator, this, "businessObjectDataKey", buffer, theBusinessObjectDataKey, (this.businessObjectDataKey!= null)); theStorageName = this.getStorageName(); strategy.appendField(locator, this, "storageName", buffer, theStorageName, (this.storageName!= null)); theNewBusinessObjectDataStatus = this.getNewBusinessObjectDataStatus(); strategy.appendField(locator, this, "newBusinessObjectDataStatus", buffer, theNewBusinessObjectDataStatus, (this.newBusinessObjectDataStatus!= null)); theOldBusinessObjectDataStatus = this.getOldBusinessObjectDataStatus(); strategy.appendField(locator, this, "oldBusinessObjectDataStatus", buffer, theOldBusinessObjectDataStatus, (this.oldBusinessObjectDataStatus!= null)); theNewStorageUnitStatus = this.getNewStorageUnitStatus(); strategy.appendField(locator, this, "newStorageUnitStatus", buffer, theNewStorageUnitStatus, (this.newStorageUnitStatus!= null)); theOldStorageUnitStatus = this.getOldStorageUnitStatus(); strategy.appendField(locator, this, "oldStorageUnitStatus", buffer, theOldStorageUnitStatus, (this.oldStorageUnitStatus!= null)); theS3Endpoint = this.getS3Endpoint(); strategy.appendField(locator, this, "s3Endpoint", buffer, theS3Endpoint, (this.s3Endpoint!= null)); theS3BucketName = this.getS3BucketName(); strategy.appendField(locator, this, "s3BucketName", buffer, theS3BucketName, (this.s3BucketName!= null)); theS3KeyPrefix = this.getS3KeyPrefix(); strategy.appendField(locator, this, "s3KeyPrefix", buffer, theS3KeyPrefix, (this.s3KeyPrefix!= null)); theS3ObjectTagKey = this.getS3ObjectTagKey(); strategy.appendField(locator, this, "s3ObjectTagKey", buffer, theS3ObjectTagKey, (this.s3ObjectTagKey!= null));
/** * Executes S3 specific steps required for initiation of a business object data destroy. * * @param businessObjectDataDestroyDto the DTO that holds various parameters needed to initiate a business object data destroy */ void executeS3SpecificStepsImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto) { // Create an S3 file transfer parameters DTO to access the S3 bucket. // Since the S3 key prefix represents a directory, we add a trailing '/' character to it. S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto = storageHelper.getS3FileTransferRequestParamsDto(); s3FileTransferRequestParamsDto.setS3Endpoint(businessObjectDataDestroyDto.getS3Endpoint()); s3FileTransferRequestParamsDto.setS3BucketName(businessObjectDataDestroyDto.getS3BucketName()); s3FileTransferRequestParamsDto.setS3KeyPrefix(StringUtils.appendIfMissing(businessObjectDataDestroyDto.getS3KeyPrefix(), "/")); // Create an S3 file transfer parameters DTO to be used for S3 object tagging operation. S3FileTransferRequestParamsDto s3ObjectTaggerParamsDto = storageHelper .getS3FileTransferRequestParamsDtoByRole(businessObjectDataDestroyDto.getS3ObjectTaggerRoleArn(), businessObjectDataDestroyDto.getS3ObjectTaggerRoleSessionName()); s3ObjectTaggerParamsDto.setS3Endpoint(businessObjectDataDestroyDto.getS3Endpoint()); // Get all S3 objects matching the S3 key prefix from the S3 bucket. List<S3VersionSummary> s3VersionSummaries = s3Service.listVersions(s3FileTransferRequestParamsDto); // Tag the S3 objects to initiate the deletion. s3Service.tagVersions(s3FileTransferRequestParamsDto, s3ObjectTaggerParamsDto, s3VersionSummaries, new Tag(businessObjectDataDestroyDto.getS3ObjectTagKey(), businessObjectDataDestroyDto.getS3ObjectTagValue())); }
BusinessObjectDataKey businessObjectDataKey = businessObjectDataDestroyDto.getBusinessObjectDataKey(); storageUnitDaoHelper.getStorageUnitEntity(businessObjectDataDestroyDto.getStorageName(), businessObjectDataEntity); StorageUnitStatusEntity.DISABLING, businessObjectDataDestroyDto.getStorageName(), businessObjectDataHelper.businessObjectDataKeyToString(businessObjectDataKey))); storageUnitEntity.setFinalDestroyOn(HerdDateUtils.addDays(currentTime, businessObjectDataDestroyDto.getFinalDestroyInDays())); businessObjectDataDestroyDto.setOldStorageUnitStatus(storageUnitEntity.getStatus().getCode()); storageUnitDaoHelper.updateStorageUnitStatus(storageUnitEntity, StorageUnitStatusEntity.DISABLED, reason); businessObjectDataDestroyDto.setNewStorageUnitStatus(storageUnitEntity.getStatus().getCode());
/** * Create an instance of {@link BusinessObjectDataDestroyDto } * */ public BusinessObjectDataDestroyDto createBusinessObjectDataDestroyDto() { return new BusinessObjectDataDestroyDto(); }
new BusinessObjectDataDestroyDto(businessObjectDataKey, STORAGE_NAME, BusinessObjectDataStatusEntity.DELETED, BusinessObjectDataStatusEntity.VALID, StorageUnitStatusEntity.DISABLING, StorageUnitStatusEntity.ENABLED, S3_ENDPOINT, S3_BUCKET_NAME, S3_KEY_PREFIX, S3_OBJECT_TAG_KEY, S3_OBJECT_TAG_VALUE, S3_OBJECT_TAGGER_ROLE_ARN, S3_OBJECT_TAGGER_ROLE_SESSION_NAME, BDATA_FINAL_DESTROY_DELAY_IN_DAYS), new BusinessObjectDataDestroyDto(businessObjectDataKey, STORAGE_NAME, BusinessObjectDataStatusEntity.DELETED, BusinessObjectDataStatusEntity.VALID, StorageUnitStatusEntity.DISABLED, StorageUnitStatusEntity.DISABLING, S3_ENDPOINT, S3_BUCKET_NAME, S3_KEY_PREFIX, S3_OBJECT_TAG_KEY, S3_OBJECT_TAG_VALUE, S3_OBJECT_TAGGER_ROLE_ARN, S3_OBJECT_TAGGER_ROLE_SESSION_NAME, BDATA_FINAL_DESTROY_DELAY_IN_DAYS)); businessObjectDataDestroyDtoStates.get(0).copyTo(businessObjectDataDestroyDto); return null; }).when(businessObjectDataInitiateDestroyHelperService).prepareToInitiateDestroy(new BusinessObjectDataDestroyDto(), businessObjectDataKey); doAnswer(invocation -> { BusinessObjectDataDestroyDto businessObjectDataDestroyDto = (BusinessObjectDataDestroyDto) invocation.getArguments()[0]; businessObjectDataDestroyDtoStates.get(1).copyTo(businessObjectDataDestroyDto); return null; }).when(businessObjectDataInitiateDestroyHelperService).executeInitiateDestroyAfterStep(any(BusinessObjectDataDestroyDto.class));
public Object copyTo(Object target) { final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE; return copyTo(null, target, strategy); }
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; lhsStorageName = this.getStorageName(); String rhsStorageName; rhsStorageName = that.getStorageName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "storageName", lhsStorageName), LocatorUtils.property(thatLocator, "storageName", rhsStorageName), lhsStorageName, rhsStorageName, (this.storageName!= null), (that.storageName!= null))) { return false; lhsNewBusinessObjectDataStatus = this.getNewBusinessObjectDataStatus(); String rhsNewBusinessObjectDataStatus; rhsNewBusinessObjectDataStatus = that.getNewBusinessObjectDataStatus(); if (!strategy.equals(LocatorUtils.property(thisLocator, "newBusinessObjectDataStatus", lhsNewBusinessObjectDataStatus), LocatorUtils.property(thatLocator, "newBusinessObjectDataStatus", rhsNewBusinessObjectDataStatus), lhsNewBusinessObjectDataStatus, rhsNewBusinessObjectDataStatus, (this.newBusinessObjectDataStatus!= null), (that.newBusinessObjectDataStatus!= null))) { return false; lhsOldBusinessObjectDataStatus = this.getOldBusinessObjectDataStatus(); String rhsOldBusinessObjectDataStatus; rhsOldBusinessObjectDataStatus = that.getOldBusinessObjectDataStatus(); if (!strategy.equals(LocatorUtils.property(thisLocator, "oldBusinessObjectDataStatus", lhsOldBusinessObjectDataStatus), LocatorUtils.property(thatLocator, "oldBusinessObjectDataStatus", rhsOldBusinessObjectDataStatus), lhsOldBusinessObjectDataStatus, rhsOldBusinessObjectDataStatus, (this.oldBusinessObjectDataStatus!= null), (that.oldBusinessObjectDataStatus!= null))) { return false; lhsNewStorageUnitStatus = this.getNewStorageUnitStatus(); String rhsNewStorageUnitStatus; rhsNewStorageUnitStatus = that.getNewStorageUnitStatus(); if (!strategy.equals(LocatorUtils.property(thisLocator, "newStorageUnitStatus", lhsNewStorageUnitStatus), LocatorUtils.property(thatLocator, "newStorageUnitStatus", rhsNewStorageUnitStatus), lhsNewStorageUnitStatus, rhsNewStorageUnitStatus, (this.newStorageUnitStatus!= null), (that.newStorageUnitStatus!= null))) { return false;
/** * Executes S3 specific steps required for initiation of a business object data destroy. * * @param businessObjectDataDestroyDto the DTO that holds various parameters needed to initiate a business object data destroy */ void executeS3SpecificStepsImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto) { // Create an S3 file transfer parameters DTO to access the S3 bucket. // Since the S3 key prefix represents a directory, we add a trailing '/' character to it. S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto = storageHelper.getS3FileTransferRequestParamsDto(); s3FileTransferRequestParamsDto.setS3Endpoint(businessObjectDataDestroyDto.getS3Endpoint()); s3FileTransferRequestParamsDto.setS3BucketName(businessObjectDataDestroyDto.getS3BucketName()); s3FileTransferRequestParamsDto.setS3KeyPrefix(StringUtils.appendIfMissing(businessObjectDataDestroyDto.getS3KeyPrefix(), "/")); // Create an S3 file transfer parameters DTO to be used for S3 object tagging operation. S3FileTransferRequestParamsDto s3ObjectTaggerParamsDto = storageHelper .getS3FileTransferRequestParamsDtoByRole(businessObjectDataDestroyDto.getS3ObjectTaggerRoleArn(), businessObjectDataDestroyDto.getS3ObjectTaggerRoleSessionName()); s3ObjectTaggerParamsDto.setS3Endpoint(businessObjectDataDestroyDto.getS3Endpoint()); // Get all S3 objects matching the S3 key prefix from the S3 bucket. List<S3VersionSummary> s3VersionSummaries = s3Service.listVersions(s3FileTransferRequestParamsDto); // Tag the S3 objects to initiate the deletion. s3Service.tagVersions(s3FileTransferRequestParamsDto, s3ObjectTaggerParamsDto, s3VersionSummaries, new Tag(businessObjectDataDestroyDto.getS3ObjectTagKey(), businessObjectDataDestroyDto.getS3ObjectTagValue())); }
BusinessObjectDataKey businessObjectDataKey = businessObjectDataDestroyDto.getBusinessObjectDataKey(); storageUnitDaoHelper.getStorageUnitEntity(businessObjectDataDestroyDto.getStorageName(), businessObjectDataEntity); StorageUnitStatusEntity.DISABLING, businessObjectDataDestroyDto.getStorageName(), businessObjectDataHelper.businessObjectDataKeyToString(businessObjectDataKey))); storageUnitEntity.setFinalDestroyOn(HerdDateUtils.addDays(currentTime, businessObjectDataDestroyDto.getFinalDestroyInDays())); businessObjectDataDestroyDto.setOldStorageUnitStatus(storageUnitEntity.getStatus().getCode()); storageUnitDaoHelper.updateStorageUnitStatus(storageUnitEntity, StorageUnitStatusEntity.DISABLED, reason); businessObjectDataDestroyDto.setNewStorageUnitStatus(storageUnitEntity.getStatus().getCode());
public Object createNewInstance() { return new BusinessObjectDataDestroyDto(); }
public static<_B >BusinessObjectDataDestroyDto.Builder<_B> copyOf(final BusinessObjectDataDestroyDto _other) { final BusinessObjectDataDestroyDto.Builder<_B> _newBuilder = new BusinessObjectDataDestroyDto.Builder<_B>(null, null, false); _other.copyTo(_newBuilder); return _newBuilder; }
theBusinessObjectDataKey = this.getBusinessObjectDataKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "businessObjectDataKey", theBusinessObjectDataKey), currentHashCode, theBusinessObjectDataKey, (this.businessObjectDataKey!= null)); theStorageName = this.getStorageName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storageName", theStorageName), currentHashCode, theStorageName, (this.storageName!= null)); theNewBusinessObjectDataStatus = this.getNewBusinessObjectDataStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "newBusinessObjectDataStatus", theNewBusinessObjectDataStatus), currentHashCode, theNewBusinessObjectDataStatus, (this.newBusinessObjectDataStatus!= null)); theOldBusinessObjectDataStatus = this.getOldBusinessObjectDataStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oldBusinessObjectDataStatus", theOldBusinessObjectDataStatus), currentHashCode, theOldBusinessObjectDataStatus, (this.oldBusinessObjectDataStatus!= null)); theNewStorageUnitStatus = this.getNewStorageUnitStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "newStorageUnitStatus", theNewStorageUnitStatus), currentHashCode, theNewStorageUnitStatus, (this.newStorageUnitStatus!= null)); theOldStorageUnitStatus = this.getOldStorageUnitStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oldStorageUnitStatus", theOldStorageUnitStatus), currentHashCode, theOldStorageUnitStatus, (this.oldStorageUnitStatus!= null)); theS3Endpoint = this.getS3Endpoint(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "s3Endpoint", theS3Endpoint), currentHashCode, theS3Endpoint, (this.s3Endpoint!= null)); theS3BucketName = this.getS3BucketName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "s3BucketName", theS3BucketName), currentHashCode, theS3BucketName, (this.s3BucketName!= null)); theS3KeyPrefix = this.getS3KeyPrefix(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "s3KeyPrefix", theS3KeyPrefix), currentHashCode, theS3KeyPrefix, (this.s3KeyPrefix!= null)); theS3ObjectTagKey = this.getS3ObjectTagKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "s3ObjectTagKey", theS3ObjectTagKey), currentHashCode, theS3ObjectTagKey, (this.s3ObjectTagKey!= null));
BusinessObjectDataDestroyDto businessObjectDataDestroyDto = new BusinessObjectDataDestroyDto(); businessObjectDataDestroyDto.getBusinessObjectDataKey(), businessObjectDataDestroyDto.getStorageName(), businessObjectDataDestroyDto.getNewStorageUnitStatus(), businessObjectDataDestroyDto.getOldStorageUnitStatus()); businessObjectDataDestroyDto.getBusinessObjectDataKey(), businessObjectDataDestroyDto.getNewBusinessObjectDataStatus(), businessObjectDataDestroyDto.getOldBusinessObjectDataStatus()); businessObjectDataDestroyDto.getBusinessObjectDataKey(), businessObjectDataDestroyDto.getStorageName(), businessObjectDataDestroyDto.getNewStorageUnitStatus(), businessObjectDataDestroyDto.getOldStorageUnitStatus());
@Override public BusinessObjectDataDestroyDto build() { if (_storedValue == null) { return this.init(new BusinessObjectDataDestroyDto()); } else { return ((BusinessObjectDataDestroyDto) _storedValue); } }
public static<_B >BusinessObjectDataDestroyDto.Builder<_B> copyOf(final BusinessObjectDataDestroyDto _other, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) { final BusinessObjectDataDestroyDto.Builder<_B> _newBuilder = new BusinessObjectDataDestroyDto.Builder<_B>(null, null, false); _other.copyTo(_newBuilder, _propertyTree, _propertyTreeUse); return _newBuilder; }
new BusinessObjectDataDestroyDto(businessObjectDataKey, STORAGE_NAME, BusinessObjectDataStatusEntity.DELETED, BusinessObjectDataStatusEntity.VALID, StorageUnitStatusEntity.DISABLING, StorageUnitStatusEntity.ENABLED, S3_ENDPOINT, S3_BUCKET_NAME, TEST_S3_KEY_PREFIX, S3_OBJECT_TAG_KEY, S3_OBJECT_TAG_VALUE, S3_OBJECT_TAGGER_ROLE_ARN, S3_OBJECT_TAGGER_ROLE_SESSION_NAME, BDATA_FINAL_DESTROY_DELAY_IN_DAYS); new BusinessObjectDataDestroyDto(businessObjectDataKey, STORAGE_NAME, BusinessObjectDataStatusEntity.DELETED, BusinessObjectDataStatusEntity.VALID, StorageUnitStatusEntity.DISABLING, StorageUnitStatusEntity.ENABLED, S3_ENDPOINT, S3_BUCKET_NAME, TEST_S3_KEY_PREFIX, S3_OBJECT_TAG_KEY, S3_OBJECT_TAG_VALUE, S3_OBJECT_TAGGER_ROLE_ARN, S3_OBJECT_TAGGER_ROLE_SESSION_NAME, BDATA_FINAL_DESTROY_DELAY_IN_DAYS),
BusinessObjectDataDestroyDto businessObjectDataDestroyDto = new BusinessObjectDataDestroyDto(); new BusinessObjectDataDestroyDto(businessObjectDataKey, STORAGE_NAME, BusinessObjectDataStatusEntity.DELETED, BusinessObjectDataStatusEntity.VALID, StorageUnitStatusEntity.DISABLING, StorageUnitStatusEntity.ENABLED, S3_ENDPOINT, S3_BUCKET_NAME, TEST_S3_KEY_PREFIX, S3_OBJECT_TAG_KEY, S3_OBJECT_TAG_VALUE, S3_OBJECT_TAGGER_ROLE_ARN, S3_OBJECT_TAGGER_ROLE_SESSION_NAME, BDATA_FINAL_DESTROY_DELAY_IN_DAYS),