2.17.2: 2011-06-17

net.sf.basedb.core
Class Job.ProgressReporterImpl

java.lang.Object
  extended by net.sf.basedb.core.Job.ProgressReporterImpl
All Implemented Interfaces:
ProgressReporter
Enclosing class:
Job

static class Job.ProgressReporterImpl
extends Object
implements ProgressReporter

Implements the ProgressReporter interface and stores the percentage completed for the current job.


Field Summary
private  JobAgent agent
           
private  ProgressReporter chained
           
private  Job job
           
private  int jobId
           
private  long lastUpdate
           
private  int lastValue
           
private  int offset
           
private  SessionControl sc
           
private  String server
           
private static long UPDATE_INTERVAL
          Number of miliseconds between updates to the database.
private static int UPDATE_PERCENT
          Min percentage difference between updates to the database.
 
Constructor Summary
Job.ProgressReporterImpl(Job job, String server, JobAgent agent, ProgressReporter chained)
           
 
Method Summary
 void append(String message)
          Append a message to the previous one.
private  void appendProgress(org.hibernate.Session session, String statusMessage)
           
 void display(int percent, String message)
          Display a progress message.
(package private)  void setConfigured(PluginResponse response)
           
(package private)  void setEnded(PluginResponse response, boolean isShuttingDown)
           
(package private)  void setStarted(Class<? extends SignalTransporter> signalTransporter, String signalId)
           
private  void updateProgress(org.hibernate.Session session, int percent, String statusMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_INTERVAL

private static final long UPDATE_INTERVAL
Number of miliseconds between updates to the database.

See Also:
Constant Field Values

UPDATE_PERCENT

private static final int UPDATE_PERCENT
Min percentage difference between updates to the database.

See Also:
Constant Field Values

sc

private final SessionControl sc

jobId

private final int jobId

server

private final String server

job

private final Job job

agent

private final JobAgent agent

chained

private final ProgressReporter chained

lastUpdate

private long lastUpdate

lastValue

private int lastValue

offset

private int offset
Constructor Detail

Job.ProgressReporterImpl

Job.ProgressReporterImpl(Job job,
                         String server,
                         JobAgent agent,
                         ProgressReporter chained)
                   throws BaseException
Throws:
BaseException
Method Detail

display

public void display(int percent,
                    String message)
Description copied from interface: ProgressReporter
Display a progress message.

Specified by:
display in interface ProgressReporter
Parameters:
percent - How many percent of the task that is completed or -1 if not known
message - A message, or null

append

public void append(String message)
Description copied from interface: ProgressReporter
Append a message to the previous one.

Specified by:
append in interface ProgressReporter
Parameters:
message - The message

updateProgress

private void updateProgress(org.hibernate.Session session,
                            int percent,
                            String statusMessage)

appendProgress

private void appendProgress(org.hibernate.Session session,
                            String statusMessage)

setConfigured

void setConfigured(PluginResponse response)

setStarted

void setStarted(Class<? extends SignalTransporter> signalTransporter,
                String signalId)

setEnded

void setEnded(PluginResponse response,
              boolean isShuttingDown)

2.17.2: 2011-06-17