All Packages Class Hierarchy This Package Previous Next Index
Class semper.txlayer.context.TXContext
java.lang.Object
|
+----semper.txlayer.context.TXBaseContext
|
+----semper.txlayer.context.TXContext
- public class TXContext
- extends TXBaseContext
- implements Cloneable
This class is the notion of a context for the txlayer
A TXContext is a communication endpoint where data
can be sent through. It has to be established
with the acceptContext() and offerContext() methods before
any operation can take place.
-
TXContext(CLAddress)
- Constructor.
-
TXContext(CLAddress, SituationDescription)
- Constructor.
-
TXContext(CLAddress, SituationDescription, AttributeSet)
- Constructor.
-
TXContext(TXHostname, CLAddress)
- Constructor.
-
TXContext(TXHostname, CLAddress, AttributeSet)
- Constructor.
-
TXContext(TXHostname, CLAddress, SituationDescription)
- Constructor.
-
TXContext(TXHostname, CLAddress, SituationDescription, AttributeSet)
- Constructor.
-
acceptContext()
- Accepts a context while listening to the txaddress.
-
acceptContext(long)
- Accepts a context while listening to the txaddress..
-
classInit()
- Since we want to have a server open that listens on a particular
port for incoming offerContexts, we need sth like classinit().
-
clone()
- Override clone() to be able for non-friends to clone us.
-
close()
- Closes the channel.
-
getMyCertificateContext()
-
-
getPeerCertificateContext()
-
-
getSubContext(CLAddress, int)
- This method creates a new TXSubContext that can be put into
a TransferTransaction.
-
getSubContext(int)
- This method creates a new TXSubContext that can be put into
a TransferTransaction.
-
getUserData()
-
-
init()
- Since we want to have a server open that listens on a particular
port for incoming offerContexts, we need sth like classinit().
-
isInitialized()
- Check whether the module is initialized.
-
offerContext()
- Offers the peer specified in the txaddress to establish a context.
-
offerContext(Serializable)
- Offers the peer specified in the txaddress to establish a context.
-
toString()
-
TXContext
public TXContext(TXHostname peerHostname,
CLAddress claddress,
AttributeSet secAttributes)
- Constructor.
The situationDescription of the context is set to "Unspecified".
- Parameters:
- peerHostname - Specifies the peer to communicate with.
- claddress - Serves as an identifier for the use of the Commerce Layer.
- secAttributes - Specifies the security attributes that are to be
applied to the connection.
Currently valid: Authenticity and Confidentiality
TXContext
public TXContext(TXHostname peerHostname,
CLAddress claddress)
- Constructor.
The situationDescription of the context is set to "Unspecified".
- Parameters:
- peerHostname - Specifies the peer to communicate with.
- claddress - Serves as an identifier for the use of the Commerce Layer.
TXContext
public TXContext(CLAddress claddress)
- Constructor.
Only usefull for accepting contexts.
The situationDescription of the context is set to "Unspecified".
The hostname is set to the local host.
- Parameters:
- claddress - Serves as an identifier for the use of the Commerce Layer.
TXContext
public TXContext(CLAddress claddress,
SituationDescription situationDescription,
AttributeSet secAttributes)
- Constructor.
Only usefull for accepting contexts.
The hostname is set to the local host.
- Parameters:
- claddress - Serves as an identifier for the use of the Commerce Layer.
- situationDescription - The description that is to be used when
negotiating certificates for secure communications
and for signing non-repudiation tokens (including
SECA specific attributes).
You can pass a situationDescription with all nulls
init, or you can fix arbitrary parameters, in which case
you should be sure that you or the peer have matching
certificates.
When this parameter has a SECAAttribute in it,
the SECAAttribute is ignored for negotiating
certificates for secure communications.
- secAttributes - Specifies the security attributes that are to be
applied to the connection.
Currently valid: Authenticity and Confidentiality
TXContext
public TXContext(TXHostname peerHostname,
CLAddress claddress,
SituationDescription situationDescription,
AttributeSet secAttributes)
- Constructor.
- Parameters:
- peerHostname - Specifies the peer to communicate with.
- claddress - Serves as an identifier for the use of the Commerce Layer.
- situationDescription - The description that is to be used when
negotiating certificates for secure communications
and for signing non-repudiation tokens (including
SECA specific attributes).
You can pass a situationDescription with all nulls
init, or you can fix arbitrary parameters, in which case
you should be sure that you or the peer have matching
certificates.
When this parameter has a SECAAttribute in it,
the SECAAttribute is ignored for negotiating
certificates for secure communications.
- secAttributes - Specifies the security attributes that are to be
applied to the connection.
Currently valid: Authenticity and Confidentiality
TXContext
public TXContext(TXHostname peerHostname,
CLAddress claddress,
SituationDescription situationDescription)
- Constructor.
- Parameters:
- peerHostname - Specifies the peer to communicate with.
- claddress - Servers as an identifier for the use of the Commerce Layer.
- situationDescription - The description that is to be used when
negotiating certificates for secure communications
and for signing non-repudiation tokens (including
SECA specific attributes).
You can pass a situationDescription with all nulls
init, or you can fix arbitrary parameters, in which case
you should be sure that you or the peer have matching
certificates.
When this parameter has a SECAAttribute in it,
the SECAAttribute is ignored for negotiating
certificates for secure communications.
TXContext
public TXContext(CLAddress claddress,
SituationDescription situationDescription)
- Constructor.
Only usefull for accepting contexts.
- Parameters:
- claddress - Servers as an identifier for the use of the Commerce Layer.
- situationDescription - The description that is to be used when
negotiating certificates for secure communications
and for signing non-repudiation tokens (including
SECA specific attributes).
You can pass a situationDescription with all nulls
init, or you can fix arbitrary parameters, in which case
you should be sure that you or the peer have matching
certificates.
When this parameter has a SECAAttribute in it,
the SECAAttribute is ignored for negotiating
certificates for secure communications.
isInitialized
public static synchronized boolean isInitialized()
- Check whether the module is initialized.
- Returns:
- true if and only if fully initialized;
init
public static void init() throws TXContextCommException
- Since we want to have a server open that listens on a particular
port for incoming offerContexts, we need sth like classinit().
This method opens a server SecComPoint.
Every acceptContext uses this server.
When the _sempconfig option semper.noListeners or
semper.txlayer.noListeners is set to "1",
no server SecComPoint is opened.
- Throws: TXContextCommException
- When either the local hostname could not be
determined or the startServicePointThread call failed.
classInit
public static synchronized void classInit() throws TXContextCommException
- Since we want to have a server open that listens on a particular
port for incoming offerContexts, we need sth like classinit().
Every acceptContext uses this server.
This method opens a server SecComPoint.
When the _sempconfig option semper.noListeners or
semper.txlayer.noListeners is set to "1",
no server SecComPoint is opened.
- Throws: TXContextCommException
- When either the local hostname could not be
determined or the startServicePointThread call failed.
offerContext
public synchronized void offerContext() throws TXContextCommException, TXContextNotAccepted
- Offers the peer specified in the txaddress to establish a context.
- Throws: TXContextNotAccepted
- When there is no one listening for our
context at txaddress.
- Throws: TXContextCommException
- When you attempt to re-offer
an already open TXContext; when parameters are missing;
when misc. Comm errors occur.
offerContext
public synchronized void offerContext(Serializable userData) throws TXContextCommException, TXContextNotAccepted
- Offers the peer specified in the txaddress to establish a context.
- Parameters:
- userData - A Serializable that is transferred to the accepting
peer on connection establishment. It can be retrieved
with getUserData();
- Throws: TXContextNotAccepted
- When there is no one listening for our
context at txaddress.
- Throws: TXContextCommException
- When you attempt to re-offer
an already open TXContext; when parameters are missing;
when misc. Comm errors occur.
acceptContext
public synchronized Serializable acceptContext() throws TXContextCommException, TXContextNotOffered
- Accepts a context while listening to the txaddress. This method does
not time out.
- Returns:
- The userData object that was transmitted from the peer,
or null when there is no userData object.
- Throws: TXContextNotOffered
- When there is no one offering a context at
txaddress.
- Throws: TXContextCommException
- When you attempt to re-offer
an already open TXContext; when parameters are missing;
when misc. Comm errors occur;
when the _sempconfig option semper.txlayer.noListeners is set to "1".
acceptContext
public synchronized Serializable acceptContext(long timeOut) throws TXContextCommException, TXContextNotOffered
- Accepts a context while listening to the txaddress..
- Parameters:
- timeOut - The time in millisecs that should be waited for incoming
contexts.
- Returns:
- The userData object that was transmitted from the peer,
or null when there is no userData object.
- Throws: TXContextNotOffered
- When there is no one offering a context at
txaddress or when there is a timeout.
- Throws: TXContextCommException
- When you attempt to re-offer
an already open TXContext; when parameters are missing;
when misc. Comm errors occur.
getSubContext
public TXSubContext getSubContext(int tid)
- This method creates a new TXSubContext that can be put into
a TransferTransaction. The new TXSubContext is based on the TXContext.
tid and the claddress of the TXContext are combined to
form a new claddress for the TXSubContext.
- Parameters:
- tid - The tid is used as a channel correlator in the way it is
used in comm and seccomm.
- Returns:
- TXSubContext A new context through communication of
transactions should take place.
getSubContext
protected TXSubContext getSubContext(CLAddress claddress,
int tid)
- This method creates a new TXSubContext that can be put into
a TransferTransaction. The new TXSubContext is based on the TXContext.
tid and claddress are combined to form a new claddress for
the TXSubContext.
- Parameters:
- claddress - The claddress the new subcontext should be
based on.
- tid - The tid is used as a channel correlator in the way it is
used in comm and seccomm.
- Returns:
- TXSubContext A new context through communication of
transactions should take place.
getMyCertificateContext
public CertificateContext getMyCertificateContext()
- Returns:
- A clone of my own certificates that are used
in the connection. Might be null if no connection
is established.
getPeerCertificateContext
public CertificateContext getPeerCertificateContext()
- Returns:
- A clone of the peers certificates that are used
in the connection. Might be null if no connection
is established.
getUserData
public Serializable getUserData()
- Returns:
- The userData object that is transmitted
from the peer calling offerContext to
the peer calling acceptContext. The userData
can be retrieved from both peers contexts. When
there is no userData,
null
is returned.
close
public synchronized void close() throws TXContextCommException
- Closes the channel.
- Throws: TXContextCommException
- When the Channel does not
want to be closed... .
clone
public Object clone() throws CloneNotSupportedException
- Override clone() to be able for non-friends to clone us.
- Throws: CloneNotSupportedException
- When the super does
not want to clone us. Should never happen... .
- Overrides:
- clone in class Object
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index