com.oakgrovesystems.util
Class Navigator

java.lang.Object
  |
  +--com.oakgrovesystems.reactor.client.AbstractReactorProxy
        |
        +--com.oakgrovesystems.reactor.client.EJBReactorProxy
              |
              +--com.oakgrovesystems.util.Navigator
All Implemented Interfaces:
ReactorProxy

public class Navigator
extends EJBReactorProxy


Field Summary
protected  com.oakgrovesystems.reactor.processMediation.Policy currentPolicy
           
protected  com.oakgrovesystems.reactor.processMediation.Process currentProcess
           
 
Fields inherited from class com.oakgrovesystems.reactor.client.AbstractReactorProxy
authToken
 
Constructor Summary
Navigator(com.oakgrovesystems.reactor.processMediation.Policy policy, java.lang.String authToken)
          Constructs navigator object.
 
Method Summary
protected  java.lang.String createStackTrace(java.lang.Throwable t)
           
 boolean executePolicy(com.oakgrovesystems.reactor.LabelPath labelPath)
          Executes a policy using labelPath If label path is relative then it should be relative to the process with which current policy is associated with.
 com.oakgrovesystems.reactor.LabelPath getAbsoluteLabelPath(java.lang.String path)
          Gets a LabelPath object with a absolute path.
 com.oakgrovesystems.reactor.processMediation.Policy getCurrentPolicy()
          Gets current policy Current policy is the policy that is currently being executed
 com.oakgrovesystems.reactor.processMediation.Process getCurrentProcess()
          Gets the current process Current process is the process with which this policy is associated with
 com.oakgrovesystems.reactor.processMediation.Operand getOperand(com.oakgrovesystems.reactor.LabelPath labelPath)
          Gets operand using label path If label path is relative then it should be relative to the process with which current policy is associated with.
 java.util.Set getOperandIdsByLabelAndValue(java.lang.String label, java.lang.String value)
          Obtains a list of operand ID strings that refer to any operands that have a desired label (name) and value.
 com.oakgrovesystems.reactor.processMediation.Policy getPolicy(com.oakgrovesystems.reactor.LabelPath labelPath)
          Gets policy using label path If label path is relative then it should be relative to the process with which current policy is associated with.
 com.oakgrovesystems.reactor.processMediation.Process getProcess(com.oakgrovesystems.reactor.LabelPath labelPath)
          Gets Process using label path If label path is relative then it should be relative to the process with which current policy is associated with.
 java.util.Set getProcessIdsForOperandsByLabelAndValue(java.lang.String label, java.lang.String value)
          Obtains a list of process ID's that are associated with any operands that have a desired label (name) and value.
 com.oakgrovesystems.reactor.LabelPath getRelativeLabelPath(java.lang.String path)
          Gets a LabelPath object with a relative path.
 com.oakgrovesystems.reactor.processMediation.Status getStatus(com.oakgrovesystems.reactor.LabelPath labelPath)
          Gets status using label path If label path is relative then it should be relative to the process with which current policy is associated with.
 com.oakgrovesystems.reactor.processMediation.Status getStatus(com.oakgrovesystems.reactor.processMediation.Process process, java.lang.String statusLabel)
          Gets status using label
 void logError(java.lang.String message)
          Logs message in server's log file
 void logError(java.lang.String message, java.lang.Throwable exception)
          Logs message in server's log file
 java.lang.String lookupEmail(com.oakgrovesystems.reactor.processMediation.ACE ace)
          Looks up an email in the directory for the ace Email will be lookedup using name of the ace.
 boolean setACLofProcess(com.oakgrovesystems.reactor.LabelPath processLabelPath, java.lang.String role, com.oakgrovesystems.reactor.LabelPath operandLabelPath)
          Adds an ACE with role and name from operand to the process.
 boolean setACLofProcess(com.oakgrovesystems.reactor.LabelPath processLabelPath, java.lang.String role, com.oakgrovesystems.reactor.LabelPath operandLabelPath, java.lang.String delimiter)
          Adds an ACE with role and multiple names from operand to the process.
 boolean setOperandValue(com.oakgrovesystems.reactor.LabelPath labelPath, java.lang.String value)
          Sets value of an operand If label path is relative then it should be relative to the process with which current policy is associated with.
 
Methods inherited from class com.oakgrovesystems.reactor.client.EJBReactorProxy
sendRequest
 
Methods inherited from class com.oakgrovesystems.reactor.client.AbstractReactorProxy
addStatusToProcess, addStatusToProcess, addStatusToProcess, cloneInstance, cloneInstance, cloneInstance, cloneInstance, cloneInstance, cloneInstance, createObjects, createObjects, delete, delete, delete, delete, get, get, get, get, getAuthToken, handleRequest, lock, lock, lock, lock, lock, lock, lock, lock, login, logout, query, removeStatusFromProcess, removeStatusFromProcess, removeStatusFromProcess, setACLOnObject, setACLOnObject, setAuthToken, setObjects, setObjects, startProcess, startProcess, startProcess, stopProcess, stopProcess, stopProcess, unlock, unlock, unlock, unlock, unlock, unlock, unlock, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentPolicy

protected com.oakgrovesystems.reactor.processMediation.Policy currentPolicy

currentProcess

protected com.oakgrovesystems.reactor.processMediation.Process currentProcess
Constructor Detail

Navigator

public Navigator(com.oakgrovesystems.reactor.processMediation.Policy policy,
                 java.lang.String authToken)
          throws ObjectDereferencingException
Constructs navigator object. Navigator will return parameter policy as current policy and current process will be the process with which the parameter policy is associated with. All objects in the tree can be accessed using label path. Use getRelativeLabelPath(String path) to create LabelPath object with a relative path or use getAbsoluteLabelPath(String path) to create LabelPath object with absolute path.

Method Detail

getRelativeLabelPath

public com.oakgrovesystems.reactor.LabelPath getRelativeLabelPath(java.lang.String path)
Gets a LabelPath object with a relative path.

Parameters:
path - The path should be relative to process with which the current policy is associated with.
Returns:
LabelPath This method returns null if this policy is not associated with any process.

getAbsoluteLabelPath

public com.oakgrovesystems.reactor.LabelPath getAbsoluteLabelPath(java.lang.String path)
Gets a LabelPath object with a absolute path.

Parameters:
path - The path should be an absolute path.
Returns:
LabelPath returns labelpath

getOperand

public com.oakgrovesystems.reactor.processMediation.Operand getOperand(com.oakgrovesystems.reactor.LabelPath labelPath)
Gets operand using label path If label path is relative then it should be relative to the process with which current policy is associated with.

Parameters:
labelPath - The Label path of the operand.
Returns:
Operand or null if operand is not found.

getPolicy

public com.oakgrovesystems.reactor.processMediation.Policy getPolicy(com.oakgrovesystems.reactor.LabelPath labelPath)
Gets policy using label path If label path is relative then it should be relative to the process with which current policy is associated with.

Parameters:
labelPath - The Label path of the policy.
Returns:
Policy or null if policy is not found.

getCurrentPolicy

public com.oakgrovesystems.reactor.processMediation.Policy getCurrentPolicy()
Gets current policy Current policy is the policy that is currently being executed

Returns:
Policy the current policy

getStatus

public com.oakgrovesystems.reactor.processMediation.Status getStatus(com.oakgrovesystems.reactor.LabelPath labelPath)
Gets status using label path If label path is relative then it should be relative to the process with which current policy is associated with.

Parameters:
labelPath - The Label path of the status.
Returns:
Status or null if status is not found.

getStatus

public com.oakgrovesystems.reactor.processMediation.Status getStatus(com.oakgrovesystems.reactor.processMediation.Process process,
                                                                     java.lang.String statusLabel)
Gets status using label

Returns:
Status or null if status is not found.

getProcess

public com.oakgrovesystems.reactor.processMediation.Process getProcess(com.oakgrovesystems.reactor.LabelPath labelPath)
Gets Process using label path If label path is relative then it should be relative to the process with which current policy is associated with.

Parameters:
labelPath - The Label path of the process.
Returns:
Process or null if process is not found.

getCurrentProcess

public com.oakgrovesystems.reactor.processMediation.Process getCurrentProcess()
Gets the current process Current process is the process with which this policy is associated with

Returns:
Process The current process

setOperandValue

public boolean setOperandValue(com.oakgrovesystems.reactor.LabelPath labelPath,
                               java.lang.String value)
Sets value of an operand If label path is relative then it should be relative to the process with which current policy is associated with.

Parameters:
labelPath - Label Path of the operand whose value is to be set.
value - New value of the operand.
Returns:
boolean returns true if succeeds or false if fails.

executePolicy

public boolean executePolicy(com.oakgrovesystems.reactor.LabelPath labelPath)
Executes a policy using labelPath If label path is relative then it should be relative to the process with which current policy is associated with.

Parameters:
labelPath - Label path of the policy to execute
Returns:
boolean returns true if sucessful or false if it fails.

setACLofProcess

public boolean setACLofProcess(com.oakgrovesystems.reactor.LabelPath processLabelPath,
                               java.lang.String role,
                               com.oakgrovesystems.reactor.LabelPath operandLabelPath)
Adds an ACE with role and name from operand to the process. If label path is relative then it should be relative to the process with which current policy is associated with.

Parameters:
processLabelPath - The label path of process whose acl has to be set
role - The role of the ace
operandLabelPath - The label path of operand whose value contains the name of ace
Returns:
boolean Returns true if succeeds or false if fails

setACLofProcess

public boolean setACLofProcess(com.oakgrovesystems.reactor.LabelPath processLabelPath,
                               java.lang.String role,
                               com.oakgrovesystems.reactor.LabelPath operandLabelPath,
                               java.lang.String delimiter)
Adds an ACE with role and multiple names from operand to the process. If label path is relative then it should be relative to the process with which current policy is associated with. If no names are specified in the operand, then this method will silently do nothing.

Parameters:
processLabelPath - The label path of process whose acl has to be set
role - The role of the ace
operandLabelPath - The label path of operand whose value contains the name of ace
Returns:
boolean Returns true if succeeds or false if fails

getOperandIdsByLabelAndValue

public java.util.Set getOperandIdsByLabelAndValue(java.lang.String label,
                                                  java.lang.String value)
Obtains a list of operand ID strings that refer to any operands that have a desired label (name) and value.

Parameters:
label - the operand string label (name) to search for
value - the operand string value to search for
Returns:
a set of String object ID's

getProcessIdsForOperandsByLabelAndValue

public java.util.Set getProcessIdsForOperandsByLabelAndValue(java.lang.String label,
                                                             java.lang.String value)
Obtains a list of process ID's that are associated with any operands that have a desired label (name) and value.

Parameters:
label - the operand string label (name) to search for
value - the operand string value to search for
Returns:
a set of String object ID's

lookupEmail

public java.lang.String lookupEmail(com.oakgrovesystems.reactor.processMediation.ACE ace)
Looks up an email in the directory for the ace Email will be lookedup using name of the ace.

Returns:
String email of the ace or null if not found.

logError

public void logError(java.lang.String message)
Logs message in server's log file

Parameters:
message - The message to log

logError

public void logError(java.lang.String message,
                     java.lang.Throwable exception)
Logs message in server's log file

Parameters:
message - The message to log
exception - The exception to log

createStackTrace

protected java.lang.String createStackTrace(java.lang.Throwable t)


Copyright (c) 1999-2004 Oak Grove Systems. All Rights Reserved.