public abstract class SandboxSupport
extends java.lang.Object
Constructor and Description |
---|
SandboxSupport() |
Modifier and Type | Method and Description |
---|---|
boolean |
addAdministrator(Sandbox sandbox,
java.lang.String userName)
Adds a user to the list of administrators of a sandbox.
|
abstract void |
addRepository(Sandbox sandbox,
SandboxedRepository repos)
Adds a repository in its latest certified state to a sandbox.
|
boolean |
canSynchronizedPublish(Sandbox sandbox)
Returns
true if all locks needed for
synchronizedPublish are available at the time of the
invocation. |
MetadataRevision |
certifyRepositoryMainline(java.util.Set<java.lang.String> reposIdSet,
java.lang.String revisionNote)
Certifies the state of the mainlines of the specified repositories
at the time of invocation.
|
MetadataRevision |
certifyRepositoryMainline(java.lang.String reposId,
java.lang.String revisionNote)
Certifies the state of the mainline of a specified repository.
|
void |
checkNewSandboxName(java.lang.String name)
Checks if a String can be used to name a new sandbox.
|
boolean |
completeSandboxPendingUpdates(Sandbox sandbox)
Completes all pending updates.
|
void |
completeSandboxPendingUpdates(java.lang.String sandboxId,
SandboxBackgroundTask.Proxy<java.lang.Boolean> proxy)
Completes all pending updates in a background thread.
|
boolean |
containsRepositoryErrorLogs(Sandbox sandbox)
Returns
true if an error occurred to any repository during
the last sandbox operation. |
abstract void |
destroy(Sandbox sandbox)
Destroys a sandbox and deletes all information pertaining to the sandbox.
|
void |
destroy(Sandbox sandbox,
boolean retainInfo)
Destroys a sandbox and optionally retains the sandbox information such as
operation logs.
|
void |
destroy(java.lang.String sandboxId,
boolean retainInfo,
SandboxBackgroundTask.Proxy<java.lang.Object> proxy)
Destroys a sandbox in a background thread.
|
abstract boolean |
enableFeature(Sandbox sandbox,
java.lang.String featureId)
Enables a feature in the sandbox.
|
java.util.Map<java.lang.String,java.lang.Throwable> |
enableFeatures(Sandbox sandbox,
java.util.List<java.lang.String> featureIdList)
Enables a list of features.
|
void |
enableFeatures(java.lang.String sandboxId,
java.util.List<java.lang.String> featureIdList,
SandboxBackgroundTask.Proxy<java.util.Map<java.lang.String,java.lang.Throwable>> proxy)
Enables a list of features in a background thread.
|
Sandbox |
findSandbox(java.lang.String nameOrId)
Finds a sandbox by its name or ID.
|
java.util.List<java.lang.String> |
getEnabledFeatureIdList(Sandbox sandbox)
Gets the IDs of the features enabled in a sandbox.
|
abstract java.util.List<SandboxedFeature> |
getEnabledFeatures(Sandbox sandbox)
Returns the list of features enabled in a sandbox.
|
static SandboxSupport |
getInstance()
Returns the system default implementation of this class.
|
int |
getNumberOfOpenSandboxes()
Returns the number of sandboxes that are currently open, excluding the
sandboxes created from archives.
|
int |
getNumberOfOpenSandboxes(boolean includeArchives)
Returns the number of sandboxes that are currently open.
|
abstract java.util.List<SandboxedRepository> |
getRepositories(Sandbox sandbox)
Returns the list of repositories that have been branched for a sandbox.
|
java.util.Map<java.lang.String,ChangeHint> |
getRepositoryChangeHints(Sandbox sandbox)
Returns the hints taken by the current operation.
|
RepositoryErrorLog |
getRepositoryErrorLog(Sandbox sandbox,
java.lang.String reposId)
Returns the error log from the last repository operation if any.
|
java.util.List<RepositoryErrorLog> |
getRepositoryErrorLogs(Sandbox sandbox)
Returns the list of non-null error logs from the repository branches of a
sandbox.
|
java.util.List<java.lang.String> |
getRepositoryIdList(Sandbox sandbox)
Returns the IDs of the repositories that have been branched for a sandbox.
|
ChangeSet |
getRepositoryLastChanges(Sandbox sandbox,
java.lang.String reposId)
Returns the changes obtained last time from a repository branch.
|
abstract Sandbox |
getSandbox(java.lang.String id)
Returns the information of an existing sandbox.
|
abstract SandboxArchive |
getSandboxArchive(Sandbox sandbox)
Returns the
SandboxArchive object if the given sandbox is
from an archive. |
SandboxInfoCache |
getSandboxInfoCache(java.lang.String id)
Returns the information of an existing sandbox and caches some of the
information upon the first access.
|
java.util.Map<java.lang.String,SandboxUpdateErrorInfo> |
getSandboxLastUpdateErrors(Sandbox sandbox)
Gets the errors from the last failed update.
|
java.lang.String |
getSandboxNameOrId(java.lang.String sandboxId)
Returns the name or a URI representation of the ID of a sandbox if the
sandbox exists.
|
abstract SandboxLog |
getSandboxOperationLog(Sandbox sandbox)
Returns the log from the current or last sandbox operation.
|
abstract java.lang.Long |
getSandboxOperationLogId(java.lang.String sandboxId,
SandboxState.Condition condition)
Returns the ID of an open log for a sandbox.
|
int |
getSandboxOperationProgress(Sandbox sandbox)
Returns an integer from 0 (inclusive) to 100 (inclusive) to indicate the
progress of the current sandbox operation.
|
int |
getSandboxOperationProgress(Sandbox sandbox,
java.lang.String featureId)
Returns an integer from 0 (inclusive) to 100 (inclusive) to indicate the
progress of the current sandbox operation by feature.
|
java.util.List<SandboxUpdate> |
getSandboxPendingUpdates(Sandbox sandbox)
Gets the list of pending updates if any.
|
java.util.Date |
getSandboxPendingUpdatesDueDate(Sandbox sandbox)
Returns the nearest due date of the pending updates.
|
boolean |
hasUncommittedChanges(Sandbox sandbox)
Returns
true if the sandbox is open and any of the repository
branches in the sandbox has uncommitted changes. |
boolean |
isCompatible(SandboxedFeature feature,
SandboxConstraints constraints)
Returns
true if the feature can be enabled in a sandbox with
the specified constraints. |
boolean |
isLockedBySandboxArchive()
Returns
true if the mainline of any repository is locked by
a sandbox archive at the time of invcation. |
boolean |
isSandboxOperationProcessRunning(Sandbox sandbox)
Returns
true if a process that performs an operation of the
sandbox is running at the time of the invocation. |
boolean |
isSandboxPendingUpdates(Sandbox sandbox)
Returns
true if there is any pending update for this sandbox. |
boolean |
isVisualBuilder(SandboxedFeature feature)
Returns
true if the given sandboxed feature is Visual Builder. |
boolean |
isVisualBuilder(java.lang.String featureId)
Returns
true if the given sandboxed feature is Visual Builder. |
boolean |
isVisualBuilderEnabled(java.lang.String sandboxId)
Deprecated.
Use
Sandbox.isVisualBuilderEnabled instead. |
java.util.List<java.lang.String> |
listAdministrators(Sandbox sandbox)
Returns the list of administrators of a sandbox.
|
java.util.List<java.lang.String> |
listOpenSandboxes()
Returns the IDs of the sandboxes that are open at the time of invocation,
not including the sandboxes created from archives.
|
abstract java.util.List<java.lang.String> |
listOpenSandboxes(boolean includeArchives)
Returns the IDs of the sandboxes that are open at the time of invocation.
|
Sandbox |
listSandbox(java.lang.String name)
Returns the most recently created sandbox whose name matches the specified
name exactly.
|
abstract java.util.List<java.lang.String> |
listSandboxes(java.lang.String name,
boolean exactMatch)
Returns the IDs of the sandboxes whose names contain or match the
specified name.
|
java.util.List<SandboxLogRef> |
listSandboxLogs(Sandbox sandbox,
java.lang.Class<? extends SandboxLog> type)
Returns a list of sandbox logs from the latest to the oldest.
|
protected void |
logEvent(Sandbox sandbox,
RepositoryEvent e)
Logs a repository event.
|
void |
markSandboxesForUpdate(SandboxUpdatePatchInfo patchInfo)
Marks all open sandboxes for update.
|
void |
markSandboxForUpdate(SandboxUpdatePatchInfo patchInfo,
Sandbox sandbox)
Marks a sandbox for update.
|
java.util.Set<java.lang.String> |
newRepositoryBaselines(java.lang.String note)
Requests that all available repositories in the system establish new
baselines for the current state of the repositories.
|
abstract Sandbox |
newSandbox(SandboxArchive archive)
Creates a new sandbox from an archive as its initial contents.
|
abstract Sandbox |
newSandbox(java.lang.String name)
Creates a new sandbox.
|
void |
newSandbox(java.lang.String name,
SandboxBackgroundTask.Proxy<Sandbox> proxy)
Creates a new sandbox in a background thread.
|
RepositoryExceptions |
prepareForRefresh(Sandbox sandbox)
Explicitly invokes
SandboxedRepository.prepareForRefresh to
start the refresh process. |
abstract java.util.Map<SandboxedRepository,ChangeSet> |
publish(Sandbox sandbox)
Merges changes in a sandbox back into the repositories.
|
void |
publish(java.lang.String sandboxId,
SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
Publishes a sandbox in a background thread.
|
abstract java.util.Map<SandboxedRepository,ChangeSet> |
refresh(Sandbox sandbox)
Merges changes made in participating repositories into a sandbox.
|
java.util.Map<SandboxedRepository,ChangeSet> |
refresh(Sandbox sandbox,
ChangeHint.Provider hintProvider)
Merges changes made in participating repositories into a sandbox.
|
void |
refresh(java.lang.String sandboxId,
ChangeHint.Provider hintProvider,
SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
Refreshes a sandbox in a background thread.
|
void |
refresh(java.lang.String sandboxId,
SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
Refreshes a sandbox in a background thread.
|
boolean |
removeAdministrator(Sandbox sandbox,
java.lang.String userName)
Removes a user from the list of administrators of a sandbox.
|
abstract void |
setDescription(Sandbox sandbox,
java.lang.String desc)
Updates the description of a sandbox.
|
abstract void |
setName(Sandbox sandbox,
java.lang.String name)
Updates the name of a sandbox.
|
abstract void |
setPrivate(Sandbox sandbox,
boolean p)
Marks a sandbox private or not.
|
abstract void |
setPublishable(Sandbox sandbox,
boolean p)
Marks a sandbox publishable or not.
|
void |
setSandboxConstraints(Sandbox sandbox,
SandboxConstraints constraints)
Sets constraints for a sandbox.
|
void |
setSandboxConstraintsSummary(Sandbox sandbox,
java.lang.String constraintsSummary)
Sets the summary of constraints for a sandbox.
|
void |
setSandboxOperationChangeHint(Sandbox sandbox,
ChangeHint changeHint)
Deprecated.
Use
ChangeHint.Provider on operations that
support it. This method itself cannot be synchronized with
the operations that need the hints. |
java.util.Map<SandboxedRepository,ChangeSet> |
synchronizedPublish(Sandbox sandbox,
boolean refreshBefore)
Publishes a sandbox only when all mainline exclusive locks of the branched
repositories are available; in other words, a
ConcurrentSandboxOperationException is thrown when another
synchronizedPublish call is in progress, or when a mainline
exclusive lock of any branched repository has been acquired by an archive. |
void |
synchronizedPublish(java.lang.String sandboxId,
SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
Publishes a sandbox in a background thread when all mainline exclusive
locks of the branched repositories are available This method does not
wait for the operation to complete.
|
void |
timeoutSandboxOperationProcesses()
Marks sandboxes that are being processed for a duration that is longer
than the default time allowed.
|
boolean |
tryLock(SandboxArchive archive)
Tries to acquire the lock for processing a sandbox archive.
|
void |
unlock(SandboxArchive archive)
Releases the lock acquired for processing a sandbox archive.
|
void |
unpublish(Sandbox sandbox)
Unpublishes a sandbox if it's eligible.
|
IneligibleForUnpublishException |
unpublishCheck(Sandbox sandbox)
Checks if a sandbox is eligible for unpublish at this moment.
|
public static SandboxSupport getInstance()
public abstract Sandbox newSandbox(java.lang.String name) throws SandboxException
name
- the name of the sandboxSandboxNameTakenException
- if the name is already takenSandboxNameTooLongException
- if the name is too long to be a
sandbox nameIllegalCharSequenceException
- if the name contains illegal
character sequencesIllegalSandboxNameException
- if the name is null or illegal
accoridng to a rule that has not been documented. Note that
IllegalSandboxNameException
is the super class
of all other exceptions thrown indiciating a name cannot
be used for the new sandboxTooManyOpenSandboxesException
- if the system imposes a maximum
number of open sandboxes and the number has been reachedSandboxException
- if an error occurs while creating a sandboxpublic void checkNewSandboxName(java.lang.String name)
name
- the name to be checkedSandboxNameTakenException
- if the name is already takenSandboxNameTooLongException
- if the name is too long to be a
sandbox nameIllegalCharSequenceException
- if the name contains illegal
character sequencesIllegalSandboxNameException
- if the name is null or illeal
accoridng to a rule that has not been documented. Note that
IllegalSandboxNameException
is the super class
of all other exceptions thrown indiciating a name cannot
be used for the new sandboxjava.lang.UnsupportedOperationException
- if this method is not supportednewSandbox(String)
public void newSandbox(java.lang.String name, SandboxBackgroundTask.Proxy<Sandbox> proxy)
name
- the name of the sandboxproxy
- the proxy object that handles the background taskjava.lang.UnsupportedOperationException
- if this method is not supportedpublic abstract Sandbox newSandbox(SandboxArchive archive) throws SandboxException
archive
- the archive that contains the initial contentsSandboxException
- if an error occurs while creating a sandboxpublic abstract SandboxArchive getSandboxArchive(Sandbox sandbox)
SandboxArchive
object if the given sandbox is
from an archive.sandbox
- the sandbox the SandboxArchive
object is
associated withSandboxArchive
object if the given sandbox is
from an archive; null
otherwisepublic abstract void setName(Sandbox sandbox, java.lang.String name)
sandbox
- the sandbox to updatename
- the new namejava.lang.IllegalArgumentException
- if the given name is nullpublic abstract void setDescription(Sandbox sandbox, java.lang.String desc)
sandbox
- the sandboxdesc
- the descriptionpublic abstract void setPrivate(Sandbox sandbox, boolean p)
sandbox
- the sandbox to be set private or sharedp
- true
if the given sandbox is to be set to privatepublic abstract void setPublishable(Sandbox sandbox, boolean p)
sandbox
- the sandbox to be set publishable or notp
- true
if the given sandbox is to be set to
publishablepublic abstract java.util.List<java.lang.String> listSandboxes(java.lang.String name, boolean exactMatch)
name
- the name of the sandboxexactMatch
- true
if the names of the returned sandboxes
must match the specified name exactlyjava.lang.IllegalArgumentException
- if the given name is nullpublic abstract java.util.List<java.lang.String> listOpenSandboxes(boolean includeArchives)
destroy
to be performed on it. In other words, a sandbox that
is not open can only be destroyed.includeArchives
- true
if the returned list should include
the sandboxes that are created from archivespublic java.util.List<java.lang.String> listOpenSandboxes()
public int getNumberOfOpenSandboxes(boolean includeArchives)
includeArchives
- true
if the sandboxes created from
archives should be included if openjava.lang.UnsupportedOperationException
- if this operation is not supportedpublic int getNumberOfOpenSandboxes()
java.lang.UnsupportedOperationException
- if this operation is not supportedpublic Sandbox findSandbox(java.lang.String nameOrId)
nameOrId
- the name or IDnull
if no matchgetSandboxNameOrId(java.lang.String)
public Sandbox listSandbox(java.lang.String name)
name
- the name of the sandboxjava.lang.IllegalArgumentException
- if the given name is nullpublic abstract Sandbox getSandbox(java.lang.String id)
id
- the ID of the sandboxnull
if there is no such
sandboxpublic java.lang.String getSandboxNameOrId(java.lang.String sandboxId)
MetadataRevisionNoteURI.SandboxId
is returned.sandboxId
- the ID of the sandbox to be checkednull
if no sandbox can be found for the given IDfindSandbox(java.lang.String)
public SandboxInfoCache getSandboxInfoCache(java.lang.String id)
id
- the ID of the sandboxpublic java.util.List<SandboxLogRef> listSandboxLogs(Sandbox sandbox, java.lang.Class<? extends SandboxLog> type)
sandbox
- the sandbox associated with the logstype
- the type of the logs; null
if all types should be
returnedjava.lang.NullPointerException
- if the given sandbox is nulljava.lang.UnsupportedOperationException
- if this method is not supportedpublic abstract SandboxLog getSandboxOperationLog(Sandbox sandbox)
listSandboxLogs
. If an operation is successful and a log
is produced, this method continues to return the log from the successful
operation until the next operation begins. During this time, the returned
log is the same as the first log returned by listSandboxLogs
.sandbox
- the sandbox where the operation was performednull
if not availablelistSandboxLogs(oracle.adf.share.sandbox.Sandbox, java.lang.Class<? extends oracle.adf.share.sandbox.logging.SandboxLog>)
public abstract java.lang.Long getSandboxOperationLogId(java.lang.String sandboxId, SandboxState.Condition condition)
sandboxId
- the ID of the sandbox for which the log is createdcondition
- the condition when the log is availablenull
if no log is available for the given
sandbox in the given conditionpublic int getSandboxOperationProgress(Sandbox sandbox)
sandbox
- the sandbox on which the operation is in progresspublic int getSandboxOperationProgress(Sandbox sandbox, java.lang.String featureId)
sandbox
- the sandbox on which the operation is in progressfeatureId
- the ID of the enabled featurejava.lang.IllegalArgumentException
- if the given feature is not definedpublic void setSandboxConstraints(Sandbox sandbox, SandboxConstraints constraints)
sandbox
- the sandbox with which the constraints are to be associatedconstraints
- the constraints for the sandboxjava.lang.UnsupportedOperationException
- if this method is not supportedpublic void setSandboxConstraintsSummary(Sandbox sandbox, java.lang.String constraintsSummary)
sandbox
- the sandbox with which the constraints are to be associatedconstraintsSummary
- the summary of constraints for the sandboxjava.lang.UnsupportedOperationException
- if this method is not supported@Deprecated public void setSandboxOperationChangeHint(Sandbox sandbox, ChangeHint changeHint)
ChangeHint.Provider
on operations that
support it. This method itself cannot be synchronized with
the operations that need the hints.sandbox
- the sandbox on which the current operation is in progresschangeHint
- the change hint; null
if the default hint
should be givenjava.lang.UnsupportedOperationException
- if this method is not supportedSandboxTransaction
public java.util.Map<java.lang.String,ChangeHint> getRepositoryChangeHints(Sandbox sandbox)
setSandboxOperationChangeHint
method.sandbox
- the sandbox being operatedjava.lang.NullPointerException
- if the given sandbox is nulljava.lang.UnsupportedOperationException
- if this method is not supportedpublic abstract boolean enableFeature(Sandbox sandbox, java.lang.String featureId) throws IncompatibleFeatureException, SandboxException
sandbox
- the sandboxfeatureId
- the ID of the sandboxed featurefalse
if the feature was already enabled prior to this
calljava.lang.IllegalArgumentException
- if the specified feature is unavailableIncompatibleFeatureException
- if the feature is incompatible with
the sandboxSandboxException
- if an error occurs while enabling the featurepublic java.util.Map<java.lang.String,java.lang.Throwable> enableFeatures(Sandbox sandbox, java.util.List<java.lang.String> featureIdList) throws IncompatibleFeatureException, SandboxException
sandbox
- the sandbox where the features are to be enabledfeatureIdList
- the IDs of the features to be enabledjava.lang.UnsupportedOperationException
- if enabling multiple features at
a time is not supportedIncompatibleFeatureException
SandboxException
public void enableFeatures(java.lang.String sandboxId, java.util.List<java.lang.String> featureIdList, SandboxBackgroundTask.Proxy<java.util.Map<java.lang.String,java.lang.Throwable>> proxy)
sandboxId
- the ID of the sandboxfeatureIdList
- the list of the IDs of the features to be enabledproxy
- the proxy object that handles the background taskjava.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean isCompatible(SandboxedFeature feature, SandboxConstraints constraints)
true
if the feature can be enabled in a sandbox with
the specified constraints. This method may be invoked before a sandbox is
created, after the constraints are known.feature
- the sandbox feature to be enabledconstraints
- the conditions a sandbox must satisfy to enable the
feature; null
to indicate no constraintstrue
if the feature can be enabled in a sandbox with
the given constraintspublic abstract void addRepository(Sandbox sandbox, SandboxedRepository repos) throws SandboxException
sandbox
- the sandboxrepos
- the participating repositorySandboxException
- if an error occurs while adding the repositorypublic abstract java.util.List<SandboxedRepository> getRepositories(Sandbox sandbox)
sandbox
- the sandboxpublic java.util.List<java.lang.String> getRepositoryIdList(Sandbox sandbox)
sandbox
- the sandbox where the repositories are branched forjava.lang.UnsupportedOperationException
- if this method is not supportedpublic abstract java.util.List<SandboxedFeature> getEnabledFeatures(Sandbox sandbox)
sandbox
- the sandboxpublic java.util.List<java.lang.String> getEnabledFeatureIdList(Sandbox sandbox)
sandbox
- the sandbox where the features are enabledjava.lang.UnsupportedOperationException
- if this method is not supportedpublic ChangeSet getRepositoryLastChanges(Sandbox sandbox, java.lang.String reposId)
sandbox
- the sandbox that contains the repository branchnull
if such information is unavailablepublic boolean hasUncommittedChanges(Sandbox sandbox)
true
if the sandbox is open and any of the repository
branches in the sandbox has uncommitted changes.sandbox
- the sandbox to be checkedtrue
if the sandbox is open and any of the repository
branches in the sandbox has uncommitted changesjava.lang.IllegalArgumentException
- if the given sandbox is nullSandboxedRepository.hasChanges(oracle.adf.share.sandbox.Sandbox)
public RepositoryErrorLog getRepositoryErrorLog(Sandbox sandbox, java.lang.String reposId)
sandbox
- the sandbox where the repository is branchedreposId
- the ID of the repositorynull
if there is no error, or the error log is not
availablepublic java.util.List<RepositoryErrorLog> getRepositoryErrorLogs(Sandbox sandbox)
sandbox
- the sandbox where the repositories are branchedcontainsRepositoryErrorLogs(oracle.adf.share.sandbox.Sandbox)
public boolean containsRepositoryErrorLogs(Sandbox sandbox)
true
if an error occurred to any repository during
the last sandbox operation.sandbox
- the sandbox where the repositories are branchedtrue
if an error occurred to any branched repository
during the last sandbox operationprotected void logEvent(Sandbox sandbox, RepositoryEvent e)
sandbox
- the sandboxe
- the repository eventpublic RepositoryExceptions prepareForRefresh(Sandbox sandbox)
SandboxedRepository.prepareForRefresh
to
start the refresh process. The purpose of this method is to allow an
administrator to put a sandbox in "refresh state" without starting the
actual refresh process immediately. It is expected that a call to
refresh
will follow shortly if not immediately.
It is possible to call refresh
without calling this method
first; in that case, SandboxedRepository.prepareForRefresh
will be invoked implicitly if it has not been called. From a
repository's point of view,
SandboxedRepository.prepareForRefresh
is always executed
before SandboxedRepository.refresh
in all cases.
If SandboxedRepository.prepareForRefresh
fails, the errors
are returned; when that happens, invoking any refresh
methods
of this class will result in the same exception. Note that a call to a
refresh
method of this class is still required even though
it's expected that refresh
will fail. Only a
refresh
method can move the sandbox out of the refresh state.
sandbox
- the sandbox that is about to be refreshednull
if all repositories have succeededjava.lang.UnsupportedOperationException
- if this method is not supportedpublic abstract java.util.Map<SandboxedRepository,ChangeSet> refresh(Sandbox sandbox) throws SuspendedSandboxOperationException, RepositoryExceptions
SandboxState.INACTIVE
.sandbox
- the sandboxSuspendedSandboxOperationException
- if the refresh process is
suspended because more information is neededRepositoryExceptions
- if merge conflicts are detected or any error
occurs during the processpublic java.util.Map<SandboxedRepository,ChangeSet> refresh(Sandbox sandbox, ChangeHint.Provider hintProvider) throws SuspendedSandboxOperationException, RepositoryExceptions
SandboxState.INACTIVE
.sandbox
- the sandboxhintProvider
- the hint provider; null
if the hint
should come from the deprecated
setSandboxOperationChangeHint
. To
provide null
as hint, pass in
new ChangeHint.Provider()
,
not null
.SuspendedSandboxOperationException
- if the refresh process is
suspended because more information is neededRepositoryExceptions
- if merge conflicts are detected or any error
occurs during the processjava.lang.UnsupportedOperationException
- if this method is not supportedpublic void refresh(java.lang.String sandboxId, SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
sandboxId
- the ID of the sandbox to be refreshedproxy
- the proxy object that handles the background taskjava.lang.UnsupportedOperationException
- if this method is not supportedpublic void refresh(java.lang.String sandboxId, ChangeHint.Provider hintProvider, SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
sandboxId
- the ID of the sandbox to be refreshedhintProvider
- the hint provider; null
if the hint
should come from the deprecated
setSandboxOperationChangeHint
. To
provide null
as hint, pass in
new ChangeHint.Provider()
,
not null
.proxy
- the proxy object that handles the background taskjava.lang.UnsupportedOperationException
- if this method is not supportedpublic abstract java.util.Map<SandboxedRepository,ChangeSet> publish(Sandbox sandbox) throws RepositoryExceptions
SandboxState.INACTIVE
.sandbox
- the sandboxRepositoryExceptions
- if merge conflicts are detected or any error
occurs during the processpublic void publish(java.lang.String sandboxId, SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
sandboxId
- the ID of the sandbox to be publishedproxy
- the proxy object that handles the background taskjava.lang.UnsupportedOperationException
- if this method is not supportedpublic java.util.Set<java.lang.String> newRepositoryBaselines(java.lang.String note)
note
- a short identifier indicating what the new repository baseline
are forjava.lang.UnsupportedOperationException
- if this operation is unsupportedSandboxedRepository.newCertifiedLabel(java.lang.String)
public abstract void destroy(Sandbox sandbox) throws RepositoryExceptions
sandbox
- the sandbox to be destroyedRepositoryExceptions
- if there is any error coming from the repositoriespublic IneligibleForUnpublishException unpublishCheck(Sandbox sandbox)
unpublish
is called.sandbox
- the sandbox to be checkednull
if the given sandbox is eligible for unpublish;
otherwise an object is returned to indicate the reasonjava.lang.IllegalArgumentException
- if the given sandbox is nluljava.lang.UnsupportedOperationException
- if this operation is not supportedunpublish(oracle.adf.share.sandbox.Sandbox)
public void unpublish(Sandbox sandbox) throws IneligibleForUnpublishException
sandbox
- the sandbox to be unpublishedIneligibleForUnpublishException
- if the given sandbox is ineligible
for unpublishjava.lang.IllegalArgumentException
- if the given sandbox is nulljava.lang.UnsupportedOperationException
- if this operation is not supportedunpublishCheck(oracle.adf.share.sandbox.Sandbox)
public MetadataRevision certifyRepositoryMainline(java.util.Set<java.lang.String> reposIdSet, java.lang.String revisionNote)
reposIdSet
- the IDs of the repositories that have changedrevisionNote
- a short note that describes the revision. The length
of the note must not exceed 100 bytes.java.lang.IllegalArgumentException
- if the set of repository IDs is null
or empty, or if any of the repository does not exist, or if
the revision note is null, or if the length of the
revision note exceeds 100 bytesjava.lang.UnsupportedOperationException
- if this method is not supported,
or if any of the given repositories does not support baseline
certification without the use of a sandboxConcurrentOperationException
- if the mainline of any given
repository is being certified at the time of invocation
either via a sandbox, CSM archive or this methodpublic MetadataRevision certifyRepositoryMainline(java.lang.String reposId, java.lang.String revisionNote)
certifyRepositoryMainline(Set,String)
for more details.reposId
- the ID of the repository that has changedrevisionNote
- a short note that describes the revision. The length
of the note must not exceed 100 bytes.java.lang.IllegalArgumentException
- if the given repository ID is null,
or if the given repository does not exist, or if the
revision note is null, or if the length of the revision
note exceeds 100 bytesjava.lang.UnsupportedOperationException
- if this method is not supported,
or if the given repository does not support baseline
certification without the use of a sandboxConcurrentOperationException
- if the mainline of the given
repository is being certified at the time of invocation
either via a sandbox, CSM archive or this methodcertifyRepositoryMainline(Set,String)
public void destroy(Sandbox sandbox, boolean retainInfo) throws RepositoryExceptions
SandboxState.DESTROYED
.sandbox
- the sandbox to be destroyedretainInfo
- true
if the sandbox information should be
retainedjava.lang.UnsupportedOperationException
- if this method is not supportedRepositoryExceptions
destroy(Sandbox)
public void destroy(java.lang.String sandboxId, boolean retainInfo, SandboxBackgroundTask.Proxy<java.lang.Object> proxy)
sandboxId
- the ID of the sandbox to be destroyedretainInfo
- true
if the sandbox information should be
retainedproxy
- the proxy object that handles the background taskjava.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean tryLock(SandboxArchive archive)
unlock(SandboxArchive)
. The behavior of
calling this method again with a different SandboxArchive
object before releasing the lock for the first call is undefined.archive
- the sandbox archive to be processedtrue
if the lock is acquired successfully;
false
if the involved repositories are currently
locked by other sandboxesjava.lang.IllegalArgumentException
- if the given sandbox archive is nulljava.lang.UnsupportedOperationException
- if this method is not supportedunlock(oracle.adf.share.sandbox.SandboxArchive)
public void unlock(SandboxArchive archive)
SandboxArchive
object.archive
- the sandbox archive that was just processed; or
null
if the information of the archive is no
longer availablejava.lang.UnsupportedOperationException
- if this method is not supportedtryLock(oracle.adf.share.sandbox.SandboxArchive)
public boolean isLockedBySandboxArchive()
true
if the mainline of any repository is locked by
a sandbox archive at the time of invcation. When the processing of a
sandbox archive is in progress,
ConcurrentSandboxOperationException
may be thrown by methods that require the same locks already acquired
by the archive, such as enableFeature
or
synchronizedPublish
. The client may simply skip all
operations and wait until this method returns false
again.true
if the mainline of any repository is locked by
a sandbox archive at the time of invocationtryLock(oracle.adf.share.sandbox.SandboxArchive)
,
unlock(oracle.adf.share.sandbox.SandboxArchive)
public java.util.Map<SandboxedRepository,ChangeSet> synchronizedPublish(Sandbox sandbox, boolean refreshBefore) throws RepositoryExceptions, ConcurrentSandboxOperationException
ConcurrentSandboxOperationException
is thrown when another
synchronizedPublish
call is in progress, or when a mainline
exclusive lock of any branched repository has been acquired by an archive.sandbox
- the sandbox to be publishedrefreshBefore
- true
if refresh
should be
called first after acquiring the necessary locks.
If a repository is pending resume after the first
pass, the process will be resumed once with change
hint ChangeHint.STOP_AT_CONFLICTS
.
If any repository is still pending resume after the
second pass, a SuspendedSandboxOperation
is thrown.RepositoryExceptions
- if any error occurs during the publishConcurrentSandboxOperationException
- if refreshBefore
is true
and any repository is still pending
resume after the first resumepublic void synchronizedPublish(java.lang.String sandboxId, SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
sandboxId
- the ID of the sandbox to be publishedproxy
- the proxy object that handles the background taskjava.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean canSynchronizedPublish(Sandbox sandbox)
true
if all locks needed for
synchronizedPublish
are available at the time of the
invocation. This information serves as a hint only. A
ConcurrentSandboxOperationException
may still be thrown
when synchronizedPublish
is invoked because the locks
may be acquired by another sandbox between the invocation of this method
and that of synchronizedPublish
. If a client must block
on synchronizedPublish
, skip this check and call
synchronizedPublish
periodically until
ConcurrentSandboxOperationException
is not thrown.sandbox
- the sandbox to be publishedtrue
if all locks needed for
synchronizedPublish
are available at the time of the
invocationpublic boolean addAdministrator(Sandbox sandbox, java.lang.String userName)
sandbox
- the sandbox administereduserName
- the user to be added as an administratortrue
if the user is not an administrator prior to
this call; false
if the user was not added to the
list because he is already an administrator of the sandboxjava.lang.IllegalArgumentException
- if the sandbox or user name is nullpublic boolean removeAdministrator(Sandbox sandbox, java.lang.String userName)
sandbox
- the sandbox administered by the useruserName
- the user to be removed from the list of administratorstrue
if the user is an administrator prior to this
call and is successfully removed from the list;
false
if the user is not on the list or cannot be
removed because he is the owner of the sandboxjava.lang.IllegalArgumentException
- if the sandbox or user name is nullpublic java.util.List<java.lang.String> listAdministrators(Sandbox sandbox)
sandbox
- the sandboxjava.lang.IllegalArgumentException
- if the sandbox is nullpublic void markSandboxesForUpdate(SandboxUpdatePatchInfo patchInfo)
patchInfo
- the information of the patch that initiates the updatejava.lang.IllegalArgumentException
- if the patch information is nulljava.lang.UnsupportedOperationException
- if this operation is not supportedpublic void markSandboxForUpdate(SandboxUpdatePatchInfo patchInfo, Sandbox sandbox)
patchInfo
- the information of the patch that initiates the updatesandbox
- the sandbox to be markedjava.lang.IllegalArgumentException
- if the patch information or sandbox is
nulljava.lang.UnsupportedOperationException
- if this operation is not supportedpublic boolean isSandboxPendingUpdates(Sandbox sandbox)
true
if there is any pending update for this sandbox.sandbox
- the sandbox to be checkedtrue
if there is any pending update for this sandboxjava.lang.UnsupportedOperationException
- if this method is not supportedpublic java.util.Date getSandboxPendingUpdatesDueDate(Sandbox sandbox)
sandbox
- the sandbox to be checkednull
if
there is no pending updates. Certain dates before January 1, 1970,
00:00:00 GMT are designated as constants that represent special
event points. For example, SandboxUpdate.DUE_NOW
indicates that this sandbox must be updated immediately before
they can be used again.
SandboxUpdate.DUE_NEXT_REFRESH
indicates the updates
may be deferred until the next time this sandbox is refreshed.java.lang.UnsupportedOperationException
- if this method is not supportedSandboxUpdate
public java.util.List<SandboxUpdate> getSandboxPendingUpdates(Sandbox sandbox)
sandbox
- the sandbox to be checkedjava.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean completeSandboxPendingUpdates(Sandbox sandbox) throws SandboxUpdateException
sandbox
- the sandbox to be updatedtrue
if this sandbox has been updated successfully
and refresh is requiredSandboxUpdateException
- if an error occurs while updating the
sandboxpublic void completeSandboxPendingUpdates(java.lang.String sandboxId, SandboxBackgroundTask.Proxy<java.lang.Boolean> proxy)
sandboxId
- the ID of the sandbox to be updatedproxy
- the proxy object that handles the background taskjava.lang.UnsupportedOperationException
- if this method is not supportedpublic java.util.Map<java.lang.String,SandboxUpdateErrorInfo> getSandboxLastUpdateErrors(Sandbox sandbox)
sandbox
- the sandbox that was updatedSandboxUpdateSupport
classes
from the last failed update. The keys of the map are the full
names of the SandboxUpdateSupport
classes. An empty
map is returned if there is no pending updates, or if the pending
updates have not been started, or if the updates were successful.java.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean isSandboxOperationProcessRunning(Sandbox sandbox)
true
if a process that performs an operation of the
sandbox is running at the time of the invocation. If the returned value
is true
, a ConcurrentSandboxOperationException
may be thrown when initiating another sandbox operation. Note that the
returned value false
does not necessarily mean no operation
is going on. Some operation such as "refresh" requires a series of
processes to complete. There may be no process running but the operation
as a whole is still in progress.sandbox
- the sandbox that may be being processedtrue
if a process that performs an operation of the
sandbox is running at the time of invocationjava.lang.UnsupportedOperationException
- if this method is not supportedpublic void timeoutSandboxOperationProcesses()
@Deprecated public boolean isVisualBuilderEnabled(java.lang.String sandboxId)
Sandbox.isVisualBuilderEnabled
instead.true
if Visual Builder feature is enabled in the
given sandbox and at least one associated repository used by the feature
reports changes.sandboxId
- the ID of the sandboxtrue
if Visual Builder feature is enabled in the
given sandbox and at least one associated repository used by the
feature reports changesjava.lang.IllegalArgumentException
- if the sandbox ID is null or invalidjava.lang.UnsupportedOperationException
- if this method is not supportedAssociatedRepository
,
RepositoryAssociation
public boolean isVisualBuilder(java.lang.String featureId)
true
if the given sandboxed feature is Visual Builder.featureId
- the ID of the sandboxed feature to be checkedtrue
if the given sandboxed feature is Visual Builderjava.lang.IllegalArgumentException
- if the given feature ID is nullpublic boolean isVisualBuilder(SandboxedFeature feature)
true
if the given sandboxed feature is Visual Builder.feature
- the sandboxed feature to be checkedtrue
if the given sandboxed feature is Visual Builderjava.lang.IllegalArgumentException
- if the given feature is null