use of de.janrufmonitor.service.commons.http.IHttpResponse 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.IHttpResponse 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;
}
use of de.janrufmonitor.service.commons.http.IHttpResponse in project janrufmonitor by tbrandt77.
the class ClientDialerDialog method getLines.
private String[] getLines() {
IRequester r = this.getRequester(new GetDialExtensions());
IHttpResponse resp = r.request();
this.m_logger.info("GetExtensionsList returned " + resp.getCode());
if (resp.getCode() == 200) {
try {
String lines = new String(resp.getContent());
if (lines != null & lines.length() > 0) {
this.m_logger.info("GetExtensionsList returned " + lines);
return lines.split(",");
}
} catch (Exception e) {
m_logger.log(Level.SEVERE, e.getMessage(), e);
return null;
}
}
return null;
}
use of de.janrufmonitor.service.commons.http.IHttpResponse in project janrufmonitor by tbrandt77.
the class HttpCallerManager method getCallers.
public ICallerList getCallers(IFilter[] filters, ISearchTerm[] searchTerms) {
if (!this.isConnected()) {
this.m_logger.warning("Client is not yet connected with the server.");
return this.getRuntime().getCallerFactory().createCallerList();
}
IRequester r = this.getRequester(new CallerListGetHandler(this.getCallerManager(), filters, searchTerms));
IHttpResponse resp = r.request();
String xml = this.getXmlContent(resp);
this.handleRequester(resp, r);
ICallerList l = XMLSerializer.toCallerList(xml);
if (l != null) {
this.addCallerManagerAttribute(l);
return l;
}
this.m_logger.warning("Callerlist from remote host was empty.");
return this.getRuntime().getCallerFactory().createCallerList();
}
use of de.janrufmonitor.service.commons.http.IHttpResponse in project janrufmonitor by tbrandt77.
the class HttpCallerManager method setCaller.
public void setCaller(ICallerList callerList) {
if (!this.isConnected()) {
this.m_logger.warning("Client is not yet connected with the server.");
return;
}
IRequester r = null;
IHttpResponse resp = null;
r = this.getRequester(new CallerListSetHandler(callerList, this.getCallerManager()));
resp = r.request();
this.handleRequester(resp, r);
}
Aggregations