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 | Protected Member Functions | List of all members
de.desy.tine.client.TLinkFactory Class Reference

TLinkFactory.java. More...

Public Member Functions

int getBlackListedLinkStatus (TLink lnk)
 Returns the original link status which caused the link to be black listed. More...
 
void setUserType (String type)
 Set the application type string. More...
 
String getUserName ()
 Gets the user name seen in all link requests from this client application. More...
 
void setUserName (String userName)
 Sets the user name seen in all link requests to that specified. More...
 
void closeBackgroundGlobalsLinks ()
 unpins and closes any background globals links that were started due to synchronous calls to a known globals server.
 
TLink simpleLink (String devname, String devproperty, TDataType dout, TDataType din, short devaccess)
 Put a new TLink in the link table. More...
 

Static Public Member Functions

static int setAccessLock (String context, String server, AccessLockType lockType, int lockDuration)
 Acquires an access lock to the server specified. More...
 
static int setAccessLock (String context, String server, AccessLockType lockType, int lockDuration, int lockFlags)
 Acquires an access lock to the server specified. More...
 
static void removeAccessLock (String context, String server)
 removes an access lock on the server specified. More...
 
static synchronized TLinkFactory getInstance ()
 Insert the method's description here. More...
 

Protected Member Functions

void removeTLink (TLink lnk)
 Remove a TLink from the link table Removes a TLink from the link table by setting the entry explicitly to null. More...
 

Detailed Description

TLinkFactory.java.

User interface calls to access available methods from the TLink factory

The available public methods from the TLink factory singleton generally involve configuration settings affecting performance, memory (table capacities) and behavior.

Member Function Documentation

◆ getBlackListedLinkStatus()

int de.desy.tine.client.TLinkFactory.getBlackListedLinkStatus ( TLink  lnk)

Returns the original link status which caused the link to be black listed.

Parameters
lnkis the TLink for which the black listed status is desired
Returns
the black listed link status (or invalid_link if the link has not been blacklisted)

Referenced by de.desy.tine.client.TLink.execute().

◆ getInstance()

static synchronized TLinkFactory de.desy.tine.client.TLinkFactory.getInstance ( )
static

◆ getUserName()

String de.desy.tine.client.TLinkFactory.getUserName ( )

Gets the user name seen in all link requests from this client application.

Returns
the current user name setting

◆ removeAccessLock()

static void de.desy.tine.client.TLinkFactory.removeAccessLock ( String  context,
String  server 
)
static

removes an access lock on the server specified.

A client application can obtain an access lock to the given server provided the caller has WRITE privileges himself. Once the lock is obtained, no other process will be allowed WRITE access regardless of any other access control lists. A lock may be preemptive (LOCK_PREEMTIVE) or persistent (LOCK_PERSISTENT). Preemptive locks may be aborted (LOCK_ABORT) by other callers with WRITE privileges. Persistent locks may not. A client can free a lock he has obtained by calling this method (nominally equivalent to setAccessLock() + AccessLockType.LOCK_CANCEL.

Parameters
contextis the targeted context of the server
serveris the targeted device server
Returns
a tine return code

example:

// ...
String[] lckinfo = TQuery.getAccessLockInformation("PETRA","MagnetServer");
if (lckinfo[0].length() > 0)
{ // someone has a lock already
System.out.println("MagnetServer locked by "+lckinfo[0]+" at address "+lckinfo[1]+" ("+lckinfo[2]+")");
return;
}
int cc = TLinkFactory.setAccessLock("PETRA","MagnetServer", TLinkFactory.AccessLockType.LOCK_PERSISTENT, 60);
if (cc == 0)
{ // I now have omplete control !
// do something meaningful ....
// ...
}
else
{
System.out.println("setAccessLock: "+TErrorList.getErrorString(cc));
}
// finished with the lock
TLinkFactory.removeAccessLock("PETRA","MagnetServer");
// ...

References de.desy.tine.client.TLinkFactory.setAccessLock().

Referenced by de.desy.tine.queryUtils.TQuery.removeAccessLock().

◆ removeTLink()

void de.desy.tine.client.TLinkFactory.removeTLink ( TLink  lnk)
protected

Remove a TLink from the link table Removes a TLink from the link table by setting the entry explicitly to null.

If the link is a TCP/IP link then the termination flag is reset to false in order to give the terminateBucket thread a chance to clean up the connection.

Referenced by de.desy.tine.client.TLink.close().

◆ setAccessLock() [1/2]

static int de.desy.tine.client.TLinkFactory.setAccessLock ( String  context,
String  server,
AccessLockType  lockType,
int  lockDuration 
)
static

Acquires an access lock to the server specified.

A client application can obtain an access lock to the given server provided the caller has WRITE privileges himself. Once the lock is obtained, no other process will be allowed WRITE access regardless of any other access control lists. A lock may be preemptive (LOCK_PREEMTIVE) or persistent (LOCK_PERSISTENT). Preemptive locks may be aborted (LOCK_ABORT) by other callers with WRITE privileges. Persistent locks may not.

Parameters
contextis the targeted context of the server
serveris the targeted device server
lockTypeis the desired lock type: one of AccessLockType.LOCK_CANCEL, AccessLockType.LOCK_PREEPMTIVE, AccessLockType.LOCK_PERSISTENT or AccessLockType.LOCK_ABORT.
lockDurationis the requested duration of the lock in seconds. This applies only to preemptive locks. Persistent locks will ignore this parameter and continue to renew the lock until the caller cancels the lock (graceful) or disappears (maximum 60 second wait).
Returns
a tine return code

example:

// ...
String[] lckinfo = TQuery.getAccessLockInformation("PETRA","MagnetServer");
if (lckinfo[0].length() > 0)
{ // someone has a lock already
System.out.println("MagnetServer locked by "+lckinfo[0]+" at address "+lckinfo[1]+" ("+lckinfo[2]+")");
return;
}
int cc = TLinkFactory.setAccessLock("PETRA","MagnetServer", TLinkFactory.AccessLockType.LOCK_PERSISTENT, 60);
if (cc == 0)
{ // I now have omplete control !
// do something meaningful ....
// ...
}
else
{
System.out.println("setAccessLock: "+TErrorList.getErrorString(cc));
}
// finished with the lock
TLinkFactory.removeAccessLock("PETRA","MagnetServer");
// ...

Referenced by de.desy.tine.client.TLinkFactory.removeAccessLock(), and de.desy.tine.queryUtils.TQuery.setAccessLock().

◆ setAccessLock() [2/2]

static int de.desy.tine.client.TLinkFactory.setAccessLock ( String  context,
String  server,
AccessLockType  lockType,
int  lockDuration,
int  lockFlags 
)
static

Acquires an access lock to the server specified.

A client application can obtain an access lock to the given server provided the caller has WRITE privileges himself. Once the lock is obtained, no other process will be allowed WRITE access regardless of any other access control lists. A lock may be preemptive (LOCK_PREEMTIVE) or persistent (LOCK_PERSISTENT). Preemptive locks may be aborted (LOCK_ABORT) by other callers with WRITE privileges. Persistent locks may not.

Parameters
contextis the targeted context of the server
serveris the targeted device server
lockTypeis the desired lock type: one of AccessLockType.LOCK_CANCEL, AccessLockType.LOCK_PREEPMTIVE, AccessLockType.LOCK_PERSISTENT or AccessLockType.LOCK_ABORT.
lockDurationis the requested duration of the lock in seconds. This applies only to preemptive locks. Persistent locks will ignore this parameter and continue to renew the lock until the caller cancels the lock (graceful) or disappears (maximum 60 second wait).
lockFlagscan contain optional access lock flags such as LOCK_XREAD (exclusive read).
Returns
a tine return code

References de.desy.tine.client.TLinkFactory.getInstance().

◆ setUserName()

void de.desy.tine.client.TLinkFactory.setUserName ( String  userName)

Sets the user name seen in all link requests to that specified.

Parameters
userNameis the desired user name setting

◆ setUserType()

void de.desy.tine.client.TLinkFactory.setUserType ( String  type)

Set the application type string.

Parameters
typeis the desired type string (default = 'JAVA')

◆ simpleLink()

TLink de.desy.tine.client.TLinkFactory.simpleLink ( String  devname,
String  devproperty,
TDataType  dout,
TDataType  din,
short  devaccess 
)

Put a new TLink in the link table.


Calling this method directly bypasses various system checks for cdi hooks, duplicate links, etc.
A direct call is generally used internally for address queries from the ENS.

Returns
TLink

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