private void writeAnalyticsExportDestination(XmlWriter xml, AnalyticsExportDestination destination) { if (destination == null) { return; } xml.start("Destination"); if (destination.getS3BucketDestination() != null) { xml.start("S3BucketDestination"); AnalyticsS3BucketDestination s3BucketDestination = destination.getS3BucketDestination(); addParameterIfNotNull(xml, "Format", s3BucketDestination.getFormat()); addParameterIfNotNull(xml, "BucketAccountId", s3BucketDestination.getBucketAccountId()); addParameterIfNotNull(xml, "Bucket", s3BucketDestination.getBucketArn()); addParameterIfNotNull(xml, "Prefix", s3BucketDestination.getPrefix()); xml.end(); // </S3BucketDestination> } xml.end(); // </Destination> }
@Override protected void doStartElement( String uri, String name, String qName, Attributes attrs) { if (in("AnalyticsConfiguration")) { if (name.equals("Filter")) { filter = new AnalyticsFilter(); } else if (name.equals("StorageClassAnalysis")) { storageClassAnalysis = new StorageClassAnalysis(); } } else if (in("AnalyticsConfiguration", "Filter")) { if (name.equals("And")) { andOperandsList = new ArrayList<AnalyticsFilterPredicate>(); } } else if (in("AnalyticsConfiguration", "StorageClassAnalysis")) { if (name.equals("DataExport")) { dataExport = new StorageClassAnalysisDataExport(); } } else if (in("AnalyticsConfiguration", "StorageClassAnalysis", "DataExport")) { if (name.equals("Destination")) { destination = new AnalyticsExportDestination(); } } else if (in("AnalyticsConfiguration", "StorageClassAnalysis", "DataExport", "Destination")) { if (name.equals("S3BucketDestination")) { s3BucketDestination = new AnalyticsS3BucketDestination(); } } }
/** * Sets the account ID that owns the destination bucket and returns this object for method chaining. * If no account ID is provided, the owner will not be validated prior to exporting data. */ public AnalyticsS3BucketDestination withBucketAccountId(String bucketAccountId) { setBucketAccountId(bucketAccountId); return this; }
s3BucketDestination.setFormat(getText()); } else if (name.equals("BucketAccountId")) { s3BucketDestination.setBucketAccountId(getText()); } else if (name.equals("Bucket")) { s3BucketDestination.setBucketArn(getText()); } else if (name.equals("Prefix")) { s3BucketDestination.setPrefix(getText());
/** * Sets the file format used when exporting data to Amazon S3. * Returns this object for method chaining. */ public AnalyticsS3BucketDestination withFormat(AnalyticsS3ExportFileFormat format) { setFormat(format); return this; }
/** * Sets the prefix to use when exporting data. The exported data begins with this prefix. * The object is returned for method chaining. */ public AnalyticsS3BucketDestination withPrefix(String prefix) { setPrefix(prefix); return this; } }
/** * Sets the Amazon resource name (ARN) of the bucket to which data is exported * and returns this object for method chaining. */ public AnalyticsS3BucketDestination withBucketArn(String bucketArn) { setBucketArn(bucketArn); return this; }
s3BucketDestination.setFormat(getText()); } else if (name.equals("BucketAccountId")) { s3BucketDestination.setBucketAccountId(getText()); } else if (name.equals("Bucket")) { s3BucketDestination.setBucketArn(getText()); } else if (name.equals("Prefix")) { s3BucketDestination.setPrefix(getText());
/** * Sets the file format used when exporting data to Amazon S3. * Returns this object for method chaining. */ public AnalyticsS3BucketDestination withFormat(String format) { setFormat(format); return this; }
/** * Sets the prefix to use when exporting data. The exported data begins with this prefix. * The object is returned for method chaining. * @param prefix used when exporting data. * @return this object for method chaining.. */ @SuppressWarnings("checkstyle:hiddenfield") public AnalyticsS3BucketDestination withPrefix(String prefix) { setPrefix(prefix); return this; } }
/** * Sets the Amazon resource name (ARN) of the bucket to which data is exported * and returns this object for method chaining. * @param bucketArn the bucket arn. * @return this object for method chaining. */ @SuppressWarnings("checkstyle:hiddenfield") public AnalyticsS3BucketDestination withBucketArn(String bucketArn) { setBucketArn(bucketArn); return this; }
private void writeAnalyticsExportDestination(XmlWriter xml, AnalyticsExportDestination destination) { if (destination == null) { return; } xml.start("Destination"); if (destination.getS3BucketDestination() != null) { xml.start("S3BucketDestination"); final AnalyticsS3BucketDestination s3BucketDestination = destination .getS3BucketDestination(); addParameterIfNotNull(xml, "Format", s3BucketDestination.getFormat()); addParameterIfNotNull(xml, "BucketAccountId", s3BucketDestination.getBucketAccountId()); addParameterIfNotNull(xml, "Bucket", s3BucketDestination.getBucketArn()); addParameterIfNotNull(xml, "Prefix", s3BucketDestination.getPrefix()); xml.end(); // </S3BucketDestination> } xml.end(); // </Destination> }
"Destination", "S3BucketDestination")) { if (name.equals("Format")) { s3BucketDestination.setFormat(getText()); } else if (name.equals("BucketAccountId")) { s3BucketDestination.setBucketAccountId(getText()); } else if (name.equals("Bucket")) { s3BucketDestination.setBucketArn(getText()); } else if (name.equals("Prefix")) { s3BucketDestination.setPrefix(getText());
s3BucketDestination = new AnalyticsS3BucketDestination();
/** * Sets the prefix to use when exporting data. The exported data begins with this prefix. * The object is returned for method chaining. * @param prefix used when exporting data. * @return this object for method chaining.. */ @SuppressWarnings("checkstyle:hiddenfield") public AnalyticsS3BucketDestination withPrefix(String prefix) { setPrefix(prefix); return this; } }
/** * Sets the account ID that owns the destination bucket and returns this object for method chaining. * If no account ID is provided, the owner will not be validated prior to exporting data. * @param bucketAccountId the bucket account ID. * @return this object for method chaining. */ @SuppressWarnings("checkstyle:hiddenfield") public AnalyticsS3BucketDestination withBucketAccountId(String bucketAccountId) { setBucketAccountId(bucketAccountId); return this; }
/** * Sets the Amazon resource name (ARN) of the bucket to which data is exported * and returns this object for method chaining. * @param bucketArn the bucket arn. * @return this object for method chaining. */ @SuppressWarnings("checkstyle:hiddenfield") public AnalyticsS3BucketDestination withBucketArn(String bucketArn) { setBucketArn(bucketArn); return this; }
@Test public void getResponse_unmarshalls_properly() throws Exception { AnalyticsConfiguration configuration = parseGetAnalyticsConfigurationResponse(GET_RESPONSE).getAnalyticsConfiguration(); AnalyticsFilter filter = configuration.getFilter(); StorageClassAnalysis storageClassAnalysis = configuration.getStorageClassAnalysis(); assertEquals("analytics-id", configuration.getId()); assertNotNull(filter); List<AnalyticsFilterPredicate> operands = ((AnalyticsAndOperator) filter.getPredicate()).getOperands(); assertEquals(2, operands.size()); assertEquals("documents/", ((AnalyticsPrefixPredicate) operands.get(0)).getPrefix()); assertEquals("foo", ((AnalyticsTagPredicate) operands.get(1)).getTag().getKey()); assertEquals("bar", ((AnalyticsTagPredicate) operands.get(1)).getTag().getValue()); assertEquals(StorageClassAnalysisSchemaVersion.V_1.toString(), storageClassAnalysis.getDataExport().getOutputSchemaVersion()); AnalyticsS3BucketDestination s3BucketDestination = storageClassAnalysis.getDataExport().getDestination().getS3BucketDestination(); assertEquals(AnalyticsS3ExportFileFormat.CSV.toString(), s3BucketDestination.getFormat()); assertEquals("123456789", s3BucketDestination.getBucketAccountId()); assertEquals("arn:aws:s3:::destination-bucket", s3BucketDestination.getBucketArn()); assertEquals("destination-prefix", s3BucketDestination.getPrefix()); }
"StorageClassAnalysis", "DataExport", "Destination", "S3BucketDestination")) { if (name.equals("Format")) { s3BucketDestination.setFormat(getText()); } else if (name.equals("BucketAccountId")) { s3BucketDestination.setBucketAccountId(getText()); } else if (name.equals("Bucket")) { s3BucketDestination.setBucketArn(getText()); } else if (name.equals("Prefix")) { s3BucketDestination.setPrefix(getText());