Bug 5806 - Change of GramJob.setDuration()
: Change of GramJob.setDuration()
wsrf gram clients
: 4.1.2
: Macintosh All
: P2 normal
: 4.2
Assigned To:
  Show dependency treegraph
Reported: 2008-01-21 17:13 by
Modified: 2008-02-04 10:47 (History)



You need to log in before you can comment on or make changes to this bug.

Description From 2008-01-21 17:13:01
In GramJob duration and terminationTime are handled separately.
Duration is handled currently in weird way.
If someone sets the job duration via GramJob only the hour of the
day and minutes are taken from the input type java.util.Date.
So a duration > 24h is not possible.
Also it does not seem to be very intuitive that the duration of a
job will e.g. be 17 hours if the time of the Date of the input
parameter 'duration' is 17:00:00

Here's code from an older version of trunk

    public void setDuration(
        Date duration)
        if (duration == null)
            this.terminationTime = null;
            Calendar durationCalendar = Calendar.getInstance();
            int hours = durationCalendar.get(Calendar.HOUR_OF_DAY);
            int minutes = durationCalendar.get(Calendar.MINUTE);

            this.terminationTime = Calendar.getInstance();
            this.terminationTime.add(Calendar.HOUR_OF_DAY, hours);
            this.terminationTime.add(Calendar.MINUTE, minutes);

We'll change the setDuration method to the following:

    void setDuration(int hours, int minutes)

GramJob will then calculate the termination time by adding the hours
and minutes to the current date.

Implementation already completed.
------- Comment #1 From 2008-02-04 10:47:46 -------
setDuration now accepts hours and minutes as parameters note this is an
interface change from 4.0.x series.