public class SandboxPlayground
extends java.lang.Object
SandboxedRepository
or SandboxedFeature
subclasses to run through the life cycle of a sandbox and test the
implementation.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JDBC_URL
The name of the Java system property that defines the JDBC URL of the
database the framework uses.
|
Modifier and Type | Method and Description |
---|---|
void |
addRepository(java.lang.String repositoryId)
Adds a sandboxed repository.
|
static SandboxPlayground |
create(java.lang.String name)
Creates a new sandbox playground.
|
static SandboxPlayground |
create(java.lang.String name,
SandboxConstraints constraints)
Creates a sandbox playground with a set of constraints on the sandbox.
|
boolean |
destroy()
Destroyes this sandbox playground.
|
void |
enableFeature(java.lang.String featureId)
Enables a sandboxed feature.
|
void |
enterSandboxEnvironment()
Sets the metadata environment of the current ADF context to be a sandbox
environment for this sandbox playground.
|
static boolean |
exists(java.lang.String name)
Checks if a name is already taken.
|
java.io.PrintStream |
getDiagnosticsPrintStream()
Returns the print stream this object prints out diagnostics messages to.
|
java.lang.String |
getOperationLog()
Gets the log from the last operation.
|
java.lang.Throwable |
getRepositoryError(java.lang.String repositoryId)
Gets the error resulted from a repository.
|
java.util.Map<java.lang.String,java.lang.Throwable> |
getRepositoryErrors()
Returns errors from all repositories.
|
boolean |
interactiveRefresh(ChangeHint changeHint)
Refreshes the sandbox and sets the change hint if any of the repositories
requests for it.
|
static java.util.List<java.lang.String> |
listAvailableFeatures()
Lists all available features discovered by the framework.
|
static java.util.List<java.lang.String> |
listAvailableRepositories()
Lists all available repositories discovered by the framework.
|
static SandboxPlayground |
load(java.lang.String name)
Loads an existing sandbox playground.
|
void |
printRepositoryErrors()
Prints the errors from repositories to the standard error stream.
|
boolean |
publish()
Publishes this sandbox playground.
|
boolean |
refresh()
Refreshes the sandbox.
|
void |
setDiagnosticsPrintStream(java.io.PrintStream out)
Sets the print stream for this object to print out diagnostics
messages.
|
public static final java.lang.String JDBC_URL
oracle.adf.share.sandbox.util.SandboxPlayground.JDBC_URL
.
An example of the value:
"jdbc:oracle:thin:user/pwd@host:3000:dbname"
/public static boolean exists(java.lang.String name)
name
- the name of the playgroundtrue
if the playground with the specified name existsjava.lang.IllegalArgumentException
- if the given name is nullpublic static SandboxPlayground create(java.lang.String name)
name
- the name of the new sandbox playgroundjava.lang.IllegalArgumentException
- if the given name is null or if the
name is already takenpublic static SandboxPlayground create(java.lang.String name, SandboxConstraints constraints)
name
- the name of the sandbox playgroundconstraints
- the sandbox constraints; null
to remove
the default constraintsjava.lang.IllegalArgumentException
- if the given name is null or if the
name is already takenpublic static SandboxPlayground load(java.lang.String name)
name
- the name of the existing sandbox playgroundif
- the specified name does not existpublic static java.util.List<java.lang.String> listAvailableFeatures()
public static java.util.List<java.lang.String> listAvailableRepositories()
public void setDiagnosticsPrintStream(java.io.PrintStream out)
out
- the print stream for printing out diagnostics messages;
null
if diagnostics messages need not be
printedpublic java.io.PrintStream getDiagnosticsPrintStream()
null
if diagnostics messages are not printedpublic void enableFeature(java.lang.String featureId)
featureId
- the ID of the featurejava.lang.IllegalArgumentException
- if the given ID is nullpublic void addRepository(java.lang.String repositoryId)
repositoryId
- the ID of the repositoryjava.lang.IllegalArgumentException
- if the given ID is nullpublic boolean refresh()
true
if the sandbox is refreshed successfully;
false
if there are errors from the repositoriesgetRepositoryError(java.lang.String)
public boolean interactiveRefresh(ChangeHint changeHint)
changeHint
- the change hinttrue
if the sandbox is refreshed successfully;
false
if there are errors from the repositoriesgetRepositoryError(java.lang.String)
public java.lang.Throwable getRepositoryError(java.lang.String repositoryId)
repositoryId
- the ID of the repositorynull
if there is no
error from the repository or if there is no such repositorypublic java.util.Map<java.lang.String,java.lang.Throwable> getRepositoryErrors()
public void printRepositoryErrors()
public java.lang.String getOperationLog()
null
if the log
is emptypublic boolean publish()
true
if this sandbox has been published successfullypublic boolean destroy()
true
if this sandbox playground has been destroyed
successfullypublic void enterSandboxEnvironment()