Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1)

E10663-02


oracle.rules.sdk2.repository
Interface RuleRepository


public interface RuleRepository

A common API to access rule dictionaries stored in repository.


Method Summary
 void close()
          Close the repository so that resources it holds are released.
 boolean exists(DictionaryFQN fqn)
          Determine whether a dictionary identified by the DictionaryFQN exists in the repository.
 boolean exists(java.lang.String pkg, java.lang.String name)
          Determine whether a dictionary with the specified package and name exists in the repository.
 DictionaryFinder getDictionaryFinder()
          Returns the repository's dictionary finder.
 DictionaryFQN[] getNames(DictionaryFQN fqn)
          Get the fully qualfied names of dictionaries stored in the repository that match the dictionary package and name specified in the DictionaryFQN.
 DictionaryFQN[] getNames(java.lang.String pkg, java.lang.String name)
          Get the fully qualfied names of dictionaries stored in the repository that match the specified dictionary package and name.
 RepositoryContext getRepositoryContext()
          Get the context for this repository.
 RepositoryType getRepositoryType()
          Get the rule repository type.
 void init(RepositoryContext ctx)
          Initialize the repository by passing security and configuration information.
 boolean isStale(DictionaryFQN fqn)
          Check if a newer version of a dictionary is available.
 boolean isStale(java.lang.String pkg, java.lang.String name)
          Check if a newer version of a dictionary is available.
 RuleDictionary load(DictionaryFQN fqn)
          Load a dictionary from the repository.
 RuleDictionary load(java.lang.String pkg, java.lang.String name)
          Load a dictionary from the repository.
 void registerChangeListener(RepositoryChangeListener dcl)
          Register a listener for dictionary changes.
 void remove(DictionaryFQN fqn)
          Remove the dictionary identified by its fully qualified name from repository.
 void remove(java.lang.String pkg, java.lang.String name)
          Remove the dictionary identified by the package and name from repository.
 void rename(DictionaryFQN fqn, DictionaryFQN newFQN, boolean overwrite)
          Rename a dictionary in the repository.
 void rename(RuleDictionary dictionary, DictionaryFQN newFQN, boolean overwrite)
          Rename the specified dictionary in the repository.
 void rename(RuleDictionary dictionary, java.lang.String newPkg, java.lang.String newName, boolean overwrite)
          Rename the specified dictionary in the repository.
 void rename(java.lang.String pkg, java.lang.String name, java.lang.String newPkg, java.lang.String newName, boolean overwrite)
          Rename a dictionary in the repository.
 void save(RuleDictionary dictionary)
          Save a dictionary to the repository.
 void saveAs(RuleDictionary dictionary, DictionaryFQN fqn, boolean overwrite)
          Save a dictionary to repository with a new identity.
 void saveAs(RuleDictionary dictionary, java.lang.String pkg, java.lang.String name, boolean overwrite)
          Save a dictionary to repository with a new identity.
 void unregisterChangeListener(RepositoryChangeListener dcl)
          Unregister a listener for dictionary changes.

 

Method Detail

init

void init(RepositoryContext ctx)
          throws RepositoryException
Initialize the repository by passing security and configuration information. This method must be invoked before performing any repository operations.
Parameters:
ctx - an instance of the RepositoryContext class which contains security and repository configuration information.
Throws:
RepositoryException - if error is encountered in repository initialization

getRepositoryContext

RepositoryContext getRepositoryContext()
Get the context for this repository.
Returns:
the RepositoryContext object

getRepositoryType

RepositoryType getRepositoryType()
Get the rule repository type. It identifies the underlying repository and provides methods for discovery of the repository configuration parameters.
Returns:
type of the repository

getNames

DictionaryFQN[] getNames(java.lang.String pkg,
                         java.lang.String name)
                         throws RepositoryException
Get the fully qualfied names of dictionaries stored in the repository that match the specified dictionary package and name.
Parameters:
pkg - the dictionary package. A null value means "don't care" and all dictionary packages in the repository will match.
name - the dictionary name. A null value means "don't care" and all dictionary names in the repository will match.
Returns:
An array of fully qualified dictionary names. If no dictionaries in the repository match the specified package and name, a 0 length array is returned.
Throws:
RepositoryException - if error when accessing the repository

getNames

DictionaryFQN[] getNames(DictionaryFQN fqn)
                         throws RepositoryException
Get the fully qualfied names of dictionaries stored in the repository that match the dictionary package and name specified in the DictionaryFQN.
Parameters:
fqn - the DictionaryFQN that specifies the desired dictionary package and name. A null value for any of these means "don't care" and any corresponding value will match.
Returns:
An array of fully qualified dictionary names. Each property in the specified DictionaryFQN may be null indicating that any value may match that property. If no dictionaries in the repository match the specified DictionaryFQN, a 0 length array is returned.
Throws:
RepositoryException - if error occurs when accessing the repository

exists

boolean exists(java.lang.String pkg,
               java.lang.String name)
               throws RepositoryException
Determine whether a dictionary with the specified package and name exists in the repository.
Parameters:
pkg - the dictionary package
name - the dictionary name
Returns:
true if a dictionary with given package and name exists in the repository, otherwise false.
Throws:
RepositoryException - if error occurs accessing the repository

exists

boolean exists(DictionaryFQN fqn)
               throws RepositoryException
Determine whether a dictionary identified by the DictionaryFQN exists in the repository.
Parameters:
fqn - the fully qualified name of the dictionary.
Returns:
true if a dictionary with given fully qualified name exists in the repository, otherwise false.
Throws:
RepositoryException - if error occurs accessing the repository

load

RuleDictionary load(java.lang.String pkg,
                    java.lang.String name)
                    throws RepositoryException,
                           SDKException
Load a dictionary from the repository.
Parameters:
pkg - the dictionary package
name - the dictionary name
Returns:
an instance of RuleDictionary for the dictionary identified by the dictionary package and name.
Throws:
RepositoryException - if error when loading the dictionary
SDKException

load

RuleDictionary load(DictionaryFQN fqn)
                    throws RepositoryException,
                           SDKException
Load a dictionary from the repository.
Parameters:
fqn - the fully qualified name of the dictionary.
Returns:
an instance of RuleDictionary for the dictionary identified by the fully qualified name.
Throws:
RepositoryException - if error occurred loading the dictionary from the repository.
SDKException - if error occurred creating the RuleDictionary object.

save

void save(RuleDictionary dictionary)
          throws RepositoryException,
                 SDKException
Save a dictionary to the repository. If the dictionary does not exist in the repository, it will be created. If the dictionary exists in the repository, it is updated with the new dictionary content.
Parameters:
dictionary - the rule dictionary to save
Throws:
RepositoryException - an error occured in the attempt to save the dictionary.
SDKException - if an error occured serializing the dictionary to XML.

saveAs

void saveAs(RuleDictionary dictionary,
            java.lang.String pkg,
            java.lang.String name,
            boolean overwrite)
            throws RepositoryException,
                   SDKException
Save a dictionary to repository with a new identity. If a dictionary with the same package and name exists in the repository, a DictionaryAlreadyExistsException will be thrown. Otherwise, the dictionary content will be saved with the new package and name. The dictionary stored with the old identity is unmodified by this operation.
Parameters:
dictionary - the rule dictionary to save
pkg - the new dictionary package.
name - the new dictionary name.
overwrite - a value of true will allow overwriting an existing dictionary with the name composed from pkg and name. Otherwise, an exception is thrown if the dictionary already exists.
Throws:
DictionaryAlreadyExistsException - a dictionary with the same package and name already exists in the repository.
RepositoryException - an exception occured during the attempt to save the dictionary in the repository.
SDKException - if an error occured serializing the dictionary to XML or in the in-memory dictionary rename.

saveAs

void saveAs(RuleDictionary dictionary,
            DictionaryFQN fqn,
            boolean overwrite)
            throws RepositoryException,
                   SDKException
Save a dictionary to repository with a new identity. If a dictionary identified by the new fully qualified name exists in the repository, a DictionaryAlreadyExistsException will be thrown. Otherwise, the dictionary content will be saved with the new identity. The dictionary stored with the old identity is unmodified by this operation.
Parameters:
dictionary - the rule dictionary to save
fqn - the new fully qualified name for the dictionary.
overwrite - a value of true will allow overwriting an existing dictionary with the name fqn. Otherwise, an exception is thrown if the dictionary already exists.
Throws:
DictionaryAlreadyExistsException - a dictionary with the same fully qualified name already exists in the repository.
RepositoryException - an exception occured during the attempt to save the dictionary in the repository.
SDKException - if an error occured serializing the dictionary to XML or in the in-memory dictionary rename.

remove

void remove(java.lang.String pkg,
            java.lang.String name)
            throws RepositoryException
Remove the dictionary identified by the package and name from repository.
Parameters:
pkg - the dictionary package
name - the dictionary name
Throws:
RepositoryException - an exception occured attempting to remove the dictionary

remove

void remove(DictionaryFQN fqn)
            throws RepositoryException
Remove the dictionary identified by its fully qualified name from repository.
Parameters:
fqn - the fully qualified name
Throws:
RepositoryException - an exception occured attempting to remove the dictionary

rename

void rename(java.lang.String pkg,
            java.lang.String name,
            java.lang.String newPkg,
            java.lang.String newName,
            boolean overwrite)
            throws SDKException
Rename a dictionary in the repository.
Parameters:
pkg - the dictionary package
name - name of the dictionary to rename
newPkg - the new dictionary package
newName - the new name of the dictionary
overwrite - a value of true will allow overwriting an existing dictionary with the name composed from newPkg and newName. Otherwise, an exception is thrown if the dictionary exists.
Throws:
DictionaryNotFoundException - a dictionary with the package oldPkg and name oldName does not exist in the repository.
DictionaryAlreadyExistsException - a dictionary with the package newPkg and name newName already exists in the repository.
RepositoryException - thrown if the dictionary can not be renamed
SDKException - if an error occured renaming the dictionary itself.

rename

void rename(DictionaryFQN fqn,
            DictionaryFQN newFQN,
            boolean overwrite)
            throws SDKException
Rename a dictionary in the repository.
Parameters:
fqn - the current fully qualified name of the dictionary
newFQN - the new fully qualified name.
overwrite - a value of true will allow overwriting an existing dictionary with the name newFQN. Otherwise, an exception is thrown if the dictionary exists.
Throws:
DictionaryNotFoundException - a dictionary with the qualified name oldFQN does not exist in the repository.
DictionaryAlreadyExistsException - a dictionary with the qualified name newFQN already exists in the repository.
RepositoryException - thrown if the dictionary can not be renamed
SDKException - if an error occured renaming the dictionary itself.

rename

void rename(RuleDictionary dictionary,
            java.lang.String newPkg,
            java.lang.String newName,
            boolean overwrite)
            throws SDKException
Rename the specified dictionary in the repository. The specified dictionary will be removed in the repository and stored under the new package and name.
Parameters:
dictionary - the dictionary to be renamed.
newPkg - the new dictionary package
newName - the new name of the dictionary
overwrite - a value of true will allow overwriting an existing dictionary with the name composed from newPkg and newName. Otherwise, an exception is thrown if the dictionary exists.
Throws:
DictionaryNotFoundException - the specified dictionary does not exist in the repository.
DictionaryAlreadyExistsException - a dictionary with the package newPkg and name newName already exists in the repository.
RepositoryException - thrown if the dictionary can not be renamed
SDKException - if an error occured renaming the dictionary itself.

rename

void rename(RuleDictionary dictionary,
            DictionaryFQN newFQN,
            boolean overwrite)
            throws SDKException
Rename the specified dictionary in the repository. The specified dictionary will be removed in the repository and stored under the new fully qualified name.
Parameters:
dictionary - the dictionary to be renamed.
newFQN - the new fully qualified name.
overwrite - a value of true will allow overwriting an existing dictionary with the name newFQN. Otherwise, an exception is thrown if the dictionary exists.
Throws:
DictionaryNotFoundException - the specified dictionary does not exist in the repository.
DictionaryAlreadyExistsException - a dictionary with the qualified name newFQN already exists in the repository.
RepositoryException - thrown if the dictionary can not be renamed
SDKException - if an error occured renaming the dictionary itself.

isStale

boolean isStale(java.lang.String pkg,
                java.lang.String name)
                throws RepositoryException
Check if a newer version of a dictionary is available.
Parameters:
pkg - the dictionary package
name - the dictionary name
Returns:
true if
  • the dictionary has been modified since it was loaded, or
  • the dictionary was never loaded, or
  • the underlying store doesn't support this operation.
Otherwise it returns false.
Throws:
RepositoryException - an error occured in the check

isStale

boolean isStale(DictionaryFQN fqn)
                throws RepositoryException
Check if a newer version of a dictionary is available.
Parameters:
fqn - the fully qualified name of the dictionary
Returns:
true if
  • the dictionary has been modified since it was loaded, or
  • the dictionary was never loaded, or
  • the underlying store doesn't support this operation.
Otherwise it returns false.
Throws:
RepositoryException - an error occured in the check

registerChangeListener

void registerChangeListener(RepositoryChangeListener dcl)
                            throws RepositoryException
Register a listener for dictionary changes.
Throws:
RepositoryException - an error occured in the check

unregisterChangeListener

void unregisterChangeListener(RepositoryChangeListener dcl)
                              throws RepositoryException
Unregister a listener for dictionary changes.
Throws:
RepositoryException - an error occured in the check

close

void close()
           throws RepositoryException
Close the repository so that resources it holds are released.
Throws:
RepositoryException - an exception occured during closing the repository

getDictionaryFinder

DictionaryFinder getDictionaryFinder()
Returns the repository's dictionary finder.
Returns:
the repository's dictionary finder.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1)

E10663-02


Copyright © 2009, Oracle and/or its affiliates. All rights reserved.