public abstract class AssociatedRepository extends SandboxedRepository
branch
, refresh
,
publish
or destroy
are no-op. The "changes"
reported by this class are the associated workspaces.
Note that a sandbox can be associated with independent repositories without
the use of a AssociatedRepository
. As long as the ID of a
repository is available, association can be made using class
RepositoryAssociation
and
RepositoryAssociationUpdate
. It is however recommended that
an associated repository should define a subclass of this class as a place
holder to better integrate with the "composed" repository branches in the
same sandbox. Having a repository class will also make the association
more visible since the associated workspaces are presented as repository
changes.
SandboxedRepository.MainlineCertifier
Modifier | Constructor and Description |
---|---|
protected |
AssociatedRepository()
Constructs an associated repository instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
branch(Sandbox sandbox,
java.lang.String sourceBaseline)
Branches the objects for a sandbox so that future modifications to the
sandbox will not affect the original repository.
|
void |
destroy(Sandbox sandbox)
Destroys a sandbox.
|
ChangeSet |
getChanges(Sandbox sandbox)
Returns the workspaces as changes.
|
abstract java.lang.String |
getPreferredSandboxedFeature()
Returns the ID of the preferred sandboxed feature that uses this
repository.
|
static boolean |
hasAssociatedChanges(Sandbox sandbox,
java.lang.String featureId)
Returns
true if any repository "branched" in a sandbox is an
instance of this class and hasChanges returns
true . |
boolean |
hasChanges(Sandbox sandbox)
Returns
true if there is any associated workspace. |
UndoableChanges |
publish(Sandbox sandbox)
Merges changes in a sandbox into the repository mainline.
|
UndoableChanges |
refresh(Sandbox sandbox,
java.lang.String targetBaseline)
Merges changes from a repository baseline into the sandbox.
|
branch, equals, getAvailableProviders, getAvailableProviders, getBranchId, getId, getInstance, getInstance, getLastUpdateDate, getLastUpdatedBy, getMainlineCertifier, getName, getPendingTransaction, getState, hashCode, isRefreshNeeded, newCertifiedLabel, prepareForRefresh, prePublish, publish, publishCompleted, refreshCompleted, setProgress, test, test, toString, warn
protected AssociatedRepository()
public abstract java.lang.String getPreferredSandboxedFeature()
SandboxedFeature
be defined for better visibility.
Some clients such as REST services may enable this preferred feature in a sandbox as soon as this repository is associated with the sandbox.
null
if
not availablepublic static boolean hasAssociatedChanges(Sandbox sandbox, java.lang.String featureId)
true
if any repository "branched" in a sandbox is an
instance of this class and hasChanges
returns
true
. The result may not be accurate if the implementation
class of the sandboxed feature or any of the branched repositories is not
available in the system.sandbox
- the sandbox to be checkedfeatureId
- the ID of an enabled sandboxed feature. If not null and
the feature is indeed enabled in the sandbox, only the
repositories used by the feature are checked.true
if any branched repository in the sandbox or of
an enabled feature is an instance of this class and
hasChanges
returns truejava.lang.IllegalArgumentException
- if the sandbox is nullpublic java.lang.String branch(Sandbox sandbox, java.lang.String sourceBaseline) throws SandboxException
SandboxedRepository
branch
in class SandboxedRepository
sandbox
- the sandboxsourceBaseline
- the baseline which the sandbox is based on. The
baseline is usually the latest certified baselineSandboxException
- if an error occursSandboxedRepository.refresh(oracle.adf.share.sandbox.Sandbox, String)
public UndoableChanges refresh(Sandbox sandbox, java.lang.String targetBaseline) throws MergeConflictsException, SandboxException
SandboxedRepository
refresh
in class SandboxedRepository
sandbox
- the sandboxtargetBaseline
- the target baseline; null
if the target
baseline should be the tip of the mainlinenull
if there is no changeMergeConflictsException
- if any conflict occurs during the mergeSandboxException
- if an error occurspublic UndoableChanges publish(Sandbox sandbox) throws MergeConflictsException, SandboxException
SandboxedRepository
publish
in class SandboxedRepository
sandbox
- the sandboxnull
if there is no changeMergeConflictsException
- if any conflict occurs during the mergeSandboxException
- if an error occurspublic ChangeSet getChanges(Sandbox sandbox)
getChanges
in class SandboxedRepository
sandbox
- the sandbox associated with this repositoryjava.lang.IllegalArgumentException
- if the sandbox is nullpublic boolean hasChanges(Sandbox sandbox)
true
if there is any associated workspace.hasChanges
in class SandboxedRepository
sandbox
- the sandbox associated with this repositorytrue
if there is any associated workspacejava.lang.IllegalArgumentException
- if the sandbox is nullSandboxedRepository.getChanges(oracle.adf.share.sandbox.Sandbox)
public void destroy(Sandbox sandbox) throws SandboxException
SandboxedRepository
destroy
in class SandboxedRepository
sandbox
- the sandboxSandboxException
- if an error occurs