infosapient.control
Class InfoSapientController

java.lang.Object
  |
  +--infosapient.system.ObservableImpl
        |
        +--infosapient.control.InfoSapientController
Direct Known Subclasses:
InfoSapientServletController

public class InfoSapientController
extends ObservableImpl
implements Observer

Class InfoSapientController mediates the state for the rules Server and the knowledgebase development environment.

IDE Tasks:

Server Tasks:

Modifucation Log

Version:
$Revision: 1.1.1.1 $
Author:
Copyright (c) 1996-2001, Workplace Performance Tools, All Rights Reserved. License to use this program is provided under the COMMON PUBLIC LICENSE 0.5 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
See Also:
InfoSapientLauncher, InfoSapientRuleEditor, InfoSapientAttributeEditor, InfoSapientInferenceEditor, InfoSapientInferControl, FzyTorquemada, Serialized Form

Field Summary
(package private)  boolean chgsOutstanding
           
(package private)  FzyCorrelation corrMethod
           
(package private)  FzyAttribute currentAttribute
           
(package private)  FzyRule currentRule
           
(package private)  FzySet currentSet
           
(package private)  java.util.Date date
           
(package private) static java.util.Properties ERRORMsgs
           
(package private)  FzyImplicationMethod inferMethod
           
(package private)  java.lang.String kbFileName
           
(package private) static java.io.PrintWriter Log
           
(package private)  boolean logErrors
           
(package private)  FzyResolutionMethod resEngine
           
(package private)  java.util.Properties runParameters
           
(package private)  FSEvent runTimeEvent
           
(package private)  boolean runTimeOnly
           
(package private)  FzyKnowledgebase theKB
           
 
Fields inherited from class infosapient.system.ObservableImpl
arr, changed, obs, serialVersionUID
 
Constructor Summary
InfoSapientController()
           
InfoSapientController(boolean f)
          Set runtime flag Creation date: (2/2/00 1:29:37 PM)
InfoSapientController(java.io.PrintWriter out)
           
InfoSapientController(java.lang.String kbFilePathName)
          Initializes the BlackMesa Controller as the controller for the Rules Server.
 
Method Summary
(package private) static void ()
           
 void addAttribute(FzyAttribute attrib)
          Method to add a newly created FzyAttribute to the knowledgebase.
 void addRule(FzyRule rule)
          Method to add the created or modified rule to the knowledgebase.
 void execute(java.util.Properties rp)
          Execute a BlackMesa answer session as agent for Rules server.
 FzyAttribute getAttribute()
          Accessor to return the current attribute.
 boolean getChgsOutstanding()
          Accessor method to determine if the BlackMesaController has noted outstanding changes.
 FzyKnowledgebase getKB()
          Accessor method to return the knowledgebase.
 FzyRule getRule()
          Accessor to get the current rule being created, modified or deleted.
(package private)  java.lang.String getStackTrace(java.lang.Throwable throwable)
           
protected  void handleAskPrompt(FSEvent event)
          Method to pass back needed information to the executive during a run time session.
 void handleFSEvent(FSEvent ale)
          Method to directly handle events without going through Observable/Observer interfaces.
protected static void log(java.lang.String s)
           
 void newKB(java.lang.String name)
          Create a new knowledgebase.
private  void openErrorDialog(java.lang.Exception e)
          Display an error message.
private  void openErrorDialog(java.lang.String e)
          Creation date: (05/03/01 1:13:11 PM)
private  void processDeleteKB(java.io.File theKBFile)
          Method to delete the knowledgebase after user has given permission.
private  void processExit()
          Insert the method's description here.
private  void processForAttrEd(FzyAttribute fa)
          Create a new window based on the attribute provided.
private  void processForHelp()
          Insert the method's description here.
private  void processForInferControl()
          Open a inference controller to run tests on rules, attributes.
private  void processForInferEd()
          Insert the method's description here.
private  void processForRuleEd(FzyRule fr)
          Open an Editor on the specified rule.
private  void processForSetEd(FzySet fs)
          Open a set editor on the designated Fuzzy Set.
 void readKB(java.lang.String name)
          Method to read (load) the knowledgebase into the system.
 void setAttribute(FzyAttribute a)
          Accessor to set the current attribute being defined or modified.
 void setChgsOutstanding(boolean f)
          Method to notify other components that changes have been made to the knowledgebase.
 void setKB(FzyKnowledgebase kb)
          Sets the knowledge base for the controller Creation date: (12/13/1999 10:32:17 AM)
 void setRule(FzyRule r)
          Accessor to set the current rule being created or modified.
 void update(Observable obser, java.lang.Object obj)
          Method to support the Observer interface.
private  void verifyDeleteKB()
          Insert the method's description here.
 void writeKB(java.lang.String fn)
          Write the knowledgebase out in POSIX format, XML tagged.
 
Methods inherited from class infosapient.system.ObservableImpl
addObserver, clearChanged, containsObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

runTimeEvent

transient FSEvent runTimeEvent

date

transient java.util.Date date

runParameters

transient java.util.Properties runParameters

runTimeOnly

transient boolean runTimeOnly

chgsOutstanding

transient boolean chgsOutstanding

kbFileName

transient java.lang.String kbFileName

theKB

transient FzyKnowledgebase theKB

corrMethod

transient FzyCorrelation corrMethod

inferMethod

transient FzyImplicationMethod inferMethod

resEngine

transient FzyResolutionMethod resEngine

currentAttribute

transient FzyAttribute currentAttribute

currentSet

transient FzySet currentSet

currentRule

transient FzyRule currentRule

logErrors

transient boolean logErrors

Log

static java.io.PrintWriter Log

ERRORMsgs

static java.util.Properties ERRORMsgs
Constructor Detail

InfoSapientController

public InfoSapientController()

InfoSapientController

public InfoSapientController(java.io.PrintWriter out)

InfoSapientController

public InfoSapientController(java.lang.String kbFilePathName)
Initializes the BlackMesa Controller as the controller for the Rules Server.
Parameters:
String - -- the fully qualified pathname to the knowledgebase to be loaded.

InfoSapientController

public InfoSapientController(boolean f)
Set runtime flag Creation date: (2/2/00 1:29:37 PM)
Parameters:
f - boolean
Method Detail

static void ()

addAttribute

public void addAttribute(FzyAttribute attrib)
Method to add a newly created FzyAttribute to the knowledgebase. Users must implement @link Observer#update to catch exceptions.
Parameters:
infosapient.system.FzyAttribute - -- the attribute being added.

addRule

public void addRule(FzyRule rule)
Method to add the created or modified rule to the knowledgebase. Users must implement @link Observer#update to catch exceptions.
Parameters:
FzyRule - -- the rule being added to the knowledgebase.

execute

public void execute(java.util.Properties rp)
             throws java.lang.IllegalArgumentException
Execute a BlackMesa answer session as agent for Rules server. All exceptions and other events are surfaced to my observers through the infosapient.system.Observable#notifyObservers method.
Parameters:
Properties - -- the properties object containing the goal, and appropriate attribute values for needed information as key value pairs.

getAttribute

public FzyAttribute getAttribute()
Accessor to return the current attribute.
Returns:
FzyAttribute -- the current attribute.

getChgsOutstanding

public boolean getChgsOutstanding()
Accessor method to determine if the BlackMesaController has noted outstanding changes.
Returns:
boolean -- true if changes made to any of the knowledgebase components and the changes have not been saved.

getKB

public FzyKnowledgebase getKB()
Accessor method to return the knowledgebase.
Returns:
FzyKnowledgebase -- the current knowledgebase.

getRule

public FzyRule getRule()
Accessor to get the current rule being created, modified or deleted.
Returns:
infosapient.system.FzyRule -- the current rule.

getStackTrace

java.lang.String getStackTrace(java.lang.Throwable throwable)

handleAskPrompt

protected void handleAskPrompt(FSEvent event)
Method to pass back needed information to the executive during a run time session.
Parameters:
FSEvent - -- the event that contains the attribute and the specific request for information.

handleFSEvent

public void handleFSEvent(FSEvent ale)
Method to directly handle events without going through Observable/Observer interfaces. This method is only used by BlackMesa windows.
Parameters:
FSEvent - -- event to be handled.

log

protected static void log(java.lang.String s)

newKB

public void newKB(java.lang.String name)
Create a new knowledgebase. WARNING: This method will not force a previously created knowledgebase to save itself.
Parameters:
String - -- the name of the new knowledgebase.

openErrorDialog

private void openErrorDialog(java.lang.Exception e)
Display an error message.
Parameters:
e - java.lang.Exception

openErrorDialog

private void openErrorDialog(java.lang.String e)
Creation date: (05/03/01 1:13:11 PM)
Parameters:
e - java.lang.Exception

processDeleteKB

private void processDeleteKB(java.io.File theKBFile)
Method to delete the knowledgebase after user has given permission.

processExit

private void processExit()
Insert the method's description here. Creation date: (05/03/01 1:10:53 PM)

processForAttrEd

private void processForAttrEd(FzyAttribute fa)
Create a new window based on the attribute provided. Creation date: (05/03/01 1:11:25 PM)
Parameters:
fa - infosapient.system.FzyAttribute

processForHelp

private void processForHelp()
Insert the method's description here. Creation date: (05/03/01 1:15:27 PM)

processForInferControl

private void processForInferControl()
Open a inference controller to run tests on rules, attributes. Creation date: (05/03/01 1:14:24 PM)

processForInferEd

private void processForInferEd()
Insert the method's description here. Creation date: (05/03/01 1:14:00 PM)

processForRuleEd

private void processForRuleEd(FzyRule fr)
Open an Editor on the specified rule. Creation date: (05/03/01 1:12:34 PM)
Parameters:
fr - infosapient.system.FzyRule

processForSetEd

private void processForSetEd(FzySet fs)
Open a set editor on the designated Fuzzy Set. Creation date: (05/03/01 1:11:59 PM)
Parameters:
fs - infosapient.system.FzySet

readKB

public void readKB(java.lang.String name)
            throws java.lang.Exception
Method to read (load) the knowledgebase into the system. Users must implement the Observer interface @link Observer#update to catch exceptions.
Parameters:
String - -- the fully qualified path name of the knowledgebase.

setAttribute

public void setAttribute(FzyAttribute a)
Accessor to set the current attribute being defined or modified.
Parameters:
FzyAttribute - -- the current attribute.

setChgsOutstanding

public void setChgsOutstanding(boolean f)
Method to notify other components that changes have been made to the knowledgebase.

setKB

public void setKB(FzyKnowledgebase kb)
Sets the knowledge base for the controller Creation date: (12/13/1999 10:32:17 AM)
Parameters:
kb - infosapient.system.FzyKnowledgebase

setRule

public void setRule(FzyRule r)
Accessor to set the current rule being created or modified. (This will be the same rule in the ARCRuleEditor window.)
Parameters:
infosapient.system.FzyRule - -- the current rule.

update

public void update(Observable obser,
                   java.lang.Object obj)
Method to support the Observer interface. My observed objects will notify me of state changes through this interface.
Specified by:
update in interface Observer
Parameters:
Observable - -- the object that sent the notifyObservers message
Object - the object sent as an argument when the observed object invoked notifyObservers.

verifyDeleteKB

private void verifyDeleteKB()
Insert the method's description here. Creation date: (05/03/01 1:16:04 PM)

writeKB

public void writeKB(java.lang.String fn)
Write the knowledgebase out in POSIX format, XML tagged.
Parameters:
String - - the file name of the knowledgebase.

License to use this program is provided under the TERMS OF THE COMMON PUBLIC LICENSE 0.5. ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

Copyright (c) 2001, Workplace Performance Tools, All Rights Reserved