/*
* Created on Nov 23, 2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
* CHANGES
* 2005-02-16 getExportPropertyInformation() removed. Use TPropertyList.getEqualProperties()
* 2005-02-16 changed property list from LinkedList to TPropertyList.
* 2005-02-15 removed getStockPropertyNames. use TPropertyList.getPropertyNames().
*/
package de.desy.tine.server.properties;
import java.util.*;
import de.desy.tine.dataUtils.TDataTime;
import de.desy.tine.definitions.TFormat;
import de.desy.tine.definitions.TStrings;
import de.desy.tine.server.TServerSettings;
import de.desy.tine.server.TServerStatistics;
import de.desy.tine.server.alarms.TAlarmDefinition;
import de.desy.tine.server.alarms.TAlarmMessage;
import de.desy.tine.server.alarms.TAlarmMessage5;
import de.desy.tine.server.alarms.TAlarmWatchEntry;
import de.desy.tine.server.connections.TClient;
import de.desy.tine.server.connections.TClientEntry;
import de.desy.tine.server.connections.TConnectionStruct;
import de.desy.tine.server.connections.TContractEntry;
import de.desy.tine.server.connections.TContractTable;
import de.desy.tine.server.equipment.TWriteAccessInfo;
import de.desy.tine.server.histories.THistoryRecordStruct;
import de.desy.tine.startup.TInitializer;
import de.desy.tine.startup.TInitializerFactory;
import de.desy.tine.structUtils.TStructDescription;
import de.desy.tine.structUtils.TStructRegistry;
/**
* \internal
*
* This class provides a list of stock properties and a Tagged Structure
* description.
*
* @author duval
*
*/
public final class TStockProperties {
/*
* ID constants; not really needed anymore; use e.g.
* TStockProperties.PROPERTIES.getID();
*/
public static final int PROPERTIES_ID = 1;
public static final int NPROPERTIES_ID = 2;
public static final int DEVICES_ID = 3;
public static final int NDEVICES_ID = 4;
public static final int STOCK_PROPERTIES_ID = 5;
public static final int NSTOCK_PROPERTIES_ID = 6;
public static final int SRVOS_ID = 7;
public static final int SRVSTARTTIME_ID = 8;
public static final int SRVVERSION_ID = 9;
public static final int STRUCTFORMAT_ID = 10;
public static final int ACCESSLOCK_ID = 11;
public static final int ACTIVITY_ID = 12;
public static final int ADDUSER_ID = 13;
public static final int ALARMS_ID = 14;
public static final int ALARMSEXT_ID = 15;
public static final int ALARMDEFS_ID = 16;
public static final int APPDATE_ID = 17;
public static final int APPVERSION_ID = 18;
public static final int CLIENTS_ID = 19;
public static final int CONTRACTS_ID = 20;
public static final int DEBUGLEVEL_ID = 21;
public static final int DELUSER_ID = 22;
public static final int DENIEDUSERS_ID = 23;
public static final int HISTORIES_ID = 24;
public static final int IPNETS_ID = 25;
public static final int LOGCOMMANDS_ID = 26;
public static final int LOGDEPTH_ID = 27;
public static final int LOGFILE_ID = 28;
public static final int MESSAGE_ID = 29;
public static final int NALARMS_ID = 30;
public static final int NALMDEFS_ID = 31;
public static final int NHISTORIES_ID = 32;
public static final int NIPNETS_ID = 33;
public static final int NUSERS_ID = 34;
public static final int SRVALIASLIST_ID = 35;
public static final int SRVDESC_ID = 36;
public static final int SRVEXIT_ID = 37;
public static final int SRVLOCATION_ID = 38;
public static final int SRVLOGFILE_ID = 39;
public static final int SRVLOGFILES_ID = 40;
public static final int SRVSELFTEST_ID = 41;
public static final int SRVSTATS_ID = 42;
public static final int USERS_ID = 43;
public static final int SRVLASTACCESS_ID = 44;
public static final int NALMWATCH_ID = 45;
public static final int ALMWATCHTBL_ID = 46;
public static final int ADDHISTORY_ID = 47;
public static final int DEVDESCRIPTION_ID = 48;
public static final int SRVINIT_ID = 49;
public static final int SRVIDLE_ID = 50;
public static final int BITFIELDFORMAT_ID = 50;
public static final int CONNECTIONS_ID = 51;
public static final int SRVCOMMANDS_ID = 52;
public static final int SRVCMDLINE_ID = 53;
public static final int SRVCWD_ID = 54;
public static final int ADDIPNET_ID = 55;
public static final int DELIPNET_ID = 56;
public static final int SRVADDR_ID = 57;
public static final int SRVRESET_ID = 58;
public static final int SRVPID_ID = 59;
public static final int SRVSUBSYSTEM_ID = 60;
public static final int DEVLOCATION_ID = 61;
public static final int DEVMASK_ID = 62;
public static final int DEVONLINE_ID = 63;
public static final int ZPOSITION_ID = 64;
public static final int METAPROPERTIES_ID = 65;
public static final int SRVSETTINGS_ID = 66;
public static final int SRVADMINS_ID = 67;
public static final int MANIFEST_ID = 68;
public static final int MANIFESTPATH_ID = 69;
private static final int nice_query_size = 10;
/*
* HOW TO ADD A STOCK PROPERTY
* 1. Create struct type if necessary (derive from TStructBase)
* 2. Create final static Stock Property here.
* 3. In initPropertyList(): add new property.
* 4. Add Stock property to the server or equipment module.
* 5. don't forget the TQuery.isStockProperty() method << no longer necessary
*/
/*
* Static properties
*/
public final static TExportProperty PROPERTIES = new TExportProperty(
PROPERTIES_ID, "PROPERTIES", "exported property name list", 256,
TFormat.CF_NAME64);
public final static TExportProperty PROPERTIES_STRUCT = new TExportProperty(
PROPERTIES_ID, "PROPERTIES", "exported property name list", 10,
TFormat.CF_STRUCT, "PRPQSr4", 1, TFormat.CF_NAME64, "");
public final static TExportProperty METAPROPERTIES = new TExportProperty(
METAPROPERTIES_ID, "METAPROPERTIES", "valid meta properties of exported Properties", 256,
TFormat.CF_NAME64, 1, TFormat.CF_NAME64);
public final static TExportProperty METAPROPS = new TExportProperty(
METAPROPERTIES_ID, "METAPROPS", "valid meta properties of exported Properties", 256,
TFormat.CF_NAME64, 1, TFormat.CF_NAME64);
public final static TExportProperty METAPROPERTIES_STRUCT = new TExportProperty(
METAPROPERTIES_ID, "METAPROPERTIES", "valid meta properties of exported Properties", 10,
TFormat.CF_STRUCT, "PRPQSr4", 1, TFormat.CF_NAME64, "");
public final static TExportProperty METAPROPS_STRUCT = new TExportProperty(
METAPROPERTIES_ID, "METAPROPS", "valid meta properties of exported Properties", 10,
TFormat.CF_STRUCT, "PRPQSr4", 1, TFormat.CF_NAME64, "");
public final static TExportProperty PROPERTIES_USTRING = new TExportProperty(
PROPERTIES_ID, "PROPERTIES", "exported property name list", 256,
TFormat.CF_USTRING);
public final static TExportProperty METAPROPERTIES_USTRING = new TExportProperty(
METAPROPERTIES_ID, "METAPROPERTIES", "valid meta properties of exported Properties", 256,
TFormat.CF_USTRING);
public final static TExportProperty METAPROPS_USTRING = new TExportProperty(
METAPROPERTIES_ID, "METAPROPS", "valid meta properties of exported Properties", 256,
TFormat.CF_USTRING);
public final static TExportProperty PROPS = new TExportProperty(
PROPERTIES_ID, "PROPS", "exported property name list", 256,
TFormat.CF_NAME64);
public final static TExportProperty PROPS_STRUCT = new TExportProperty(
PROPERTIES_ID, "PROPS", "exported property name list", 10,
TFormat.CF_STRUCT, "PRPQSr4", 1, TFormat.CF_NAME64, "");
public final static TExportProperty PROPS_USTRING = new TExportProperty(
PROPERTIES_ID, "PROPS", "exported property name list", 256,
TFormat.CF_USTRING);
public final static TExportProperty NPROPERTIES = new TExportProperty(
NPROPERTIES_ID, "NPROPERTIES", "size of exported property name list",
1, TFormat.CF_SHORT);
public final static TExportProperty NPROPS = new TExportProperty(
NPROPERTIES_ID, "NPROPS", "size of exported property name list", 1,
TFormat.CF_SHORT);
public final static TExportProperty DEVICES = new TExportProperty(
DEVICES_ID, "DEVICES", "exported device name list", 256,
TFormat.CF_NAME64);
public final static TExportProperty NDEVICES = new TExportProperty(
NDEVICES_ID, "NDEVICES", "size of exported device list", 1,
TFormat.CF_SHORT);
public final static TExportProperty STOCKPROPS = new TExportProperty(
STOCK_PROPERTIES_ID, "STOCKPROPS", "stock property name list", 256,
TFormat.CF_NAME32,1,TFormat.CF_NAME32);
public final static TExportProperty STOCKPROPS_STRUCT = new TExportProperty(
STOCK_PROPERTIES_ID, "STOCKPROPS", "stock property name list", 10,
TFormat.CF_STRUCT, "PRPQSr4", 1, TFormat.CF_NAME64, "");
// public final static TExportProperty STOCKPROPS_STRUCT = new TExportProperty(
// STOCK_PROPERTIES_ID, "STOCKPROPS", "stock property name list", 10,
// TFormat.CF_STRUCT, "XPQS", 1, TFormat.CF_NAME32, "");
public final static TExportProperty STOCKPROPS_USTRING = new TExportProperty(
STOCK_PROPERTIES_ID, "STOCKPROPS", "stock property name list", 256,
TFormat.CF_USTRING);
public final static TExportProperty NSTOCKPROPS = new TExportProperty(
NSTOCK_PROPERTIES_ID, "NSTOCKPROPS", "size stock property name list",
1, TFormat.CF_SHORT);
public final static TExportProperty SRVOS = new TExportProperty(SRVOS_ID,
"SRVOS", "operating system", 16, TFormat.CF_TEXT);
public final static TExportProperty SRVSTARTTIME = new TExportProperty(
SRVSTARTTIME_ID, "SRVSTARTTIME", "startup time of server", 32,
TFormat.CF_TEXT);
public final static TExportProperty SRVSTARTTIME_LONG = new TExportProperty(
SRVSTARTTIME_ID, "SRVSTARTTIME", "startup time of server", 1,
TFormat.CF_LONG);
public final static TExportProperty SRVVERSION = new TExportProperty(
SRVVERSION_ID, "SRVVERSION", "TINE Server Version Number", 16, TFormat.CF_TEXT);
public final static TExportProperty SRVADDR = new TExportProperty(
SRVADDR_ID, "SRVADDR", "get server address parameters", 5, TFormat.CF_NAME32,3,TFormat.CF_NAME32);
public final static TExportProperty SRVSTATS = new TExportProperty(
SRVSTATS_ID, "SRVSTATS", "Server Statistics counters", 16, TFormat.CF_LONG);
public final static TExportProperty SRVSETTINGS = new TExportProperty(
SRVSETTINGS_ID, "SRVSETTINGS", "Selected Server Settings",1,
TFormat.CF_STRUCT, "SrvSetQy",1, TFormat.CF_NULL, "");
public final static TExportProperty SRVADMINS = new TExportProperty(
SRVADMINS_ID, "SRVADMINS", "Registered Administrators", 256,
TFormat.CF_NAME16,0,TFormat.CF_NULL);
public final static TExportProperty STRUCTFORMAT_INTINT = new TExportProperty(
STRUCTFORMAT_ID, "STRUCTFORMAT", "Tagged structure information", 512,
TFormat.CF_INTINT, "", 16, TFormat.CF_TEXT, "");
public final static TExportProperty STRUCTFORMAT_NDD = new TExportProperty(
STRUCTFORMAT_ID, "STRUCTFORMAT", "Tagged structure information", 512,
TFormat.CF_NAME64DBLDBL, "", 16, TFormat.CF_TEXT, "");
public final static TExportProperty STRUCTFORMAT = new TExportProperty(
STRUCTFORMAT_ID, "STRUCTFORMAT", "Tagged structure information", 512,
TFormat.CF_NAME16II, "", 16, TFormat.CF_TEXT, "");
public final static TExportProperty BITFIELDFORMAT = new TExportProperty(
BITFIELDFORMAT_ID, "BITFIELDFORMAT", "bitfield structure information", 512,
TFormat.CF_NAME16I, "", 16, TFormat.CF_TEXT, "");
public final static TExportProperty CONTRACTS = new TExportProperty(
CONTRACTS_ID, "CONTRACTS", "List of contracts",
TContractTable.nice_query_size, TFormat.CF_STRUCT,
"CTQSr4", 1, TFormat.CF_NULL,"");
public final static TExportProperty CLIENTS = new TExportProperty(
CLIENTS_ID, "CLIENTS", "List of clients",
TClient.nice_query_size,
TFormat.CF_STRUCT, "CLNQS",1, TFormat.CF_NULL, "");
public final static TExportProperty CONNECTIONS = new TExportProperty(
CONNECTIONS_ID, "CONNECTIONS", "Current client connection table",
TContractTable.nice_query_size, TFormat.CF_STRUCT,
"CONTBLr4", 1, TFormat.CF_NULL,"");
public final static TExportProperty ACTIVITY = new TExportProperty(
ACTIVITY_ID, "ACTIVITY", "Server statistics",1,
TFormat.CF_STRUCT, TServerStatistics.getStructDescription().getTagName(),
0, TFormat.CF_NULL, "");
public final static TExportProperty USERS = new TExportProperty(
USERS_ID, "USERS", "users with write access", 256,
TFormat.CF_NAME16, 1, TFormat.CF_NAME64);
public final static TExportProperty NUSERS = new TExportProperty(
NUSERS_ID, "NUSERS", "number users with write access", 1,
TFormat.CF_SHORT, 1, TFormat.CF_NAME64);
public final static TExportProperty IPNETS = new TExportProperty(
IPNETS_ID, "IPNETS", "IP Network addresses with write access", 256,
TFormat.CF_NAME16, 1, TFormat.CF_NAME64);
public final static TExportProperty NIPNETS = new TExportProperty(
NIPNETS_ID, "NIPNETS", "Number of IP Network addresses with write access", 1,
TFormat.CF_SHORT, 1, TFormat.CF_NAME64);
public final static TExportProperty ACCESSLOCK = new TExportProperty(
ACCESSLOCK_ID, "ACCESSLOCK", "Get/Set an Access lock on all properties",
3, TFormat.CF_NAME32, 2,TFormat.CF_SHORT);
public final static TExportProperty ADDUSER = new TExportProperty(
ADDUSER_ID, "ADDUSER", "Add User to users access list",
0, TFormat.CF_NULL, 1,TFormat.CF_NAME16);
public final static TExportProperty DELUSER = new TExportProperty(
DELUSER_ID, "DELUSER", "Delete User from users access list",
0, TFormat.CF_NULL, 1,TFormat.CF_NAME16);
public final static TExportProperty ADDIPNET = new TExportProperty(
ADDIPNET_ID, "ADDIPNET", "Add address to ip nets access list",
0, TFormat.CF_NULL, 1,TFormat.CF_NAME16);
public final static TExportProperty DELIPNET = new TExportProperty(
DELIPNET_ID, "DELIPNET", "Delete address from ip nets access list",
0, TFormat.CF_NULL, 1,TFormat.CF_NAME16);
public final static TExportProperty SRVDESC = new TExportProperty(
SRVDESC_ID, "SRVDESC", "Server Description",
64, TFormat.CF_TEXT);
public final static TExportProperty SRVLOCATION = new TExportProperty(
SRVLOCATION_ID, "SRVLOCATION", "Server Location",
32, TFormat.CF_TEXT);
public final static TExportProperty SRVLASTACCESS = new TExportProperty(
SRVLASTACCESS_ID, "SRVLASTACCESS", "get most recent command access",
5, TFormat.CF_NAME32);
public final static TExportProperty SRVCOMMANDS = new TExportProperty(
SRVCOMMANDS_ID, "SRVCOMMANDS", "get recent command list",
100, TFormat.CF_STRUCT,
"WRACCTBL", 1, TFormat.CF_NULL,"");
public final static TExportProperty SRVCMDLINE = new TExportProperty(
SRVCMDLINE_ID, "SRVCMDLINE", "get the FEC's startup command line",
132, TFormat.CF_TEXT);
public final static TExportProperty SRVCWD = new TExportProperty(
SRVCWD_ID, "SRVCWD", "get the FEC's startup working directory",
132, TFormat.CF_TEXT);
public final static TExportProperty SRVPID = new TExportProperty(
SRVPID_ID, "SRVPID", "get the FEC's process ID",
1, TFormat.CF_INT32);
public final static TExportProperty SRVLASTACCESS_LONG = new TExportProperty(
SRVLASTACCESS_ID, "SRVLASTACCESS", "get most recent command access",
5, TFormat.CF_LONG);
public final static TExportProperty SRVALIASLIST = new TExportProperty(
SRVALIASLIST_ID, "SRVALIASLIST", "name/alias pairs", 512,
TFormat.CF_NAME32);
public final static TExportProperty SRVSELFTEST = new TExportProperty(
SRVSELFTEST_ID, "SRVSELFTEST", "get self-test file",
32000, TFormat.CF_TEXT);
public final static TExportProperty SRVLOGFILE = new TExportProperty(
SRVLOGFILE_ID, "SRVLOGFILE", "get specified log file",
32000, TFormat.CF_TEXT,64, TFormat.CF_TEXT);
public final static TExportProperty SRVLOGFILES = new TExportProperty(
SRVLOGFILES_ID, "SRVLOGFILES", "get log file list",
32, TFormat.CF_NAME64);
public final static TExportProperty SRVEXIT = new TExportProperty(
SRVEXIT_ID, "SRVEXIT", "Force Server stop",
0, TFormat.CF_NULL, 1,TFormat.CF_INT32);
public final static TExportProperty SRVINIT = new TExportProperty(
SRVINIT_ID, "SRVINIT", "Re-initialize targetted server",
0, TFormat.CF_NULL, 0,TFormat.CF_NULL);
public final static TExportProperty SRVRESET = new TExportProperty(
SRVRESET_ID, "SRVRESET", "Reset Server (when enabled)",
0, TFormat.CF_NULL, 1,TFormat.CF_LONG);
public final static TExportProperty SRVIDLE = new TExportProperty(
SRVIDLE_ID, "SRVIDLE", "get/set the idle state of the targetted server",
1, TFormat.CF_LONG, 1,TFormat.CF_LONG);
public final static TExportProperty SRVSUBSYSTEM = new TExportProperty(
SRVSUBSYSTEM_ID, "SRVSUBSYSTEM", "get the registered subsystem",
32, TFormat.CF_TEXT, 0,TFormat.CF_NULL);
public final static TExportProperty DEVDESCRIPTION = new TExportProperty(
DEVDESCRIPTION_ID, "DEVDESCRIPTION", "get the device description assigned to the targeted device",
1, TFormat.CF_NAME64, 0,TFormat.CF_NULL);
public final static TExportProperty DEVLOCATION = new TExportProperty(
DEVLOCATION_ID, "DEVLOCATION", "get the device location assigned to the targeted device",
1, TFormat.CF_NAME64, 0,TFormat.CF_NULL);
public final static TExportProperty DEVMASK = new TExportProperty(
DEVMASK_ID, "DEVMASK", "get/set the device mask assigned to the targeted device",
1, TFormat.CF_INT32, 1,TFormat.CF_INT32);
public final static TExportProperty DEVONLINE = new TExportProperty(
DEVONLINE_ID, "DEVONLINE", "get/set the device on-line status assigned to the targeted device",
1, TFormat.CF_INT32, 1,TFormat.CF_INT32);
public final static TExportProperty ZPOSITION = new TExportProperty(
ZPOSITION_ID, "ZPOSITION", "get/set the device Z (longitudinal) postition assigned to the targeted device",
1, TFormat.CF_FLOAT, 1,TFormat.CF_FLOAT);
public final static TExportProperty LOGFILE = new TExportProperty(
LOGFILE_ID, "LOGFILE", "get fec log file",
32000, TFormat.CF_TEXT);
public final static TExportProperty MANIFEST = new TExportProperty(
MANIFEST_ID, "MANIFEST", "get fec host's manifest file",
32000, TFormat.CF_TEXT);
public final static TExportProperty MANIFESTPATH = new TExportProperty(
MANIFESTPATH_ID, "SRVMANIFESTPATH", "location of server's manifest",
132, TFormat.CF_TEXT);
public final static TExportProperty LOGDEPTH = new TExportProperty(
LOGDEPTH_ID, "LOGDEPTH", "get/set fec log file depth",
1,TFormat.CF_SHORT,1,TFormat.CF_SHORT);
public final static TExportProperty LOGCOMMANDS = new TExportProperty(
LOGCOMMANDS_ID, "LOGCOMMANDS", "en/dis-able command logging flag",
1,TFormat.CF_SHORT,1,TFormat.CF_SHORT);
public final static TExportProperty MESSAGE = new TExportProperty(
MESSAGE_ID, "MESSAGE", "write/log (or read last) message to fec",
128, TFormat.CF_TEXT,128, TFormat.CF_TEXT);
public final static TExportProperty HISTORIES = new TExportProperty(
HISTORIES_ID, "HISTORIES", "history properties", 256,
TFormat.CF_NAME64);
public final static TExportProperty HISTORIES_STRUCT = new TExportProperty(
HISTORIES_ID, "HISTORIES", "history properties", 256,
TFormat.CF_STRUCT,"HRSr4",1,TFormat.CF_NAME64,"");
public final static TExportProperty NHISTORIES = new TExportProperty(
NHISTORIES_ID, "NHISTORIES", "number of history properties", 1,
TFormat.CF_SHORT);
public final static TExportProperty ADDHISTORY = new TExportProperty(
ADDHISTORY_ID, "ADDHISTORY", "add/edit a history record", 0,
TFormat.CF_NULL,"",1,TFormat.CF_STRUCT,"HQS");
public final static TExportProperty ADDHISTORY_STR = new TExportProperty(
ADDHISTORY_ID, "ADDHISTORY", "add a history record with default settings", 0,
TFormat.CF_NULL,"",1,TFormat.CF_NAME64,"");
public final static TExportProperty DEBUGLEVEL = new TExportProperty(
DEBUGLEVEL_ID, "DEBUGLEVEL", "read/set debug level",
1,TFormat.CF_SHORT,1,TFormat.CF_SHORT);
public final static TExportProperty ALARMS = new TExportProperty(
ALARMS_ID, "ALARMS", "get alarm list", 256,
TFormat.CF_STRUCT,"AMSr4",5,TFormat.CF_LONG,"");
public final static TExportProperty ALARMSEXT = new TExportProperty(
ALARMSEXT_ID, "ALARMSEXT", "get extended alarm list", 256,
TFormat.CF_STRUCT,"AMSr4",5,TFormat.CF_LONG,"");
public final static TExportProperty ALARMSEXT_STRUCTIN = new TExportProperty(
ALARMSEXT_ID, "ALARMSEXT", "get extended alarm list", 256,
TFormat.CF_STRUCT,"AMSr4",5,TFormat.CF_STRUCT,"");
public final static TExportProperty NALARMS = new TExportProperty(
ALARMS_ID, "NALARMS", "number alarms (alarm snapshot)", 5,
TFormat.CF_LONG);
public final static TExportProperty ALARMDEFS = new TExportProperty(
ALARMDEFS_ID, "ALMDEFS", "get alarm definition list", 256,
TFormat.CF_STRUCT,"ADSr4",1,TFormat.CF_STRUCT,"ADSr4");
public final static TExportProperty NALARMDEFS = new TExportProperty(
NALMDEFS_ID, "NALMDEFS", "number of alarm definitions", 1,
TFormat.CF_SHORT);
public final static TExportProperty NALMWATCH = new TExportProperty(
NALMWATCH_ID, "NALMWATCH", "number of alarms in watch table", 1,
TFormat.CF_LONG);
public final static TExportProperty ALMWATCHTBL = new TExportProperty(
ALMWATCHTBL_ID, "ALMWATCHTBL", "current Alarm Watch Table", 1,
TFormat.CF_STRUCT,"AWSr4",1,TFormat.CF_STRUCT,"AWSr4");
public final static TExportProperty APPDATE = new TExportProperty(
APPDATE_ID, "APPDATE", "application date", 1,
TFormat.CF_LONG);
public final static TExportProperty APPDATE_STRING = new TExportProperty(
APPDATE_ID, "APPDATE", "application date", 32,
TFormat.CF_TEXT);
public final static TExportProperty APPVERSION = new TExportProperty(
APPVERSION_ID, "APPVERSION", "application version", 16, TFormat.CF_TEXT);
// TODO Drop property IDs
private static TPropertyList propertyList = new TPropertyList();
private static TStructDescription stockStruct = null;
private static TStructDescription stockStructLegacy = null;
private static TPropertyList fecPropertyList = new TPropertyList();
static
{
initPropertyList();
initStructDescription();
new TAlarmMessage();
new TAlarmDefinition();
}
/**
* Returns a static list of stock properties
*
* @return List of stock properties
*/
public static TPropertyList getPropertyList()
{
return propertyList;
}
/**
* Returns the stock structure description.
*
* @return
*/
public static TStructDescription getStructDescription()
{
return stockStruct;
}
public static TStructDescription getLegacyStructDescription()
{
return stockStructLegacy;
}
public static boolean isFecProperty(String property)
{
if (fecPropertyList.hasProperty(property)) return true;
return false;
}
/**
* Defines the stock structure as a static TStructDescription.
*
*/
private static void initStructDescription()
{
stockStruct = new TStructDescription("PRPQSr4");
stockStruct.beginDefinition();
stockStruct.addField("property",TFormat.CF_TEXT, TStrings.PROPERTY_NAME_SIZE);
stockStruct.addField("description",TFormat.CF_TEXT, TStrings.PROPERTY_DESC_SIZE);
stockStruct.addField("redirection",TFormat.CF_TEXT, TStrings.PROPERTY_REDIR_SIZE);
stockStruct.addField("tagOut",TFormat.CF_TEXT, TStrings.TAG_NAME_SIZE);
stockStruct.addField("tagIn",TFormat.CF_TEXT, TStrings.TAG_NAME_SIZE);
stockStruct.addField("units",TFormat.CF_TEXT, TStrings.UNITS_SIZE);
stockStruct.addField("min",TFormat.CF_FLOAT, 1);
stockStruct.addField("max",TFormat.CF_FLOAT, 1);
stockStruct.addField("sizeOut",TFormat.CF_LONG, 1);
stockStruct.addField("sizeIn",TFormat.CF_LONG, 1);
stockStruct.addField("overloads",TFormat.CF_LONG, 1);
stockStruct.addField("historyShort",TFormat.CF_SHORT, 1);
stockStruct.addField("historyLong",TFormat.CF_SHORT, 1);
stockStruct.addField("formatOut",TFormat.CF_BYTE, 1);
stockStruct.addField("formatIn",TFormat.CF_BYTE, 1);
stockStruct.addField("access",TFormat.CF_BYTE, 1);
stockStruct.addField("graphType",TFormat.CF_BYTE, 1);
stockStruct.addField("rangeUnits",TFormat.CF_TEXT, TStrings.UNITS_SIZE);
stockStruct.addField("rangeMin",TFormat.CF_FLOAT, 1);
stockStruct.addField("rangeMax",TFormat.CF_FLOAT, 1);
stockStruct.addField("numRows",TFormat.CF_SHORT, 1);
stockStruct.addField("rowSize",TFormat.CF_SHORT, 1);
stockStruct.addField("arrayType",TFormat.CF_SHORT, 1);
stockStruct.addField("reserved",TFormat.CF_SHORT, 3);
stockStruct.setArraySize(nice_query_size);
stockStruct.endDefinition();
TStructRegistry.add(getStructDescription());
stockStruct = new TStructDescription("XPQS");
stockStruct.beginDefinition();
stockStruct.addField("property",TFormat.CF_TEXT, 32);
stockStruct.addField("description",TFormat.CF_TEXT, 64);
stockStruct.addField("redirection",TFormat.CF_TEXT, 32);
stockStruct.addField("tagOut",TFormat.CF_TEXT, 8);
stockStruct.addField("tagIn",TFormat.CF_TEXT, 8);
stockStruct.addField("units",TFormat.CF_TEXT, 16);
stockStruct.addField("min",TFormat.CF_FLOAT, 1);
stockStruct.addField("max",TFormat.CF_FLOAT, 1);
stockStruct.addField("sizeOut",TFormat.CF_LONG, 1);
stockStruct.addField("sizeIn",TFormat.CF_LONG, 1);
stockStruct.addField("overloads",TFormat.CF_LONG, 1);
stockStruct.addField("shortDepth",TFormat.CF_SHORT, 1);
stockStruct.addField("longDepth",TFormat.CF_SHORT, 1);
stockStruct.addField("formatOut",TFormat.CF_BYTE, 1);
stockStruct.addField("formatIn",TFormat.CF_BYTE, 1);
stockStruct.addField("access",TFormat.CF_BYTE, 1);
stockStruct.addField("graphType",TFormat.CF_BYTE, 1);
stockStruct.addField("rangeUnits",TFormat.CF_TEXT, 16);
stockStruct.addField("rangeMin",TFormat.CF_FLOAT, 1);
stockStruct.addField("rangeMax",TFormat.CF_FLOAT, 1);
stockStruct.addField("numRows",TFormat.CF_SHORT, 1);
stockStruct.addField("rowSize",TFormat.CF_SHORT, 1);
stockStruct.addField("arrayType",TFormat.CF_SHORT, 1);
stockStruct.addField("reserved",TFormat.CF_SHORT, 3);
stockStruct.setArraySize(nice_query_size);
stockStruct.endDefinition();
TStructRegistry.add(getStructDescription());
// get the remaining stock structures into the registry
new TWriteAccessInfo("","","","","",0);
new TClient();
new TConnectionStruct();
new TContractEntry();
new TServerSettings();
new THistoryRecordStruct();
TAlarmMessage5.initStructDescription();
new TAlarmWatchEntry();
stockStructLegacy = new TStructDescription("PQS");
stockStructLegacy.beginDefinition();
stockStructLegacy.addField("property",TFormat.CF_TEXT, 32);
stockStructLegacy.addField("description",TFormat.CF_TEXT, 32);
stockStructLegacy.addField("size",TFormat.CF_SHORT, 1);
stockStructLegacy.addField("format",TFormat.CF_BYTE, 1);
stockStructLegacy.addField("access",TFormat.CF_BYTE, 1);
stockStructLegacy.setArraySize(256);
stockStructLegacy.endDefinition();
TStructRegistry.add(getLegacyStructDescription());
}
/**
* Initializes the stock property list.
*/
private static void initPropertyList()
{
propertyList.addProperty(PROPERTIES, null);
propertyList.addProperty(PROPERTIES_STRUCT, null);
propertyList.addProperty(PROPERTIES_USTRING, null);
propertyList.addProperty(PROPS, null);
propertyList.addProperty(PROPS_STRUCT, null);
propertyList.addProperty(PROPS_USTRING, null);
propertyList.addProperty(NPROPERTIES, null);
propertyList.addProperty(NPROPS, null);
propertyList.addProperty(METAPROPERTIES, null);
propertyList.addProperty(METAPROPERTIES_USTRING, null);
propertyList.addProperty(METAPROPERTIES_STRUCT, null);
propertyList.addProperty(METAPROPS, null);
propertyList.addProperty(METAPROPS_USTRING, null);
propertyList.addProperty(METAPROPS_STRUCT, null);
propertyList.addProperty(DEVICES, null);
propertyList.addProperty(NDEVICES, null);
propertyList.addProperty(DEVDESCRIPTION, null);
propertyList.addProperty(DEVLOCATION, null);
propertyList.addProperty(DEVMASK, null);
propertyList.addProperty(DEVONLINE, null);
propertyList.addProperty(ZPOSITION, null);
propertyList.addProperty(STOCKPROPS, null);
// propertyList.addProperty(PROPERTIES_STRUCT_LEGACY, null);
propertyList.addProperty(STOCKPROPS_STRUCT, null);
propertyList.addProperty(STOCKPROPS_USTRING, null);
propertyList.addProperty(NSTOCKPROPS, null);
propertyList.addProperty(SRVOS, null);
propertyList.addProperty(SRVSTARTTIME, null);
propertyList.addProperty(SRVSTARTTIME_LONG, null);
propertyList.addProperty(SRVVERSION, null);
propertyList.addProperty(STRUCTFORMAT, null);
propertyList.addProperty(BITFIELDFORMAT, null);
propertyList.addProperty(CONTRACTS, null);
propertyList.addProperty(CLIENTS, null);
propertyList.addProperty(CONNECTIONS, null);
propertyList.addProperty(ACTIVITY, null);
propertyList.addProperty(USERS, null);
propertyList.addProperty(IPNETS, null);
propertyList.addProperty(ADDIPNET, null);
propertyList.addProperty(DELIPNET, null);
propertyList.addProperty(NUSERS, null);
propertyList.addProperty(NIPNETS, null);
propertyList.addProperty(ACCESSLOCK, null);
propertyList.addProperty(ADDUSER, null);
propertyList.addProperty(DELUSER, null);
propertyList.addProperty(SRVDESC, null);
propertyList.addProperty(SRVLOCATION, null);
propertyList.addProperty(SRVLASTACCESS, null);
propertyList.addProperty(SRVCOMMANDS, null);
propertyList.addProperty(SRVEXIT, null);
propertyList.addProperty(SRVINIT, null);
propertyList.addProperty(SRVIDLE, null);
propertyList.addProperty(DEBUGLEVEL, null);
propertyList.addProperty(LOGCOMMANDS, null);
propertyList.addProperty(MESSAGE, null);
propertyList.addProperty(SRVALIASLIST, null);
propertyList.addProperty(NALARMS, null);
propertyList.addProperty(ALARMS, null);
propertyList.addProperty(ALARMSEXT, null);
propertyList.addProperty(NALARMDEFS, null);
propertyList.addProperty(ALARMDEFS, null);
propertyList.addProperty(HISTORIES, null);
propertyList.addProperty(HISTORIES_STRUCT, null);
propertyList.addProperty(NHISTORIES, null);
propertyList.addProperty(SRVLOGFILE, null);
propertyList.addProperty(SRVLOGFILES, null);
propertyList.addProperty(LOGFILE, null);
propertyList.addProperty(LOGDEPTH, null);
propertyList.addProperty(MANIFEST, null);
propertyList.addProperty(MANIFESTPATH, null);
propertyList.addProperty(APPDATE, null);
propertyList.addProperty(APPDATE_STRING, null);
propertyList.addProperty(APPVERSION, null);
propertyList.addProperty(SRVSELFTEST, null);
propertyList.addProperty(SRVSTATS, null);
propertyList.addProperty(NALMWATCH, null);
propertyList.addProperty(ALMWATCHTBL, null);
propertyList.addProperty(ADDHISTORY, null);
propertyList.addProperty(SRVCMDLINE, null);
propertyList.addProperty(SRVCWD, null);
propertyList.addProperty(SRVADDR, null);
propertyList.addProperty(SRVRESET, null);
propertyList.addProperty(SRVPID, null);
propertyList.addProperty(SRVSETTINGS, null);
propertyList.addProperty(SRVADMINS, null);
// only add these after the others (otherwise a concurrency problem ensues ...)
fecPropertyList.addProperty(STOCKPROPS, null);
fecPropertyList.addProperty(SRVOS, null);
fecPropertyList.addProperty(SRVSTARTTIME, null);
fecPropertyList.addProperty(SRVVERSION, null);
fecPropertyList.addProperty(STRUCTFORMAT, null);
fecPropertyList.addProperty(BITFIELDFORMAT, null);
fecPropertyList.addProperty(SRVDESC, null);
fecPropertyList.addProperty(SRVLOCATION, null);
fecPropertyList.addProperty(SRVEXIT, null);
fecPropertyList.addProperty(DEBUGLEVEL, null);
fecPropertyList.addProperty(LOGCOMMANDS, null);
fecPropertyList.addProperty(SRVLOGFILE, null);
fecPropertyList.addProperty(SRVLOGFILES, null);
fecPropertyList.addProperty(LOGFILE, null);
fecPropertyList.addProperty(LOGDEPTH, null);
fecPropertyList.addProperty(MANIFEST, null);
fecPropertyList.addProperty(MANIFESTPATH, null);
fecPropertyList.addProperty(APPDATE, null);
fecPropertyList.addProperty(APPVERSION, null);
fecPropertyList.addProperty(SRVSTATS, null);
fecPropertyList.addProperty(SRVSETTINGS, null);
fecPropertyList.addProperty(SRVADMINS, null);
}
public static boolean isStockProperty(String prp)
{
if (prp == null || prp.length() == 0) return false;
String uprp = prp.toUpperCase();
if (propertyList.hasProperty(uprp)) return true;
if (fecPropertyList.hasProperty(uprp)) return true;
return false;
}
/**
* Constructor disabled.
*
*/
private TStockProperties()
{
initPropertyList();
initStructDescription();
new TAlarmMessage();
new TAlarmDefinition();
}
public static int getNumStockProperties()
{
return propertyList.countAllProperties();
}
//TODO Move to separate class
public static String getStockSrvOS()
{
return TInitializerFactory.getInstance().getInitializer().getOs();
}
// TODO Move to separate class
public static String getStockSrvVersion()
{
TInitializer ti = TInitializerFactory.getInstance().getInitializer();
return ti.getVersion()+":"+ti.getBuildId();
}
// TODO Move to separate class
public static String getStockSrvStartup()
{
return TInitializerFactory.getInstance().getInitializer().getSystemStartup();
}
// TODO Move to separate class
public static String getStockSrvCwd()
{
return TInitializerFactory.getInstance().getInitializer().getSystemCwd();
}
// TODO Move to separate class
public static int getStockSrvPid()
{
return TInitializerFactory.getInstance().getInitializer().getPid();
}
/**
* Returns the names of all stock properties
*
* @return
*/
public static Set<String> getPropertyNames()
{
return propertyList.getPropertyNames();
}
}