public class TaskSql extends AbstractSql
update task set started = case when started>(select start from done where
done.objid=task.object order by start limit 1) then (select start from done
where done.objid=task.object order by start limit 1) end;
This may take a while.| Modifier and Type | Class and Description |
|---|---|
static class |
TaskSql.Dump
Retrieves a target.
|
static class |
TaskSql.Fallback
Adds fall-back stars for non-SIMBAD objects.
|
static class |
TaskSql.Force
Forces rebuild of a target from the stated xml file, sends mail.
|
static class |
TaskSql.Names
Retrieves a target.
|
static class |
TaskSql.Rebuild
Rebuilds the serialized parsed targets in the database.
|
static class |
TaskSql.Retrieve
Retrieves a target.
|
AbstractSql.Columns, AbstractSql.ExtractPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
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.
|
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.
|
KEY_TABLE, SQLBATCHDIR, SQLFAILDIRKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOMECONFIG, KEY_CLASS| Constructor and Description |
|---|
TaskSql(Map<String,String> prop)
Constructs a new task sql.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
(package private) boolean |
enterTarget(String telid,
SporeTarget target,
Document dom,
int s0,
long urlstamp) |
void |
exit()
On exit we close our prepared statement, if it exists.
|
List<String> |
getAllObjectNames(String telid)
Gets all objects names, as defined in objname
|
List<String> |
getAllTargetNames(String telid)
Gets all unique target names.
|
static List<String> |
getAllTargetNamesFromTask(String telid)
Returns a list of all object name, if a telescope is specified, then only
for this telescope
|
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.
|
SporeTarget |
newTarget(String telid,
File xml)
Reads a new target from a resource, serializes it into the database and
sets all fields to according values.
|
SporeTarget |
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.
|
private static SporeTarget |
parseTarget(String tel,
String ascii,
Map<String,String> parseprop) |
Map<String,SporeTarget> |
retrieve(String telescope,
Collection<String> names)
Retrieves the collection of targets given by their name.
|
Map<String,Document> |
retrieveXml(String telescope,
Collection<String> names) |
boolean |
setEnabled(TargetDefinition td,
boolean nuen)
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 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 force)
Reads a new target from a resource, serializes it into the database and
sets all fields to according values.
|
delete, distinct, distinct, getAccess, getDefaultArchive, getDefaultFormat, getTable, init, insert, isEntry, release, release, replace, retrieve, retrieve, retrieve, single, singleclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, 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, stringPropertiespublic 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
public 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
public void exit()
exit in interface ExitCleaningexit in class AbstractSqlpublic Map<String,SporeTarget> 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 setEnabled(TargetDefinition td, boolean nuen)
public static List<String> getAllTargetNamesFromTask(String telid)
public List<String> getAllTargetNames(String telid)
telid - public List<String> getAllObjectNames(String telid)
telid - public boolean updateTarget(String telid, File xml)
public boolean updateTarget(String telid, File xml, 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 force)
public SporeTarget newTarget(String telid, File xml)
public SporeTarget newTarget(String telid, URL xml, long urlstamp, int s0)
boolean enterTarget(String telid, SporeTarget target, Document dom, int s0, long urlstamp)
private boolean setTimestamp(TargetDefinition target, String field, Date now)
private Date getTimestamp(TargetDefinition td, String fieldname)
private boolean createInsert()