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 |
---|---|
void |
close()
logout
|
FritzBoxSession |
connect()
login if needed
|
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
|
protected FritzBoxSession |
login()
login in and return the session
|
protected void |
logout() |
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)
protected FritzBoxSession login()
protected SessionInfo getSessionInfo(String params) throws Exception, IOException
params
- Exception
IOException
public <T> T getTypedResponse(String relativeUrl, String params, Class clazz) throws Exception
getTypedResponse
in interface FritzBoxSession
relativeUrl
- params
- clazz
- Exception
public String getResponse(String relativeUrl, String params) throws Exception
getResponse
in interface FritzBoxSession
relativeUrl
- params
- Exception
protected String doGetResponse(String relativeUrl, String params) throws Exception
relativeUrl
- params
- Exception
public static String readUrl(String url) throws MalformedURLException, IOException
url
- MalformedURLException
IOException
public static String readResponse(InputStream stream) throws IOException
stream
- IOException
protected void logout()
public String getMd5(String input)
FritzBoxSession
getMd5
in interface FritzBoxSession
public FritzBoxSession createNewSession() throws Exception
createNewSession
in interface FritzBoxSessionBuilder
Exception
public static FritzBoxSession getInstance() throws Exception
Exception
public FritzBoxSession connect()
FritzBoxSession
connect
in interface FritzBoxSession
public void close()
FritzBoxSession
close
in interface FritzBoxSession
Copyright © 2018 BITPlan GmbH. All rights reserved.