public class FritzBoxSessionImpl extends Object implements FritzBoxSession, FritzBoxSessionBuilder
| Modifier and Type | Field and Description |
|---|---|
static boolean |
debug |
static boolean |
domockito |
protected static Logger |
LOGGER |
| Constructor and Description |
|---|
FritzBoxSessionImpl()
create a FritzBox Session
|
FritzBoxSessionImpl(Fritzbox pFritzbox)
create a FritzBox Session
|
| Modifier and Type | Method and Description |
|---|---|
FritzBoxSession |
createNewSession() |
protected String |
doGetResponse(String relativeUrl,
String params)
response handler (to be mocked in test cases)
|
static FritzBoxSession |
getInstance() |
String |
getMd5(String input)
get the md5 for the given input
|
String |
getResponse(String relativeUrl,
String params)
get the response for the given relative Url
|
protected SessionInfo |
getSessionInfo(String params)
get the session info
|
<T> T |
getTypedResponse(String relativeUrl,
String params,
Class clazz)
get the XML Result
|
FritzBoxSession |
login()
login
|
void |
logout()
log out
|
static String |
readResponse(InputStream stream)
read a response string from the given input stream
|
static String |
readUrl(String url)
read from the given url
|
public static boolean debug
protected static Logger LOGGER
public static boolean domockito
public FritzBoxSessionImpl()
public FritzBoxSessionImpl(Fritzbox pFritzbox)
public FritzBoxSession login()
FritzBoxSessionlogin in interface FritzBoxSessionprotected SessionInfo getSessionInfo(String params) throws Exception, IOException
params - ExceptionIOExceptionpublic <T> T getTypedResponse(String relativeUrl, String params, Class clazz) throws Exception
getTypedResponse in interface FritzBoxSessionrelativeUrl - params - clazz - Exceptionpublic String getResponse(String relativeUrl, String params) throws Exception
getResponse in interface FritzBoxSessionrelativeUrl - params - Exceptionprotected String doGetResponse(String relativeUrl, String params) throws Exception
relativeUrl - params - Exceptionpublic static String readUrl(String url) throws MalformedURLException, IOException
url - MalformedURLExceptionIOExceptionpublic static String readResponse(InputStream stream) throws IOException
stream - IOExceptionpublic void logout()
FritzBoxSessionlogout in interface FritzBoxSessionpublic String getMd5(String input)
FritzBoxSessiongetMd5 in interface FritzBoxSessionpublic FritzBoxSession createNewSession() throws Exception
createNewSession in interface FritzBoxSessionBuilderExceptionpublic static FritzBoxSession getInstance() throws Exception
ExceptionCopyright © 2018. All rights reserved.