public abstract class ResourceTypeDef<T> extends BaseTypeDef<T>
BaseTypeDef
NON_INDEXABLE_KEY_PREFIX
Constructor and Description |
---|
ResourceTypeDef(java.lang.String typeId, java.lang.String[] keyNames, java.lang.String fileExtension)
Constructor for defining a resource type that also has an associated XML Object that can be embedded in configuration data to refer to instances of this type.
|
ResourceTypeDef(java.lang.String typeId, java.lang.String[] keyNames, ValidationGroup[] groupValidators, java.lang.String fileExtension)
Constructor for defining a resource type that also has an associated XML Object that can be embedded in configuration data to refer to instances of this type.
|
Modifier and Type | Method and Description |
---|---|
abstract T |
changeIdentity(Ref oldref, Ref newref, T data)
Changes the identity of an instance of this type to a new identity.
|
boolean |
checkcontentequality(Ref ref, java.lang.Object data, java.lang.Object data1) |
abstract void |
checkWellFormed(Ref refToData, java.lang.Object data, Diagnostics diags, ValidationContext context)
Verifies that the data is well formed.
|
static boolean |
checkWellFormedClass(java.lang.Object data, java.lang.Class expectedClass, Diagnostics diags, ValidationContext context)
Helper method that checks that the given data is an instance of the given class.
|
abstract java.util.Set<Ref> |
computeExternalReferences(Ref ref, T data)
Returns a set of Ref object representing the external references found in the given data.
|
abstract T |
getCopyOf(Ref ref, T data)
Returns a copy of the given data.
|
DeltaHandler |
getDeltaHandler()
Returns the Handler that manages the computation of delta between two different values of a resource of this type.
|
abstract java.util.Collection<NonQualifiedEnvValue> |
getEnvValues(Ref ref, T data)
Returns a collection of instances of environment dependent values in the given data.
|
abstract ValueRepresentation<T> |
getExportedValueRepresentation()
Returns the exported value representation.
|
java.lang.String |
getFileExtension()
Returns the file extension for this configuration type
|
long |
getFingerprint(Ref ref, T data)
returns the finger print for the given data
|
abstract ValueRepresentation<T> |
getPersistedValueRepresentation()
Returns the persisted value representation.
|
SourceValueRepresentation<T> |
getSourceValueRepresentation()
Returns the source value representation.
|
java.util.List<ValidationGroup> |
getValidationGroups()
Returns the group validators
|
abstract boolean |
hasSensitiveInformation(Ref ref, T data)
Returns true if the data has information that is considered sensitive, such as user names and passwords.
|
abstract T |
modifyReferences(Ref ref, T data, java.util.Map<Ref,Ref> mapping)
changes references in the given data according to the given map and returns the result.
|
abstract T |
setEnvValues(Ref ref, T data, java.util.Collection<EnvValueAction> envValues)
Processes the given collection of environment value actions in the data.
|
abstract void |
validate(Ref refToData, T data, Diagnostics diags, ValidationContext context)
Validates the data, and adds and diagnostics (warnings, errors) to the diags list.
|
computeIndexValues, getKeyIndex, getKeyNames, getKeyValue, getKeyValues, getTypeId, hasIndex, keyExists
public ResourceTypeDef(java.lang.String typeId, java.lang.String[] keyNames, java.lang.String fileExtension)
typeId
- id of the typekeyNames
- array of key names that constitute the searchable properties of a component. A null value or an empty array indicates no searchable properties. The names can be arbitrary but they have to be unique in the array. If keyNames are defined the subclasses of component type should also reimplement the BaseTypeDef.getKeyValue(Ref, Object, String)
method.fileExtension
- the optional file extension to use.public ResourceTypeDef(java.lang.String typeId, java.lang.String[] keyNames, ValidationGroup[] groupValidators, java.lang.String fileExtension)
typeId
- id of the typekeyNames
- array of key names that constitute the searchable properties of a component. A null value or an empty array indicates no searchable properties. The names can be arbitrary but they have to be unique in the array. If keyNames are defined the subclasses of component type should also reimplement the BaseTypeDef.getKeyValue(Ref, Object, String)
method.groupValidators
- collection of GroupValidator objects for validating a group of instances of this resource type that are correlated by a common attribute valuefileExtension
- the optional file extension to use.public final java.util.List<ValidationGroup> getValidationGroups()
public final java.lang.String getFileExtension()
public abstract void checkWellFormed(Ref refToData, java.lang.Object data, Diagnostics diags, ValidationContext context)
validate(com.bea.wli.config.Ref, T, com.bea.wli.config.resource.Diagnostics, com.bea.wli.config.spi.ValidationContext)
method. This method is called once when a resource is created or updated.refToData
- reference to the resourcedata
- the resource data whose well-formedness is being testeddiags
- extra information about the error/reason must be added here.context
- the diagnostic context containing extra informationpublic long getFingerprint(Ref ref, T data)
public abstract java.util.Set<Ref> computeExternalReferences(Ref ref, T data)
public abstract T modifyReferences(Ref ref, T data, java.util.Map<Ref,Ref> mapping) throws java.lang.Exception
mapping
- mapping from old references to the new onesdata
- Copy data containing the old referencesjava.lang.Exception
public abstract java.util.Collection<NonQualifiedEnvValue> getEnvValues(Ref ref, T data)
public abstract T setEnvValues(Ref ref, T data, java.util.Collection<EnvValueAction> envValues)
public abstract void validate(Ref refToData, T data, Diagnostics diags, ValidationContext context)
This method may be called even if the resource has not been updated. Validation will occur in the following cases
refToData
- reference of the resource to validatedata
- value of the resource to validatediags
- diagnostics list where the warnings, errors etc should be addedcontext
- the diagnostic context containing extra informationpublic abstract T changeIdentity(Ref oldref, Ref newref, T data)
oldref
- old identitynewref
- new identitydata
- data whose identity is being changedpublic abstract ValueRepresentation<T> getPersistedValueRepresentation()
public abstract ValueRepresentation<T> getExportedValueRepresentation()
public abstract boolean hasSensitiveInformation(Ref ref, T data)
ref
- the reference to the resourcedata
- the datapublic SourceValueRepresentation<T> getSourceValueRepresentation()
SourceValueRepresentation.DEFAULT
public DeltaHandler getDeltaHandler()
DeltaHandler.DEFAULT_HANDLER
public static boolean checkWellFormedClass(java.lang.Object data, java.lang.Class expectedClass, Diagnostics diags, ValidationContext context)
public boolean checkcontentequality(Ref ref, java.lang.Object data, java.lang.Object data1)