|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.languagecomputer.api.BaseWebClient<T>
public abstract class BaseWebClient<T extends BaseWebService>
Base web client wrapper for the services. Handles the register/unregister functionality.
Constructor Summary | |
---|---|
BaseWebClient(ServiceConfig serviceConfig)
Creates a new BaseWebClient with the ServiceConfig . |
Method Summary | ||
---|---|---|
protected void |
disconnect()
"Disconnects" the current remote web service, only needs to be called when switching servers. |
|
abstract String |
getName()
Returns the name of the service to use for URL lookup. |
|
String |
getSessionID()
Returns the current session identifier, or null if there
currently is no session. |
|
protected T |
getWebService()
Returns the BaseWebService to use for this
BaseWebClient . |
|
protected abstract
|
getWebServiceClass()
Returns the BaseWebService class this BaseWebClient
wraps. |
|
String |
registerSession()
Registers a new session with the remote service. |
|
boolean |
sessionRegistered()
Convenience method for determining if there is currently a registered session. |
|
void |
setSession(Session session)
Ignored: since this is a web client, this method should never be called. |
|
void |
setSessionID(String sessionID)
Sets the session identifier to use for this BaseWebClient . |
|
void |
unregisterSession()
Unregisters the current session with the remote service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseWebClient(ServiceConfig serviceConfig)
BaseWebClient
with the ServiceConfig
.
Method Detail |
---|
public void setSession(Session session)
BaseWebClient
s are created directly, not by the
Session
object.
setSession
in interface Service
public abstract String getName()
getName
in interface Service
protected abstract <T extends BaseWebService> Class<T> getWebServiceClass()
BaseWebService
class this BaseWebClient
wraps.
public void setSessionID(String sessionID)
BaseWebClient
.
public String getSessionID()
null
if there
currently is no session.
IllegalStateException
- If the BaseWebClient
has not
registered a session yet.public boolean sessionRegistered()
registerSession()
protected T getWebService() throws Exception
BaseWebService
to use for this
BaseWebClient
. Loads the proper web service location and
timeouts.
Exception
protected void disconnect()
getWebService()
a new server can be
connected to (specified through the ServiceConfig
).
public String registerSession() throws Exception
Exception
getSessionID()
public void unregisterSession() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |