public class SporeTarget extends AbstractTarget implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
SporeTarget.Constraint
Defines one constraint for target selection.
|
static class |
SporeTarget.Dump |
AbstractTarget.Aim, AbstractTarget.Allocation, AbstractTarget.ConstraintAdapter, AbstractTarget.FitsEntry, AbstractTarget.PickAdapter, AbstractTarget.Setup, AbstractTarget.TargetComparatorPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
(package private) Map<String,List<String>> |
aborting
Errors for immediate abort.
|
(package private) Map<String,Object> |
astronomy
The map of astronomical objects found in the target.
|
(package private) Map<String,List<String>> |
blocking
Errors blocking the target.
|
(package private) ExpressionEvaluator |
canrate
The expression to fulfill for a rating to take place.
|
(package private) List<Appointable.Constraint> |
constraints
A list of constraints.
|
(package private) Set<String> |
daughternames |
(package private) boolean |
dbread
For converting to xml, this field is true if target comes from db.
|
(package private) boolean |
dbwrite
If true, task database is updated on execution add.
|
static String |
DEFIMAGETYPE
The default parameter name giving the remaining night-time.
|
(package private) Map<String,List<String>> |
delaying
Errors delaying the target.
|
(package private) Map<String,Integer> |
delaymax
The maximum number of delayed retries allowed.
|
(package private) Map<String,Long> |
delaytime
The delay time until target is re-enabled.
|
(package private) String |
description
The abstract of the observing program.
|
(package private) ExpressionEvaluator |
duration
The duration of the observation, if explicetly given.
|
(package private) List<javax.mail.Address> |
email
A list of e-mail addresses.
|
(package private) boolean |
enabled
True if target is enabled.
|
(package private) Map<String,Object> |
fitsheader
The map of fits-header entries found.
|
(package private) List<Meriting> |
gains
The gains of the target.
|
(package private) boolean |
hdbread
For converting to xml, this field is true if history comes from db.
|
(package private) boolean |
hdbwrite
If true, history database is updated on execution add.
|
(package private) List<HistoryAware.Pick> |
history
The pick history of the target.
|
(package private) int |
historymax
The maximum size of the history list.
|
(package private) boolean |
historyover
If true, program is completed.
|
(package private) Map<String,List<String>> |
ignoring
Errors ignored.
|
(package private) String |
imagetype
The image type.
|
(package private) UserProfile.Affil |
institution
The institution the user belongs to (aka the time requestor).
|
static String |
KEY_IMAGETYPE
The key to the parameter name of the remaining night-time.
|
(package private) Set<UserProfile.Notifies> |
notify
A list of notification triggers.
|
(package private) String |
proposal
The proposal id.
|
(package private) List<Appointable.Constraint> |
rate
The list of rating constraints, if given.
|
(package private) ExpressionEvaluator |
requires
The condition required for target selection.
|
(package private) Map<String,List<String>> |
retrying
Errors sparking an immediate retry.
|
(package private) Map<String,Integer> |
retrymax
The maximum number of immediate retries allowed.
|
private static long |
serialVersionUID |
(package private) Map<String,Object> |
setup
The map of setups found in the target.
|
(package private) Date |
submitted
If known, the submission date.
|
(package private) String |
successorname
The successor target.
|
(package private) File |
targetfile
The target file when stored as an xml-file.
|
(package private) String |
targetname
The target name.
|
(package private) String |
targettype
The target type.
|
(package private) List<String> |
team
The cois user.
|
(package private) List<Meriting> |
timeslots
The time slot(s) of the target.
|
(package private) String |
title
The abstract of the observing program.
|
(package private) String |
user
The target user.
|
expoKEY_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| Modifier | Constructor and Description |
|---|---|
protected |
SporeTarget()
A no-arg constructor is needed for object serialization.
|
protected |
SporeTarget(Map<String,String> prop)
Constructor chaining.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDaughterName(String dau)
Add a daughter to this target specifying only the name.
|
void |
clearHistory()
Deletes the entire history.
|
protected Map<String,List<String>> |
getAbortErrors()
Returns an array of mappings of exception targets to error names.
|
protected Map<String,Object> |
getAstronomicalData()
Returns all stars in this target.
|
protected Map<String,List<String>> |
getBlockErrors()
Returns an array of mappings of exception targets to error names.
|
List<Appointable.Constraint> |
getConstraints()
Returns the list of
SporeTarget.Constraint objects this target is subject to. |
protected boolean |
getDatabaseRead()
Returns the history database-access boolean.
|
boolean |
getDatabaseWrite()
Returns the history database-access boolean.
|
protected Set<String> |
getDaughterNames()
Returns the list of daughter targets or null if this target does not have
any.
|
protected Map<String,List<String>> |
getDelayErrors()
Returns an array of mappings of exception targets to error names.
|
protected Map<String,Integer> |
getDelays()
Returns the mapping to the maximum number of retries, delays and the
delay time.
|
protected Map<String,Long> |
getDelayTimes()
Returns the mapping to the maximum number of retries, delays and the
delay time.
|
String |
getDescription()
Returns the observing program description.
|
String |
getDescriptionID()
Returns the observing program id.
|
protected ExpressionEvaluator |
getDuration()
Returns the expression that is used to calculate the execution time of
the target.
|
List<javax.mail.Address> |
getEmailAddresses()
Returns the e-mail addresses linked to this target.
|
List<HistoryAware.Pick> |
getEntireHistory()
Returns the entire history the target is aware of.
|
HistoryAware.Pick |
getFailure(int index)
Returns the date of the failed pick with the given index.
|
int |
getFailureCount()
Returns the number of failed observations this target had.
|
File |
getFile()
Returns the file name stored in the DOM.
|
HistoryAware.Pick |
getFirstFailure()
Return the date of the first failed observation.
|
HistoryAware.Pick |
getFirstPick()
Returns the first pick.
|
HistoryAware.Pick |
getFirstSuccess()
Returns the pick of the first successful observation.
|
protected Map<String,Object> |
getFitsHeader()
Returns all fits header in this target.
|
protected List<Meriting> |
getGainMerits()
Returns the timeslot and gain merits as an array.
|
boolean |
getHistoryDatabaseRead()
Returns the history database-access boolean.
|
boolean |
getHistoryDatabaseWrite()
Returns the history database-access boolean.
|
protected int |
getHistoryMax()
Returns the maximum size of the history.
|
protected Map<String,List<String>> |
getIgnoreErrors()
Returns an array of mappings of exception targets to error names.
|
Object |
getImageType()
Returns the image type or the default value, if it was not set.
|
UserProfile.Affil |
getInstitution()
Returns the institution the target time should account to.
|
HistoryAware.Pick |
getLastFailure()
Returns the date of the last failed observation.
|
HistoryAware.Pick |
getLastPick()
Returns the last pick.
|
HistoryAware.Pick |
getLastSuccess()
Returns the pick of the last successful observation.
|
String |
getName()
Returns the Target description of the object.
|
Set<UserProfile.Notifies> |
getNotify()
Return the list of notification as tag-names.
|
HistoryAware.Pick |
getPick(int nr)
Returns the specified pick.
|
int |
getPickCount()
Returns the number of picks in the history.
|
protected List<Appointable.Constraint> |
getRateConstraints()
Returns the list of
SporeTarget.Constraint objects this target is subject to
at rating. |
protected ExpressionEvaluator |
getRateRequires()
Returns the expression that must evaluate to true for this target to get
evaluated after an observation.
|
protected ExpressionEvaluator |
getRequires()
Returns the expression that must evaluate to true for this target to get
picked.
|
protected Map<String,Integer> |
getRetries()
Returns the mapping to the maximum number of retries, delays and the
delay time.
|
protected Map<String,List<String>> |
getRetryErrors()
Returns an array of mappings of exception targets to error names.
|
Map<String,Object> |
getSetups()
Returns the list of
Setup objects of this target. |
Date |
getSubmitted()
The date the target was originally submitted.
|
HistoryAware.Pick |
getSuccess(int index)
Returns the date of the succesful pick with the given index.
|
int |
getSuccessCount()
Returns the number of succesful observations this target had.
|
protected String |
getSuccessorName()
Sets this target's successor.
|
URL |
getTargetResource()
Return the file name stored in the DOM as an url-rsource.
|
Object |
getTargetSpecific(Object idobj)
Returns a special object of target-specific definitions.
|
List<String> |
getTeam()
Returns the list of coi or null if none given.
|
protected List<Meriting> |
getTimeslotMerits()
Returns the timeslot and gain merits as an array.
|
String |
getTitle()
Returns the observing program description.
|
Object |
getType()
Returns the string value of the
DTDConstants.TARGETTYPE
attribute. |
String |
getUser()
Returns the target user.
|
boolean |
isEnabled()
Test the access attribute of the Object element in the given
target-DOM.
|
boolean |
isProgramCompleted()
Returns true if the observing program on this target is over.
|
private void |
readObject(ObjectInputStream stream)
On deserialization, first read the hidden object definitions, then the
properties of this target.
|
protected void |
setAstronomicalData(Map<String,Object> astro)
Sets the map of astronomical targets.
|
protected void |
setConstraints(List<Appointable.Constraint> prevent)
Sets the target constraints.
|
protected void |
setDatabaseAccess(boolean read,
boolean write)
Sets the database-access flags for read and write.
|
protected void |
setDelayAndRetry(Map<String,Integer> delmax,
Map<String,Long> delfor,
Map<String,Integer> retmax)
Sets the maximum number of retries, the maximum number of delays and the
delay time.
|
protected void |
setDescription(String program)
Sets the observing program description.
|
protected void |
setDuration(ExpressionEvaluator durcalc)
Sets the estimated duration of target execution.
|
protected void |
setEmailAddresses(List<javax.mail.Address> address)
Sets the list of e-mail addresses.
|
void |
setEnabled(boolean to)
Sets the access attribute to enabled.
|
protected void |
setErrors(Map<String,List<String>> blockmap,
Map<String,List<String>> delaymap,
Map<String,List<String>> abortmap,
Map<String,List<String>> retrymap,
Map<String,List<String>> ignoremap)
Sets the error maps.
|
protected void |
setFitsHeader(Map<String,Object> fits)
Sets the map of fits headers.
|
protected void |
setHistory(List<HistoryAware.Pick> past,
int max)
Sets the target history and its maximum size.
|
void |
setHistoryDatabaseAccess(boolean read,
boolean write)
Sets the history database-access flags for read and write.
|
protected void |
setImageType(String itype)
Sets the image type.
|
protected void |
setInstitution(UserProfile.Affil who)
Sets the target institute.
|
protected void |
setMerits(List<Meriting> multiplicative,
List<Meriting> additive)
Sets the target merits.
|
protected void |
setNotify(Set<UserProfile.Notifies> triggers)
Sets the list of notification triggers.
|
void |
setProgramCompleted(boolean over)
Returns true if the observing program on this target is over.
|
protected void |
setRateConstraints(List<Appointable.Constraint> prevent)
Sets the target constraints.
|
protected void |
setRateRequires(ExpressionEvaluator necessary)
Sets the boolean condition that is check for target availability prior to
any other parameter constraints.
|
protected void |
setRequires(ExpressionEvaluator necessary)
Sets the boolean condition that is check for target availability prior to
any other parameter constraints.
|
protected void |
setSetups(Map<String,Object> instrumentation)
Sets the map of setups.
|
void |
setSubmitted(Date submit)
Sets the target submission date.
|
protected void |
setSuccessorName(String suck)
Sets this target's successor name.
|
void |
setTargetFile(File xml)
Sets the target xml-file.
|
void |
setTargetName(String name,
String id)
Sets the target name.
|
protected void |
setTargetType(String type)
Sets the target type.
|
protected void |
setTeam(List<String> who)
Sets the target cois.
|
protected void |
setTitle(String program)
Sets the observing program title.
|
protected void |
setUser(String who)
Sets the target user.
|
long |
sumExposures() |
private void |
writeObject(ObjectOutputStream stream)
We customize object serialization.
|
clone, 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, stringPropertiesprivate static final long serialVersionUID
public static final String KEY_IMAGETYPE
public static final String DEFIMAGETYPE
String targettype
Date submitted
String imagetype
#KEY_IMAGETPYE.String targetname
String proposal
String title
String description
File targetfile
String user
List<javax.mail.Address> email
Set<UserProfile.Notifies> notify
UserProfile.Affil institution
ExpressionEvaluator requires
List<Appointable.Constraint> constraints
ExpressionEvaluator duration
String successorname
Map<String,List<String>> blocking
Map<String,List<String>> delaying
Map<String,Integer> delaymax
Map<String,List<String>> ignoring
Map<String,List<String>> aborting
ExpressionEvaluator canrate
List<Appointable.Constraint> rate
int historymax
boolean enabled
List<HistoryAware.Pick> history
boolean historyover
boolean dbwrite
boolean dbread
boolean hdbwrite
boolean hdbread
protected SporeTarget()
private void writeObject(ObjectOutputStream stream) throws IOException
IOExceptionprivate void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
PropertyContainer.setProperties(java.util.Map<java.lang.String, java.lang.Object>).IOExceptionClassNotFoundExceptionpublic String getName()
getName in interface TargetDefinitionpublic Object getImageType()
getImageType in interface TargetDefinitionpublic String getTitle()
getTitle in interface TargetDefinitionpublic String getDescription()
getDescription in interface TargetDefinitionpublic String getDescriptionID()
getDescriptionID in interface TargetDefinitionpublic File getFile()
public String getUser()
getInstitution() is defined.getUser in interface TargetDefinitionpublic List<String> getTeam()
getTeam in interface TargetDefinitionpublic List<javax.mail.Address> getEmailAddresses()
getEmailAddresses in interface TargetDefinitionpublic Set<UserProfile.Notifies> getNotify()
public UserProfile.Affil getInstitution()
getUser(), which is a required element should be
used for time allocation.getInstitution in interface TargetDefinitionpublic Object getType()
DTDConstants.TARGETTYPE
attribute. This is a required attribute to the object tag and states the
sequence type to load for this target.getType in interface TargetDefinitionprotected void setSuccessorName(String suck)
#resolveChildren has been called.protected String getSuccessorName()
protected Set<String> getDaughterNames()
protected void addDaughterName(String dau)
public void setEnabled(boolean to)
protected void setTargetType(String type)
public void setSubmitted(Date submit)
public void setTargetName(String name, String id)
protected void setImageType(String itype)
public void setTargetFile(File xml)
protected void setUser(String who)
protected void setEmailAddresses(List<javax.mail.Address> address)
protected void setNotify(Set<UserProfile.Notifies> triggers)
protected void setTitle(String program)
protected void setDescription(String program)
protected void setInstitution(UserProfile.Affil who)
protected int getHistoryMax()
protected void setErrors(Map<String,List<String>> blockmap, Map<String,List<String>> delaymap, Map<String,List<String>> abortmap, Map<String,List<String>> retrymap, Map<String,List<String>> ignoremap)
protected Map<String,List<String>> getBlockErrors()
protected Map<String,List<String>> getDelayErrors()
protected Map<String,List<String>> getAbortErrors()
protected Map<String,List<String>> getRetryErrors()
protected Map<String,List<String>> getIgnoreErrors()
protected void setDelayAndRetry(Map<String,Integer> delmax, Map<String,Long> delfor, Map<String,Integer> retmax)
delmax - Mapping of exception target to maximum delays.delfor - Mapping of exception target to delay times.retmax - Mapping of exception target to maximum retries.protected Map<String,Integer> getDelays()
protected Map<String,Long> getDelayTimes()
protected Map<String,Integer> getRetries()
protected void setRequires(ExpressionEvaluator necessary)
protected ExpressionEvaluator getRequires()
protected void setConstraints(List<Appointable.Constraint> prevent)
public List<Appointable.Constraint> getConstraints()
SporeTarget.Constraint objects this target is subject to.protected void setMerits(List<Meriting> multiplicative, List<Meriting> additive)
protected List<Meriting> getTimeslotMerits()
protected List<Meriting> getGainMerits()
protected void setRateConstraints(List<Appointable.Constraint> prevent)
protected List<Appointable.Constraint> getRateConstraints()
SporeTarget.Constraint objects this target is subject to
at rating.protected void setRateRequires(ExpressionEvaluator necessary)
protected ExpressionEvaluator getRateRequires()
protected void setDuration(ExpressionEvaluator durcalc)
protected ExpressionEvaluator getDuration()
protected void setSetups(Map<String,Object> instrumentation)
protected void setAstronomicalData(Map<String,Object> astro)
protected Map<String,Object> getAstronomicalData()
protected void setFitsHeader(Map<String,Object> fits)
public URL getTargetResource()
getTargetResource in interface TargetDefinitionpublic Object getTargetSpecific(Object idobj)
DTDConstants.SETUP section. The object returned is a
Setup instance.DTDConstants.OBJECT section. The object returned is a
AbstractTarget.Aim instance.DTDConstants.FITSHEADER section. The object returned is a
Collection of FitsEntry instances.DTDConstants.CONSTANT section.getTargetSpecific in interface TargetDefinitionidobj - An identifier, most likely a string.protected void setDatabaseAccess(boolean read,
boolean write)
public void setHistoryDatabaseAccess(boolean read,
boolean write)
protected void setHistory(List<HistoryAware.Pick> past, int max)
past - The pick history of the target, good and bad picks.max - The maximum size of the history list.db - The history-db access boolean.public void setProgramCompleted(boolean over)
Appointable.isProgramOver(globals.GlobalGrouping) method in the sense
that a program completion is not bound to current observing
circumstances, thus the normal action is that an appointable target whose
program is over, may set this flag for fast replies.public boolean getDatabaseWrite()
protected boolean getDatabaseRead()
public boolean getHistoryDatabaseWrite()
public boolean getHistoryDatabaseRead()
public boolean isEnabled()
public Date getSubmitted()
public boolean isProgramCompleted()
Appointable.isProgramOver(globals.GlobalGrouping) method in the sense
that a program completion is not bound to current observing
circumstances, thus the normal action is that an appointable target whose
program is over, may set this flag for fast replies.public List<HistoryAware.Pick> getEntireHistory()
public void clearHistory()
public int getPickCount()
public HistoryAware.Pick getPick(int nr)
public HistoryAware.Pick getFirstPick()
public HistoryAware.Pick getLastPick()
public int getSuccessCount()
public int getFailureCount()
public HistoryAware.Pick getFirstSuccess()
public HistoryAware.Pick getLastSuccess()
public HistoryAware.Pick getSuccess(int index)
public HistoryAware.Pick getFirstFailure()
public HistoryAware.Pick getLastFailure()
public HistoryAware.Pick getFailure(int index)
public long sumExposures()