|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
mysql.AbstractSql
mysql.TaskSql
public class TaskSql
A class that comprises actions connected with the 'task' table in the stella database.
| Nested Class Summary | |
|---|---|
static class |
TaskSql.Force
Forces rebuild of a target from the stated xml file, sends mail. |
static class |
TaskSql.Rebuild
Rebuilds the serialized parsed targets in the database. |
static class |
TaskSql.Retrieve
Retrieves a target. |
static class |
TaskSql.Xml
Updates a target from the stated xml file. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static boolean |
DEFDBREADRULE
Per default we allow histroy reading and writing. |
private static boolean |
DEFDBWRITERULE
Per default we allow histroy reading and writing. |
private static String |
DEFENABLEDFIELD
The key to the enabled flag in the database. |
private static String |
DEFFINISHEDFIELD
The key to the finished timestamp in the database. |
private static String |
DEFOBJECTNAMEFIELD
The key to the main object name in the database. |
private static String |
DEFPROPOSALFIELD
The key to the proposal id in the database. |
private static String |
DEFSERIALFIELD
The key to the dom-serial field. |
private static String |
DEFSTARTEDFIELD
The key to the first pick timestamp in the database. |
private static String |
DEFSUBMITTEDFIELD
The key to the submitted timestamp in the database. |
private static String |
DEFTABLE
The default table name. |
private static String |
DEFTARGETNAMEFIELD
The key to the unique target name in the database. |
private static String |
DEFTELESCOPEFIELD
The default target name field in the database |
private static String |
DEFXMLFIELD
The key to the xml-scii field. |
private static String |
DEFXMLSTAMPFIELD
The key to the timestamp the xml file was serialized. |
private PreparedStatement |
insert
The prepared statement for inserting a new object description. |
static String |
KEY_DBREADRULE
If this is set to false, target history are only read. |
static String |
KEY_DBWRITERULE
If this is set to false, target history are only read. |
static String |
KEY_ENABLEDFIELD
The key to the enabled flag in the database. |
static String |
KEY_FINISHEDFIELD
The key to the finished timestamp in the database. |
static String |
KEY_OBJECTNAMEFIELD
The key to the main object name in the database. |
static String |
KEY_PROPOSALFIELD
The key to the proposal id in the database. |
static String |
KEY_SERIALFIELD
The key to the dom-serial field. |
static String |
KEY_STARTEDFIELD
The key to the first pick timestamp in the database. |
static String |
KEY_SUBMITTEDFIELD
The key to the submitted timestamp in the database. |
static String |
KEY_TARGETNAMEFIELD
The key to the unique target name in the database. |
static String |
KEY_TELESCOPEFIELD
The key to the target name in the database. |
static String |
KEY_XMLFIELD
The key to the xml-scii field. |
static String |
KEY_XMLSTAMPFIELD
The key to the timestamp the xml file was serialized. |
| Fields inherited from class mysql.AbstractSql |
|---|
KEY_TABLE |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
TaskSql(Map<String,String> prop)
Constructs a new task sql. |
|
| Method Summary | |
|---|---|
private boolean |
createInsert()
Tries to create a prepared statement for entering task data into the task table. |
boolean |
deleteTarget(TargetDefinition td)
Deletes the target, tries sending mail to the user. |
boolean |
deleteTarget(TargetDefinition td,
boolean mail)
Deletes the target, possibly sending mail to the user |
private boolean |
enterTarget(String telid,
ParsedTarget target,
Document dom,
int s0,
long urlstamp,
boolean mail)
|
void |
exit()
On exit we close our prepared statement, if it exists. |
Date |
getFinished(TargetDefinition target)
Checks, if the target with the given name is finished. |
Date |
getStarted(TargetDefinition target)
Checks, if the target with the given name is started. |
private Date |
getTimestamp(TargetDefinition td,
String fieldname)
Returns the time stamp of the xml field. |
Date |
getXmlTime(TargetDefinition target)
Returns the value of the finished timestamp or -1 if target is not finished. |
ParsedTarget |
newTarget(String telid,
File xml)
Reads a new target from a resource, serializes it into the database and sets all fields to according values. |
ParsedTarget |
newTarget(String telid,
URL xml,
long urlstamp,
int s0)
Reads a new target from a resource, serializes it into the database and sets all fields to according values. |
ParsedTarget |
newTarget(String telid,
URL xml,
long urlstamp,
int s0,
boolean sendmail)
Reads a new target from a resource, serializes it into the database and sets all fields to according values. |
Map<String,ParsedTarget> |
retrieve(String telescope,
Collection<String> names)
Retrieves the collection of targets given by their name. |
private void |
sendAndWait(Mailer gmail,
javax.mail.Address from,
javax.mail.Address[] user,
javax.mail.Address[] cc,
javax.mail.Address[] bcc,
String subj,
String text)
|
boolean |
setEnabled(TargetDefinition td,
boolean nuen)
Sets the enabled flag of the stated target. |
boolean |
setEnabled(TargetDefinition td,
boolean nuen,
boolean mail)
Sets the enabled flag of the stated target. |
boolean |
setFinished(TargetDefinition target,
Date now)
Sets the finished timestamp to the value submitted in the date field, if a task entry for the target with the given name exists. |
boolean |
setStarted(TargetDefinition target,
Date now)
Sets the started timestamp to the value submitted in the date field, if a task entry for the target with the given name exists. |
private boolean |
setTimestamp(TargetDefinition target,
String field,
Date now)
Sets a timestamp using the provided target definition in the named field. |
boolean |
updateTarget(String telid,
File xml)
Reads a new target from a resource, serializes it into the database and sets all fields to according values. |
boolean |
updateTarget(String telid,
File xml,
boolean mailit)
|
boolean |
updateTarget(String telid,
File xml,
boolean mailit,
boolean force)
Reads a new target from a resource, serializes it into the database and sets all fields to according values. |
boolean |
updateTarget(String telid,
URL xml,
long urlstamp,
int s0)
Reads a new target from a resource, serializes it into the database and sets all fields to according values. |
boolean |
updateTarget(String telid,
URL xml,
long urlstamp,
int s0,
boolean mailit,
boolean force)
Reads a new target from a resource, serializes it into the database and sets all fields to according values. |
| Methods inherited from class mysql.AbstractSql |
|---|
getPassword, getTable, getUserName, init, isEntry |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_TARGETNAMEFIELD
public static final String KEY_OBJECTNAMEFIELD
public static final String KEY_PROPOSALFIELD
public static final String KEY_ENABLEDFIELD
public static final String KEY_SUBMITTEDFIELD
public static final String KEY_STARTEDFIELD
public static final String KEY_FINISHEDFIELD
public static final String KEY_XMLSTAMPFIELD
public static final String KEY_XMLFIELD
public static final String KEY_SERIALFIELD
public static final String KEY_TELESCOPEFIELD
public static final String KEY_DBREADRULE
public static final String KEY_DBWRITERULE
private static final String DEFTABLE
private static final String DEFTARGETNAMEFIELD
private static final String DEFOBJECTNAMEFIELD
private static final String DEFPROPOSALFIELD
private static final String DEFENABLEDFIELD
private static final String DEFSUBMITTEDFIELD
private static final String DEFSTARTEDFIELD
private static final String DEFFINISHEDFIELD
private static final String DEFXMLSTAMPFIELD
private static final String DEFXMLFIELD
private static final String DEFSERIALFIELD
private static final String DEFTELESCOPEFIELD
private static final boolean DEFDBREADRULE
private static final boolean DEFDBWRITERULE
private PreparedStatement insert
| Constructor Detail |
|---|
public TaskSql(Map<String,String> prop)
| Method Detail |
|---|
public void exit()
exit in interface ExitCleaning
public Map<String,ParsedTarget> retrieve(String telescope,
Collection<String> names)
HistorySql.
ParsedTargets without
history.public Date getFinished(TargetDefinition target)
public boolean setFinished(TargetDefinition target,
Date now)
public Date getStarted(TargetDefinition target)
public boolean setStarted(TargetDefinition target,
Date now)
public Date getXmlTime(TargetDefinition target)
public boolean deleteTarget(TargetDefinition td)
public boolean deleteTarget(TargetDefinition td,
boolean mail)
public boolean setEnabled(TargetDefinition td,
boolean nuen)
public boolean setEnabled(TargetDefinition td,
boolean nuen,
boolean mail)
public boolean updateTarget(String telid,
File xml)
public boolean updateTarget(String telid,
File xml,
boolean mailit)
public boolean updateTarget(String telid,
File xml,
boolean mailit,
boolean force)
public boolean updateTarget(String telid,
URL xml,
long urlstamp,
int s0)
public boolean updateTarget(String telid,
URL xml,
long urlstamp,
int s0,
boolean mailit,
boolean force)
public ParsedTarget newTarget(String telid,
File xml)
public ParsedTarget newTarget(String telid,
URL xml,
long urlstamp,
int s0)
public ParsedTarget newTarget(String telid,
URL xml,
long urlstamp,
int s0,
boolean sendmail)
private boolean enterTarget(String telid,
ParsedTarget target,
Document dom,
int s0,
long urlstamp,
boolean mail)
private void sendAndWait(Mailer gmail,
javax.mail.Address from,
javax.mail.Address[] user,
javax.mail.Address[] cc,
javax.mail.Address[] bcc,
String subj,
String text)
private boolean setTimestamp(TargetDefinition target,
String field,
Date now)
private Date getTimestamp(TargetDefinition td,
String fieldname)
private boolean createInsert()
KEY_TARGETNAMEFIELDKEY_OBJECTNAMEFIELDKEY_PROPOSALFIELDKEY_ENABLEDFIELDKEY_SUBMITTEDFIELDKEY_STARTEDFIELDKEY_FINISHEDFIELDKEY_XMLSTAMPFIELDKEY_XMLFIELDKEY_SERIALFIELD
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||