TIBCO FTL®
|
The class FTL is the first entry point of an FTL program. More...
Static Public Member Functions | |
static void | Close () |
This call closes (that is, terminates) FTL within your program, and reclaims unmanaged resources. More... | |
static IRealm | ConnectToRealmServer (String ServerUrl, String AppName, ITibProperties Properties) |
Connect to a realm server, and create a realm object. More... | |
static ITibProperties | CreateProperties () |
Create an empty property list object without any default values. More... | |
static bool | IsOpen () |
This method is for TIBCO internal use only. More... | |
static void | SetLogFiles (String filePrefix, long maxFileSize, int maxFiles, ITibProperties properties) |
Arrange rotating log files. More... | |
static void | SetLogHandler (ILogHandler logHandler, ITibProperties properties) |
Register a global log handler. More... | |
Public Attributes | |
const int | EVENTQUEUE_DISCARD_NEW = 2 |
Discard new events, instead of adding them to the queue. More... | |
const int | EVENTQUEUE_DISCARD_NONE = 0 |
Do not discard events (default behavior). More... | |
const int | EVENTQUEUE_DISCARD_OLD = 1 |
Discard old events from the head of the queue. More... | |
Static Public Attributes | |
static readonly string | BUILTIN_MSG_FMT_KEY_FIELDNAME = "_key" |
Built-in field name of the key field in a keyed opaque message. More... | |
static readonly long | BUILTIN_MSG_FMT_KEY_MAXLEN = 255 |
Maximum length (in bytes) of the key field of a keyed opaque message. More... | |
static readonly string | BUILTIN_MSG_FMT_KEYED_OPAQUE = "_keyed_opaque" |
Built-in format name for keyed opaque messages. More... | |
static readonly string | BUILTIN_MSG_FMT_OPAQUE = "_default_opaque" |
Built-in format name for opaque messages. More... | |
static readonly string | BUILTIN_MSG_FMT_OPAQUE_FIELDNAME = "_data" |
Built-in field name of the data field in an opaque message or a keyed opaque message More... | |
static readonly long | BUILTIN_MSG_FMT_OPAQUE_MAXSIZE = 12000 |
Maximum efficient length (in bytes) of a built-in opaque message. More... | |
static readonly string | EVENTQUEUE_PROPERTY_BOOL_INLINE_MODE = "com.tibco.ftl.client.inline" |
Inline mode (low-latency); boolean. More... | |
static readonly string | EVENTQUEUE_PROPERTY_INT_DISCARD_POLICY = "com.tibco.ftl.client.discard.policy" |
Discard policy; integer. More... | |
static readonly string | EVENTQUEUE_PROPERTY_INT_DISCARD_POLICY_DISCARD_AMOUNT = "com.tibco.ftl.client.discard.amount" |
Discard amount; integer. More... | |
static readonly string | EVENTQUEUE_PROPERTY_INT_DISCARD_POLICY_MAX_EVENTS = "com.tibco.ftl.client.discard.max_events" |
Max events; integer. More... | |
static readonly string | EVENTQUEUE_PROPERTY_STRING_NAME = "com.tibco.ftl.client.queue.name" |
Queue name; string. More... | |
static readonly string | LOG_LEVEL_DEBUG = "debug" |
Debug – output trace entries for all events (debug, verbose, information, warning and severe events). See LogLevel. More... | |
static readonly string | LOG_LEVEL_INFO = "info" |
Info – output trace entries for information, warning and severe events. See LogLevel. More... | |
static readonly string | LOG_LEVEL_OFF = "off" |
Off – disable all tracing. See LogLevel. More... | |
static readonly string | LOG_LEVEL_SEVERE = "severe" |
Severe – output trace entries only for severe events. See LogLevel. More... | |
static readonly string | LOG_LEVEL_VERBOSE = "verbose" |
Verbose – output trace entries for verbose, information, warning and severe events. See LogLevel. More... | |
static readonly string | LOG_LEVEL_WARN = "warn" |
Warn – output trace entries for warning and severe events. See LogLevel. More... | |
static readonly string | PUBLISHER_PROPERTY_BOOL_RELEASE_MSGS_TO_SEND = "com.tibco.ftl.client.publisher.release" |
Ownership of outbound messages; boolean. More... | |
static readonly string | PUBLISHER_PROPERTY_DOUBLE_PERSISTENCE_RETRY_DURATION = "com.tibco.ftl.client.publisher.persistence.retry.duration" |
Retry duration for persistent publisher operations; double. More... | |
static readonly string | PUBLISHER_PROPERTY_STRING_LABEL = "com.tibco.ftl.client.publisher.label" |
Property name for a publisher label; string More... | |
static readonly string | REALM_PROPERTY_DOUBLE_CONNECT_INTERVAL = "com.tibco.ftl.client.interval" |
Property name for the interval between connection attempts; double. More... | |
static readonly long | REALM_PROPERTY_HTTPS_CONNECTION_TRUST_EVERYONE = 0 |
Trust any realm server; property value constant. More... | |
static readonly long | REALM_PROPERTY_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_FILE = 1 |
Trust a realm server if its certificate is in a trust file; property value constant. More... | |
static readonly long | REALM_PROPERTY_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_STRING = 2 |
Trust a realm server if its certificate is in a trust string; property value constant. More... | |
static readonly string | REALM_PROPERTY_LONG_CONNECT_RETRIES = "com.tibco.ftl.client.retries" |
Property name for number of connection attempts; long. More... | |
static readonly string | REALM_PROPERTY_LONG_TRUST_TYPE = "com.tibco.ftl.trust.type" |
Property name for secure realm server trust type; long. More... | |
static readonly string | REALM_PROPERTY_STRING_APPINSTANCE_IDENTIFIER = "com.tibco.ftl.client.appinstance.identifier" |
Property name for application instance identifier; string. More... | |
static readonly string | REALM_PROPERTY_STRING_CLIENT_LABEL = "com.tibco.ftl.client.label" |
Property name for client label; string. More... | |
static readonly string | REALM_PROPERTY_STRING_SECONDARY_SERVER = "com.tibco.ftl.client.secondary" |
Property name for URL of backup realm server for fault tolerance; string. More... | |
static readonly string | REALM_PROPERTY_STRING_TRUST_FILE = "com.tibco.ftl.trust.file" |
Property name for secure realm server trust file; string. More... | |
static readonly string | REALM_PROPERTY_STRING_TRUST_PEM_STRING = "com.tibco.ftl.trust.pem.string" |
Property name for secure realm server trust data; string. More... | |
static readonly string | REALM_PROPERTY_STRING_USERNAME = "com.tibco.ftl.client.username" |
Property name for realm server username; string. More... | |
static readonly string | REALM_PROPERTY_STRING_USERPASSWORD = "com.tibco.ftl.client.userpassword" |
Property name for realm server password; string. More... | |
static readonly string | SUBSCRIBER_PROPERTY_BOOL_EXPLICIT_ACK = "com.tibco.ftl.client.subscriber.explicitack" |
Explicit acknowledgement; boolean. More... | |
static readonly string | SUBSCRIBER_PROPERTY_BOOL_RELEASE_MSGS_TO_CALLBACK = "com.tibco.ftl.client.subscriber.release" |
Ownership of inbound messages; boolean. More... | |
static readonly string | SUBSCRIBER_PROPERTY_DOUBLE_PERSISTENCE_RETRY_DURATION = "com.tibco.ftl.client.subscriber.persistence.retry.duration" |
Retry duration for persistent subscriber operations; double. More... | |
static readonly string | SUBSCRIBER_PROPERTY_STRING_DURABLE_NAME = "com.tibco.ftl.client.durable.name" |
Durable name property; string. More... | |
static readonly string | SUBSCRIBER_PROPERTY_STRING_KEY_FIELD_NAME = "com.tibco.ftl.client.subscriber.keyfieldname" |
Key field name for a dynamic last-value durable; string. More... | |
static readonly string | SUBSCRIBER_PROPERTY_STRING_LABEL = "com.tibco.ftl.client.subscriber.label" |
Property name for a subscriber label; string More... | |
static readonly string | SUBSCRIBER_PROPERTY_STRING_NAME = "com.tibco.ftl.client.subscriber.name" |
Static durable subscriber name property; string. More... | |
static readonly string | TIBMAP_PROPERTY_DOUBLE_PERSISTENCE_RETRY_DURATION = "com.tibco.ftl.client.map.persistence.retry.duration" |
Retry duration for map operations; double. More... | |
Properties | |
static String | LogLevel [set] |
Set the FTL log trace level. More... | |
static String | Version [get] |
Version of the FTL class library. More... | |
The class FTL is the first entry point of an FTL program.
Programs use the class FTL to create IRealm and ITibProperties objects, and to set log levels.
Programmers can expect all public methods of FTL interfaces to throw either FTLException, or a more specific subclass.
Programs do not instantiate this class.
|
inlinestatic |
This call closes (that is, terminates) FTL within your program, and reclaims unmanaged resources.
Programs must not call Close
within a callback.
Programs must Dispose
IRealm objects before closing FTL.
|
inlinestatic |
Connect to a realm server, and create a realm object.
The realm server defines information about endpoints, transports and formats, which lets applications communicate within a realm. The realm object is a local copy (within your program) of the subset of the realm information that pertains to your application.
Note: It is good practice that each application process maintain only one connection to each relevant realm server. Realm objects are thread-safe; you can safely use the same realm object in all the threads of an application program. Do not duplicate connections to the same realm server in several threads, which would duplicate the realm object.
ServerUrl | The call contacts the realm server at this URL. |
AppName | The call sends this application name to the realm server. The server responds with an application-specific subset of the realm information. To use the default application, supply null. |
Properties | Properties configure interaction with the realm server. Required for connecting to a secure realm server, for authentication, and for fault tolerance. Otherwise optional; to omit, supply null.
|
On success, this method returns a realm object.
On failure, this method returns null.
|
inlinestatic |
Create an empty property list object without any default values.
As a mechanism for configuring objects, some FTL creation calls accept a properties object, which contains paired property names and values.
|
inlinestatic |
This method is for TIBCO internal use only.
This method will be removed from the public interface in a future release.
|
inlinestatic |
Arrange rotating log files.
The filename extension .0
indicates the current log file. Rotation shifts each file by incrementing its numeric extension. If the number of files would exceed the maximum, rotation deletes the oldest file.
filePrefix | All log files begin with this filename prefix. |
maxFileSize | FTL rotates the log files when the current log file exceeds this limit (in bytes). This value must be greater than 102400 (100 kilobytes). |
maxFiles | FTL limits the number of log files to this maximum. |
properties | Reserved for future use. To ensure forward compatibility, programmers must supply null. |
|
inlinestatic |
Register a global log handler.
If you register a log handler (at most one), then FTL directs all log statements to that handler.
logHandler | FTL invokes this log handler to process all log statements. |
properties | Reserved for future use. To ensure forward compatibility, programmers must supply null. |
|
static |
Built-in field name of the key field in a keyed opaque message.
|
static |
Maximum length (in bytes) of the key field of a keyed opaque message.
|
static |
Built-in format name for keyed opaque messages.
Keyed opaque messages contain only a character string and a byte-string. Content matchers can match against the key field (character string).
This format name is valid as an argument to IRealm.CreateMessage(string).
|
static |
Built-in format name for opaque messages.
Opaque messages contain only a byte-string.
This format name is valid as an argument to IRealm.CreateMessage(string).
|
static |
Built-in field name of the data field in an opaque message or a keyed opaque message
|
static |
Maximum efficient length (in bytes) of a built-in opaque message.
Larger payloads are less efficient.
This threshold also limits the total length of a keyed opaque message (including the key string, its null terminator, and the opaque data).
const int TIBCO.FTL.FTL.EVENTQUEUE_DISCARD_NEW = 2 |
Discard new events, instead of adding them to the queue.
const int TIBCO.FTL.FTL.EVENTQUEUE_DISCARD_NONE = 0 |
Do not discard events (default behavior).
const int TIBCO.FTL.FTL.EVENTQUEUE_DISCARD_OLD = 1 |
Discard old events from the head of the queue.
|
static |
Inline mode (low-latency); boolean.
Programs that receive time-sensitive messages can use inline mode to favor low latency over high throughput. Inline mode reduces inbound message latency using inline transport I/O in the same thread as the ISubscriberListener callback method.
Inline mode requires that callback methods always return quickly; otherwise, long callbacks can delay message I/O (defeating the purpose of inline mode).
Inline mode could reduce the average number of messages in the vectors that the callback receives.
It is good practice to dispatch an inline queue from only one thread. Dispatching an inline-mode queue from several threads could result in actual wait times that are longer than the dispatch timeout arguments. For example, if thread A dispatches with timeout 10 seconds, and thread B dispatches with timeout 15 seconds, then the timer for thread B does not start until after the dispatch call returns in thread A. The apparent timeout for thread B could be as long as 25 seconds.
When specifying inline mode, programmers must coordinate with administrators to avoid illegal state exceptions.
To enable inline mode, pass this property to IRealm.CreateEventQueue(ITibProperties) with value true
. Otherwise, the default behavior disables inline mode.
|
static |
Discard policy; integer.
This property determines the behavior of the queue on overflow (too many events).
To enable discard on overflow, pass this property to IRealm.CreateEventQueue(ITibProperties). Otherwise, the default behavior disables discard.
These members are the legal values:
|
static |
Discard amount; integer.
When a queue overflows, this property determines the number of events to discard.
If you specify FTL.EVENTQUEUE_DISCARD_OLD, you may also specify this value. The value must be less than FTL.EVENTQUEUE_PROPERTY_INT_DISCARD_POLICY_MAX_EVENTS. When absent, the default value is 1.
If you specify FTL.EVENTQUEUE_DISCARD_NEW, then IRealm.CreateEventQueue(ITibProperties) ignores this value. Discarding new events always discards exactly enough events so that the rest fit on the queue.
|
static |
Max events; integer.
When distributing an event to the queue would overflow this limit, the queue discards events.
If you specify a discard policy that could actually discard events, then you must also specify a value for this maximum.
|
static |
Queue name; string.
It is good practice to assign a unique name to each event queue (that is, unique within the program). If the queue discards events, the advisory message identifies the queue using this name, which can help diagnose the issue.
|
static |
Debug – output trace entries for all events (debug, verbose, information, warning and severe events). See LogLevel.
|
static |
Info – output trace entries for information, warning and severe events. See LogLevel.
|
static |
Off – disable all tracing. See LogLevel.
|
static |
Severe – output trace entries only for severe events. See LogLevel.
|
static |
Verbose – output trace entries for verbose, information, warning and severe events. See LogLevel.
|
static |
Warn – output trace entries for warning and severe events. See LogLevel.
|
static |
Ownership of outbound messages; boolean.
When false
or absent, client program code retains ownership of outbound messages that it sends through this publisher.
When true
, the FTL library accepts ownership of outbound messages that the client sends through this publisher. Client code releases the message object when it invokes the send call; from that moment onward, client code must not reference the message object, because the FTL library can destroy the message object at any time.
Client code can release a message only if client owns the message. In particular, if a subscriber does not release its messages to the callback, then the callback must not send it through a publisher that releases messages. (See FTL.SUBSCRIBER_PROPERTY_BOOL_RELEASE_MSGS_TO_CALLBACK.)
|
static |
Retry duration for persistent publisher operations; double.
When IRealm.CreatePublisher(string, ITibProperties), IPublisher.Send(IMessage), IPublisher.Send(IMessage[]), or IPublisher.Send(IMessage[], int) cannot access the persistence server (usually because of network failure or quorum unavailability), they can automatically retry the interaction. The value of this property determines the retry behavior. Supply it to the publisher create call.
Values:
Closing the publisher or the realm supersedes and cancels retry behavior.
|
static |
Property name for a publisher label; string
It is good practice to include this property in every publisher create call. Monitoring data incorporates these labels so administrators can identify and distinguish among publishers. Use labels that reveal the unique role and identity of each publisher within the application program.
The library does not use labels internally.
|
static |
Property name for the interval between connection attempts; double.
When connecting to a realm server, supply this property to FTL.ConnectToRealmServer.
The connect call waits this interval (in seconds) between connection attempts.
The default value is 1.0.
|
static |
Trust any realm server; property value constant.
This constant is one possible value of the property REALM_PROPERTY_LONG_TRUST_TYPE in the method FTL.ConnectToRealmServer.
The client trusts any realm server without verifying trust in the server's certificate. Do not use this value except for convenience in development and testing. It is not secure.
|
static |
Trust a realm server if its certificate is in a trust file; property value constant.
This constant is one possible value of the property REALM_PROPERTY_LONG_TRUST_TYPE in the method FTL.ConnectToRealmServer.
The client trusts the realm server based on the trust file created by the realm server and distributed by the administrator.
Specify the file path of the trust file in the property REALM_PROPERTY_STRING_TRUST_FILE.
|
static |
Trust a realm server if its certificate is in a trust string; property value constant.
This constant is one possible value of the property REALM_PROPERTY_LONG_TRUST_TYPE in the method FTL.ConnectToRealmServer.
The client trusts the realm server based on a trust string.
Specify the trust string in the property REALM_PROPERTY_STRING_TRUST_PEM_STRING.
|
static |
Property name for number of connection attempts; long.
When connecting to a realm server, supply this property to FTL.ConnectToRealmServer.
If the connect call cannot connect to the realm server after this maximum number of connection attempts, it fails with an exception.
The default value is 5.
|
static |
Property name for secure realm server trust type; long.
When connecting to a secure realm server, supply this property to FTL.ConnectToRealmServer. Its value determines trust in the realm server's certificate.
|
static |
Property name for application instance identifier; string.
It is good practice to include this property in the realm connect call of every application program. It gives administrators flexible control over application deployment and over the transports that carry message traffic.
For example, the program obtains the application identifier as a command line argument (or through another configuration mechanism). If an application identifier is present, then the program passes it to FTL.ConnectToRealmServer as the value of this property.
Within the realm, administrators can define one or more application instances, which tailor the connections between endpoints and transports. The value of this property selects from among those instances.
|
static |
Property name for client label; string.
It is good practice to include this property in the realm connect call of every application program. Administrators can use client labels in monitoring and management to recognize and distinguish among processes.
For example, the program obtains the client label as a command line argument (or through another configuration mechanism). If a client label is present, then the program passes it to FTL.ConnectToRealmServer as the value of this property.
|
static |
Property name for URL of backup realm server for fault tolerance; string.
Supply this property to FTL.ConnectToRealmServer. The realm object attempts to connect to a backup server at this URL if it cannot connect to its regular server.
|
static |
Property name for secure realm server trust file; string.
When connecting to a secure realm server, supply this property to FTL.ConnectToRealmServer.
If the realm connect call specifies the trust type as REALM_PROPERTY_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_FILE, use this property to indicate the location of the trust file.
|
static |
Property name for secure realm server trust data; string.
When connecting to a secure realm server, supply this property to FTL.ConnectToRealmServer.
If the realm connect call specifies the trust type as REALM_PROPERTY_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_STRING, use this property to supply the trust string in PEM format.
|
static |
Property name for realm server username; string.
Supply this property to FTL.ConnectToRealmServer which identifies your program to the realm server with the username value you supply.
|
static |
Property name for realm server password; string.
Supply this property to FTL.ConnectToRealmServer, which identifies your program to the realm server with the password value you supply.
|
static |
Explicit acknowledgement; boolean.
A durable subscriber can acknowledge message receipt to its durable (in the persistence store) in either of two ways:
To enable explicit acknowledgement mode, pass this property to IRealm.CreateSubscriber(string, ITibProperties) with value true
. Otherwise, the default behavior is automatic acknowledgement.
|
static |
Ownership of inbound messages; boolean.
When false
or absent, the FTL library retains ownership of inbound messages that arrive through this subscriber. The library automatically destroys each message after the callback returns.
When true
, client program code accepts ownership of inbound messages that arrive through this subscriber. The FTL library releases the message object when it dispatches the message to the client's callback. The callback can pass this message to another program thread. Client program code must explicitly destroy the message object.
|
static |
Retry duration for persistent subscriber operations; double.
When IRealm.CreateSubscriber(string, ITibProperties) or IMessage.Acknowledge() cannot access the persistence server (usually because of network failure or quorum unavailability), they can automatically retry the interaction. The value of this property determines the retry behavior. Supply it to the subscriber create call.
Values:
Closing the subscriber or the realm supersedes and cancels retry behavior.
|
static |
Durable name property; string.
To request messages from a persistence store, supply a durable name as the value of this property in a IRealm.CreateSubscriber(string, ITibProperties) call.
If a static or dynamic durable with this name already exists, the new subscriber draws messages from that durable.
Otherwise, the store creates a new dynamic durable with this name.
If this property is present, it overrides the FTL.SUBSCRIBER_PROPERTY_STRING_NAME property.
|
static |
Key field name for a dynamic last-value durable; string.
When creating or subscribing to a dynamic last-value durable, this property is required. Supply the name of the last-value durable's key field as the value of this property.
The subscriber's content matcher must match the key field against a specific value.
|
static |
Property name for a subscriber label; string
It is good practice to include this property in every subscriber create call. Monitoring data incorporates these labels so administrators can identify and distinguish among subscribers. Use labels that reveal the unique role and identity of each subscriber within the application program.
The library does not use labels internally.
|
static |
Static durable subscriber name property; string.
To request messages from static durable in a persistence store, programs may supply a subscriber name as the value of this property in a IRealm.CreateSubscriber(string, ITibProperties) call.
If FTL.SUBSCRIBER_PROPERTY_STRING_DURABLE_NAME is present, it overrides this property.
If neither this property nor FTL.SUBSCRIBER_PROPERTY_STRING_DURABLE_NAME is present, then the create call uses the default durable subscriber name (_default
).
|
static |
Retry duration for map operations; double.
When IRealm.CreateMap(String, String, ITibProperties), ITibMap.Set(string, IMessage), ITibMap.Get(string), or ITibMap.Remove(string) (with lock or without lock) cannot access the persistence server (usually because of network failure or quorum unavailability), they can automatically retry the interaction. The value of this property determines the retry behavior. Supply it to the map create call.
Values:
Closing the realm or destroying the map supersedes and cancels retry behavior.
This property does not apply to map iterators.
|
staticset |
Set the FTL log trace level.
This field determines the global log trace level for low-level FTL internal calls.
For information about tuning the log level separately for individual elements, see the topic Log Levels in the book TIBCO FTL Development.
Valid Levels:
|
staticget |
Version of the FTL class library.
Programs can use this string to output the FTL version in a start banner or in debug output.