private static Map<String, EntityProperty> getPropertiesFromDictionary(TableEntity entity, TableRequestOptions options, final OperationContext opContext) throws IOException, StorageException { Map<String, EntityProperty> properties = entity.writeEntity(opContext); if (properties == null) { properties = new HashMap<String, EntityProperty>(); } options.assertPolicyIfRequired(); // Check if encryption policy is set and invoke EncryptEnity if it is set. if (options.getEncryptionPolicy() != null) { properties = options.getEncryptionPolicy().encryptEntity(properties, entity.getPartitionKey(), entity.getRowKey(), options.getEncryptionResolver()); } return properties; } }
/** * Populates any null fields in the first requestOptions object with values from the second requestOptions object. * * @param modifiedOptions * A {@link TableRequestOptions} object from which to copy options. * @param clientOptions * A {@link TableRequestOptions} object where options will be copied. * * @return A {@link RequestOptions} object. */ private static void populate(TableRequestOptions modifiedOptions, final TableRequestOptions clientOptions) { RequestOptions.populateRequestOptions(modifiedOptions, clientOptions, true /* setStartTime */); if (modifiedOptions.getTablePayloadFormat() == null) { modifiedOptions.setTablePayloadFormat(clientOptions.getTablePayloadFormat()); } if (modifiedOptions.getPropertyResolver() == null) { modifiedOptions.setPropertyResolver(clientOptions.getPropertyResolver()); } if (modifiedOptions.getDateBackwardCompatibility() == null) { modifiedOptions.setDateBackwardCompatibility(clientOptions.getDateBackwardCompatibility()); } if (modifiedOptions.getEncryptionPolicy() == null) { modifiedOptions.setEncryptionPolicy(clientOptions.getEncryptionPolicy()); } if (modifiedOptions.getEncryptionResolver()== null) { modifiedOptions.setEncryptionResolver(clientOptions.getEncryptionResolver()); } }
/** * Creates an instance of the <code>RequestOptions</code> class by copying values from another * <code>TableRequestOptions</code> instance. * * @param other * A <code>TableRequestOptions</code> object that represents the request options to copy. */ public TableRequestOptions(final TableRequestOptions other) { super(other); if (other != null) { this.setTablePayloadFormat(other.getTablePayloadFormat()); this.setPropertyResolver(other.getPropertyResolver()); this.setDateBackwardCompatibility(other.getDateBackwardCompatibility()); this.setEncryptionPolicy(other.getEncryptionPolicy()); this.setEncryptionResolver(other.getEncryptionResolver()); } }