org.owasp.orizon.dusk
Class Dusk

java.lang.Object
  extended by org.owasp.orizon.core.Trackable
      extended by org.owasp.orizon.core.Engine
          extended by org.owasp.orizon.dusk.Dusk

public class Dusk
extends Engine

Dusk is the rule processing engine. It will open library/ content, parse the rules and understand them. From 1.1.xx it is freecc based.

Since:
1.1.10
Author:
thesp0nge

Field Summary
 
Fields inherited from class org.owasp.orizon.core.Engine
engineCantTrace, engineMissingTraceName, engineStartErrno, errno, errstr, faults, has_faults, has_output, initialized, inputName, O_E_DELIVER, O_E_ERROR, O_E_IDLE, O_E_PAUSED, O_E_READY, O_E_RUNNING, O_E_STOPPED, prompt, ps1, reader, rules, s, silence, status, t0, t1, time
 
Fields inherited from class org.owasp.orizon.core.Trackable
trace, traceName
 
Constructor Summary
Dusk()
           
Dusk(java.io.BufferedReader b)
           
Dusk(java.lang.String recipeName)
           
 
Method Summary
 java.util.Vector<Rule> deliver()
           
 boolean exec(java.lang.String command)
          Engine specific execute command routine.
 boolean init()
          Dusk initialization is issued by reading the recipe, storing it in a String object.
 boolean pause()
          Pause the engine.
protected  boolean process(java.lang.Object n)
          Engine specific freecc tree generated root node management routine.
 void setBufferedInputStream(java.io.BufferedReader b)
           
 void setExpectedEngineName(java.lang.String engineName)
           
 void setLang(int code)
           
 void setRecipeName(java.lang.String recipeName)
           
 boolean shell()
          Engine specific interactive shell.
 boolean start()
          Starts the Dusk engine.
 boolean stop()
          Stop the engine.
 
Methods inherited from class org.owasp.orizon.core.Engine
addFault, canOutput, canPause, canRun, canStop, debug, errorString, exitOnFailure, feed, getAppName, getElapsedStatement, getErrno, getFaults, getProperties, getScanMills, getStats, getTimer, hasFaults, hasOutput, isPaused, isRunning, isStopped, isTestMode, isTurnedOn, pauseTimer, reset, resetTimer, setAppName, setErrorString, setProperties, setReader, setStats, setTestMode, startTimer, stopTimer
 
Methods inherited from class org.owasp.orizon.core.Trackable
getTraceName, isTrace, setTrace, setTraceName, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dusk

public Dusk()

Dusk

public Dusk(java.lang.String recipeName)

Dusk

public Dusk(java.io.BufferedReader b)
Method Detail

setBufferedInputStream

public void setBufferedInputStream(java.io.BufferedReader b)

setRecipeName

public void setRecipeName(java.lang.String recipeName)

setLang

public void setLang(int code)

setExpectedEngineName

public void setExpectedEngineName(java.lang.String engineName)

init

public boolean init()
Dusk initialization is issued by reading the recipe, storing it in a String object. Here you can call the exec() method using that string as parameter.

Specified by:
init in class Engine
Returns:
true if the recipe can be read or false otherwise.

pause

public boolean pause()
Description copied from class: Engine
Pause the engine.

Specified by:
pause in class Engine
Returns:
true if the engine can be paused, or false otherwise.

shell

public boolean shell()
Description copied from class: Engine
Engine specific interactive shell. OSH will permit users to interact with Orizon engines direct issuing them commands. For such a reason an interactive shell needs to be spawned.

Specified by:
shell in class Engine
Returns:
true if the shell can be spawned, or false otherwise.

start

public boolean start()
Starts the Dusk engine.

Specified by:
start in class Engine
Returns:
true if the Dusk engine can be started, or false otherwise.

stop

public boolean stop()
Description copied from class: Engine
Stop the engine. Freeze engine's activities preparing it to release results.

Specified by:
stop in class Engine
Returns:
true if the engine can be stopped, or false otherwise

exec

public boolean exec(java.lang.String command)
Description copied from class: Engine
Engine specific execute command routine. Each engine has to be able to receive commands from the outside (the shell o the SkyLine object), process them and giving back a result. This method will executes a command.

Specified by:
exec in class Engine
Parameters:
command - the command to execute
Returns:
true if the command has been executed, or false otherwise

deliver

public java.util.Vector<Rule> deliver()

process

protected boolean process(java.lang.Object n)
Description copied from class: Engine
Engine specific freecc tree generated root node management routine. This method will be called in exec() or shell() method giving the root node from the tree generated by each engine parser.

Specified by:
process in class Engine
Parameters:
n - the root node
Returns:
true or false if the caller routine has to exit upon return.