public class WorkspaceManager extends ObjectImpl implements RelationalObject
RelationalObject.Filter
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_ID
The type identifier.
|
index, path
DDL_QNAMES_FILTER, DEFAULT_FILTERS, JCR_FILTER, NO_FILTERS, NT_FILTER, RESIDUAL_FILTER
EMPTY_ARRAY
AMPERSAND, AT, BR, CLASS, CLOSE_ANGLE_BRACKET, CLOSE_BRACE, CLOSE_BRACKET, CLOSE_PRE_CMT, CLOSE_PRE_TAG, CLOSE_SQUARE_BRACKET, COLON, COMMA, CONNECTION_SUFFIX, CURRENT_FOLDER_SYMBOL, DDL, DEFAULT_LOCAL_WORKSPACE_NAME, DIVIDE, DOLLAR_SIGN, DOT, DOT_CHAR, DOT_DOT, DOT_KOMODO, DOUBLE_BACK_SLASH, DRIVE_SEPARATOR, EMPTY_ARRAY, EMPTY_STRING, ENUM, EQUALS, FILE_EXTENSION_SEPARATOR, FILE_NAME_WILDCARD, FINAL, FORWARD_SLASH, HASH, HYPHEN, INTERFACE, JAR, JAVA, JAVA_IO_TMPDIR, JBOSS_SERVER_TMP_DIR, KOMODO, LINE_SEPARATOR, LINE_SEPARATOR_PROPERTY_NAME, LOG, MINUS, MULTIPLY, NBSP, NEW_LINE, OPEN_ANGLE_BRACKET, OPEN_BRACE, OPEN_BRACKET, OPEN_PRE_CMT, OPEN_PRE_TAG, OPEN_SQUARE_BRACKET, PARENT_FOLDER_SYMBOL, PERCENT, PIPE, PLUS, PREFIX_PATTERN, PRIVATE, PUBLIC, QUESTION_MARK, QUOTE_MARK, SEMI_COLON, SERVICE_VDB_SUFFIX, SERVICE_VDB_VIEW_MODEL, SERVICE_VDB_VIEW_SUFFIX, SOURCES, SPACE, SPEECH_MARK, SRC, STAR, STATIC, TAB, TARGET, UNDERSCORE, UNDERSCORE_CHAR, VDB_DEPLOYMENT_SUFFIX, VDB_PREFIX, XML, XML_SUFFIX, ZIP, ZIP_SUFFIX
accept, addChild, addDescriptor, equals, getAbsolutePath, getAllDescriptors, getChild, getChild, getChildren, getChildrenOfType, getDescriptor, getDescriptors, getIndex, getName, getObjectFactory, getObjectProperty, getParent, getPrimaryType, getProperty, getPropertyDescriptor, getPropertyDescriptors, getPropertyFactory, getPropertyNames, getRawChildren, getRawDescriptors, getRawParent, getRawProperty, getRawPropertyDescriptors, getRawPropertyNames, getRepository, handleError, hasChild, hasChild, hasChildren, hasDescriptor, hashCode, hasProperties, hasProperty, hasRawChild, hasRawChild, hasRawChildren, hasRawProperty, isChildRestricted, print, provision, removeChild, removeDescriptor, setObjectProperty, setPrimaryType, setProperty, toString, validatePropertyValue, validateType
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
accept, addChild, addDescriptor, getChild, getChild, getChildren, getChildrenOfType, getDescriptor, getDescriptors, getIndex, getObjectFactory, getPrimaryType, getProperty, getPropertyDescriptor, getPropertyDescriptors, getPropertyFactory, getPropertyNames, getRawChildren, getRawDescriptors, getRawParent, getRawProperty, getRawPropertyDescriptors, getRawPropertyNames, hasChild, hasChild, hasChildren, hasDescriptor, hasProperties, hasProperty, hasRawChild, hasRawChild, hasRawChildren, hasRawProperty, isChildRestricted, print, removeChild, removeDescriptor, setPrimaryType, setProperty
getAbsolutePath, getName, getParent, getRepository
public static WorkspaceManager getInstance(Repository repository, Repository.UnitOfWork transaction) throws KException
repository
- the repository whose workspace manager is being requested (cannot be null
)transaction
- the transaction containing the user name of the owner of this workspace manager
(if null
then this manager is owner by the system user and has the workspace root as its path)null
)KException
- if there is an error obtaining the workspace managerpublic String getOwner()
public KomodoType[] getChildTypes()
getChildTypes
in interface KomodoObject
getChildTypes
in class ObjectImpl
ObjectImpl.getChildTypes()
public RelationalObject.Filter[] getFilters()
getFilters
in interface RelationalObject
properties
and descriptors
are
valid for this object (never null
but can be empty)RelationalObject.getFilters()
public int getTypeId()
getTypeId
in interface KomodoObject
getTypeId
in class ObjectImpl
ObjectImpl.getTypeId()
public KomodoType getTypeIdentifier(Repository.UnitOfWork uow)
getTypeIdentifier
in interface KomodoObject
getTypeIdentifier
in class ObjectImpl
public static void uncacheInstance(Repository repository, String owner)
repository
- remove instance with given repositorypublic Model createModel(Repository.UnitOfWork uow, Vdb vdb, String modelName) throws KException
uow
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)vdb
- the parent of the model object being created (cannot be null
)modelName
- the name of the model to create (cannot be empty)null
)KException
- if an error occurspublic Dataservice createDataservice(Repository.UnitOfWork uow, KomodoObject parent, String serviceName) throws KException
uow
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the dataservice object being created (can be null
)serviceName
- the name of the dataservice to create (cannot be empty)null
)KException
- if an error occurspublic Connection createConnection(Repository.UnitOfWork uow, KomodoObject parent, String sourceName) throws KException
uow
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the connection object being created (can be null
)sourceName
- the name of the connection to create (cannot be empty)null
)KException
- if an error occurspublic DdlFile createDdlFile(Repository.UnitOfWork uow, KomodoObject parent, String ddlFileName, byte[] content) throws KException
uow
- the transaction (cannot be null
and must have a state of
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the DDL file object being created (can be null
)ddlFileName
- the name of the DDL file to create (cannot be empty)content
- the file content (cannot be null
)null
)KException
- if an error occurspublic Driver createDriver(Repository.UnitOfWork uow, KomodoObject parent, String driverName, byte[] content) throws KException
uow
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the driver object being created (can be null
)driverName
- the name of the driver to create (cannot be empty)content
- the file content (cannot be null
)null
)KException
- if an error occurspublic Driver createDriver(Repository.UnitOfWork uow, KomodoObject parent, String driverName) throws KException
uow
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the driver object being created (can be null
)driverName
- the name of the driver to create (cannot be empty)null
)KException
- if an error occurspublic Folder createFolder(Repository.UnitOfWork uow, KomodoObject parent, String folderName) throws KException
uow
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the folder object being created (can be null
)folderName
- the name of the folder to create (cannot be empty)null
)KException
- if an error occurspublic ResourceFile createResourceFile(Repository.UnitOfWork uow, KomodoObject parent, String resourceFileName, byte[] content) throws KException
uow
- the transaction (cannot be null
and must have a state of
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the resource file object being created (can be null
)resourceFileName
- the name of the resource file to create (cannot be empty)content
- the file content (cannot be null
)null
)KException
- if an error occurspublic Schema createSchema(Repository.UnitOfWork uow, KomodoObject parent, String schemaName) throws KException
uow
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the schema object being created (can be null
)schemaName
- the name of the schema to create (cannot be empty)null
)KException
- if an error occurspublic UdfFile createUdfFile(Repository.UnitOfWork uow, KomodoObject parent, String udfFileName, byte[] content) throws KException
uow
- the transaction (cannot be null
and must have a state of
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the UDF file object being created (can be null
)udfFileName
- the name of the UDF file to create (cannot be empty)content
- the file content (cannot be null
)null
)KException
- if an error occurspublic Vdb createVdb(Repository.UnitOfWork uow, KomodoObject parent, String vdbName, String externalFilePath) throws KException
uow
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the model object being created (can be null
if VDB should be created at the workspace
root)vdbName
- the name of the VDB to create (cannot be empty)externalFilePath
- the VDB file path on the local file system (cannot be empty)null
)KException
- if an error occurspublic void delete(Repository.UnitOfWork transaction, KomodoObject... kobjects) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)kobjects
- the object(s) being deleted (cannot be null
, empty, or have a null
element)KException
- if an error occurs or if an object does not existpublic String[] findByType(Repository.UnitOfWork transaction, String type, String parentPath, String namePattern, boolean includeSubTypes) throws KException
transaction
- the transaction (cannot be null
and must have a state of
Repository.UnitOfWork.State.NOT_STARTED
)type
- the lexicon node type name of objects being found (cannot be empty)parentPath
- the parent path whose children recursively will be checked (can be empty if searching from the workspace root)namePattern
- the regex used to match object names (can be empty if all objects of the given type are being requested)includeSubTypes
- determines whether sub types are included in the returnnull
but
can be empty)KException
- if an error occurspublic String[] findByType(Repository.UnitOfWork transaction, String type) throws KException
transaction
- the transaction (cannot be null
and must have a state of
Repository.UnitOfWork.State.NOT_STARTED
)type
- the lexicon node type name of objects being foundnull
but can be empty)KException
- if an error occurspublic String[] findByType(Repository.UnitOfWork transaction, String type, boolean includeSubTypes) throws KException
transaction
- the transaction (cannot be null
and must have a state of
Repository.UnitOfWork.State.NOT_STARTED
)type
- the lexicon node type name of objects being foundincludeSubTypes
- determines whether sub types are included in the returnnull
but can be empty)KException
- if an error occurspublic Model[] findModels(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)Model
s in the workspace (never null
but can be empty)KException
- if an error occurspublic Schema[] findSchemas(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)Model
s in the workspace (never null
but can be empty)KException
- if an error occurspublic Dataservice[] findDataservices(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)Dataservice
s in the workspaceKException
- if an error occurspublic Connection[] findConnections(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)Connection
s in the workspaceKException
- if an error occurspublic Driver[] findDrivers(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)Driver
s in the workspaceKException
- if an error occurspublic Vdb[] findVdbs(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)Vdb
s in the workspace (never null
but can be empty)KException
- if an error occurspublic void remove(Repository.UnitOfWork transaction)
remove
in interface KomodoObject
remove
in class ObjectImpl
ObjectImpl.remove(org.komodo.spi.repository.Repository.UnitOfWork)
public final void rename(Repository.UnitOfWork transaction, String newName) throws UnsupportedOperationException
rename
in interface KomodoObject
rename
in class ObjectImpl
UnsupportedOperationException
- if calledKomodoObject.rename(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String)
public <T> T resolve(Repository.UnitOfWork transaction, Object object, Class<T> resolvedClass) throws KException
KomodoObject
then null is
returned.
The type id of the KomodoObject
is extracted and the correct
relational model object created. If the latter is not assignable from the
given adapted class then it is concluded the adaption should fail and
null is returned, otherwise the new object is returned.T
- the desired outcome classtransaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)object
- the object being resolvedresolvedClass
- the class the object should be resolved to (cannot be null
)null
if not resolvable)KException
- if a resolver could not be found or if an error occurredpublic void setFilters(RelationalObject.Filter[] newFilters)
setFilters
in interface RelationalObject
newFilters
- the new set of filters to use when deciding which properties
and descriptors
are valid for this object (can be null
)RelationalObject.setFilters(org.komodo.relational.RelationalObject.Filter[])
public ImportMessages importArtifact(Repository.UnitOfWork transaction, KomodoObject parent, StorageReference storageRef) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the imported vdbstorageRef
- the reference to the destination within the storagenull
)KException
- if error occurspublic ImportMessages importArtifact(Repository.UnitOfWork transaction, KomodoObject parent, StorageReference storageRef, ImportOptions importOptions) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)parent
- the parent of the imported vdbstorageRef
- the reference to the destination within the storageimportOptions
- options for the importnull
)KException
- if error occurspublic String exportArtifact(Repository.UnitOfWork transaction, Exportable artifact, String storageType, Properties parameters) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)artifact
- the vdb to be exportedstorageType
- the type of storage to export toparameters
- the parameters for the storage, appropriate to the storage typenull
KException
- if error occursCopyright © 2013–2019. All rights reserved.