Skip navigation links


oracle.idm.util.progress
Class ProgressProcessor

java.lang.Object
  extended by oracle.idm.util.progress.ProgressReporter
      extended by oracle.idm.util.progress.ProgressProcessor

All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
BulkProvision, BulkProvStatusUpdate, ProgressMonitor, ProgressRequestProcessor

public abstract class ProgressProcessor
extends ProgressReporter
implements java.lang.Runnable

This class provides a base implementation for progress event producing tools.

ProgressProcessor allows only direct access to state transitions. For queued requests for state transition, see ProgressRequestProcessor.

See Also:
ProgressRequestProcessor

Field Summary
static java.lang.String ABORTED
          Internally triggered state indicates that processing has been aborted.
static java.lang.String CANCELED
          Externally triggered state indicates that processing has been canceled.
static java.lang.String FINISHED
          Internally triggered state indicates that processing has been finished.
protected  DurationInfo progressEventDurationInfo
           
protected  java.lang.String progressEventLocalizedMessage
           
protected  java.lang.String progressEventMessage
           
protected  java.lang.String progressEventName
           
protected  PercentInfo progressEventPercentInfo
           
protected  java.lang.Object progressEventProgressInfo
           
protected  StateInfo progressEventStateInfo
           
protected  StatusInfo progressEventStatusInfo
           
protected  StepInfo progressEventStepInfo
           
protected  java.lang.Throwable progressEventThrowable
           
static java.lang.String RESTORED
          Internally triggered state indicates that processing has been restored.
static java.lang.String RESUMED
          Externally triggered state indicates that processing has been resumed.
static java.lang.String STARTED
          Externally triggered state indicates that processing has been started.
static java.lang.String STOPPED
          Externally triggered state indicates that processing has been stopped.
static java.lang.String SUSPENDED
          Externally triggered state indicates that processing has been suspended.
static java.lang.String TIMEDOUT
          Internally triggered state indicates that processing has been timedout.
protected  Transitions transitions
           
static Transitions TRANSITIONS
          State transition model (null is the pre-initial state):

 

Constructor Summary
protected ProgressProcessor()
           
protected ProgressProcessor(ProgressManager manager)
           
protected ProgressProcessor(ProgressManager manager, Transitions transitions)
           
protected ProgressProcessor(Transitions transitions)
           

 

Method Summary
protected  boolean abort(boolean quiet)
           
protected  void block()
          This method will block until notified.
protected  void block(java.util.Set states)
          This method will block while the states contains the current state.
protected  void block(java.lang.String state)
          This method will block while the state is the current state.
 boolean canAbort()
           
 boolean canCancel()
           
protected  void cancel()
          This method calls cancel(false).
protected  boolean cancel(boolean quiet)
           
 boolean canFinish()
           
 boolean canReset()
           
 boolean canRestore()
           
 boolean canResume()
           
 boolean canStart()
           
 boolean canStop()
           
 boolean canSuspend()
           
 boolean canTimeout()
           
 boolean canTransition(java.lang.String state)
          Checks if the current state can be transitioned to the state parameter.
protected  boolean finish(boolean quiet)
           
protected  ProgressEvent getProgressEvent()
           
protected  DurationInfo getProgressEventDurationInfo()
           
protected  java.lang.String getProgressEventLocalizedMessage()
           
protected  java.lang.String getProgressEventMessage()
           
protected  java.lang.String getProgressEventName()
           
protected  PercentInfo getProgressEventPercentInfo()
           
protected  java.lang.Object getProgressEventProgressInfo()
           
protected  StateInfo getProgressEventStateInfo()
           
protected  StatusInfo getProgressEventStatusInfo()
           
protected  StepInfo getProgressEventStepInfo()
           
protected  java.lang.Throwable getProgressEventThrowable()
           
protected  Transitions getTransitions()
           
 boolean isAborted()
           
 boolean isCanceled()
           
protected  boolean isFinal()
          Checks if the current state is one of the final states.
 boolean isFinished()
           
protected  boolean isInitial()
          Checks if the current state is one of the initial states.
protected  boolean isIntermediate()
          Checks if the current state is one of the intermediate states.
protected  boolean isNext(java.lang.String state)
          Checks if the given state is one of the next states.
protected  boolean isPrevious(java.lang.String state)
          Checks if the given state is one of the previous states.
protected  boolean isReachable()
          Checks if the current state is one of the reachable states.
 boolean isReset()
           
 boolean isRestored()
           
 boolean isResumed()
           
 boolean isStarted()
           
 boolean isStopped()
           
 boolean isSuspended()
           
 boolean isTimedout()
           
protected  boolean isUnreachable()
          Checks if the current state is one of the unreachable states.
 void ping()
          This method will send a ping progress event.
protected abstract  void process(boolean quiet)
          This method does all of the processing.
 void reset()
          This method resets the progress reporter, call when you want to reuse the same progress reporter to report progress on a new process.
protected  boolean restore(boolean quiet)
           
protected  void resume()
          This method calls resume(false).
protected  boolean resume(boolean quiet)
           
 void run()
          Implements runnable, calls start().
protected  void sendProgressEvent()
          This method will send a progress event.
protected  void setTransitions(Transitions transitions)
           
protected  void start()
          This method calls process(false) and catches any throwables that happen during processing, reports them to listeners, and it attempts to transition to aborted state.
protected  boolean start(boolean quiet)
           
protected  void stop()
          This method calls stop(false).
protected  boolean stop(boolean quiet)
           
protected  void suspend()
          This method calls suspend(false).
protected  boolean suspend(boolean quiet)
           
protected  boolean timeout(boolean quiet)
           
protected  boolean transition(java.lang.String state, boolean quiet)
          This method will change current state to the state parameter and send a progress event.

 

Methods inherited from class oracle.idm.util.progress.ProgressReporter
clearTransient, continuing, getDuration, getErrorTotal, getException, getLocalizedMessage, getLocalizedMessages, getMessage, getMessages, getProgressManager, getRuntimeException, getStateCurrent, getStateTimeStamp, getTimeout, getTransient, getWarningTotal, hasTimedout, isStateCurrent, isTransient, markTransient, resetDuration, sendProgressEvent, setErrorTotal, setProgressManager, setStateCurrent, setStateTimeStamp, setTimeout, setWarningTotal, throwErrorOrException, throwErrorOrRuntimeException, throwException, throwRuntimeException, unmarkTransient

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

STARTED

public static final java.lang.String STARTED
Externally triggered state indicates that processing has been started. Upon user request, processor transitions into STARTED state.
See Also:
Constant Field Values

STOPPED

public static final java.lang.String STOPPED
Externally triggered state indicates that processing has been stopped. Upon user request, processor transitions into STOPPED state. Stopping does not imply any cleanup, and stopps imediately.
See Also:
Constant Field Values

CANCELED

public static final java.lang.String CANCELED
Externally triggered state indicates that processing has been canceled. Upon user request, processor transitions into CANCELED state. Canceling implies cleanup, and needs to perform restauration as necessary.
See Also:
Constant Field Values

RESTORED

public static final java.lang.String RESTORED
Internally triggered state indicates that processing has been restored. After processing has been canceled, and restauration is complete, processor transitions into RESTORED state.
See Also:
Constant Field Values

SUSPENDED

public static final java.lang.String SUSPENDED
Externally triggered state indicates that processing has been suspended. Upon user request, processor transitions into SUSPENDED state.
See Also:
Constant Field Values

RESUMED

public static final java.lang.String RESUMED
Externally triggered state indicates that processing has been resumed. Upon user request, processor transitions into RESUMED state.
See Also:
Constant Field Values

FINISHED

public static final java.lang.String FINISHED
Internally triggered state indicates that processing has been finished. After processor has finished, processor transitions into FINISHED state.
See Also:
Constant Field Values

ABORTED

public static final java.lang.String ABORTED
Internally triggered state indicates that processing has been aborted. After processor has aborted, processor transitions into ABORTED state.
See Also:
Constant Field Values

TIMEDOUT

public static final java.lang.String TIMEDOUT
Internally triggered state indicates that processing has been timedout. After processor has timedout, processor transitions into TIMEDOUT state.
See Also:
Constant Field Values

TRANSITIONS

public static final Transitions TRANSITIONS
State transition model (null is the pre-initial state):
 null -> STARTED
 STARTED -> [ STOPPED | CANCELED | SUSPENDED | FINISHED | ABORTED | TIMEDOUT ]
 CANCELED -> [ STOPPED | RESTORED | ABORTED | TIMEDOUT ]
 SUSPENDED -> [ STOPPED | CANCELED | RESUMED | FINISHED | ABORTED | TIMEDOUT ]
 RESUMED -> [ STOPPED | CANCELED | SUSPENDED | FINISHED | ABORTED | TIMEDOUT ]
 

transitions

protected Transitions transitions

progressEventName

protected java.lang.String progressEventName

progressEventMessage

protected java.lang.String progressEventMessage

progressEventLocalizedMessage

protected java.lang.String progressEventLocalizedMessage

progressEventThrowable

protected java.lang.Throwable progressEventThrowable

progressEventStateInfo

protected StateInfo progressEventStateInfo

progressEventStatusInfo

protected StatusInfo progressEventStatusInfo

progressEventStepInfo

protected StepInfo progressEventStepInfo

progressEventPercentInfo

protected PercentInfo progressEventPercentInfo

progressEventDurationInfo

protected DurationInfo progressEventDurationInfo

progressEventProgressInfo

protected java.lang.Object progressEventProgressInfo

Constructor Detail

ProgressProcessor

protected ProgressProcessor()

ProgressProcessor

protected ProgressProcessor(ProgressManager manager)

ProgressProcessor

protected ProgressProcessor(Transitions transitions)

ProgressProcessor

protected ProgressProcessor(ProgressManager manager,
                            Transitions transitions)

Method Detail

getTransitions

protected Transitions getTransitions()

setTransitions

protected void setTransitions(Transitions transitions)

run

public void run()
Implements runnable, calls start(). It throws exceptions from start as runtime exceptions.
Specified by:
run in interface java.lang.Runnable

start

protected void start()
              throws java.lang.Exception
This method calls process(false) and catches any throwables that happen during processing, reports them to listeners, and it attempts to transition to aborted state.

If the throwable caught by this method is marked as transient, it will not be reported to the progress listeners and abort transition will not be attempted.

Subclasses should make this method public.

Throws:
java.lang.Exception

stop

protected void stop()
This method calls stop(false).

Subclasses that support STOPPED state should make this method public.


cancel

protected void cancel()
This method calls cancel(false).

Subclasses that support CANCELED state should make this method public.


suspend

protected void suspend()
This method calls suspend(false).

Subclasses that support SUSPENDED state should make this method public.


resume

protected void resume()
This method calls resume(false).

Subclasses that support RESUMED state should make this method public.


process

protected abstract void process(boolean quiet)
                         throws java.lang.Exception
This method does all of the processing. It typically invokes start(quiet), does something, and then invokes finish(quiet).

This method must not be synchronized!!!

Parameters:
quiet - if quiet is true, this method does not throw transition exceptions
Throws:
java.lang.Exception

block

protected void block()
This method will block until notified.

block

protected void block(java.lang.String state)
This method will block while the state is the current state.

block

protected void block(java.util.Set states)
This method will block while the states contains the current state.

isNext

protected boolean isNext(java.lang.String state)
Checks if the given state is one of the next states.

isPrevious

protected boolean isPrevious(java.lang.String state)
Checks if the given state is one of the previous states.

isInitial

protected boolean isInitial()
Checks if the current state is one of the initial states.

isIntermediate

protected boolean isIntermediate()
Checks if the current state is one of the intermediate states.

isFinal

protected boolean isFinal()
Checks if the current state is one of the final states.

isReachable

protected boolean isReachable()
Checks if the current state is one of the reachable states.

isUnreachable

protected boolean isUnreachable()
Checks if the current state is one of the unreachable states.

isStarted

public boolean isStarted()

isStopped

public boolean isStopped()

isCanceled

public boolean isCanceled()

isRestored

public boolean isRestored()

isSuspended

public boolean isSuspended()

isResumed

public boolean isResumed()

isFinished

public boolean isFinished()

isAborted

public boolean isAborted()

isTimedout

public boolean isTimedout()

isReset

public boolean isReset()

canTransition

public boolean canTransition(java.lang.String state)
Checks if the current state can be transitioned to the state parameter.

canStart

public boolean canStart()

canStop

public boolean canStop()

canCancel

public boolean canCancel()

canRestore

public boolean canRestore()

canSuspend

public boolean canSuspend()

canResume

public boolean canResume()

canFinish

public boolean canFinish()

canAbort

public boolean canAbort()

canTimeout

public boolean canTimeout()

canReset

public boolean canReset()

transition

protected boolean transition(java.lang.String state,
                             boolean quiet)
This method will change current state to the state parameter and send a progress event. If the state transition is now allowed it will return false in the quiet mode, or throw a TransitionException.
Parameters:
quiet - if quiet is true, it will not throw TransitionException upon failure
Returns:
true if transitioned is allowed, false otherwise

start

protected boolean start(boolean quiet)

stop

protected boolean stop(boolean quiet)

cancel

protected boolean cancel(boolean quiet)

restore

protected boolean restore(boolean quiet)

suspend

protected boolean suspend(boolean quiet)

resume

protected boolean resume(boolean quiet)

finish

protected boolean finish(boolean quiet)

abort

protected boolean abort(boolean quiet)

timeout

protected boolean timeout(boolean quiet)

reset

public void reset()
Description copied from class: ProgressReporter
This method resets the progress reporter, call when you want to reuse the same progress reporter to report progress on a new process.
Overrides:
reset in class ProgressReporter

getProgressEventName

protected java.lang.String getProgressEventName()

getProgressEventMessage

protected java.lang.String getProgressEventMessage()

getProgressEventLocalizedMessage

protected java.lang.String getProgressEventLocalizedMessage()

getProgressEventThrowable

protected java.lang.Throwable getProgressEventThrowable()

getProgressEventStateInfo

protected StateInfo getProgressEventStateInfo()

getProgressEventStatusInfo

protected StatusInfo getProgressEventStatusInfo()

getProgressEventStepInfo

protected StepInfo getProgressEventStepInfo()

getProgressEventPercentInfo

protected PercentInfo getProgressEventPercentInfo()

getProgressEventDurationInfo

protected DurationInfo getProgressEventDurationInfo()

getProgressEventProgressInfo

protected java.lang.Object getProgressEventProgressInfo()

getProgressEvent

protected ProgressEvent getProgressEvent()

sendProgressEvent

protected void sendProgressEvent()
This method will send a progress event.

ping

public void ping()
This method will send a ping progress event.

Skip navigation links