|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmymobilesite.communication.LibertyProtocol
public class LibertyProtocol
The LibertyProtocol class is responsible for coordinating the messages that are sent between the mobile phone and the Identity Provdier, Discovery Service and Web Service Provider.
Field Summary | |
---|---|
private boolean |
abort
|
static int |
AUTHENTICATING_USER
State constant indicating that the class is in the process of authenticating the user. |
static int |
CONTACTING_IDP
State constant indicating that the class is establishing the session with the Identity Provider. |
private int |
currentState
|
private ResourceOffering |
discoResource
|
private HttpTransport |
discoSession
|
static int |
DONE
State constant indicating that the class has completed its tasks successfully. |
private java.lang.Thread |
executingThread
|
private AuthTransport |
idpSession
|
private LibertyProtocolListener |
listener
|
static int |
NOT_STARTED
State constant indicating that the class has not yet started its work. |
private HttpTransport |
providerSession
|
private java.lang.String |
pwd
|
static int |
REQUESTING_SERVICE
State constant indicating that the class is requesting the service chosen by the user from the Web Service Provider. |
private ResourceOffering[] |
resourceOfferings
|
static int |
RETRIEVING_PROVIDER_LIST
State constant indicating that the class is retrieving the list of resource offerings from the Discovery Service. |
private boolean |
running
|
private java.lang.String |
un
|
private int |
userchoice
|
Constructor Summary | |
---|---|
LibertyProtocol(LibertyProtocolListener listener)
The contstructor registers the listener and initialises the executing thread. |
Method Summary | |
---|---|
void |
abort()
This method can be called if the current operation of the LibertyProtocol class needs to be aborted for some reason. |
void |
establishIdpSession()
This method causes the class to enter the CONTACTING_IDP state and starts the executing thread. |
void |
getProviders(java.lang.String un,
java.lang.String pwd)
This method causes the class to enter the AUTHENTICATING_USER state and starts the executing thread. |
void |
requestService(int userchoice)
This method causes the class to enter the REQUESTING_SERVICE state and starts the executing thread. |
void |
retryDiscoQuery()
In some cases the Controller will have to retry to retrieve the list of providers. |
void |
retryGetProviders()
In some cases the Controller will have to retry the authentication. |
void |
run()
This method takes care of the actual execution and performs tasks appropriate to the current state of the class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private AuthTransport idpSession
private HttpTransport discoSession
private HttpTransport providerSession
private ResourceOffering discoResource
private ResourceOffering[] resourceOfferings
private LibertyProtocolListener listener
private java.lang.Thread executingThread
public static final int NOT_STARTED
public static final int CONTACTING_IDP
public static final int AUTHENTICATING_USER
public static final int RETRIEVING_PROVIDER_LIST
public static final int REQUESTING_SERVICE
public static final int DONE
private int currentState
private boolean abort
private boolean running
private java.lang.String un
private java.lang.String pwd
private int userchoice
Constructor Detail |
---|
public LibertyProtocol(LibertyProtocolListener listener)
listener
- LibertyProtocolListener The listener that should be notified of events
in this class.Method Detail |
---|
public void abort()
public void establishIdpSession()
public void getProviders(java.lang.String un, java.lang.String pwd)
un
- String The username to be authenticated.pwd
- String The password provided by the user.public void retryGetProviders()
public void retryDiscoQuery()
public void requestService(int userchoice)
userchoice
- int The index of the WSP chosen by the user.public void run()
run
in interface java.lang.Runnable
Runnable.run()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |