/jbpm-flow/src/main/java/org/jbpm/process/instance/timer/TimerInstance.java

https://github.com/mariofusco/jbpm · Java · 136 lines · 88 code · 29 blank · 19 comment · 0 complexity · db3db8b528d2a3cf5e2699e7c0bf70f9 MD5 · raw file

  1. /**
  2. * Copyright 2010 JBoss Inc
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.jbpm.process.instance.timer;
  17. import java.io.Serializable;
  18. import java.util.Date;
  19. import org.drools.core.time.JobHandle;
  20. /**
  21. *
  22. * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
  23. */
  24. public class TimerInstance implements Serializable{
  25. private long id;
  26. private long timerId;
  27. private long delay;
  28. private long period;
  29. private JobHandle jobHandle;
  30. private Date activated;
  31. private Date lastTriggered;
  32. private long processInstanceId;
  33. private int repeatLimit = -1;
  34. private long sessionId;
  35. private String cronExpression;
  36. public long getId() {
  37. return id;
  38. }
  39. public void setId(long id) {
  40. this.id = id;
  41. }
  42. public long getTimerId() {
  43. return timerId;
  44. }
  45. public void setTimerId(long timerId) {
  46. this.timerId = timerId;
  47. }
  48. public long getDelay() {
  49. return delay;
  50. }
  51. public void setDelay(long delay) {
  52. this.delay = delay;
  53. }
  54. public long getPeriod() {
  55. return period;
  56. }
  57. public void setPeriod(long period) {
  58. this.period = period;
  59. }
  60. public JobHandle getJobHandle() {
  61. return jobHandle;
  62. }
  63. public void setJobHandle(JobHandle jobHandle) {
  64. this.jobHandle = jobHandle;
  65. }
  66. public Date getActivated() {
  67. return activated;
  68. }
  69. public void setActivated(Date activated) {
  70. this.activated = activated;
  71. }
  72. public void setLastTriggered(Date lastTriggered) {
  73. this.lastTriggered = lastTriggered;
  74. }
  75. public Date getLastTriggered() {
  76. return lastTriggered;
  77. }
  78. public long getProcessInstanceId() {
  79. return processInstanceId;
  80. }
  81. public void setProcessInstanceId(long processInstanceId) {
  82. this.processInstanceId = processInstanceId;
  83. }
  84. @Override
  85. public String toString() {
  86. return "TimerInstance [id=" + id + ", timerId=" + timerId + ", delay=" + delay + ", period=" + period + ", jobHandle=" + jobHandle + ", activated=" + activated + ", lastTriggered=" + lastTriggered + ", processInstanceId=" + processInstanceId
  87. + "]";
  88. }
  89. public int getRepeatLimit() {
  90. return repeatLimit;
  91. }
  92. public void setRepeatLimit(int stopAfter) {
  93. this.repeatLimit = stopAfter;
  94. }
  95. public long getSessionId() {
  96. return sessionId;
  97. }
  98. public void setSessionId(long sessionId) {
  99. this.sessionId = sessionId;
  100. }
  101. public String getCronExpression() {
  102. return cronExpression;
  103. }
  104. public void setCronExpression(String cronExpression) {
  105. this.cronExpression = cronExpression;
  106. }
  107. }