Indicates that no authentication
is required.
public const int TPNOAUTH;
Remarks
Indicates that no authentication is required, see
also the remarks of the return values of C function tpchkauth
in Tuxedo ATMI C Function Reference
Indicates that system authentication only is
required
public const int TPSYSAUTH;
Remarks
Indicates that system authentication only is
required, see also the remarks of the return values of C function tpchkauth in Tuxedo ATMI C Function Reference
Indicates that both system and application
specific authentication are required.
public const int TPAPPAUTH;
Remarks
Indicates that both system and application specific authentication are required. see also the remarks of the return values of C function tpchkauth in Tuxedo ATMI C Function Reference
Joins an application.
public static AppContext tpinit(
TypedTPINIT tpinfo
);
Remarks
This is a factory method used to create an
instance of AppContext class and call ATMI C function
tpinit for that instance. After successful return
from this method, the application context created and kept in Tuxedo libraries
is associated with the instance of AppContext class
created and returned by this method. Whenever any instance method of AppContext is called for an AppContext
instance (for example, ac.tpcall(,´) ), the instance method will automatically check the
identicalness of the context associated with the AppContext
instance and the context current running thread is using. If two contexts are
not same, the instance method will automatically call ATMI C function tpsetctxt on the AppContext
instance for current running thread first and then make the real ATMI C
function call. This guarantees that the instance method always work on the
right context as we expect it to do, so users do not have to call tpgetctxt and tpsetctxt
explicitly for themselves any more.
TypedTPINIT is class
which is a mapping to ATMI C structure TPINIT.
This method should be called before any instance method of AppContext class is called.
Returns the authentication level required to join
the application.
public static int tpchkauth();
Remarks
This is a direct mapping to ATMI C function tpchkauth.
Accesses the digital signature and encryption
information associated with a typed message buffer.
public static
void tpenvelope(
TypedBuffer tb,
int
occurrence,
out TPKEY outputkey,
out long
status,
out string
timestamp,
long flags
);
Remarks
Due to the difference between C# and C, some
arguments of this method differ from its counterpart in ATMI C functions. The
first argument char* data and the second argument long len of ATMI C function tpenvelope
combines to form a new argument TypedBuffer
tb, the first argument of AppContext.epenvelope.
The arguments outputkey, status and timestamp
must be assigned an effective variable respectively and can not be set to null.
Opens a key handle for digital
signature generation, message encryption, or message decryption.
public static
TPKEY tpkey_open(
string principal_name,
string
location,
string identity_proof,
long flags
);
public
static TPKEY tpkey_open(
string principal_name,
string
location,
byte[] identity_proof,
long flags
);
Remarks
Closes a previously opened key handle..
public static
void tpkey_close(
TPKEY key
);
Remarks
Gets information associated with a key handle.
public static
void tpkey_getinfo(
TPKEY key,
string attr_name,
byte[] value,
ref long value_len
);
Remarks
Sets optional attribute parameters associated with
a key handle.
public static void tpkey_setinfo(
TPKEY key,
string attr_name,
byte[] value
);
Remarks
Marks a typed message buffer for
encryption.
public static void tpseal(
TypedBuffer
data,
TPKEY key
);
Remarks
Marks a typed message buffer for
digital signature.
public static void tpsign(
TypedBuffer
data,
TPKEY key
);
Remarks
Converts the value of this instance to a String.
public
override string ToString();
Remarks
Return value
The string represents the instance.
Leaves an application.
public void tpterm();
Remarks
This should be the last instance method call on an
instance of AppContext. After this method returns, the instance ends its life and should be garbage
collected, any instance method call on it will result in a TPESWITCHCTXTException.
Return value
Upon successful completion, AppContext.tpacall() returns
with no value.
Upon failure, AppContext.tpacall() throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method for sending a service
request.
public AsyncCallDescriptor
tpacall(
string svc,
TypedBuffer tb,
long flags
);
Remarks
The second argument char* data and the
third argument long len of the ATMI C function
tpacall combine to the second argument TypedBuffer tb of
this method. Users may pass the size of the data to this method by setting the
property tb.Datalen to the desired value
before calling this method.
The returned value is an instance of AsyncCallDescriptor class that can be used to receive the
reply of the request sent by AppContext.tpgetrply
Return value
Upon successful completion, AppContext.tpacall() returns
an instance of AsyncCallDescriptor class that can be
used to receive the reply of the request sent.
Upon failure, AppContext.tpacall() throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method for getting a reply from
a previous request.
public void tpgetrply(
ref AsyncCallDescriptor acd,
ref TypedBuffer tb,
long flags
);
Remarks
The second argument char** data and the
third argument long* len of the ATMI C
function tpgetrply combine to the second argument ref
TypedBuffer tb of this
method.
Return value
Upon successful return from AppContext.tpgetrply() or upon return where an exception of TPESVCFAILException
is thrown, TPException.tpurcode() can be called to
get an application defined value that was sent as part of tpreturn().
Upon failure, AppContext.tpgetrply() throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method for canceling a call
descriptor for outstanding reply.
public void tpcancel(
AsyncCallDescriptor
acd
);
Remarks
.
Return value
Upon successful completion, AppContext.tpacancel()
returns with no value.
Upon failure, AppContext.tpcancel() throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Administers unbooted
application.
public void tpadmcall(
TypedFML32 inbuf,
ref TypedFML32 outbuf
);
Remarks
.
Return value
Upon successful completion, this method returns
with no value.
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method to broadcast notification
by name.
public void tpbroadcast(
string lmid,
string usrname,
string cltname,
TypedBuffer tb,
long flags
);
Remarks
.
Return value
Upon successful completion, this method returns
with no value.
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method to send notification to a
specific client.
public void tpnotify(
CLIENT id,
TypedBuffer tb,
long flags
);
Remarks
.
Return value
Upon successful completion, this method returns
with no value.
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method for sending service
request and awaiting its reply.
public void tpcall(
string svc,
TypedBuffer idata,
ref TypedBuffer odata,
long flags
);
Remarks
.
Return value
Upon successful return from
this method or upon return where an exception of TPESVCFAILException
is thrown, TPException.tpurcode() can be called to get an application defined value that
was sent as part of tpreturn().
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Sets the method for handling
unsolicited messages.
public UnsolicitedMessageHandler
tpsetunsol(
UnsolicitedMessageHandler
umhdl
);
Remarks
.
Return value
Upon success, this method
returns the previous setting for the unsolicited message handling method. (null is a successful return indicating that no message
handling method had been set previously.)
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method for checking for
unsolicited message.
public int tpchkunsol();
Remarks
.
Return value
Upon successful completion,
this method returns the number of unsolicited messages dispatched;
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method for establishing a
conversational service connection.
public ConversationDescriptor
tpconnect(
string svc,
TypedBuffer tb,
long flags
);
Remarks
.
Return value
Upon successful completion,
this method returns an instance of ConversationDescriptor
class that is used to refer to the connection in subsequent calls.
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method for taking down a
conversational service connection.
public void tpdiscon(
ConversationDescriptor
cd
);
Remarks
.
Return value
Upon successful completion,
this method returns with no value.
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Method for receiving a message
in a conversational connection.
public void tprecv(
ConversationDescriptor
cd,
ref TypedBuffer tb,
long flags
);
Remarks
.
Return value
Upon successful completion,
this method returns with no value.
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates. If the thrown exception is an instance of TPEEVENTException
and its property Event is set to the value TPEEVENTException.TPEV_SVCSUCC
or TPEEVENTException.TPEV_SVCFAIL, TPExcetption.tpurcode() can be used to get an application
defined value that was sent as part of tpreturn().
Method for sending a message in
a conversational connection.
public void tpsend(
ConversationDescriptor
cd,
TypedBuffer tb,
long flags
);
Remarks
.
Return value
Upon successful completion,
this method returns with no value.
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates. If the thrown exception is an instance of TPEEVENTException
and its property Event is set to the value TPEEVENTException.TPEV_SVCSUCC
or TPEEVENTException.TPEV_SVCFAIL, TPExcetption.tpurcode() can be used to get an application
defined value that was sent as part of tpreturn().
Method to enqueue
a message.
public void tpenqueue(
string qspace,
string qname,
TPQCTL ctl,
TypedBuffer tb,
long flags
);
Remarks
.
Return value
Upon successful completion,
this method returns with no value.
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates.
Method to dequeue
a message from a queue.
public void tpdequeue(
string qspace,
string qname,
TPQCTL ctl,
ref TypedBuffer tb,
long flags
);
Remarks
.
Return value
Upon successful completion,
this method returns with no value.
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates.
Posts an event.
public void tppost(
string eventname,
TypedBuffer tb,
long flags
);
Remarks
.
Return value
Upon successful return from this method, TPException.tpurcode() can be called to get the number of
event notifications dispatched by the EventBroker on
behalf of eventname (that is, postings for those
subscriptions whose event expression evaluated successfully against eventname and whose filter rule evaluated successfully
against data).
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates. On condition that the thrown exception is an instance of TPESVCFAILException, TPException.tpurcode() can be called to get the number of non-transactional
event notifications dispatched by the EventBroker on
behalf of eventname.
Subscribes to an event.
public SubscriptionHandle
tpsubscribe(
string eventexpr,
string filter,
TPEVCTL ctl,
long flags
);
Remarks
.
Return value
Upon successful completion, this method returns an
instance of SubscriptionHandle class that can be used
to remove this subscription from the EventBroker's
list of active subscriptions. The subscriber or any other process is allowed to
use the returned handle to delete this subscription.
Upon failure, this method throws an exception which type depends on the error code that ATMI C variable tperrno indicates.
Unsubscribes to an event.
public void tpunsubscribe(
SubscriptionHandle
handle,
long flags
);
Remarks
.
Return value
Upon completion of this method, TPException.tpurcode() can be called to get the number of subscriptions deleted
(zero or greater) from the EventBroker's list of active
subscriptions. TPException.tpurcode() may contain a number greater than 1 only when the
instance of SubscriptionHandle constructed from
wildcard handle, -1, is used. Also, TPException.tpurcode() may contain a number greater than 0 even when this method
completes unsuccessfully (that is, when the wildcard handle is used, the EventBroker may have successfully removed some
subscriptions before it encountered an error deleting others).
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates.
Converts a typed message buffer into an
exportable, machine-independent string representation, that
includes digital signatures and encryption seals.
public void tpexport(
TypedBuffer itb,
out string ostr,
ref long olen
);
public void tpexport(
TypedBuffer itb,
out byte[] obin,
ref long olen
);
Remarks
There are two overloaded methods of AppContext.tpexport. The first is equivalent to the invocation
that ATMI C function tpexport is called with TPEX_STRING
bit being set to its argument flags and the second is equivalent to the
invocation that tpexport is called with TPEX_STRING
bit being cleared from its argument flags.
These two methods are responsible for allocating
the storage space for the returned data, so no storage space have to be
allocated for ostr and obin
before these method are called.
On input, olen
needs to be set to indicate the maximum mount of data that these two methods
can returned; On output, olen
is set to the actual size of data returned in argument ostr
or obin.
Return value
Upon successful completion,
this method returns with no value.
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates.
Converts an externalized
representation of a message buffer into a typed message buffer.
public void tpimport(
string istr,
ref TypedBuffer otb
);
public void tpimport(
byte[] ibin,
ref TypedBuffer otb
);
Remarks
There are two overloaded methods of AppContext.tpimport. The first is equivalent to the
invocation that ATMI C function tpimport is called
with TPEX_STRING bit being set to its argument flags and the
second is equivalent to the invocation that tpimport
is called with TPEX_STRING bit being cleared from its argument flags.
otb must point to
a valid typed buffer either (1) previously allocated by calling new Typed***
(Typed*** represents any existing derived class of TypedBuffer,
TypedView and TypedView32 except TypedView
and TypedView32 themselves (2) delivered by the system to a receiving thread.
The buffer will be reallocated as necessary tp
accommodate the result, and its buffer type or subtype may change. The propertys otb.Size and otb.Datalen are set to the amount of valid data
contained in the output buffer.
Return value
Upon successful completion,
this method returns with no value.
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates.
Method for getting a service
request priority.
public int tpgprio();
Remarks
Return value
Upon successful completion,
this method returns a request¨s priority.
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates.
Method for setting service
request priority.
public void tpsprio(
int
prio,
long flags
);
Remarks
Return value
Upon successful completion,
this method returns with no value.
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates.
Initializes a new instance of the AppContext class
protected AppContext(
TypedTPINIT tpinfo
);
Remarks
This
method calls ATMI C function tpinit and tpgetctxt in turn to associate the application context
created and kept in Tuxedo libraries with the new instance of AppContext class. Creating new instance of AppContext class through new AppContext() is
prohibited by C# compiler due to the protected modifier of this method. Calling
AppContext.tpinit() is the only way to create new instance for AppContext class.
Return value
Upon failure, this method throws an exception
which type depends on the error code that ATMI C variable tperrno
indicates.