Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-.NET | API-Java | Examples | Downloads
page generated on 31.05.2023 - 04:45
Public Member Functions | Static Public Member Functions | List of all members
de.desy.tine.server.equipment.TEquipmentModuleFactory Class Reference

Equipment module factory. More...

Public Member Functions

int setSystemAlias (String alias, String name)
 Sets a system alias pair. More...
 
void setAvailableMemoryAlarmThreshold (long minAvailBytes)
 If minAvailBytes > 0 an automatic alarm will be set if the server's available free memory falls below this setting. More...
 
long getAvailableMemoryAlarmThreshold ()
 
int SetFreeBlocksAlarmThreshold (String path, long minFreeBlocks)
 Add given path to the automatic alarm generation tables for low disk space. More...
 
void setSendSingleDelivery (boolean value)
 Sets ability to handle synchronous requests in an 'express' manner. More...
 
boolean getSendSingleDelivery ()
 Gets the current setting for the ability to handle synchronous requests in an 'express' manner. More...
 
int registerCycleTrigger (TCycleTrigger trigger)
 Registers a cycle trigger callback dispatch function. More...
 

Static Public Member Functions

static void setRequireAcknowledgments (boolean value)
 If set to 'true' requires an acknowledgment from a client if data are set out according to DATACHANGE or EVENT criteria. More...
 
static boolean getRequireAcknowledgments ()
 If set to 'true' requires an acknowledgment from a client if data are set out according to DATACHANGE or EVENT criteria. More...
 
static void setServerWaiting (boolean value)
 A server can be toggled in and out of a waiting state with this method. More...
 
static void setRenewalLength (short value)
 A server can explicitly set the contract subscription renewal length with this call. More...
 
static int getPortOffset (String fecName)
 Obtains the FEC port offset appropriate for the give FEC name. More...
 

Detailed Description

Equipment module factory.

The equipment module factory maintains a list of registered equipment modules in a running TINE server process. It manages all access and scheduling of the associated dispatch and property handlers as well as local history and alarm access.

Author
duval

Member Function Documentation

◆ getAvailableMemoryAlarmThreshold()

long de.desy.tine.server.equipment.TEquipmentModuleFactory.getAvailableMemoryAlarmThreshold ( )
Returns
the current alarm threshold setting

◆ getPortOffset()

static int de.desy.tine.server.equipment.TEquipmentModuleFactory.getPortOffset ( String  fecName)
static

Obtains the FEC port offset appropriate for the give FEC name.

In cases where the pure registration API routines are used to register FEC and server information (as opposed to a common fecid.csv configuration file) it is often a more cumbersome task to ensure a unique FEC port on the host machine. This routine can be used to this end. It will search the existing FEC manifest on the current host in order to find the matching entry for the given FEC name. If the entry is not found, then the 'next free port' is returned. In this way the FEC can always register with its own proper FEC port, without the need to hard code this number.

If this routine is called after the server is running and the FEC name is not found in the manifest the -name_unknown is returned.

Parameters
fecNameis the targeted FEC name for which a port offset is to be assigned.
Returns
a positive port offset which is valid for the FEC name given or a negative TINE error code on error (e.g. a null fecName parameter).

example

// assuming I've instanciated my EQM ...
// get the proper port for the FEC name "MYFEC"
int port = TEquipmentModuleFactory.getPortOffset("MYFEC");
// get a reference to the EQM factory
thisEqmFactory = myEqpModule.getTEqmFactory();
// initialize the FEC (starts all services, reads configuration databases, etc.)
thisEqmFactory.systemInit("MYFEC",port,"MyTestServer"); // initialize the FEC
// ...

References de.desy.tine.dataUtils.TDataTime.getDataTimeStamp().

◆ getRequireAcknowledgments()

static boolean de.desy.tine.server.equipment.TEquipmentModuleFactory.getRequireAcknowledgments ( )
static

If set to 'true' requires an acknowledgment from a client if data are set out according to DATACHANGE or EVENT criteria.

Returns
the current setting (default = 'true')

◆ getSendSingleDelivery()

boolean de.desy.tine.server.equipment.TEquipmentModuleFactory.getSendSingleDelivery ( )

Gets the current setting for the ability to handle synchronous requests in an 'express' manner.

If set to 'true' (default) then incoming synchronous requests are handled immediately without scanning an collating the current contract table

Returns
the current setting

◆ registerCycleTrigger()

int de.desy.tine.server.equipment.TEquipmentModuleFactory.registerCycleTrigger ( TCycleTrigger  trigger)

Registers a cycle trigger callback dispatch function.

If a CYCLER is running in a server's context, then the server will receive 'Cycle Number' events scheduled by the designated CYCLER server. The cycle number will make use of the 'System Data Stamp' to tag all data sets obtained from the server. A server can also register a trigger function dispatch routine (or routines) to be called when a 'Cycle Number' event occurs. The dispatch routines will be called prior to setting the 'System Stamp' to the new Cycle Number, which will be set following the execution of all dispatch routines. Optionally, the server can provide a property (or list of properties) to be scheduled following the dispatch execution. This will ensure that such properties will be called immediately following dispatch execution AND contain the most recent Cycle Number as the 'System Data Stamp'.

Parameters
triggeris a reference to the dispatch handler to be called when a new cycle number arrives.
Returns
0 upon success or TErrorList.already_assigned

Example:

class MyCycleTrigger implements TCycleTrigger
{
long ts = 0;
public void update(int cycleNumber, int status)
{
long tts = System.currentTimeMillis();
if (ts == tts)
{ // 2 updates within the same millisecond ? (are there 2 CYCLERs?)
return;
}
ts = tts;
DbgLog.log("update","received cycle number : "+cycleNumber+" <"+status+">");
// do something useful? (maybe hardware IO)
}
}
private void initializeDeviceServer()
{
sineEqpModule = new SineEquipmentModule("SINEQM",(SineDevice[])sineDeviceSet.toArray(new SineDevice[0]));
sineEqpModule.registerCycleTrigger(new MyCycleTrigger());
// can alternatively be registered directly with the equipment module factory (e.g.):
// TEquipmentModuleFactory.getInstance().registerCycleTrigger(new MyCycleTrigger());
// Other iniatialization stuff omitted ...
// ...
}

Referenced by de.desy.tine.server.equipment.TEquipmentModule.registerCycleTrigger().

◆ setAvailableMemoryAlarmThreshold()

void de.desy.tine.server.equipment.TEquipmentModuleFactory.setAvailableMemoryAlarmThreshold ( long  minAvailBytes)

If minAvailBytes > 0 an automatic alarm will be set if the server's available free memory falls below this setting.

Parameters
minAvailBytesis the desired alarm threshold in bytes

◆ SetFreeBlocksAlarmThreshold()

int de.desy.tine.server.equipment.TEquipmentModuleFactory.SetFreeBlocksAlarmThreshold ( String  path,
long  minFreeBlocks 
)

Add given path to the automatic alarm generation tables for low disk space.

A server can instruct the local alarm subsystem to automatically generate low disk space warnings and alarms by making use of this method.

Parameters
pathis the path containing the disk drive or device mount which is to be monitored for available disk space
minFreeBlocksis the minimum number of free blocks (1000 byte units) which must be available. If the available disk space goes below this value a 'warn_disk_space' alarm is issued. If the available disk space goes below 10 percent of this value a 'low_disk_space' alarm is issued.
Returns
0 upon success or a TINE error code.

For example:

TEquipmentModuleFactory.getInstance().SetFreeBlocksAlarmThreshold("L:/history", 50000000L);

will cause disk space alarms to occur if the drive "L:" (windows system) shows fewer than 50000000 blocks (i.e. 50000000000 bytes) available.

◆ setRenewalLength()

static void de.desy.tine.server.equipment.TEquipmentModuleFactory.setRenewalLength ( short  value)
static

A server can explicitly set the contract subscription renewal length with this call.

Subscriptions generally have a set duration length of 60 at 'normal' polling intervals, which is periodically renewed by the client. Under some circumstances (e.g. the server expects 'CM_EVENT' acquisition mode and knows that the event interval is small) the server will want to explicitly set the duration length to some larger value.

Parameters
valueis the desired contact subscription renewal length

◆ setRequireAcknowledgments()

static void de.desy.tine.server.equipment.TEquipmentModuleFactory.setRequireAcknowledgments ( boolean  value)
static

If set to 'true' requires an acknowledgment from a client if data are set out according to DATACHANGE or EVENT criteria.

Parameters
valueis the desired setting (default = 'true')

◆ setSendSingleDelivery()

void de.desy.tine.server.equipment.TEquipmentModuleFactory.setSendSingleDelivery ( boolean  value)

Sets ability to handle synchronous requests in an 'express' manner.

If set to 'true' (default) then incoming synchronous requests are handled immediately without scanning an collating the current contract table

Parameters
valueis the desired setting (default = true)
See also
getSendSingleDelivery()

◆ setServerWaiting()

static void de.desy.tine.server.equipment.TEquipmentModuleFactory.setServerWaiting ( boolean  value)
static

A server can be toggled in and out of a waiting state with this method.

During initialization it might be prudent to set the waiting state to 'true' until all initialization has been completed and the server is ready to server, at which point the waiting state can then be set to 'false'.

If the server is in a waiting state, all requests will receive the error code 'not initialized' as the link status.

Parameters
valueis the wait state.

◆ setSystemAlias()

int de.desy.tine.server.equipment.TEquipmentModuleFactory.setSystemAlias ( String  alias,
String  name 
)

Sets a system alias pair.

An alias can be established for any registered property or device via this method call.

Parameters
aliasis an alias name which can be used for the registered device or property given.
nameis the targeted registered device or property for which an alias is desired.
Returns
0 if successful or a tine error code.

The documentation for this class was generated from the following file: