Skip navigation links


oracle.idm.util.progress
Class ProgressEvent

java.lang.Object
  extended by java.util.EventObject
      extended by oracle.idm.util.progress.ProgressEvent

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, XmlPrintable

public class ProgressEvent
extends java.util.EventObject
implements java.lang.Cloneable, XmlPrintable

ProgressEvent is the object used to communicate progress events to ProgressListeners. During a lengthy operation execution, an API sends ProgressEvents to the ProgressListener as defined by the ProgressListener interface.

See Also:
ProgressListener, Serialized Form

Field Summary
protected  java.lang.String tag
          Tag used to print the progress event as an XML element.
static long UNKNOWN
          UNKNOWN has a value of -1L and indicates unknown time stamp.

 

Fields inherited from class java.util.EventObject
source

 

Constructor Summary
ProgressEvent(java.lang.Object source, java.lang.String name)
          Creates a ProgressEvent.
ProgressEvent(ProgressEvent event)
          Creates a ProgressEvent by shallow copying all properties from the existing event, except for time stamp.

 

Method Summary
 void clear()
          Clears all mutable properties from the event.
 java.lang.Object clone()
          Clones ProgressEvent.
 java.lang.Throwable getCause()
          Getter for the cause property.
 DurationInfo getDurationInfo()
          Getter for the durationInfo property.
 java.lang.String getLocalizedMessage()
          Getter for the localizedMessage property.
 java.util.Collection getLocalizedMessages()
          Returns localized messages associated with this progress event.
 java.lang.String getMessage()
          Getter for the message property.
 java.util.Collection getMessages()
          Returns messages associated with this progress event.
 java.lang.String getName()
          Getter for the name property.
 PercentInfo getPercentInfo()
          Getter for the percentInfo property.
 java.lang.Object getProgressInfo()
          Getter for the progressInfo property.
 StateInfo getStateInfo()
          Getter for the stateInfo property.
 StatusInfo getStatusInfo()
          Getter for the statusInfo property.
 StepInfo getStepInfo()
          Getter for the stepInfo property.
 long getTimeStamp()
          Getter for the timeStamp property.
 void setCause(java.lang.Throwable cause)
          Setter for the cause property.
 void setDurationInfo(DurationInfo durationInfo)
          Setter for the durationInfo property.
 void setLocalizedMessage(java.lang.String localizedMessage)
          Setter for the localizedMessage property.
 void setMessage(java.lang.String message)
          Setter for the message property.
 void setPercentInfo(PercentInfo percentInfo)
          Setter for the percentInfo property.
 void setProgressInfo(java.lang.Object progressInfo)
          Setter for the progressInfo property.
 void setStateInfo(StateInfo stateInfo)
          Setter for the stateInfo property.
 void setStatusInfo(StatusInfo statusInfo)
          Setter for the statusInfo property.
 void setStepInfo(StepInfo stepInfo)
          Setter for the stepInfo property.
 void setTimeStamp()
          Setter for the timeStamp property.
 void setTimeStamp(long timeStamp)
          Setter for the timeStamp property.
static java.lang.String suggestName()
          This is a convenience method for suggesting progress event names.
static java.lang.String suggestName(java.lang.Class clazz)
          This is a convenience method for suggesting progress event names.
static java.lang.String suggestName(java.lang.Class clazz, java.lang.reflect.Method method)
          This is a convenience method for suggesting progress event names.
static java.lang.String suggestName(java.lang.Object object)
          This is a convenience method for suggesting progress event names.
static java.lang.String suggestName(java.lang.Object object, java.lang.reflect.Method method)
          This is a convenience method for suggesting progress event names.
static java.lang.String suggestName(java.lang.String className)
          This is a convenience method for suggesting progress event names.
static java.lang.String suggestName(java.lang.String className, java.lang.String methodName)
          This is a convenience method for suggesting progress event names.
 java.lang.String toString()
          Returns a string representation of PageEvent.
 void xprint(XmlPrintWriter out)
          Prints event's properties to the PrintWriter as an XML element.
protected  void xprintBody(XmlPrintWriter out)
           

 

Methods inherited from class java.util.EventObject
getSource

 

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

 

Field Detail

UNKNOWN

public static final long UNKNOWN
UNKNOWN has a value of -1L and indicates unknown time stamp.
See Also:
Constant Field Values

tag

protected java.lang.String tag
Tag used to print the progress event as an XML element.

Constructor Detail

ProgressEvent

public ProgressEvent(java.lang.Object source,
                     java.lang.String name)
Creates a ProgressEvent. Users of this API can create instances of ProgressEvent via the getProgressEvent factory method in the ProgressManager class.
Parameters:
source - The source property of the progress event can be used to pass meaningful information about where the event occurred. Typically, this will be the context or the connection object of the API in which the event took place.
name - Name must be specified at event creation time, and cannot be changed later. It is used to distinguish between events coming from different operations. Thus, the event source should set the name property to a unique value that describes the operation whose events are being reported. The reccomendation is to set the progress event name to package.Class.method of the event generating API.
See Also:
ProgressManager.getProgressEvent(String)

ProgressEvent

public ProgressEvent(ProgressEvent event)
Creates a ProgressEvent by shallow copying all properties from the existing event, except for time stamp.

Method Detail

suggestName

public static java.lang.String suggestName()
This is a convenience method for suggesting progress event names. This method will return the invoking package_Class_method if called from a method, or package_Class if called from an initialized. Use this method with caution, as it will do the right thing only if you are calling it directly from the method or initializer you want to set as the event name.
Returns:
String representing the event name.

suggestName

public static java.lang.String suggestName(java.lang.Object object,
                                           java.lang.reflect.Method method)
This is a convenience method for suggesting progress event names.
Returns:
String representing the event name.

suggestName

public static java.lang.String suggestName(java.lang.Object object)
This is a convenience method for suggesting progress event names.
Returns:
String representing the event name.

suggestName

public static java.lang.String suggestName(java.lang.Class clazz,
                                           java.lang.reflect.Method method)
This is a convenience method for suggesting progress event names.
Returns:
String representing the event name.

suggestName

public static java.lang.String suggestName(java.lang.Class clazz)
This is a convenience method for suggesting progress event names.
Returns:
String representing the event name.

suggestName

public static java.lang.String suggestName(java.lang.String className,
                                           java.lang.String methodName)
This is a convenience method for suggesting progress event names.
Returns:
String representing the event name.

suggestName

public static java.lang.String suggestName(java.lang.String className)
This is a convenience method for suggesting progress event names.
Returns:
String representing the event name.

clone

public java.lang.Object clone()
Clones ProgressEvent.
Overrides:
clone in class java.lang.Object

clear

public void clear()
Clears all mutable properties from the event.

getTimeStamp

public long getTimeStamp()
Getter for the timeStamp property. Value of UNKNOWN indicates unknown event time stamp.
Returns:
long representing the event time stamp.

setTimeStamp

public void setTimeStamp(long timeStamp)
Setter for the timeStamp property. Use value of UNKNOWN to indicate unknown event time stamp.
Parameters:
timeStamp - long representing the event time stamp.

getName

public java.lang.String getName()
Getter for the name property.
Returns:
String representing the event name.
See Also:
ProgressEvent(oracle.idm.util.progress.ProgressEvent)

setTimeStamp

public void setTimeStamp()
Setter for the timeStamp property. Sets the timeStamp to System.currentTimeMillis();

getMessage

public java.lang.String getMessage()
Getter for the message property. An event source may supply messages about the operation whose progress is being reported. For example "user created" message can be sent to the ProgressListener after creating a user.
Returns:
String representing the message.

setMessage

public void setMessage(java.lang.String message)
Setter for the message property.
Parameters:
message - String representing the event message.
See Also:
getMessage()

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Getter for the localizedMessage property. An event source may supply localized messages about the operation whose progress is being reported. For example "User has been created." localized message can be sent to the ProgressListener after creating a user.
Returns:
String representing the event localized message.

setLocalizedMessage

public void setLocalizedMessage(java.lang.String localizedMessage)
Setter for the localizedMessage property.
Parameters:
localizedMessage - String representing the event localized message.
See Also:
getLocalizedMessage()

getCause

public java.lang.Throwable getCause()
Getter for the cause property. An event source may supply throwables that were raised during an operation whose progress is being reported.
Returns:
Throwable raised during operation execution.

setCause

public void setCause(java.lang.Throwable cause)
Setter for the cause property.
Parameters:
cause - Throwable raised during operation execution.
See Also:
getCause()

getStateInfo

public StateInfo getStateInfo()
Getter for the stateInfo property. An event source may supply state information about the operation whose progress is being reported.
Returns:
State representing the event state information.

setStateInfo

public void setStateInfo(StateInfo stateInfo)
Setter for the stateInfo property.
Parameters:
stateInfo - State representing the event state information.
See Also:
getStateInfo()

getStatusInfo

public StatusInfo getStatusInfo()
Getter for the statusInfo property. An event source may supply status information about the operation whose progress is being reported.
Returns:
StatusInfo representing the event status information.

setStatusInfo

public void setStatusInfo(StatusInfo statusInfo)
Setter for the statusInfo property.
Parameters:
statusInfo - StatusInfo representing the event status information.
See Also:
getStatusInfo()

getStepInfo

public StepInfo getStepInfo()
Getter for the stepInfo property. An event source may supply step information about the operation whose progress is being reported.
Returns:
StepInfo about the operation being executed.

setStepInfo

public void setStepInfo(StepInfo stepInfo)
Setter for the stepInfo property.
Parameters:
stesInfo - StepInfo about the operation being executed.
See Also:
getStepInfo()

getPercentInfo

public PercentInfo getPercentInfo()
Getter for the percentInfo property. An event source may supply percent information about the operation whose progress is being reported.
Returns:
PercentInfo about the operation being executed.

setPercentInfo

public void setPercentInfo(PercentInfo percentInfo)
Setter for the percentInfo property.
Parameters:
percentInfo - PercentInfo about the operation being executed.
See Also:
getPercentInfo()

getDurationInfo

public DurationInfo getDurationInfo()
Getter for the durationInfo property. An event source may supply duration information about the operation whose progress is being reported.
Returns:
DurationInfo about the operation being executed.

setDurationInfo

public void setDurationInfo(DurationInfo durationInfo)
Setter for the durationInfo property.
Parameters:
durationInfo - DurationInfo about the operation being executed.
See Also:
getDurationInfo()

getProgressInfo

public java.lang.Object getProgressInfo()
Getter for the progressInfo property. An event source may supply information about the operation whose progress is being reported.
Returns:
Object representing progress information.

setProgressInfo

public void setProgressInfo(java.lang.Object progressInfo)
Setter for the progressInfo property.
Parameters:
progressInfo - Object representing progress information.
See Also:
getProgressInfo()

getMessages

public java.util.Collection getMessages()
Returns messages associated with this progress event.
Returns:
collection of messages for this event, null if none were collected

getLocalizedMessages

public java.util.Collection getLocalizedMessages()
Returns localized messages associated with this progress event.
Returns:
collection of localized messages for this event, null if none were collected

xprint

public void xprint(XmlPrintWriter out)
Prints event's properties to the PrintWriter as an XML element.
Specified by:
xprint in interface XmlPrintable
Parameters:
out - PrintWriter for printing event propeties.

xprintBody

protected void xprintBody(XmlPrintWriter out)

toString

public java.lang.String toString()
Returns a string representation of PageEvent.
Overrides:
toString in class java.util.EventObject

Skip navigation links