Search in sources :

Example 1 with CallerListGetHandler

use of de.janrufmonitor.service.client.request.handler.CallerListGetHandler in project janrufmonitor by tbrandt77.

the class HttpCallerManager method getCallers.

public ICallerList getCallers(IFilter filter) {
    if (!this.isConnected()) {
        this.m_logger.warning("Client is not yet connected with the server.");
        return this.getRuntime().getCallerFactory().createCallerList();
    }
    if (filter != null) {
        return this.getCallers(new IFilter[] { filter });
    }
    this.m_logger.info("No filter is applied.");
    IRequester r = this.getRequester(new CallerListGetHandler(this.getCallerManager()));
    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();
}
Also used : CallerListGetHandler(de.janrufmonitor.service.client.request.handler.CallerListGetHandler) ICallerList(de.janrufmonitor.framework.ICallerList) IRequester(de.janrufmonitor.service.commons.http.IRequester) IHttpResponse(de.janrufmonitor.service.commons.http.IHttpResponse)

Example 2 with CallerListGetHandler

use of de.janrufmonitor.service.client.request.handler.CallerListGetHandler 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();
}
Also used : CallerListGetHandler(de.janrufmonitor.service.client.request.handler.CallerListGetHandler) ICallerList(de.janrufmonitor.framework.ICallerList) IRequester(de.janrufmonitor.service.commons.http.IRequester) IHttpResponse(de.janrufmonitor.service.commons.http.IHttpResponse)

Aggregations

ICallerList (de.janrufmonitor.framework.ICallerList)2 CallerListGetHandler (de.janrufmonitor.service.client.request.handler.CallerListGetHandler)2 IHttpResponse (de.janrufmonitor.service.commons.http.IHttpResponse)2 IRequester (de.janrufmonitor.service.commons.http.IRequester)2