public class RepositoryTools extends Object implements StringConstants
Modifier and Type | Class and Description |
---|---|
static class |
RepositoryTools.TraversalOutputVisitor
Visitor for printing out the full tree of a
KomodoObject . |
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
Modifier and Type | Method and Description |
---|---|
static void |
copyProperties(Repository.UnitOfWork transaction,
KomodoObject source,
KomodoObject target)
Copy the properties of the source to the target
|
static KomodoObject |
findOrCreate(Repository.UnitOfWork transaction,
KomodoObject parent,
String path,
String defaultType,
String finalType)
Get or create a KomodoObject at the specified path.
|
static KomodoObject |
findOrCreateChild(Repository.UnitOfWork transaction,
KomodoObject parent,
String name)
Get or create a KomodoObject with the specified KomodoObject under the specified parent KomodoObject.
|
static KomodoObject |
findOrCreateChild(Repository.UnitOfWork transaction,
KomodoObject parent,
String name,
String komodoObjectType)
Get or create a KomodoObject with the specified KomodoObject and KomodoObject type under the specified parent KomodoObject.
|
static String |
findPathOfReference(Repository.UnitOfWork transaction,
Repository repository,
String id) |
static String |
findPropertyValue(Repository.UnitOfWork transaction,
KomodoObject kObject,
String propName)
Find the given property value from the given object, also checking for the non-prefixed version
of the property name.
|
static String |
getDisplayNameAndValue(Repository.UnitOfWork transaction,
Property property) |
static String |
getDisplayValue(Repository.UnitOfWork transaction,
Property property) |
static KomodoObject |
getSameNameObject(Repository.UnitOfWork transaction,
KomodoObject kObject,
String type)
Get an object with the same name as the given kObject with the given type,
eg.
|
static boolean |
hasPrimaryType(Repository.UnitOfWork transaction,
KomodoObject kObject,
String primaryType)
Return true is the object's primary type is has the given name, false otherwise.
|
static String |
traverse(Repository.UnitOfWork transaction,
KomodoObject kObject)
Traverses the graph of the given
KomodoObject and returns its
String representation. |
public static KomodoObject findOrCreate(Repository.UnitOfWork transaction, KomodoObject parent, String path, String defaultType, String finalType) throws Exception
transaction
- transactionparent
- the parent KomodoObject. may not be nullpath
- the path of the desired child KomodoObject. may not be nulldefaultType
- the default KomodoObject type. may be nullfinalType
- the optional final KomodoObject type. may be nullException
- if an error occursIllegalArgumentException
- if either the parent or path argument is nullpublic static KomodoObject findOrCreateChild(Repository.UnitOfWork transaction, KomodoObject parent, String name) throws Exception
transaction
- the transactionparent
- the parent KomodoObject. may not be nullname
- the name of the child KomodoObject. may not be nullException
- if an error occursIllegalArgumentException
- if either the parent or name argument is nullpublic static KomodoObject findOrCreateChild(Repository.UnitOfWork transaction, KomodoObject parent, String name, String komodoObjectType) throws Exception
transaction
- the transactionparent
- the parent KomodoObject. may not be nullname
- the name of the child KomodoObject. may not be nullkomodoObjectType
- the KomodoObject type. may be nullException
- if an error occurspublic static String findPathOfReference(Repository.UnitOfWork transaction, Repository repository, String id) throws Exception
transaction
- the transaction (cannot be null
and must have a state of
Repository.UnitOfWork.State.NOT_STARTED
)repository
- the repository where the object can be found (cannot be null
)id
- the object identifier (cannot be empty)null
if not foundException
- if an error occurspublic static String getDisplayNameAndValue(Repository.UnitOfWork transaction, Property property)
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)property
- the property whose display value is being requested (cannot be empty)public static String getDisplayValue(Repository.UnitOfWork transaction, Property property) throws Exception
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)property
- the property whose display value is being requested (cannot be empty)Exception
- the exceptionpublic static String traverse(Repository.UnitOfWork transaction, KomodoObject kObject) throws Exception
KomodoObject
and returns its
String representation.transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)kObject
- object to be traversedException
- if error occurspublic static void copyProperties(Repository.UnitOfWork transaction, KomodoObject source, KomodoObject target) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)source
- the source objecttarget
- the target objectKException
- if error occurspublic static boolean hasPrimaryType(Repository.UnitOfWork transaction, KomodoObject kObject, String primaryType) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)kObject
- the object to testprimaryType
- the primary type requiredKException
- if error occurspublic static KomodoObject getSameNameObject(Repository.UnitOfWork transaction, KomodoObject kObject, String type) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)kObject
- object with the name to findtype
- the type of the object to findKException
- if error occurspublic static String findPropertyValue(Repository.UnitOfWork transaction, KomodoObject kObject, String propName) throws KException
transaction
- the transaction (cannot be null
or have a state that is not
Repository.UnitOfWork.State.NOT_STARTED
)kObject
- the object containing the propertypropName
- the name of the property to findString
value of the propertyKException
- if error occursCopyright © 2013–2019. All rights reserved.