Search in sources :

Example 1 with CallerGetHandler

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

the class HttpCallerManager method getCaller.

public ICaller getCaller(IPhonenumber number) throws CallerNotFoundException {
    if (!this.isConnected()) {
        this.m_logger.warning("Client is not yet connected with the server.");
        throw new CallerNotFoundException("No caller found. Client is not yet connected with the server.");
    }
    IRequester r = this.getRequester(new CallerGetHandler(number, this.getCallerManager()));
    IHttpResponse resp = r.request();
    String xml = this.getXmlContent(resp);
    this.handleRequester(resp, r);
    ICaller c = XMLSerializer.toCaller(xml);
    if (c != null) {
        return c;
    }
    throw new CallerNotFoundException("no caller found.");
}
Also used : ICaller(de.janrufmonitor.framework.ICaller) IRequester(de.janrufmonitor.service.commons.http.IRequester) CallerGetHandler(de.janrufmonitor.service.client.request.handler.CallerGetHandler) IHttpResponse(de.janrufmonitor.service.commons.http.IHttpResponse)

Aggregations

ICaller (de.janrufmonitor.framework.ICaller)1 CallerGetHandler (de.janrufmonitor.service.client.request.handler.CallerGetHandler)1 IHttpResponse (de.janrufmonitor.service.commons.http.IHttpResponse)1 IRequester (de.janrufmonitor.service.commons.http.IRequester)1