com.globalcharge.android
Class ServerPool

java.lang.Object
  extended by com.globalcharge.android.ServerPool

public class ServerPool
extends java.lang.Object


Constructor Summary
ServerPool()
           
 
Method Summary
 java.lang.String getNextUrl()
          Moves onto the next server in the pool and returns it's url.
 java.lang.String getUrl()
          Fetches the last successful url from the pool, or the first in our priority ordering if we haven't .
 void recordSuccess()
          Mark the latest server url as successful
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerPool

public ServerPool()
Method Detail

getUrl

public java.lang.String getUrl()
Fetches the last successful url from the pool, or the first in our priority ordering if we haven't .

Returns:

getNextUrl

public java.lang.String getNextUrl()
Moves onto the next server in the pool and returns it's url.

Returns:
The next server Url from the pool or null if we have run out of servers

recordSuccess

public void recordSuccess()
Mark the latest server url as successful