Package org.duracloud.mill.dup.repo
Class S3DuplicationPolicyRepo
- java.lang.Object
-
- org.duracloud.mill.dup.repo.S3DuplicationPolicyRepo
-
- All Implemented Interfaces:
DuplicationPolicyRepo
public class S3DuplicationPolicyRepo extends Object implements DuplicationPolicyRepo
Provides access to a duplication policy repo that is stored in S3, as a bucket which contains the policy files.- Author:
- Bill Branan Date: 10/31/13
-
-
Field Summary
Fields Modifier and Type Field Description static StringDUP_POLICY_REPO_BUCKET_SUFFIX-
Fields inherited from interface org.duracloud.mill.dup.repo.DuplicationPolicyRepo
DUP_ACCOUNTS_NAME, DUP_POLICY_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description S3DuplicationPolicyRepo()Creates an S3 policy repo connection.S3DuplicationPolicyRepo(com.amazonaws.services.s3.AmazonS3 s3Client)Intended for testingS3DuplicationPolicyRepo(com.amazonaws.services.s3.AmazonS3 s3Client, String policyRepoBucketSuffix)S3DuplicationPolicyRepo(String policyRepoBucketSuffix)Creates an S3 policy repo connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetDuplicationAccounts()Provides a listing of DuraCloud accounts which require duplication.InputStreamgetDuplicationPolicy(String account)Provides the duplication policy for a given account
-
-
-
Field Detail
-
DUP_POLICY_REPO_BUCKET_SUFFIX
public static final String DUP_POLICY_REPO_BUCKET_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
S3DuplicationPolicyRepo
public S3DuplicationPolicyRepo()
Creates an S3 policy repo connection. Expects that S3 credentials will be available from the environment, as described here: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html
-
S3DuplicationPolicyRepo
public S3DuplicationPolicyRepo(String policyRepoBucketSuffix)
Creates an S3 policy repo connection. Uses the provided bucket suffix. Expects that S3 credentials will be available from the environment, as described here: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html
-
S3DuplicationPolicyRepo
public S3DuplicationPolicyRepo(com.amazonaws.services.s3.AmazonS3 s3Client, String policyRepoBucketSuffix)
-
S3DuplicationPolicyRepo
public S3DuplicationPolicyRepo(com.amazonaws.services.s3.AmazonS3 s3Client)
Intended for testing
-
-
Method Detail
-
getDuplicationAccounts
public InputStream getDuplicationAccounts()
Description copied from interface:DuplicationPolicyRepoProvides a listing of DuraCloud accounts which require duplication. Accounts are identified using their subdomain value.- Specified by:
getDuplicationAccountsin interfaceDuplicationPolicyRepo- Returns:
-
getDuplicationPolicy
public InputStream getDuplicationPolicy(String account)
Description copied from interface:DuplicationPolicyRepoProvides the duplication policy for a given account- Specified by:
getDuplicationPolicyin interfaceDuplicationPolicyRepo- Returns:
-
-