public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { AwsCredential theAwsCredential; theAwsCredential = this.getAwsCredential(); strategy.appendField(locator, this, "awsCredential", buffer, theAwsCredential, (this.awsCredential!= null)); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { AwsCredential theAwsCredential; theAwsCredential = this.getAwsCredential(); strategy.appendField(locator, this, "awsCredential", buffer, theAwsCredential, (this.awsCredential!= null)); } return buffer; }
@Override public AwsCredential getNewAwsCredential() throws Exception { return downloaderWebClient.getStorageUnitDownloadCredential(manifest, storageName).getAwsCredential(); } });
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { AwsCredential theAwsCredential; theAwsCredential = this.getAwsCredential(); strategy.appendField(locator, this, "awsCredential", buffer, theAwsCredential, (this.awsCredential!= null)); } return buffer; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final StorageUnitDownloadCredential that = ((StorageUnitDownloadCredential) object); { AwsCredential lhsAwsCredential; lhsAwsCredential = this.getAwsCredential(); AwsCredential rhsAwsCredential; rhsAwsCredential = that.getAwsCredential(); if (!strategy.equals(LocatorUtils.property(thisLocator, "awsCredential", lhsAwsCredential), LocatorUtils.property(thatLocator, "awsCredential", rhsAwsCredential), lhsAwsCredential, rhsAwsCredential, (this.awsCredential!= null), (that.awsCredential!= null))) { return false; } } return true; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final StorageUnitDownloadCredential that = ((StorageUnitDownloadCredential) object); { AwsCredential lhsAwsCredential; lhsAwsCredential = this.getAwsCredential(); AwsCredential rhsAwsCredential; rhsAwsCredential = that.getAwsCredential(); if (!strategy.equals(LocatorUtils.property(thisLocator, "awsCredential", lhsAwsCredential), LocatorUtils.property(thatLocator, "awsCredential", rhsAwsCredential), lhsAwsCredential, rhsAwsCredential, (this.awsCredential!= null), (that.awsCredential!= null))) { return false; } } return true; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { AwsCredential theAwsCredential; theAwsCredential = this.getAwsCredential(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "awsCredential", theAwsCredential), currentHashCode, theAwsCredential, (this.awsCredential!= null)); } return currentHashCode; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final StorageUnitDownloadCredential that = ((StorageUnitDownloadCredential) object); { AwsCredential lhsAwsCredential; lhsAwsCredential = this.getAwsCredential(); AwsCredential rhsAwsCredential; rhsAwsCredential = that.getAwsCredential(); if (!strategy.equals(LocatorUtils.property(thisLocator, "awsCredential", lhsAwsCredential), LocatorUtils.property(thatLocator, "awsCredential", rhsAwsCredential), lhsAwsCredential, rhsAwsCredential, (this.awsCredential!= null), (that.awsCredential!= null))) { return false; } } return true; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { AwsCredential theAwsCredential; theAwsCredential = this.getAwsCredential(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "awsCredential", theAwsCredential), currentHashCode, theAwsCredential, (this.awsCredential!= null)); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { AwsCredential theAwsCredential; theAwsCredential = this.getAwsCredential(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "awsCredential", theAwsCredential), currentHashCode, theAwsCredential, (this.awsCredential!= null)); } return currentHashCode; }
businessObjectDataVersion), storageName); return new BusinessObjectDataDownloadCredential(storageUnitDownloadCredential.getAwsCredential());
businessObjectDataVersion), storageName); return new BusinessObjectDataDownloadCredential(storageUnitDownloadCredential.getAwsCredential());
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof StorageUnitDownloadCredential) { final StorageUnitDownloadCredential copy = ((StorageUnitDownloadCredential) draftCopy); { Boolean awsCredentialShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.awsCredential!= null)); if (awsCredentialShouldBeCopiedAndSet == Boolean.TRUE) { AwsCredential sourceAwsCredential; sourceAwsCredential = this.getAwsCredential(); AwsCredential copyAwsCredential = ((AwsCredential) strategy.copy(LocatorUtils.property(locator, "awsCredential", sourceAwsCredential), sourceAwsCredential, (this.awsCredential!= null))); copy.setAwsCredential(copyAwsCredential); } else { if (awsCredentialShouldBeCopiedAndSet == Boolean.FALSE) { copy.awsCredential = null; } } } } return draftCopy; }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof StorageUnitDownloadCredential) { final StorageUnitDownloadCredential copy = ((StorageUnitDownloadCredential) draftCopy); { Boolean awsCredentialShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.awsCredential!= null)); if (awsCredentialShouldBeCopiedAndSet == Boolean.TRUE) { AwsCredential sourceAwsCredential; sourceAwsCredential = this.getAwsCredential(); AwsCredential copyAwsCredential = ((AwsCredential) strategy.copy(LocatorUtils.property(locator, "awsCredential", sourceAwsCredential), sourceAwsCredential, (this.awsCredential!= null))); copy.setAwsCredential(copyAwsCredential); } else { if (awsCredentialShouldBeCopiedAndSet == Boolean.FALSE) { copy.awsCredential = null; } } } } return draftCopy; }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof StorageUnitDownloadCredential) { final StorageUnitDownloadCredential copy = ((StorageUnitDownloadCredential) draftCopy); { Boolean awsCredentialShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.awsCredential!= null)); if (awsCredentialShouldBeCopiedAndSet == Boolean.TRUE) { AwsCredential sourceAwsCredential; sourceAwsCredential = this.getAwsCredential(); AwsCredential copyAwsCredential = ((AwsCredential) strategy.copy(LocatorUtils.property(locator, "awsCredential", sourceAwsCredential), sourceAwsCredential, (this.awsCredential!= null))); copy.setAwsCredential(copyAwsCredential); } else { if (awsCredentialShouldBeCopiedAndSet == Boolean.FALSE) { copy.awsCredential = null; } } } } return draftCopy; }
@Test public void getStorageUnitDownloadCredential() { BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(); businessObjectDataKey.setNamespace(NAMESPACE); businessObjectDataKey.setBusinessObjectDefinitionName(BDEF_NAME); businessObjectDataKey.setBusinessObjectFormatUsage(FORMAT_USAGE_CODE); businessObjectDataKey.setBusinessObjectFormatFileType(FORMAT_FILE_TYPE_CODE); businessObjectDataKey.setBusinessObjectFormatVersion(FORMAT_VERSION); businessObjectDataKey.setPartitionValue(PARTITION_VALUE); businessObjectDataKey.setBusinessObjectDataVersion(DATA_VERSION); String storageName = STORAGE_NAME; createBusinessObjectFormatEntity(businessObjectDataKey); // Create an S3 storage entity. List<Attribute> attributes = new ArrayList<>(); attributes.add(new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_DOWNLOAD_ROLE_ARN), "testRole")); attributes.add(new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_BUCKET_NAME), "testBucket")); attributes.add( new Attribute(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_KEY_PREFIX_VELOCITY_TEMPLATE), S3_KEY_PREFIX_VELOCITY_TEMPLATE)); storageDaoTestHelper.createStorageEntity(storageName, StoragePlatformEntity.S3, attributes); StorageUnitDownloadCredential storageUnitDownloadCredential = storageUnitService.getStorageUnitDownloadCredential(businessObjectDataKey, storageName); assertNotNull(storageUnitDownloadCredential); assertNotNull(storageUnitDownloadCredential.getAwsCredential()); assertNotNull(storageUnitDownloadCredential.getAwsCredential().getAwsAccessKey()); assertNotNull(storageUnitDownloadCredential.getAwsCredential().getAwsSecretKey()); assertNotNull(storageUnitDownloadCredential.getAwsCredential().getAwsSessionToken()); assertNotNull(storageUnitDownloadCredential.getAwsCredential().getAwsSessionExpirationTime()); }
@Test public void testGetBusinessObjectDataDownloadCredential1() throws Exception { DownloaderInputManifestDto manifest = new DownloaderInputManifestDto(); manifest.setNamespace("test1"); manifest.setBusinessObjectDefinitionName("test2"); manifest.setBusinessObjectFormatUsage("test3"); manifest.setBusinessObjectFormatFileType("test4"); manifest.setBusinessObjectFormatVersion("test5"); manifest.setPartitionValue("test6"); manifest.setSubPartitionValues(Arrays.asList("test7", "test8")); manifest.setBusinessObjectDataVersion("test9"); String storageName = "test10"; StorageUnitDownloadCredential storageUnitDownloadCredential = downloaderWebClient.getStorageUnitDownloadCredential(manifest, storageName); Assert.assertNotNull(storageUnitDownloadCredential); AwsCredential awsCredential = storageUnitDownloadCredential.getAwsCredential(); Assert.assertNotNull(awsCredential); Assert.assertEquals("https://testWebServiceHostname:1234/herd-app/rest/storageUnits/download/credential/namespaces/test1" + "/businessObjectDefinitionNames/test2/businessObjectFormatUsages/test3/businessObjectFormatFileTypes/test4/businessObjectFormatVersions/test5" + "/partitionValues/test6/businessObjectDataVersions/test9/storageNames/test10?subPartitionValues=test7%7Ctest8", awsCredential.getAwsAccessKey()); }
@Test public void testGetBusinessObjectDataDownloadCredential2() throws Exception { DownloaderInputManifestDto manifest = new DownloaderInputManifestDto(); manifest.setNamespace("test1"); manifest.setBusinessObjectDefinitionName("test2"); manifest.setBusinessObjectFormatUsage("test3"); manifest.setBusinessObjectFormatFileType("test4"); manifest.setBusinessObjectFormatVersion("test5"); manifest.setPartitionValue("test6"); manifest.setBusinessObjectDataVersion("test9"); String storageName = "test10"; downloaderWebClient.getRegServerAccessParamsDto().setUseSsl(true); StorageUnitDownloadCredential storageUnitDownloadCredential = downloaderWebClient.getStorageUnitDownloadCredential(manifest, storageName); Assert.assertNotNull(storageUnitDownloadCredential); AwsCredential awsCredential = storageUnitDownloadCredential.getAwsCredential(); Assert.assertNotNull(awsCredential); Assert.assertEquals("https://testWebServiceHostname:1234/herd-app/rest/storageUnits/download/credential/namespaces/test1" + "/businessObjectDefinitionNames/test2/businessObjectFormatUsages/test3/businessObjectFormatFileTypes/test4/businessObjectFormatVersions/test5" + "/partitionValues/test6/businessObjectDataVersions/test9/storageNames/test10", awsCredential.getAwsAccessKey()); }