org.okiproject.serviceapi.rules
Class RulesFactory

java.lang.Object
  |
  +--org.okiproject.serviceapi.rules.RulesFactory
All Implemented Interfaces:
java.io.Serializable

public class RulesFactory
extends java.lang.Object
implements java.io.Serializable

Copyright (c) 2001 Massachusetts Institute of Technology

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The RulesFactory allows the application developer to create Rules objects in the Rules database, to get Rules objects from the Rules database given selection criteria, to ask questions of Rules such as what subject can do verb for predicate.

The key objects in Rules are Rules, Verbs, Subjects, and and Predicates. There are some other objects in Rules that play supporting rules. They are SubjectType, VerbType, PredicateType.

There are two methods to create Rules. One uses method uses Person, Function, and Qualifier. The other adds effective date and expiration date. For the method without the dates the effective date is today and there is no expiration date.

There are methods for getting Rules:

(1) getRulesSimpleForm

This method is overloaded to allow for combinations
of filtering arguments to find matching Rules.


(2) getRulesForDoingVerbWithPredicate

Given a Verb and a Predicate, finds a list of all
Rules that would permit a person to do the
Verb with the Predicate. This method is overloaded
so that Rules for Verbs within a VerbType
can be found. This uses a different algorithm than
getRulesSimpleForm.

Note that the Predicate in any found Rule
might be a parent of the Predicate give as an argument.

(3) getRulesGeneralForm

Give a set of criteria/value pairs, this method finds
all matching Rules. With the general form
the application developer can do anything that the
other two forms of getRules can do and a
lot more.

See Also:
Model, Predicate, Predicates, PredicateType, Rule, Rules, Subject, Subjects, SubjectType, Verb, Verbs,

$Source: /cvs/oki/org/okiproject/serviceapi/doc/rules/org/okiproject/serviceapi/rules/RulesFactory.html,v $, Serialized Form


Constructor Summary
RulesFactory()
           
 
Method Summary
 org.okiproject.serviceapi.common.Agent getAgent()
          Method getAgent
static RulesFactory getDefaultRulesFactory(org.okiproject.serviceapi.common.Agent agent)
          Method getDefaultRulesFactory
 java.util.Map getProperties()
          Method getProperties
static RulesFactory getRulesFactory(org.okiproject.serviceapi.common.Agent agent, java.util.Map props)
          Method getRulesFactory
 void setAgent(org.okiproject.serviceapi.common.Agent agent)
          Method setAgent
 void setProperties(java.util.Map properties)
          Method setProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RulesFactory

public RulesFactory()
Method Detail

getDefaultRulesFactory

public static RulesFactory getDefaultRulesFactory(org.okiproject.serviceapi.common.Agent agent)
                                           throws java.lang.Exception
Method getDefaultRulesFactory
Parameters:
agent -  
Returns:
org.okiproject.serviceapi.rules.RulesFactory
Throws:
java.lang.Exception -  

getRulesFactory

public static RulesFactory getRulesFactory(org.okiproject.serviceapi.common.Agent agent,
                                           java.util.Map props)
                                    throws java.lang.Exception
Method getRulesFactory
Parameters:
agent -  
props -  
Returns:
org.okiproject.serviceapi.rules.RulesFactory
Throws:
java.lang.Exception -  

getAgent

public org.okiproject.serviceapi.common.Agent getAgent()
Method getAgent
Returns:
org.okiproject.serviceapi.common.Agent

setAgent

public void setAgent(org.okiproject.serviceapi.common.Agent agent)
Method setAgent
Parameters:
agent -  

getProperties

public java.util.Map getProperties()
Method getProperties
Returns:
java.util.Map

setProperties

public void setProperties(java.util.Map properties)
Method setProperties
Parameters:
properties -