|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Observes the life cycle of a connection.
Before a SSONET connection is established, server and client
negotiate their security goals. It can be configured, that
if a conflict occures, a party wants to be called back, to possibly
prevent this conflict. This callback is done by the Method
decideSecurityGoal()
.
An application can adapt its
security configuration before the requested negotiation starts.
The method negotiationRequestReceived()
is called, when a negotiation request
from the partner was received, but before the negotiation of security parameters starts.
Objects which are interested in the state
of the connection associated with a SSONET(Server)ClientSocket implement this interface.
Usually these objects register themselves to the corresponding SSONETContext.
Simple example:
public synchronized void connectionStateChanged(SSONETContext context, int currentState) { if (currentState == RUNNING_STATE) notifyAll(); } public synchronized void waitRunning(SSONETClientSocket s) { SSONETContext context = s.getContext(); context.addConnectionListener(this); while (context.getConnectionState()!=RUNNING_STATE) { // wait for notify in connectionStateChanged try { wait(); } catch (InterruptedException ie) {} // allow connectionStateChanged to finish // avoids ConcurrentModificationException in the contexts // listeners-list, if no other ConnectionListener is registered Thread.currentThread().yield(); } context.removeConnectionListener(this); }
Field Summary | |
static int |
FINISHED_STATE
|
static int |
INIT_STATE
|
static int |
MECHANISMS_NEGOTIATION
|
static int |
NOT_STARTED_STATE
|
static int |
RUNNING_STATE
|
static int |
SECURITY_GOAL_NEGOTIATION
|
Method Summary | |
void |
connectionStateChanged(org.ssonet.net.SSONETContext context,
int currentState)
When the connection state has changed, this method reports the current state. |
boolean |
decideSecurityGoal(int securityGoal,
org.ssonet.net.ActionConfiguration ownConfiguration,
org.ssonet.net.SSONETContext context)
This method must decide, wether a user wants to give in in a security goal negotiation conflict, or not. |
void |
negotiationRequestReceived(org.ssonet.net.SSONETContext context,
int negotiationType)
The method negotiationRequestReceived() is called by
SSONETProtocolStream , when a request for a
security goal and mechanisms negotiation, or only a mechanisms negotiation
was received, but before the negotiation of security parameters starts. |
Field Detail |
public static final int NOT_STARTED_STATE
public static final int INIT_STATE
public static final int RUNNING_STATE
public static final int FINISHED_STATE
public static final int SECURITY_GOAL_NEGOTIATION
public static final int MECHANISMS_NEGOTIATION
Method Detail |
public void negotiationRequestReceived(org.ssonet.net.SSONETContext context, int negotiationType)
negotiationRequestReceived()
is called by
SSONETProtocolStream
, when a request for a
security goal and mechanisms negotiation, or only a mechanisms negotiation
was received, but before the negotiation of security parameters starts.
context
- the SSONETContext
used by the server for this
request.negotiationType
- SECURITY_GOAL_NEGOTIATION
if the negotiation
requested is a security goal (and mechanisms) negotiation,
MECHANISMS_NEGOTIATION
if the negotiation requested is only a
mechanisms negotiation.
public void connectionStateChanged(org.ssonet.net.SSONETContext context, int currentState)
public boolean decideSecurityGoal(int securityGoal, org.ssonet.net.ActionConfiguration ownConfiguration, org.ssonet.net.SSONETContext context)
securityGoal
- the security goal to decide on, the security
goals are defined in class ssonet.SSONETConstants.ownConfiguration
- the ActionConfiguration object of the user.
This holds the actual security goal configuration.context
- informations about the communication partner.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |