import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
import java.util.List;
-import java.util.TimeZone;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
*
*/
+@SuppressWarnings("squid:S1874") // "@Deprecated" code should not be used
public class NonrtRicApiProvider implements AutoCloseable, A1ADAPTERAPIService {
protected static final String APP_NAME = "nonrt-ric-api";
log.info("Successfully closed provider for {}", APP_NAME);
}
- private static class Iso8601Util {
-
- private static TimeZone timeZone = TimeZone.getTimeZone("UTC");
- private DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
-
- private Iso8601Util() {
- dateFormat.setTimeZone(timeZone);
- }
-
- private String now() {
- return dateFormat.format(new Date());
- }
- }
-
public void setDataBroker(DataBroker dataBroker) {
this.dataBroker = dataBroker;
if (log.isDebugEnabled()) {
DeletePolicyOutputBuilder responseBuilder = new DeletePolicyOutputBuilder();
String uri = nearRicUrlProvider.deletePolicyUrl(String.valueOf(input.getNearRtRicUrl()),
String.valueOf(input.getPolicyId()));
- ResponseEntity<Void> response = restAdapter.delete(uri);
+ restAdapter.delete(uri);
log.info("End of deletePolicy");
RpcResult<DeletePolicyOutput> rpcResult = RpcResultBuilder
.<DeletePolicyOutput>status(true).withResult(responseBuilder.build()).build();
package org.onap.sdnc.northbound.restadapter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
public class RestAdapterImpl implements RestAdapter {
- private final Logger log = LoggerFactory.getLogger(RestAdapterImpl.class);
-
private RestTemplate restTemplate;
public RestAdapterImpl() {
public <T> ResponseEntity<T> put(String uri, String body, Class<T> clazz) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
- HttpEntity<String> entity = new HttpEntity<String>(body, headers);
+ HttpEntity<String> entity = new HttpEntity<>(body, headers);
return invokeHttpRequest(uri, HttpMethod.PUT, clazz, entity);
}