Package org.duracloud.mill.dup
Class DuplicationPolicy
java.lang.Object
org.duracloud.mill.dup.DuplicationPolicy
A set of data showing, for a single DuraCloud account, which spaces
from which providers should be duplicated to another space on another
provider.
This class also handles the work of loading this data set from a file
stream, allowing it to be stored in a DuraCloud account and be read here.
- Author:
- Bill Branan Date: 10/18/13
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDuplicationStorePolicy(String spaceId, DuplicationStorePolicy dupStore) Adds a DuplicationStorePolicy for the specified space ID.A set of default policies.getDuplicationStorePolicies(String spaceId) Retrieve the duplication store policies associated with a space.A set of spaces which have policies associated with them.A list of spaces that should be ignored by the duplication task generator.static Stringmarshall(DuplicationPolicy duplicationPolicy) Unmarshals a duplication policy into a json string.static DuplicationPolicyunmarshall(InputStream policyStream) Marshals a json stream into a duplication policy object.
-
Constructor Details
-
DuplicationPolicy
public DuplicationPolicy()
-
-
Method Details
-
getDefaultPolicies
A set of default policies.- Returns:
-
getSpacesToIgnore
A list of spaces that should be ignored by the duplication task generator.- Returns:
-
getSpaceDuplicationStorePolicies
-
getSpaces
A set of spaces which have policies associated with them.- Returns:
-
getDuplicationStorePolicies
Retrieve the duplication store policies associated with a space. If no policies are set explicitly for that space, the method returns the default store policies. An empty set is returned if any of the following conditions are true: 1) the space starts with "x-" 2) the space is not configured explicitly and there are no default store policies configured. 3) the space is defined in spacesToIgnore- Parameters:
spaceId-- Returns:
-
addDuplicationStorePolicy
Adds a DuplicationStorePolicy for the specified space ID.- Parameters:
spaceId- the space ID to add the DuplicationStorePolicy fordupStore- the DuplicationStorePolicy- Returns:
- true if added, false otherwise. False will be returned if the
Set
for the specified space already contains the dupStore.
-
unmarshall
Marshals a json stream into a duplication policy object.- Parameters:
policyStream-- Returns:
- Throws:
IOException
-
marshall
Unmarshals a duplication policy into a json string.- Parameters:
duplicationPolicy-- Returns:
- Throws:
IOException
-