public class DefaultSandboxSupport extends SandboxSupport
oracle.adf.share.sandbox.SandboxSupport
.Constructor and Description |
---|
DefaultSandboxSupport()
Constructs an instance of
DefaultSandboxSupport . |
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.
|
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 transactionNote)
Certifies the state of the mainlines of the specified repositories
at the time of invocation.
|
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. |
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.
|
boolean |
enableFeature(Sandbox sandbox,
java.lang.String featureClassName)
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.
|
java.util.List<SandboxedFeature> |
getEnabledFeatures(Sandbox sandbox)
Returns the list of features enabled in a sandbox.
|
int |
getNumberOfOpenSandboxes(boolean includeArchives)
Returns the number of sandboxes that are currently open.
|
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<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.
|
Sandbox |
getSandbox(java.lang.String id)
Returns the information of an existing sandbox.
|
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.
|
SandboxLog |
getSandboxOperationLog(Sandbox sandbox)
Returns the log from the current or last sandbox operation.
|
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 |
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. |
java.util.List<java.lang.String> |
listAdministrators(Sandbox sandbox)
Returns the list of administrators of a sandbox.
|
java.util.List<java.lang.String> |
listOpenSandboxes(boolean includeArchives)
Returns the IDs of the sandboxes that are open at the time of invocation.
|
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.
|
Sandbox |
newSandbox(SandboxArchive archive)
Creates a new sandbox from an archive as its initial contents.
|
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.
|
protected SandboxInfoCache |
newSandboxInfoCache(java.lang.String sandboxId)
Constructs a new
SandboxInfoCache instance. |
protected Sandbox |
newSandboxInstance(java.lang.String sandboxId)
Constructs a new
Sandbox instance. |
RepositoryExceptions |
prepareForRefresh(Sandbox sandbox)
Explicitly invokes
SandboxedRepository.prepareForRefresh to
start the refresh process. |
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.
|
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.
|
void |
setDescription(Sandbox sandbox,
java.lang.String desc)
Updates the description of a sandbox.
|
void |
setName(Sandbox sandbox,
java.lang.String name)
Updates the name of a sandbox.
|
void |
setPrivate(Sandbox sandbox,
boolean p)
Marks a sandbox private or not.
|
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)
Gives a change hint to all repositories involved in the current operation.
|
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.
|
certifyRepositoryMainline, getInstance, getNumberOfOpenSandboxes, getRepositoryErrorLogs, hasUncommittedChanges, isCompatible, isVisualBuilder, isVisualBuilder, isVisualBuilderEnabled, listOpenSandboxes, listSandbox
public DefaultSandboxSupport()
DefaultSandboxSupport
.public void checkNewSandboxName(java.lang.String name)
SandboxSupport
checkNewSandboxName
in class SandboxSupport
name
- the name to be checkedSandboxSupport.newSandbox(String)
public Sandbox newSandbox(java.lang.String name) throws SandboxException
SandboxSupport
newSandbox
in class SandboxSupport
name
- the name of the sandboxSandboxException
- if an error occurs while creating a sandboxpublic void newSandbox(java.lang.String name, SandboxBackgroundTask.Proxy<Sandbox> proxy)
SandboxSupport
newSandbox
in class SandboxSupport
name
- the name of the sandboxproxy
- the proxy object that handles the background taskprotected Sandbox newSandboxInstance(java.lang.String sandboxId)
Sandbox
instance.sandboxId
- the ID of the sandboxprotected SandboxInfoCache newSandboxInfoCache(java.lang.String sandboxId)
SandboxInfoCache
instance.sandboxId
- the ID of the sandboxpublic SandboxArchive getSandboxArchive(Sandbox sandbox)
SandboxSupport
SandboxArchive
object if the given sandbox is
from an archive.getSandboxArchive
in class SandboxSupport
sandbox
- the sandbox the SandboxArchive
object is
associated withSandboxArchive
object if the given sandbox is
from an archive; null
otherwisepublic Sandbox newSandbox(SandboxArchive archive) throws SandboxException
SandboxSupport
newSandbox
in class SandboxSupport
archive
- the archive that contains the initial contentsSandboxException
- if an error occurs while creating a sandboxpublic void setName(Sandbox sandbox, java.lang.String name)
SandboxSupport
setName
in class SandboxSupport
sandbox
- the sandbox to updatename
- the new namepublic void setDescription(Sandbox sandbox, java.lang.String desc)
SandboxSupport
setDescription
in class SandboxSupport
sandbox
- the sandboxdesc
- the descriptionpublic void setPrivate(Sandbox sandbox, boolean p)
SandboxSupport
setPrivate
in class SandboxSupport
sandbox
- the sandbox to be set private or sharedp
- true
if the given sandbox is to be set to privatepublic void setPublishable(Sandbox sandbox, boolean p)
SandboxSupport
setPublishable
in class SandboxSupport
sandbox
- the sandbox to be set publishable or notp
- true
if the given sandbox is to be set to
publishablepublic java.util.List<java.lang.String> listSandboxes(java.lang.String name, boolean exactMatch)
SandboxSupport
listSandboxes
in class SandboxSupport
name
- the name of the sandboxexactMatch
- true
if the names of the returned sandboxes
must match the specified name exactlypublic Sandbox getSandbox(java.lang.String id)
SandboxSupport
getSandbox
in class SandboxSupport
id
- the ID of the sandboxnull
if there is no such
sandboxpublic Sandbox findSandbox(java.lang.String nameOrId)
SandboxSupport
findSandbox
in class SandboxSupport
nameOrId
- the name or IDnull
if no matchSandboxSupport.getSandboxNameOrId(java.lang.String)
public java.lang.String getSandboxNameOrId(java.lang.String sandboxId)
SandboxSupport
MetadataRevisionNoteURI.SandboxId
is returned.getSandboxNameOrId
in class SandboxSupport
sandboxId
- the ID of the sandbox to be checkednull
if no sandbox can be found for the given IDSandboxSupport.findSandbox(java.lang.String)
public SandboxInfoCache getSandboxInfoCache(java.lang.String id)
SandboxSupport
getSandboxInfoCache
in class SandboxSupport
id
- the ID of the sandboxpublic void addRepository(Sandbox sandbox, SandboxedRepository repos) throws SandboxException
SandboxSupport
addRepository
in class SandboxSupport
sandbox
- the sandboxrepos
- the participating repositorySandboxException
- if an error occurs while adding the repositorypublic java.util.List<SandboxedRepository> getRepositories(Sandbox sandbox)
SandboxSupport
getRepositories
in class SandboxSupport
sandbox
- the sandboxpublic java.util.List<java.lang.String> getRepositoryIdList(Sandbox sandbox)
SandboxSupport
getRepositoryIdList
in class SandboxSupport
sandbox
- the sandbox where the repositories are branched forpublic java.util.List<SandboxedFeature> getEnabledFeatures(Sandbox sandbox)
SandboxSupport
getEnabledFeatures
in class SandboxSupport
sandbox
- the sandboxpublic java.util.List<java.lang.String> getEnabledFeatureIdList(Sandbox sandbox)
SandboxSupport
getEnabledFeatureIdList
in class SandboxSupport
sandbox
- the sandbox where the features are enabledprotected void logEvent(Sandbox sandbox, RepositoryEvent e)
SandboxSupport
logEvent
in class SandboxSupport
sandbox
- the sandboxe
- the repository eventpublic int getSandboxOperationProgress(Sandbox sandbox)
SandboxSupport
getSandboxOperationProgress
in class SandboxSupport
sandbox
- the sandbox on which the operation is in progresspublic int getSandboxOperationProgress(Sandbox sandbox, java.lang.String featureId)
SandboxSupport
getSandboxOperationProgress
in class SandboxSupport
sandbox
- the sandbox on which the operation is in progressfeatureId
- the ID of the enabled featurepublic java.util.List<SandboxLogRef> listSandboxLogs(Sandbox sandbox, java.lang.Class<? extends SandboxLog> type)
SandboxSupport
listSandboxLogs
in class SandboxSupport
sandbox
- the sandbox associated with the logstype
- the type of the logs; null
if all types should be
returnedpublic java.lang.Long getSandboxOperationLogId(java.lang.String sandboxId, SandboxState.Condition condition)
SandboxSupport
getSandboxOperationLogId
in class SandboxSupport
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 SandboxLog getSandboxOperationLog(Sandbox sandbox)
SandboxSupport
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
.getSandboxOperationLog
in class SandboxSupport
sandbox
- the sandbox where the operation was performednull
if not availableSandboxSupport.listSandboxLogs(oracle.adf.share.sandbox.Sandbox, java.lang.Class<? extends oracle.adf.share.sandbox.logging.SandboxLog>)
public ChangeSet getRepositoryLastChanges(Sandbox sandbox, java.lang.String reposId)
SandboxSupport
getRepositoryLastChanges
in class SandboxSupport
sandbox
- the sandbox that contains the repository branchnull
if such information is unavailablepublic boolean containsRepositoryErrorLogs(Sandbox sandbox)
SandboxSupport
true
if an error occurred to any repository during
the last sandbox operation.containsRepositoryErrorLogs
in class SandboxSupport
sandbox
- the sandbox where the repositories are branchedtrue
if an error occurred to any branched repository
during the last sandbox operationpublic RepositoryErrorLog getRepositoryErrorLog(Sandbox sandbox, java.lang.String reposId)
SandboxSupport
getRepositoryErrorLog
in class SandboxSupport
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 boolean isSandboxOperationProcessRunning(Sandbox sandbox)
SandboxSupport
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.isSandboxOperationProcessRunning
in class SandboxSupport
sandbox
- the sandbox that may be being processedtrue
if a process that performs an operation of the
sandbox is running at the time of invocationpublic RepositoryExceptions prepareForRefresh(Sandbox sandbox)
SandboxSupport
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.
prepareForRefresh
in class SandboxSupport
sandbox
- the sandbox that is about to be refreshednull
if all repositories have succeededpublic java.util.Map<SandboxedRepository,ChangeSet> refresh(Sandbox sandbox) throws SuspendedSandboxOperationException, RepositoryExceptions
SandboxSupport
SandboxState.INACTIVE
.refresh
in class SandboxSupport
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
SandboxSupport
SandboxState.INACTIVE
.refresh
in class SandboxSupport
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 processpublic void refresh(java.lang.String sandboxId, SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
SandboxSupport
refresh
in class SandboxSupport
sandboxId
- the ID of the sandbox to be refreshedproxy
- the proxy object that handles the background taskpublic void refresh(java.lang.String sandboxId, ChangeHint.Provider hintProvider, SandboxBackgroundTask.Proxy<java.util.Map<SandboxedRepository,ChangeSet>> proxy)
SandboxSupport
refresh
in class SandboxSupport
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 taskpublic int getNumberOfOpenSandboxes(boolean includeArchives)
SandboxSupport
getNumberOfOpenSandboxes
in class SandboxSupport
includeArchives
- true
if the sandboxes created from
archives should be included if openpublic java.util.List<java.lang.String> listOpenSandboxes(boolean includeArchives)
SandboxSupport
destroy
to be performed on it. In other words, a sandbox that
is not open can only be destroyed.listOpenSandboxes
in class SandboxSupport
includeArchives
- true
if the returned list should include
the sandboxes that are created from archivespublic MetadataRevision certifyRepositoryMainline(java.util.Set<java.lang.String> reposIdSet, java.lang.String transactionNote)
SandboxSupport
certifyRepositoryMainline
in class SandboxSupport
reposIdSet
- the IDs of the repositories that have changedtransactionNote
- a short note that describes the revision. The length
of the note must not exceed 100 bytes.public boolean canSynchronizedPublish(Sandbox sandbox)
SandboxSupport
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.canSynchronizedPublish
in class SandboxSupport
sandbox
- the sandbox to be publishedtrue
if all locks needed for
synchronizedPublish
are available at the time of the
invocationpublic java.util.Map<SandboxedRepository,ChangeSet> synchronizedPublish(Sandbox sandbox, boolean refreshBefore) throws RepositoryExceptions, ConcurrentSandboxOperationException
SandboxSupport
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.synchronizedPublish
in class SandboxSupport
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)
SandboxSupport
synchronizedPublish
in class SandboxSupport
sandboxId
- the ID of the sandbox to be publishedproxy
- the proxy object that handles the background taskpublic java.util.Map<SandboxedRepository,ChangeSet> publish(Sandbox sandbox) throws RepositoryExceptions
SandboxSupport
SandboxState.INACTIVE
.publish
in class SandboxSupport
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)
SandboxSupport
publish
in class SandboxSupport
sandboxId
- the ID of the sandbox to be publishedproxy
- the proxy object that handles the background taskpublic IneligibleForUnpublishException unpublishCheck(Sandbox sandbox)
SandboxSupport
unpublish
is called.unpublishCheck
in class SandboxSupport
sandbox
- the sandbox to be checkednull
if the given sandbox is eligible for unpublish;
otherwise an object is returned to indicate the reasonSandboxSupport.unpublish(oracle.adf.share.sandbox.Sandbox)
public void unpublish(Sandbox sandbox) throws IneligibleForUnpublishException
SandboxSupport
unpublish
in class SandboxSupport
sandbox
- the sandbox to be unpublishedIneligibleForUnpublishException
- if the given sandbox is ineligible
for unpublishSandboxSupport.unpublishCheck(oracle.adf.share.sandbox.Sandbox)
public java.util.Set<java.lang.String> newRepositoryBaselines(java.lang.String note)
SandboxSupport
newRepositoryBaselines
in class SandboxSupport
note
- a short identifier indicating what the new repository baseline
are forSandboxedRepository.newCertifiedLabel(java.lang.String)
public void destroy(Sandbox sandbox) throws RepositoryExceptions
SandboxSupport
destroy
in class SandboxSupport
sandbox
- the sandbox to be destroyedRepositoryExceptions
- if there is any error coming from the repositoriespublic void destroy(Sandbox sandbox, boolean retainInfo) throws RepositoryExceptions
SandboxSupport
SandboxState.DESTROYED
.destroy
in class SandboxSupport
sandbox
- the sandbox to be destroyedretainInfo
- true
if the sandbox information should be
retainedRepositoryExceptions
SandboxSupport.destroy(Sandbox)
public void destroy(java.lang.String sandboxId, boolean retainInfo, SandboxBackgroundTask.Proxy<java.lang.Object> proxy)
SandboxSupport
destroy
in class SandboxSupport
sandboxId
- the ID of the sandbox to be destroyedretainInfo
- true
if the sandbox information should be
retainedproxy
- the proxy object that handles the background taskpublic boolean enableFeature(Sandbox sandbox, java.lang.String featureClassName) throws IncompatibleFeatureException, SandboxException
SandboxSupport
enableFeature
in class SandboxSupport
sandbox
- the sandboxfeatureClassName
- the ID of the sandboxed featurefalse
if the feature was already enabled prior to this
callIncompatibleFeatureException
- 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
SandboxSupport
enableFeatures
in class SandboxSupport
sandbox
- the sandbox where the features are to be enabledfeatureIdList
- the IDs of the features to be enabledIncompatibleFeatureException
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)
SandboxSupport
enableFeatures
in class SandboxSupport
sandboxId
- the ID of the sandboxfeatureIdList
- the list of the IDs of the features to be enabledproxy
- the proxy object that handles the background taskpublic void setSandboxConstraints(Sandbox sandbox, SandboxConstraints constraints)
SandboxSupport
setSandboxConstraints
in class SandboxSupport
sandbox
- the sandbox with which the constraints are to be associatedconstraints
- the constraints for the sandboxpublic void setSandboxConstraintsSummary(Sandbox sandbox, java.lang.String constraintsSummary)
SandboxSupport
setSandboxConstraintsSummary
in class SandboxSupport
sandbox
- the sandbox with which the constraints are to be associatedconstraintsSummary
- the summary of constraints for the sandboxpublic void setSandboxOperationChangeHint(Sandbox sandbox, ChangeHint changeHint)
SandboxSupport
setSandboxOperationChangeHint
in class SandboxSupport
sandbox
- the sandbox on which the current operation is in progresschangeHint
- the change hint; null
if the default hint
should be givenSandboxTransaction
public java.util.Map<java.lang.String,ChangeHint> getRepositoryChangeHints(Sandbox sandbox)
SandboxSupport
setSandboxOperationChangeHint
method.getRepositoryChangeHints
in class SandboxSupport
sandbox
- the sandbox being operatedpublic boolean tryLock(SandboxArchive archive)
SandboxSupport
unlock(SandboxArchive)
. The behavior of
calling this method again with a different SandboxArchive
object before releasing the lock for the first call is undefined.tryLock
in class SandboxSupport
archive
- the sandbox archive to be processedtrue
if the lock is acquired successfully;
false
if the involved repositories are currently
locked by other sandboxesSandboxSupport.unlock(oracle.adf.share.sandbox.SandboxArchive)
public void unlock(SandboxArchive archive)
SandboxSupport
SandboxArchive
object.unlock
in class SandboxSupport
archive
- the sandbox archive that was just processed; or
null
if the information of the archive is no
longer availableSandboxSupport.tryLock(oracle.adf.share.sandbox.SandboxArchive)
public boolean isLockedBySandboxArchive()
SandboxSupport
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.isLockedBySandboxArchive
in class SandboxSupport
true
if the mainline of any repository is locked by
a sandbox archive at the time of invocationSandboxSupport.tryLock(oracle.adf.share.sandbox.SandboxArchive)
,
SandboxSupport.unlock(oracle.adf.share.sandbox.SandboxArchive)
public boolean addAdministrator(Sandbox sandbox, java.lang.String userName)
SandboxSupport
addAdministrator
in class SandboxSupport
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 sandboxpublic boolean removeAdministrator(Sandbox sandbox, java.lang.String userName)
SandboxSupport
removeAdministrator
in class SandboxSupport
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 sandboxpublic java.util.List<java.lang.String> listAdministrators(Sandbox sandbox)
SandboxSupport
listAdministrators
in class SandboxSupport
sandbox
- the sandboxpublic void markSandboxesForUpdate(SandboxUpdatePatchInfo patchInfo)
SandboxSupport
markSandboxesForUpdate
in class SandboxSupport
patchInfo
- the information of the patch that initiates the updatepublic void markSandboxForUpdate(SandboxUpdatePatchInfo patchInfo, Sandbox sandbox)
SandboxSupport
markSandboxForUpdate
in class SandboxSupport
patchInfo
- the information of the patch that initiates the updatesandbox
- the sandbox to be markedpublic void completeSandboxPendingUpdates(java.lang.String sandboxId, SandboxBackgroundTask.Proxy<java.lang.Boolean> proxy)
SandboxSupport
completeSandboxPendingUpdates
in class SandboxSupport
sandboxId
- the ID of the sandbox to be updatedproxy
- the proxy object that handles the background taskpublic boolean completeSandboxPendingUpdates(Sandbox sandbox) throws SandboxUpdateException
SandboxSupport
completeSandboxPendingUpdates
in class SandboxSupport
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 boolean isSandboxPendingUpdates(Sandbox sandbox)
SandboxSupport
true
if there is any pending update for this sandbox.isSandboxPendingUpdates
in class SandboxSupport
sandbox
- the sandbox to be checkedtrue
if there is any pending update for this sandboxpublic java.util.Date getSandboxPendingUpdatesDueDate(Sandbox sandbox)
SandboxSupport
getSandboxPendingUpdatesDueDate
in class SandboxSupport
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.SandboxUpdate
public java.util.List<SandboxUpdate> getSandboxPendingUpdates(Sandbox sandbox)
SandboxSupport
getSandboxPendingUpdates
in class SandboxSupport
sandbox
- the sandbox to be checkedpublic java.util.Map<java.lang.String,SandboxUpdateErrorInfo> getSandboxLastUpdateErrors(Sandbox sandbox)
SandboxSupport
getSandboxLastUpdateErrors
in class SandboxSupport
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.public void timeoutSandboxOperationProcesses()
SandboxSupport
timeoutSandboxOperationProcesses
in class SandboxSupport