com.gooddata.AbstractPollHandler Maven / Gradle / Ivy
/*
* Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved.
*/
package com.gooddata;
import org.springframework.http.client.ClientHttpResponse;
import static com.gooddata.util.Validate.notNull;
/**
* For internal use by services employing polling.
* Implementing classes should override {@link #isFinished(ClientHttpResponse)} method and
* may override {@link #onFinish()} and {@link #handlePollResult(Object)} methods.
*
* @param
polling type
* @param result type
*
* @see com.gooddata.FutureResult
*/
public abstract class AbstractPollHandler extends AbstractPollHandlerBase
{
private String pollingUri;
/**
* Creates a new instance of polling handler
* @param pollingUri URI for polling
* @param pollClass class of the polling object (or {@link Void})
* @param resultClass class of the result (or {@link Void})
*/
public AbstractPollHandler(final String pollingUri, final Class
pollClass, Class resultClass) {
super(pollClass, resultClass);
this.pollingUri = notNull(pollingUri, "pollingUri");
}
@Override
public final String getPollingUri() {
return pollingUri;
}
protected void setPollingUri(final String pollingUri) {
this.pollingUri = pollingUri;
}
}