import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
+import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig;
import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams;
import org.onap.policy.controlloop.actorserviceprovider.pipeline.PipelineControllerFuture;
import org.onap.policy.controlloop.policy.PolicyResult;
private static final Logger logger = LoggerFactory.getLogger(HttpOperation.class);
/**
- * Operator that created this operation.
+ * Configuration for this operation.
*/
- private final HttpOperator operator;
+ private final HttpConfig config;
/**
* Response class.
* Constructs the object.
*
* @param params operation parameters
- * @param operator operator that created this operation
+ * @param config configuration for this operation
* @param clazz response class
*/
- public HttpOperation(ControlLoopOperationParams params, HttpOperator operator, Class<T> clazz) {
- super(params, operator);
- this.operator = operator;
+ public HttpOperation(ControlLoopOperationParams params, HttpConfig config, Class<T> clazz) {
+ super(params, config);
+ this.config = config;
this.responseClass = clazz;
}
+ public HttpClient getClient() {
+ return config.getClient();
+ }
+
+ public String getPath() {
+ return config.getPath();
+ }
+
+ public long getTimeoutMs() {
+ return config.getTimeoutMs();
+ }
+
/**
* If no timeout is specified, then it returns the operator's configured timeout.
*/
@Override
protected long getTimeoutMs(Integer timeoutSec) {
- return (timeoutSec == null || timeoutSec == 0 ? operator.getTimeoutMs() : super.getTimeoutMs(timeoutSec));
+ return (timeoutSec == null || timeoutSec == 0 ? getTimeoutMs() : super.getTimeoutMs(timeoutSec));
}
/**
* @return the path URI suffix
*/
public String makePath() {
- return operator.getPath();
+ return getPath();
}
/**
* @return the URL to which from which to get
*/
public String makeUrl() {
- return (operator.getClient().getBaseUrl() + makePath());
+ return (getClient().getBaseUrl() + makePath());
}
/**