public class Unique extends AbstractRemoteParameter implements ErrorDependingParameter, StatePreserving, Reloadable
20060312-0001 out of it. It should be set by the master mind and
transproted via RMI to interested clients (like the adapter master or the
CCD).PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
static String |
DEFBINDNAME
The default name of this value.
|
static String |
DEFNAME
The default name of this value.
|
static DateFormat |
df
The date formatter to get from now to a guider/acquire/ccd fits name.
|
static String |
KEY_SEPARATOR
A separator string after the date, before
MINUS and count. |
static String |
MINUS
The separator between date and running number.
|
static NumberFormat |
nf
The number format for running counts.
|
static String |
nq
A query operator for running counts.
|
private int |
targetcount
The target acquired at this date.
|
static NumberFormat |
tf
The number format for running tries.
|
static String |
tq
A query operator for running tries.
|
private Date |
usedate
For naming of acquire/guide/ccd frames.
|
DEFBIND, KEY_BINDKEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORNAMING_EXTENSIONCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
Unique(Map<String,String> prop)
We are not allowed to change any properties.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
get()
Gets the current unique name identifier.
|
Object |
getForError(ErrorEvent ee)
Querying the unique parameter for an error returns the current unique
number, advancing is only done by registering.
|
String |
getUniqueTarget()
The unique target ID.
|
void |
init()
We scout for a file that hold the last unique values.
|
private void |
next()
If the exposure count is to be included in the unique numbering, this is
how it is formatted and attached to it /** Increases the current number.
|
boolean |
preserve()
On exit, we save our current state if the serialize property is set.
|
void |
registerError(ErrorEvent ee)
If the error registered is a
TargetPicked, we advance the unique
number. |
double |
rescanned(String key,
String old,
String newval)
We throw an illegal argument exception if export port changed
|
boolean |
restore()
We restore our old value by reading the last date and target count from a
serialization file.
|
Object |
set(Object val)
Setting the unique number is only allowed vai a call to next, therefore
this method throws an UnsupportedOperationException.
|
addRmiListener, bindToRegistry, exit, isValid, remoteGet, removeRmiListener, unbindFromRegistrycreateParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, setName, toStringclone, 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, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFormatted, getName, getStringdefaultBoolean, 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, stringPropertiesexitreloadpublic static final DateFormat df
public static final NumberFormat nf
public static final NumberFormat tf
public static final String tq
public static final String nq
public static final String MINUS
public static final String DEFNAME
public static final String DEFBINDNAME
public static final String KEY_SEPARATOR
MINUS and count.private Date usedate
private int targetcount
public Unique(Map<String,String> prop) throws RemoteException
RemoteExceptionpublic void init()
throws InitException
init in interface Initializableinit in class AbstractRemoteParameterInitExceptionpublic double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class AbstractRemoteParameterpublic boolean restore()
restore in interface Preservingpublic boolean preserve()
preserve in interface Preservingpublic String getUniqueTarget()
public Object get()
public Object set(Object val) throws UnsupportedOperationException
set in interface ParameterUnsupportedOperationException - If this parameter is read-only.public void registerError(ErrorEvent ee)
TargetPicked, we advance the unique
number.registerError in interface ErrorDependingParameterpublic Object getForError(ErrorEvent ee)
getForError in interface ErrorDependingParameterget()private void next()