Skip to content

Commit

Permalink
Update Job instance and scheduled job id type from int to long
Browse files Browse the repository at this point in the history
Standalone version will used a range of 1 000 000 prefix by an IP adresse leading to long id
  • Loading branch information
ArnaudChirat committed Jul 16, 2024
1 parent edcd211 commit d59cde7
Show file tree
Hide file tree
Showing 86 changed files with 413 additions and 405 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ public static void upsertUser(DbConn cnx, RUserDto dto)
{
QueryResult r = cnx.runUpdate("user_insert", dto.getEmail(), dto.getExpirationDate(), dto.getFreeText(), null,
dto.getInternal(), false, dto.getLogin(), null);
int newId = r.getGeneratedId();
int newId = r.getGeneratedId().intValue();

if (dto.getNewPassword() != null && !dto.getNewPassword().isEmpty())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ScheduledJob implements Serializable
{
private static final long serialVersionUID = 7928212054684657247L;

private Integer id = null;
private Long id = null;

private String cronExpression;

Expand Down Expand Up @@ -48,7 +48,7 @@ public static ScheduledJob create(String cronExpression)
*
* @return the ID.
*/
public Integer getId()
public Long getId()
{
return this.id;
}
Expand All @@ -58,7 +58,7 @@ public Integer getId()
*
* @param id
*/
public ScheduledJob setId(Integer id)
public ScheduledJob setId(Long id)
{
this.id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
@XmlAccessorType(XmlAccessType.FIELD)
public class JobInstance
{
private Integer id;
private Long id;
private String applicationName;
private Integer parent;
private Long parent;
private String user;
private String sessionID;
private State state;
Expand All @@ -62,25 +62,25 @@ public class JobInstance
/**
* The Job Instance ID, i.e. the unique identifier of the execution request. This is a key for numerous {@link JqmClient} functions.
*/
public Integer getId()
public Long getId()
{
return id;
}

public void setId(Integer id)
public void setId(Long id)
{
this.id = id;
}

/**
* The ID of the parent job that has enqueued this job instance. Null if the execution request was not done by a running job.
*/
public Integer getParent()
public Long getParent()
{
return parent;
}

public void setParent(Integer parent)
public void setParent(Long parent)
{
this.parent = parent;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ public void setState(State state)

/**
* Position in the queue. 0 if running.<br>
* <strong>This is the value retrieved during the latest {@link JqmClient#getJob(int)} call and may not be up to date!</strong>
* <strong>This is the value retrieved during the latest {@link JqmClient#getJob(Long)} call and may not be up to date!</strong>
*/
public Long getPosition()
{
Expand Down Expand Up @@ -184,7 +184,7 @@ public void setParameters(Map<String, String> parameters)
/**
* An optional integer that running user code may update from time to time. Used to give an idea of the progress of the job instance.
* <br>
* <strong>This is the value retrieved during the latest {@link JqmClient#getJob(int)} call and may not be up to date!</strong>
* <strong>This is the value retrieved during the latest {@link JqmClient#getJob(Long)} call and may not be up to date!</strong>
*/
public Integer getProgress()
{
Expand All @@ -199,7 +199,7 @@ public void setProgress(Integer progress)
/**
* An optional list of strings that running user code may emit from time to time. Used to give an idea of the progress of the job
* instance.<br>
* <strong>This is the value retrieved during the latest {@link JqmClient#getJob(int)} call and may not be up to date!</strong>
* <strong>This is the value retrieved during the latest {@link JqmClient#getJob(Long)} call and may not be up to date!</strong>
*/
public List<String> getMessages()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public interface JobRequest extends Serializable
* when an internal API implementation occurs. Usually linked to a configuration issue.
* @return the ID of the job instance.
*/
public Integer enqueue();
public Long enqueue();

/**
* Parameters are <key,value> pairs that are passed at runtime to the job. The amount of required parameters depends on the requested
Expand Down Expand Up @@ -173,7 +173,7 @@ public interface JobRequest extends Serializable
* A job instance can be the child of another job instance. This allows you to set the ID of that parent. It should be left null if
* there is no parent.
*/
public JobRequest setParentID(Integer parentJobId);
public JobRequest setParentID(Long parentJobId);

/**
* <strong>Optional</strong><br>
Expand All @@ -190,7 +190,7 @@ public interface JobRequest extends Serializable
* This request is actually to create an occurrence of the specified recurrence. If specified, the {@link #getApplicationName()} is
* ignored.
*/
public JobRequest setScheduleId(Integer id);
public JobRequest setScheduleId(Long id);

/**
* <strong>Optional</strong><br>
Expand All @@ -214,7 +214,7 @@ public interface JobRequest extends Serializable
* <strong>Optional</strong><br>
* The default behaviour for a newly submitted JobRequest is to run as soon as possible (i.e. as soon as there is a free slot inside a
* JQM node). This method allows to change this, and to put the request inside the queue but not run it until the
* {@link JqmClient#resumeJob(int)} method is called on the newly created job instance.
* {@link JqmClient#resumeJob(Long)} method is called on the newly created job instance.
*/
public JobRequest startHeld();

Expand Down
Loading

0 comments on commit d59cde7

Please sign in to comment.