Java Doc for RulesRepository.java in  » Rule-Engine » drolls-Rule-Engine » org » drools » repository » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Rule Engine » drolls Rule Engine » org.drools.repository 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.drools.repository.RulesRepository

RulesRepository
public class RulesRepository (Code)
RulesRepository is the class that defines the bahavior for the JBoss Rules (drools) rule repository based upon the JCR specification (JSR-170).

An instance of this class is capable of storing rules used by the JBoss Rule engine. It also provides a versioning capability for rules. Rules can be imported from specified files. The RulesRepository is also capable of storing DSL content. Rules can be explicitly tied to a particular DSL node within the repository, and this reference can either follow the head version, or a specific version of the DSL node.

Rules can be tagged. Tags are stored in a separate area of the repository, and can be added on demand. Rules can have 0 or more tags. Tags are intended to help provide a means for searching for specific types of rules quickly, even when they aren't all part of the same rulepackage.

Rules can be associated with 0 or 1 states. States are created in a seperate area of the repository. States are intended to help track the progress of a rule as it traverses its life- cycle. (e.g. draft, approved, deprecated, etc.)

The RulesRepository provides versioning of rules, rule packages, and DSLs. This versioning works in a strictly linear fashion, with one version having at most 1 predecessor version (or none, if it is the first version), and at most 1 successor version (or none, if it is the most recently checked-in version). The JCR specification supports a more complicated versioning system, and if there is sufficient demand, we can modify our versioning scheme to be better aligned with JCR's versioning abilities.
author:
   Ben Truitt
author:
   Fernando Meyer
author:
   Michael Neale



Field Summary
final public static  StringDEFAULT_PACKAGE
    
final public static  StringDROOLS_URI
    
final public static  StringPACKAGE_SNAPSHOT_AREA
    
final public static  StringRULES_REPOSITORY_NAME
    
final public static  StringRULE_PACKAGE_AREA
    
final public static  StringSTATE_AREA
    
final public static  StringTAG_AREA
    

Constructor Summary
public  RulesRepository(Session session)
     This requires a JCR session be setup, and the repository be configured.

Method Summary
protected static  NodeaddNodeIfNew(Node parent, String nodeName, String type)
     Will add a node named 'nodeName' of type 'type' to 'parent' if such a node does not already exist.
public  booleancontainsPackage(String name)
     This returns true if the repository contains the specified package name.
public  StringcopyAsset(String uuidSource, String destinationPackage, String destinationName)
     This will copy an assets content to the new location.
public  voidcopyPackage(String sourcePackageName, String destPackageName)
     Copy a package to the target name.
public  voidcopyPackageSnapshot(String packageName, String snapshotName, String newName)
     Copies a snapshot to the new location/label.
Parameters:
  packageName - The name of the package.
Parameters:
  snapshotName - The label of the source snapshot
Parameters:
  newName - The new label.
public  PackageItemcreatePackage(String name, String description)
     Adds a package to the repository.
public  voidcreatePackageSnapshot(String packageName, String snapshotName)
     This will copy the package to the snapshot area.
public  StateItemcreateState(String name)
     Create a status node of the given name.
public  byte[]dumpRepositoryXml()
    
public  byte[]exportRulesRepository()
    
public  AssetItemIteratorfindArchivedAssets()
    
public  ListfindAssetsByCategory(String categoryTag, boolean seekArchivedAsset)
     This will retrieve a list of RuleItem objects - that are allocated to the provided category.
public  ListfindAssetsByCategory(String categoryTag)
    
public  AssetItemIteratorfindAssetsByName(String name, boolean seekArchived)
     This will search assets, looking for matches against the name.
public  AssetItemIteratorfindAssetsByName(String name)
    
public  SessiongetSession()
    
public  StateItemgetState(String name)
     Gets a StateItem for the specified state name.
public  voidimportRulesRepository(byte[] byteArray)
    
 booleanisNotSnapshot(Node parentNode)
    
public  String[]listPackageSnapshots(String packageName)
     Return a list of the snapshots available for the given package name.
public  IteratorlistPackages()
     an Iterator which will provide RulePackageItem's.
public  StateItem[]listStates()
    
public  AssetItemloadAssetByUUID(String uuid)
     Loads a rule by its UUID (generally the fastest way to load something).
public  CategoryItemloadCategory(String tagName)
     This will return a category for the given category path.
Parameters:
  tagName - the name of the tag to get.
public  PackageItemloadDefaultPackage()
     This will return or create the default package for rules that have no home yet.
public  PackageItemloadPackage(String name)
     Loads a RulePackage for the specified package name.
public  PackageItemloadPackageByUUID(String uuid)
     Similar to above.
public  PackageItemloadPackageSnapshot(String packageName, String snapshotName)
    
public  voidlogout()
     Explicitly logout of the underlying JCR repository.
public  voidmoveRuleItemPackage(String newPackage, String uuid, String explanation)
     This moves a rule asset from one package to another, preserving history etc etc.
public  voidremovePackageSnapshot(String packageName, String snapshotName)
     This will remove the specified snapshot.
public  StringrenameAsset(String uuid, String newAssetName)
     This will rename an assset and apply the change immediately.
public  StringrenamePackage(String uuid, String newPackageName)
     This will rename a package and apply the change immediately.
public  voidrestoreHistoricalAsset(AssetItem versionToRestore, AssetItem headVersion, String comment)
     This will restore the historical version, save, and check it in as a new version with the given comment.
public  voidsave()
     Save any pending changes.

Field Detail
DEFAULT_PACKAGE
final public static String DEFAULT_PACKAGE(Code)



DROOLS_URI
final public static String DROOLS_URI(Code)



PACKAGE_SNAPSHOT_AREA
final public static String PACKAGE_SNAPSHOT_AREA(Code)
The name of the rulepackage area of the repository



RULES_REPOSITORY_NAME
final public static String RULES_REPOSITORY_NAME(Code)
The name of the rules repository within the JCR repository



RULE_PACKAGE_AREA
final public static String RULE_PACKAGE_AREA(Code)
The name of the rulepackage area of the repository



STATE_AREA
final public static String STATE_AREA(Code)
The name of the state area of the repository



TAG_AREA
final public static String TAG_AREA(Code)
The name of the tag area of the repository




Constructor Detail
RulesRepository
public RulesRepository(Session session)(Code)
This requires a JCR session be setup, and the repository be configured.




Method Detail
addNodeIfNew
protected static Node addNodeIfNew(Node parent, String nodeName, String type) throws RulesRepositoryException(Code)
Will add a node named 'nodeName' of type 'type' to 'parent' if such a node does not already exist.
Parameters:
  parent - the parent node to add the new node to
Parameters:
  nodeName - the name of the new node
Parameters:
  type - the type of the new node a reference to the Node object that is created by the addition,or, if the node already existed, a reference to the pre-existantnode.
throws:
  RulesRepositoryException -



containsPackage
public boolean containsPackage(String name)(Code)
This returns true if the repository contains the specified package name.



copyAsset
public String copyAsset(String uuidSource, String destinationPackage, String destinationName)(Code)
This will copy an assets content to the new location. the UUID of the new asset.



copyPackage
public void copyPackage(String sourcePackageName, String destPackageName)(Code)
Copy a package to the target name.



copyPackageSnapshot
public void copyPackageSnapshot(String packageName, String snapshotName, String newName)(Code)
Copies a snapshot to the new location/label.
Parameters:
  packageName - The name of the package.
Parameters:
  snapshotName - The label of the source snapshot
Parameters:
  newName - The new label. The old one is left intact.



createPackage
public PackageItem createPackage(String name, String description) throws RulesRepositoryException(Code)
Adds a package to the repository.
Parameters:
  name - what to name the node added
Parameters:
  description - what description to use for the node a PackageItem, encapsulating the created node
throws:
  RulesRepositoryException -



createPackageSnapshot
public void createPackageSnapshot(String packageName, String snapshotName)(Code)
This will copy the package to the snapshot area. Creating a copy for deployment, etc.



createState
public StateItem createState(String name)(Code)
Create a status node of the given name.



dumpRepositoryXml
public byte[] dumpRepositoryXml() throws PathNotFoundException, IOException, RepositoryException(Code)



exportRulesRepository
public byte[] exportRulesRepository() throws IOException, PathNotFoundException, RepositoryException(Code)
TODO: comment
throws:
  IOException -
throws:
  PathNotFoundException -
throws:
  RepositoryException -



findArchivedAssets
public AssetItemIterator findArchivedAssets()(Code)



findAssetsByCategory
public List findAssetsByCategory(String categoryTag, boolean seekArchivedAsset) throws RulesRepositoryException(Code)
This will retrieve a list of RuleItem objects - that are allocated to the provided category. Only the latest versions of each RuleItem will be returned (you will have to delve into the rules deepest darkest history yourself... mahahahaha).



findAssetsByCategory
public List findAssetsByCategory(String categoryTag) throws RulesRepositoryException(Code)
TODO: Comment



findAssetsByName
public AssetItemIterator findAssetsByName(String name, boolean seekArchived)(Code)
This will search assets, looking for matches against the name.



findAssetsByName
public AssetItemIterator findAssetsByName(String name)(Code)



getSession
public Session getSession()(Code)
The JCR session that this repository is using.



getState
public StateItem getState(String name) throws RulesRepositoryException(Code)
Gets a StateItem for the specified state name. If a node for the specified state does not yet exist, one is first created.
Parameters:
  name - the name of the state to get a StateItem object encapsulating the retreived node
throws:
  RulesRepositoryException -



importRulesRepository
public void importRulesRepository(byte[] byteArray)(Code)

Parameters:
  byteArray -



isNotSnapshot
boolean isNotSnapshot(Node parentNode) throws RepositoryException(Code)

Parameters:
  parentNode -
throws:
  RepositoryException -



listPackageSnapshots
public String[] listPackageSnapshots(String packageName)(Code)
Return a list of the snapshots available for the given package name.



listPackages
public Iterator listPackages()(Code)
an Iterator which will provide RulePackageItem's. This will showALL the packages, only returning latest versions, by default.



listStates
public StateItem[] listStates()(Code)
A list of statii in the system.



loadAssetByUUID
public AssetItem loadAssetByUUID(String uuid)(Code)
Loads a rule by its UUID (generally the fastest way to load something).



loadCategory
public CategoryItem loadCategory(String tagName) throws RulesRepositoryException(Code)
This will return a category for the given category path.
Parameters:
  tagName - the name of the tag to get. If the tag to get is within aheirarchy of tag nodes, specify the full path to the tag nodeof interest (e.g. if you want to get back 'child-tag', use"parent-tag/child-tag") a TagItem object encapsulating the node for the tag in therepository
throws:
  RulesRepositoryException -



loadDefaultPackage
public PackageItem loadDefaultPackage() throws RulesRepositoryException(Code)
This will return or create the default package for rules that have no home yet.



loadPackage
public PackageItem loadPackage(String name) throws RulesRepositoryException(Code)
Loads a RulePackage for the specified package name. Will throw an exception if the specified rule package does not exist.
Parameters:
  name - the name of the package to load a RulePackageItem object



loadPackageByUUID
public PackageItem loadPackageByUUID(String uuid) throws RulesRepositoryException(Code)
Similar to above. Loads a RulePackage for the specified uuid.
Parameters:
  uuid - the uuid of the package to load a RulePackageItem object
throws:
  RulesRepositoryException -



loadPackageSnapshot
public PackageItem loadPackageSnapshot(String packageName, String snapshotName)(Code)



logout
public void logout()(Code)
Explicitly logout of the underlying JCR repository.



moveRuleItemPackage
public void moveRuleItemPackage(String newPackage, String uuid, String explanation)(Code)
This moves a rule asset from one package to another, preserving history etc etc.
Parameters:
  newPackage - The destination package.
Parameters:
  uuid - The UUID of the rule
Parameters:
  explanation - The reason (which will be added as the checkin message).



removePackageSnapshot
public void removePackageSnapshot(String packageName, String snapshotName)(Code)
This will remove the specified snapshot.



renameAsset
public String renameAsset(String uuid, String newAssetName)(Code)
This will rename an assset and apply the change immediately. the UUID of the new asset



renamePackage
public String renamePackage(String uuid, String newPackageName)(Code)
This will rename a package and apply the change immediately. the UUID of the package



restoreHistoricalAsset
public void restoreHistoricalAsset(AssetItem versionToRestore, AssetItem headVersion, String comment)(Code)
This will restore the historical version, save, and check it in as a new version with the given comment.
Parameters:
  versionToRestore -
Parameters:
  headVersion -
Parameters:
  comment -



save
public void save()(Code)
Save any pending changes.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.