com.vodafone360.people.service.transport.http.authentication
Class AuthenticationManager

java.lang.Object
  extended by java.lang.Thread
      extended by com.vodafone360.people.service.transport.http.authentication.AuthenticationManager
All Implemented Interfaces:
IConnection, IQueueListener, java.lang.Runnable

public class AuthenticationManager
extends java.lang.Thread
implements IConnection


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  java.net.URI mApiUrl
           
private  DecoderThread mDecoder
           
private  HttpConnectionThread mHttpConnection
           
private  boolean mIsConnectionRunning
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AuthenticationManager(DecoderThread decoder)
           
AuthenticationManager(HttpConnectionThread httpConnection)
           
 
Method Summary
 boolean getIsConnected()
          Returns true if the current connection thread is connected.
 boolean getIsRpgConnectionActive()
          Returns true if we have an open RPG connection or false if we do not have one.
 void handleAuthRequests()
          Uses the passed http connection to start a synchronous request against the API.
 void notifyOfItemInRequestQueue()
          Notifies the implementation that a new request is available in the queue and should trigger its delivery to the backend.
 void notifyOfRegainedNetworkCoverage()
          Called whenever the network coverage has been reestablished...
 void notifyOfUiActivity()
          If the UI is currently being used by the user this method gets called.
 void onLoginStateChanged(boolean isLoggedIn)
          Triggered by the ConnectionManager whenever the login engine has detected a change in the currently held session.
 void run()
           
 void startThread()
          Starts the main connection thread.
 void stopThread()
          Stops the current connection thread. this should also stop any running sub-connection threads such as heartbeats or polls.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mApiUrl

private java.net.URI mApiUrl

mHttpConnection

private HttpConnectionThread mHttpConnection

mDecoder

private DecoderThread mDecoder

mIsConnectionRunning

private boolean mIsConnectionRunning
Constructor Detail

AuthenticationManager

public AuthenticationManager(HttpConnectionThread httpConnection)

AuthenticationManager

public AuthenticationManager(DecoderThread decoder)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

handleAuthRequests

public void handleAuthRequests()
Uses the passed http connection to start a synchronous request against the API. This method blocks until the request is made and the response is retrieved.


getIsConnected

public boolean getIsConnected()
Description copied from interface: IConnection
Returns true if the current connection thread is connected.

Specified by:
getIsConnected in interface IConnection
Returns:
True if the connection thread is connected to the backend.

getIsRpgConnectionActive

public boolean getIsRpgConnectionActive()
Description copied from interface: IConnection
Returns true if we have an open RPG connection or false if we do not have one.

Specified by:
getIsRpgConnectionActive in interface IConnection
Returns:
True if the RPG connection is currently active or false otherwise.

notifyOfRegainedNetworkCoverage

public void notifyOfRegainedNetworkCoverage()
Description copied from interface: IConnection
Called whenever the network coverage has been reestablished...

Specified by:
notifyOfRegainedNetworkCoverage in interface IConnection

notifyOfUiActivity

public void notifyOfUiActivity()
Description copied from interface: IConnection
If the UI is currently being used by the user this method gets called.

Specified by:
notifyOfUiActivity in interface IConnection

onLoginStateChanged

public void onLoginStateChanged(boolean isLoggedIn)
Description copied from interface: IConnection
Triggered by the ConnectionManager whenever the login engine has detected a change in the currently held session. If the user has signed off for example, false will be passed as a parameter.

Specified by:
onLoginStateChanged in interface IConnection
Parameters:
isLoggedIn - True if the user was just logged in, false if he was logged out.

startThread

public void startThread()
Description copied from interface: IConnection
Starts the main connection thread.

Specified by:
startThread in interface IConnection

stopThread

public void stopThread()
Description copied from interface: IConnection
Stops the current connection thread. this should also stop any running sub-connection threads such as heartbeats or polls.

Specified by:
stopThread in interface IConnection

notifyOfItemInRequestQueue

public void notifyOfItemInRequestQueue()
Description copied from interface: IQueueListener
Notifies the implementation that a new request is available in the queue and should trigger its delivery to the backend.

Specified by:
notifyOfItemInRequestQueue in interface IQueueListener


JavaDoc