public class EnvironmentModelFileLocator extends Object
The general strategy for locating files will be to place the files in different subdirectories that indicate the type of file it is. For Oracle-provided files, the locations will be automatically added to the Environment Model search path.
The standard location for these files will be:
Any Oracle-provided files will be located in subdirectories based on the different file types and the associated product; such as:$ORACLE_HOME / product_home / plugins / fmwplatform / models
Any custom file locations must be specified by the API user using the EnvironmentModelBuilder class. For example,$ORACLE_HOME/product_home/plugins/fmwplatform/models/blueprints $ORACLE_HOME/product_home/plugins/fmwplatform/models/domain-profiles $ORACLE_HOME/product_home/plugins/fmwplatform/models/tuning-parameters
Custom files will also be located in subdirectories based on the different file types; such as:EnvironmentModelBuilder b = new EnvironmentModelBuilder("/path/to/oracle/home"); b.appendModelSearchLocation("/path/to/my/models");
This specification also allows the files to be packaged in JAR files. Any JAR files added to the model search location will be searched for the following directories to locate the different file types./path/to/my/models/topologies /path/to/my/models/domain-profiles /path/to/my/models/tuning-parameters /path/to/my/models/blueprints
To add the JAR to the model search location, simply pass it directly into the appendModelSearchLocation() method./path/to/my/models.jar$/models/topologies /path/to/my/models.jar$/models/domain-profiles /path/to/my/models.jar$/models/tuning-parameters /path/to/my/models.jar$/models/blueprints
For standard locations in the Oracle Home, any JAR files found in the following locations will be automatically added to the model search path. These JARs must conform to the structure mentioned above.EnvironmentModelBuilder b = new EnvironmentModelBuilder("/path/to/oracle/home"); b.appendModelSearchLocation("/path/to/my/models.jar");
$ORACLE_HOME / product_home / plugins / fmwplatform / models
Modifier and Type | Field and Description |
---|---|
static String |
FOLDER_BLUEPRINTS |
static String |
FOLDER_DOMAIN_PROFILES |
static String |
FOLDER_TOPOLOGIES |
static String |
FOLDER_TUNING_PARMS |
Constructor and Description |
---|
EnvironmentModelFileLocator()
Creates an instance of EnvironmentModelFileLocator.
|
EnvironmentModelFileLocator(String oracleHome)
Creates an instance of EnvironmentModelFileLocator and adds the OracleHome specified to the search list.
|
EnvironmentModelFileLocator(String oracleHome,
Map<oracle.fmwplatform.envspec.common.ResourceReference,oracle.fmwplatform.envspec.common.Versioned> resourceReferenceCache)
Creates an instance of EnvironmentModelFileLocator with a cache of resolved ResourceReferences.
|
Modifier and Type | Method and Description |
---|---|
EnvironmentModelFileLocator |
appendModelSearchLocation(File location)
Add the specified location to the end of the model file search list.
|
EnvironmentModelFileLocator |
appendModelSearchLocation(String location)
Add the specified location to the end of the model file search list.
|
<T extends oracle.fmwplatform.envspec.common.Versioned> |
getAllObjects(Class<?> classType)
Returns a list of all the model files of the specified type that are found in the search path.
|
Blueprint |
locateBlueprint(String name,
String version)
Searches for a Blueprint in the search path that matches the name and version specified.
|
DomainProfile |
locateDomainProfile(String name,
String version)
Searches for a DomainProfile in the search path that matches the name and version specified.
|
oracle.fmwplatform.envspec.common.Versioned |
locateFile(oracle.fmwplatform.envspec.common.ResourceReference<?> resourceReference)
Searches for a model file in the resourceReferenceCache and the search path that matches the values in
the ResourceReference specified.
|
oracle.fmwplatform.envspec.common.Versioned |
locateFile(String name,
String version,
Class<?> classType)
Searches for a model file in the search path that matches the name, version and classType specified.
|
oracle.fmwplatform.envspec.common.Versioned |
locateFile(String name,
String version,
Class<?> classType,
oracle.fmwplatform.envspec.common.ResourceReference<?> resourceReference) |
Topology |
locateTopology(String name,
String version)
Searches for a Topology in the search path that matches the name and version specified.
|
TuningParameters |
locateTuningParameters(String name,
String version)
Searches for a TuningParameters in the search path that matches the name and version specified.
|
static void |
main(String[] args) |
EnvironmentModelFileLocator |
prependModelSearchLocation(File location)
Add the specified location to the beginning of the model file search list.
|
EnvironmentModelFileLocator |
prependModelSearchLocation(String location)
Add the specified location to the beginning of the model file search list.
|
public static final String FOLDER_TOPOLOGIES
public static final String FOLDER_BLUEPRINTS
public static final String FOLDER_DOMAIN_PROFILES
public static final String FOLDER_TUNING_PARMS
public EnvironmentModelFileLocator()
public EnvironmentModelFileLocator(String oracleHome)
oracleHome
- the OracleHome to be added to the searcyhlistpublic EnvironmentModelFileLocator(String oracleHome, Map<oracle.fmwplatform.envspec.common.ResourceReference,oracle.fmwplatform.envspec.common.Versioned> resourceReferenceCache)
oracleHome
- the OracleHome to be added to the searchlistresourceReferenceCache
- the cache of resolved ResourceReferencespublic EnvironmentModelFileLocator appendModelSearchLocation(File location)
location
- a File specifying the location to be added to the search listpublic EnvironmentModelFileLocator appendModelSearchLocation(String location)
location
- a File specifying the location to be added to the search listpublic Blueprint locateBlueprint(String name, String version) throws FMWEnvSpecException
name
- the name of the Blueprint to be foundversion
- the version number or range to be found or null if the version is to be ignoredFMWEnvSpecException
- if the file is not foundpublic DomainProfile locateDomainProfile(String name, String version) throws FMWEnvSpecException
name
- the name of the DomainProfile to be foundversion
- the version number or range to be found or null if the version is to be ignoredFMWEnvSpecException
- if the file is not foundpublic oracle.fmwplatform.envspec.common.Versioned locateFile(oracle.fmwplatform.envspec.common.ResourceReference<?> resourceReference) throws FMWEnvSpecException
resourceReference
- a resourceReference file containing name and version criteria for the searchFMWEnvSpecException
- if the file is not foundpublic oracle.fmwplatform.envspec.common.Versioned locateFile(String name, String version, Class<?> classType) throws FMWEnvSpecException
name
- the name of the model file to be foundversion
- the version number or range to be found or null if the version is to be ignoredclassType
- The classType to be searched for which must be a Topology, Blueprint, TuningParameters or DomainProfileFMWEnvSpecException
- if the file is not foundpublic oracle.fmwplatform.envspec.common.Versioned locateFile(String name, String version, Class<?> classType, oracle.fmwplatform.envspec.common.ResourceReference<?> resourceReference) throws FMWEnvSpecException
name
- the name of the model file to be foundversion
- the version number or range to be found or null if the version is to be ignoredclassType
- The classType to be searched for which must be a Topology, Blueprint, TuningParameters or DomainProfileresourceReference
- a resourceReference that will be updated with the location where the model file was foundFMWEnvSpecException
- if the file is not foundpublic Topology locateTopology(String name, String version) throws FMWEnvSpecException
name
- the name of the Topology to be foundversion
- the version number or range to be found or null if the version is to be ignoredFMWEnvSpecException
- if the file is not foundpublic TuningParameters locateTuningParameters(String name, String version) throws FMWEnvSpecException
name
- the name of the TuningParameters to be foundversion
- the version number or range to be found or null if the version is to be ignoredFMWEnvSpecException
- if the file is not found if the file is not foundpublic <T extends oracle.fmwplatform.envspec.common.Versioned> List<T> getAllObjects(Class<?> classType) throws FMWEnvSpecException
T
- the class typeclassType
- the classType to be searched for which must be a Topology, Blueprint, TuningParameters or DomainProfileFMWEnvSpecException
- if the file is not foundpublic EnvironmentModelFileLocator prependModelSearchLocation(File location)
location
- a File specifying the location to be added to the search listpublic EnvironmentModelFileLocator prependModelSearchLocation(String location)
location
- a File specifying the location to be added to the search list