public class ObjectImpl extends Object implements KomodoObject, StringConstants
Komodo object
.Modifier and Type | Field and Description |
---|---|
protected int |
index |
protected String |
path |
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
Constructor and Description |
---|
ObjectImpl(Repository komodoRepository,
String path,
int index) |
protected int index
protected String path
public ObjectImpl(Repository komodoRepository, String path, int index)
komodoRepository
- the repository where the object is located (cannot be null
)path
- the workspace path (cannot be null
or empty)index
- the object index (value is zero for non-SNS)protected static Descriptor[] getAllDescriptors(Repository.UnitOfWork transaction, KomodoObject kobject) throws KException
KException
public static KException handleError(Exception e)
KException
if necessary.e
- the error being handled (cannot be null
)null
)public static boolean validatePropertyValue(Repository.UnitOfWork transaction, Repository repository, KomodoObject kobject, String name, Object expectedValue) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)repository
- the repository where the object is located (cannot be null
)kobject
- the object whose property value is being validated (cannot be empty)name
- the name of the property being validated (cannot be empty)expectedValue
- the expected value or null
if the property should not existtrue
if the property value is the expected valueKException
- if an error occurspublic static boolean validateType(Repository.UnitOfWork transaction, Repository repository, KomodoObject kobject, String... types) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)repository
- the repository where the object is located (cannot be null
)kobject
- the object whose type is being validated (cannot be empty)types
- the primary type or descriptor names that the object must have (cannot be null
or empty or have a
null
element)true
if object is resolvable to the specified type(s)KException
- if an error occurs or if object does not have all the specified typesprotected void provision(Repository.UnitOfWork transaction, Repository.OperationType operationType) throws KException
KException
public KObjectFactory getObjectFactory()
getObjectFactory
in interface KomodoObject
public KPropertyFactory getPropertyFactory()
getPropertyFactory
in interface KomodoObject
public boolean isChildRestricted()
isChildRestricted
in interface KomodoObject
KomodoObject.isChildRestricted()
public KomodoObject addChild(Repository.UnitOfWork transaction, String name, String primaryType) throws KException
addChild
in interface KomodoObject
KException
KomodoObject.addChild(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String,
java.lang.String)
public void addDescriptor(Repository.UnitOfWork transaction, String... descriptorNames) throws KException
addDescriptor
in interface KomodoObject
KException
KomodoObject.addDescriptor(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String[])
public boolean equals(Object object)
equals
in class Object
Object.equals(java.lang.Object)
public String getAbsolutePath()
getAbsolutePath
in interface KNode
KNode.getAbsolutePath()
public KomodoObject getChild(Repository.UnitOfWork transaction, String name) throws KException
getChild
in interface KomodoObject
KException
KomodoObject.getChild(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String)
public KomodoObject getChild(Repository.UnitOfWork transaction, String name, String typeName) throws KException
getChild
in interface KomodoObject
KException
KomodoObject.getChild(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String,
java.lang.String)
public KomodoObject[] getChildren(Repository.UnitOfWork transaction, String... namePatterns) throws KException
getChildren
in interface KomodoObject
KException
KomodoObject.getChildren(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String[])
public KomodoObject[] getChildrenOfType(Repository.UnitOfWork transaction, String type, String... namePatterns) throws KException
getChildrenOfType
in interface KomodoObject
KException
KomodoObject.getChildrenOfType(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String, java.lang.String[])
public KomodoType[] getChildTypes()
getChildTypes
in interface KomodoObject
KomodoObject.getChildTypes()
public Descriptor getDescriptor(Repository.UnitOfWork transaction, String typeName) throws KException
getDescriptor
in interface KomodoObject
KException
KomodoObject.getDescriptor(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String)
public Descriptor[] getDescriptors(Repository.UnitOfWork transaction) throws KException
getDescriptors
in interface KomodoObject
KException
KomodoObject.getDescriptors(org.komodo.spi.repository.Repository.UnitOfWork)
public int getIndex()
getIndex
in interface KomodoObject
KomodoObject.getIndex()
public String getName(Repository.UnitOfWork transaction) throws KException
getName
in interface KNode
KException
KNode.getName(org.komodo.spi.repository.Repository.UnitOfWork)
public KomodoObject getParent(Repository.UnitOfWork transaction) throws KException
getParent
in interface KNode
KException
KNode.getParent(org.komodo.spi.repository.Repository.UnitOfWork)
public Descriptor getPrimaryType(Repository.UnitOfWork transaction) throws KException
getPrimaryType
in interface KomodoObject
KException
KomodoObject.getPrimaryType(org.komodo.spi.repository.Repository.UnitOfWork)
protected <T> T getObjectProperty(Repository.UnitOfWork transaction, PropertyValueType returnValueType, String getterName, String propertyPath) throws KException
uow
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)returnValueType
- the type of the return value typegetterName
- name of the method name calling this methodpropertyPath
- relative path of the actual propertyKException
public Property getProperty(Repository.UnitOfWork transaction, String name) throws KException
getProperty
in interface KomodoObject
KException
KomodoObject.getProperty(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String)
public PropertyDescriptor getPropertyDescriptor(Repository.UnitOfWork transaction, String propName) throws KException
getPropertyDescriptor
in interface KomodoObject
KException
KomodoObject.getPropertyDescriptor(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String)
public PropertyDescriptor[] getPropertyDescriptors(Repository.UnitOfWork transaction) throws KException
getPropertyDescriptors
in interface KomodoObject
KException
KomodoObject.getPropertyDescriptors(org.komodo.spi.repository.Repository.UnitOfWork)
public String[] getPropertyNames(Repository.UnitOfWork transaction) throws KException
getPropertyNames
in interface KomodoObject
KException
KomodoObject.getPropertyNames(org.komodo.spi.repository.Repository.UnitOfWork)
public final KomodoObject[] getRawChildren(Repository.UnitOfWork transaction, String... namePatterns) throws KException
getRawChildren
in interface KomodoObject
KException
KomodoObject.getRawChildren(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String[])
public final Descriptor[] getRawDescriptors(Repository.UnitOfWork transaction) throws KException
getRawDescriptors
in interface KomodoObject
KException
KomodoObject.getRawDescriptors(org.komodo.spi.repository.Repository.UnitOfWork)
public final KomodoObject getRawParent(Repository.UnitOfWork transaction) throws KException
getRawParent
in interface KomodoObject
KException
KomodoObject.getRawParent(org.komodo.spi.repository.Repository.UnitOfWork)
public final Property getRawProperty(Repository.UnitOfWork transaction, String name) throws KException
getRawProperty
in interface KomodoObject
KException
KomodoObject.getRawProperty(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String)
public final PropertyDescriptor[] getRawPropertyDescriptors(Repository.UnitOfWork transaction) throws KException
getRawPropertyDescriptors
in interface KomodoObject
KException
KomodoObject.getRawPropertyDescriptors(org.komodo.spi.repository.Repository.UnitOfWork)
public final String[] getRawPropertyNames(Repository.UnitOfWork transaction) throws KException
getRawPropertyNames
in interface KomodoObject
KException
KomodoObject.getRawPropertyNames(org.komodo.spi.repository.Repository.UnitOfWork)
public Repository getRepository()
getRepository
in interface KNode
KNode.getRepository()
public int getTypeId()
getTypeId
in interface KomodoObject
KomodoObject.getTypeId()
public KomodoType getTypeIdentifier(Repository.UnitOfWork transaction) throws KException
getTypeIdentifier
in interface KomodoObject
KException
KomodoObject.getTypeIdentifier(org.komodo.spi.repository.Repository.UnitOfWork)
public boolean hasChild(Repository.UnitOfWork transaction, String name) throws KException
hasChild
in interface KomodoObject
KException
KomodoObject.hasChild(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String)
public boolean hasChild(Repository.UnitOfWork transaction, String name, String typeName) throws KException
hasChild
in interface KomodoObject
KException
KomodoObject.hasChild(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String,
java.lang.String)
public boolean hasChildren(Repository.UnitOfWork transaction) throws KException
hasChildren
in interface KomodoObject
KException
KomodoObject.hasChildren(org.komodo.spi.repository.Repository.UnitOfWork)
public boolean hasDescriptor(Repository.UnitOfWork transaction, String descriptorName) throws KException
hasDescriptor
in interface KomodoObject
KException
KomodoObject.hasDescriptor(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean hasProperties(Repository.UnitOfWork transaction) throws KException
hasProperties
in interface KomodoObject
KException
KomodoObject.hasProperties(org.komodo.spi.repository.Repository.UnitOfWork)
public boolean hasProperty(Repository.UnitOfWork transaction, String name) throws KException
hasProperty
in interface KomodoObject
KException
KomodoObject.hasProperty(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String)
public final boolean hasRawChild(Repository.UnitOfWork transaction, String name) throws KException
hasRawChild
in interface KomodoObject
KException
KomodoObject.hasRawChild(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String)
public final boolean hasRawChild(Repository.UnitOfWork transaction, String name, String typeName) throws KException
hasRawChild
in interface KomodoObject
KException
KomodoObject.hasRawChild(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String,
java.lang.String)
public final boolean hasRawChildren(Repository.UnitOfWork transaction) throws KException
hasRawChildren
in interface KomodoObject
KException
KomodoObject.hasRawChildren(org.komodo.spi.repository.Repository.UnitOfWork)
public final boolean hasRawProperty(Repository.UnitOfWork transaction, String name) throws KException
hasRawProperty
in interface KomodoObject
KException
KomodoObject.hasRawProperty(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String)
public void print(Repository.UnitOfWork transaction) throws KException
print
in interface KomodoObject
KException
KomodoObject.print(org.komodo.spi.repository.Repository.UnitOfWork)
public void remove(Repository.UnitOfWork transaction) throws KException
remove
in interface KomodoObject
KException
KomodoObject.remove(org.komodo.spi.repository.Repository.UnitOfWork)
public void removeChild(Repository.UnitOfWork transaction, String... names) throws KException
removeChild
in interface KomodoObject
KException
KomodoObject.removeChild(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String[])
public void removeDescriptor(Repository.UnitOfWork transaction, String... descriptorNames) throws KException
removeDescriptor
in interface KomodoObject
KException
KomodoObject.removeDescriptor(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String[])
public void rename(Repository.UnitOfWork transaction, String newName) throws KException
rename
in interface KomodoObject
KException
KomodoObject.rename(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String)
public void setPrimaryType(Repository.UnitOfWork transaction, String typeName) throws KException
setPrimaryType
in interface KomodoObject
KException
KomodoObject.setPrimaryType(org.komodo.spi.repository.Repository.UnitOfWork,
java.lang.String)
protected <T> void setObjectProperty(Repository.UnitOfWork transaction, String setterName, String propertyName, T value) throws KException
KException
public void setProperty(Repository.UnitOfWork transaction, String propertyName, Object... values) throws KException
setProperty
in interface KomodoObject
KException
KomodoObject.setProperty(org.komodo.spi.repository.Repository.UnitOfWork, java.lang.String,
java.lang.Object[])
public String toString()
toString
in class Object
Object.toString()
public void accept(Repository.UnitOfWork transaction, KomodoObjectVisitor visitor) throws Exception
accept
in interface KomodoObject
Exception
Copyright © 2013–2019. All rights reserved.