BrightSide Workbench Full Report + Source Code
org.turro.scheduler.motor.DefaultTask Class Referenceabstract
Inheritance diagram for org.turro.scheduler.motor.DefaultTask:
Collaboration diagram for org.turro.scheduler.motor.DefaultTask:

Public Member Functions

boolean isSystem ()
 
boolean isDone ()
 
boolean isActive ()
 
void setActive (boolean active)
 
Constraints getConstraints ()
 
IConstructor getConstructor ()
 
String getData ()
 
void setData (String data)
 
String getDescription ()
 
void setDescription (String value)
 
Date getEndDate ()
 
void setEndDate (Date endDate)
 
String getImplementation ()
 
void setImplementation (String value)
 
Date getStartDate ()
 
void setStartDate (Date startDate)
 
void setLastExecuted (Date lastExecuted)
 
boolean shouldRun (Date now)
 
void doRun (Motor motor)
 
void stop ()
 
void readXML (Element root)
 
void writeXML (Element root)
 
abstract String getName ()
 
abstract void run ()
 
abstract String getDataLabel ()
 
- Public Member Functions inherited from org.turro.elephant.impl.abstracts.AbstractImplementation
 AbstractImplementation ()
 
void setElement (IElement element)
 
void setConstructor (IConstructor constructor)
 
void setConfiguration (Element configuration)
 
KeyValueMap getAttributes ()
 
Long getLongAttribute (String key)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.elephant.impl.abstracts.AbstractImplementation
IElement iel
 
IConstructor constructor
 
Element configuration
 
Map attributes
 

Detailed Description

Member Function Documentation

◆ doRun()

void org.turro.scheduler.motor.DefaultTask.doRun ( Motor  motor)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 136 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

136  {
137  lastExecuted = new Date();
138  //future = motor.runTask(this);
139  }

◆ getConstraints()

Constraints org.turro.scheduler.motor.DefaultTask.getConstraints ( )

Definition at line 61 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

61  {
62  return constraints;
63  }
Here is the caller graph for this function:

◆ getConstructor()

IConstructor org.turro.scheduler.motor.DefaultTask.getConstructor ( )

◆ getData()

String org.turro.scheduler.motor.DefaultTask.getData ( )

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 71 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

71  {
72  return data;
73  }
Here is the caller graph for this function:

◆ getDataLabel()

◆ getDescription()

String org.turro.scheduler.motor.DefaultTask.getDescription ( )

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 81 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

81  {
82  return description;
83  }
Here is the caller graph for this function:

◆ getEndDate()

Date org.turro.scheduler.motor.DefaultTask.getEndDate ( )

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 91 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

91  {
92  return endDate;
93  }
Here is the caller graph for this function:

◆ getImplementation()

String org.turro.scheduler.motor.DefaultTask.getImplementation ( )

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 101 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

101  {
102  return implementation;
103  }
Here is the caller graph for this function:

◆ getName()

◆ getStartDate()

Date org.turro.scheduler.motor.DefaultTask.getStartDate ( )

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 111 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

111  {
112  return startDate;
113  }
Here is the caller graph for this function:

◆ isActive()

boolean org.turro.scheduler.motor.DefaultTask.isActive ( )

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 52 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

52  {
53  return active;
54  }

◆ isDone()

boolean org.turro.scheduler.motor.DefaultTask.isDone ( )

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 47 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

47  {
48  return future == null ? true : future.isDone();
49  }

◆ isSystem()

boolean org.turro.scheduler.motor.DefaultTask.isSystem ( )

◆ readXML()

void org.turro.scheduler.motor.DefaultTask.readXML ( Element  root)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 149 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

149  {
150  setImplementation(root.getAttributeValue("implementation"));
151  String s = root.getAttributeValue("active");
152  active = "true".equals(s);
153  if(root.getAttributeValue("description") != null)
154  setDescription(root.getAttributeValue("description"));
155  if(root.getAttributeValue("start-date") != null)
156  setStartDate((Date) ObjectString.parseString(root.getAttributeValue("start-date"), ObjectString.COMPRESSED_DATE_PATTERN, Date.class, false));
157  if(root.getAttributeValue("end-date") != null)
158  setEndDate((Date) ObjectString.parseString(root.getAttributeValue("end-date"), ObjectString.COMPRESSED_DATE_PATTERN, Date.class, false));
159  if(root.getAttributeValue("data") != null)
160  setData(root.getAttributeValue("data"));
161  constraints.readXML(root);
162  }
Here is the call graph for this function:

◆ run()

◆ setActive()

void org.turro.scheduler.motor.DefaultTask.setActive ( boolean  active)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 57 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

57  {
58  this.active = active;
59  }

◆ setData()

void org.turro.scheduler.motor.DefaultTask.setData ( String  data)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 76 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

76  {
77  this.data = data;
78  }
Here is the caller graph for this function:

◆ setDescription()

void org.turro.scheduler.motor.DefaultTask.setDescription ( String  value)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 86 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

86  {
87  description = value;
88  }
Here is the caller graph for this function:

◆ setEndDate()

void org.turro.scheduler.motor.DefaultTask.setEndDate ( Date  endDate)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 96 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

96  {
97  this.endDate = endDate;
98  }
Here is the caller graph for this function:

◆ setImplementation()

void org.turro.scheduler.motor.DefaultTask.setImplementation ( String  value)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 106 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

106  {
107  implementation = value;
108  }
Here is the caller graph for this function:

◆ setLastExecuted()

void org.turro.scheduler.motor.DefaultTask.setLastExecuted ( Date  lastExecuted)

Definition at line 120 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

120  {
121  this.lastExecuted = lastExecuted;
122  }

◆ setStartDate()

void org.turro.scheduler.motor.DefaultTask.setStartDate ( Date  startDate)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 116 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

116  {
117  this.startDate = startDate;
118  }
Here is the caller graph for this function:

◆ shouldRun()

boolean org.turro.scheduler.motor.DefaultTask.shouldRun ( Date  now)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 125 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

125  {
126  if(enoughTimeLapse(now) &&
127  (startDate == null || now.after(startDate)) &&
128  (endDate == null || now.before(endDate)) &&
129  constraints.isValid(now)) {
130  return constraints.needsRefresh();
131  }
132  return false;
133  }
Here is the call graph for this function:

◆ stop()

void org.turro.scheduler.motor.DefaultTask.stop ( )

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 142 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

142  {
143  if(future != null && !future.isDone()) {
144  future.cancel(true);
145  }
146  }

◆ writeXML()

void org.turro.scheduler.motor.DefaultTask.writeXML ( Element  root)

Implements org.turro.scheduler.motor.ScheduledTask.

Definition at line 165 of file elephant-scheduler/src/main/java/org/turro/scheduler/motor/DefaultTask.java.

165  {
166  Element el = new Element("scheduled-task");
167  el.setAttribute("name", getName());
168  el.setAttribute("implementation", getImplementation());
169  if(getDescription() != null) el.setAttribute("description", getDescription());
170  el.setAttribute("active", active ? "true" : "false");
171  if(getStartDate() != null) el.setAttribute("start-date", ObjectString.formatObject(getStartDate(), ObjectString.COMPRESSED_DATE_PATTERN, false));
172  if(getEndDate() != null) el.setAttribute("end-date", ObjectString.formatObject(getEndDate(), ObjectString.COMPRESSED_DATE_PATTERN, false));
173  if(getData() != null) el.setAttribute("data", getData());
174  root.addContent(el);
175  constraints.writeXML(el);
176  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: