use of de.janrufmonitor.service.commons.http.IRequester in project janrufmonitor by tbrandt77.
the class HttpImageProvider method getRequester.
private IRequester getRequester(IHttpRequest request) {
IRequester r = RequesterFactory.getInstance().getRequester();
r.setRequest(request);
return r;
}
use of de.janrufmonitor.service.commons.http.IRequester in project janrufmonitor by tbrandt77.
the class HttpCallManager method setCalls.
public void setCalls(ICallList calllist) {
if (!this.isConnected()) {
this.m_logger.warning("Client is not yet connected with the server.");
return;
}
IRequester r = this.getRequester(new CallListSetHandler(calllist, this.getCallManager()));
IHttpResponse resp = r.request();
this.handleRequester(resp, r);
}
use of de.janrufmonitor.service.commons.http.IRequester in project janrufmonitor by tbrandt77.
the class HttpCallManager method getCalls.
public synchronized ICallList getCalls(IFilter[] filters, int count, int offset, ISearchTerm[] searchTerms) {
if (!this.isConnected()) {
this.m_logger.warning("Client is not yet connected with the server.");
return this.getRuntime().getCallFactory().createCallList();
}
IRequester r = this.getRequester(new CallListGetHandler(this.getCallManager(), filters, searchTerms));
IHttpResponse resp = r.request();
String xml = this.getXmlContent(resp);
this.handleRequester(resp, r);
if (xml != null && xml.length() > 0) {
ICallList l = XMLSerializer.toCallList(xml);
if (l != null)
return l;
this.m_logger.warning("Calllist from remote host was empty.");
PropagationFactory.getInstance().fire(new Message(Message.ERROR, getNamespace(), "empty", new Exception("CallList from server has either a wrong format, contains forbidden characters or was empty.")));
}
return this.getRuntime().getCallFactory().createCallList();
}
use of de.janrufmonitor.service.commons.http.IRequester in project janrufmonitor by tbrandt77.
the class ClientDialerCommand method isExecutable.
public boolean isExecutable() {
// introduced since some TAPIs might reset and stop monitoring after calling GetDialExtension
boolean isSecureMonitor = Boolean.parseBoolean(System.getProperty(IJAMConst.SYSTEM_MONITOR_SECURE, "false"));
if (isSecureMonitor)
return false;
if (isConnected()) {
IRequester r = this.getRequester(new GetDialExtensions());
IHttpResponse resp = r.request();
return (resp.getCode() != 404 && resp.getCode() != 500);
}
return false;
}
use of de.janrufmonitor.service.commons.http.IRequester in project janrufmonitor by tbrandt77.
the class ClientClickDialAction method isEnabled.
public boolean isEnabled() {
// introduced since some TAPIs might reset and stop monitoring after calling GetDialExtension
boolean isSecureMonitor = Boolean.parseBoolean(System.getProperty(IJAMConst.SYSTEM_MONITOR_SECURE, "false"));
if (isSecureMonitor)
return false;
if (isConnected()) {
IRequester r = this.getRequester(new GetDialExtensions());
IHttpResponse resp = r.request();
return (resp.getCode() != 404 && resp.getCode() != 500);
}
return false;
}
Aggregations