io.logspace.agent.hq.UploadEventsResponseHandler Maven / Gradle / Ivy
/**
* Logspace
* Copyright (c) 2015 Indoqa Software Design und Beratung GmbH. All rights reserved.
* This program and the accompanying materials are made available under the terms of
* the Eclipse Public License Version 1.0, which accompanies this distribution and
* is available at http://www.eclipse.org/legal/epl-v10.html.
*/
package io.logspace.agent.hq;
import java.io.IOException;
import io.logspace.agent.shaded.apache.http.HttpResponse;
import io.logspace.agent.shaded.apache.http.client.ResponseHandler;
public class UploadEventsResponseHandler implements ResponseHandler {
private static final int HTTP_ACCEPTED = 202;
@Override
public Void handleResponse(final HttpResponse response) throws IOException {
if (response.getStatusLine().getStatusCode() != HTTP_ACCEPTED) {
throw new UploadException();
}
return null;
}
}