import java.util.EnumMap;
import java.util.Map;
+import java.util.Optional;
import java.util.Properties;
import java.util.Set;
-import java.util.Optional;
-import java.util.concurrent.atomic.AtomicReference;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import org.onap.policy.apex.service.engine.event.SynchronousEventCache;
import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerParameters;
import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMode;
-import org.onap.policy.common.parameters.GroupValidationResult;
-import org.onap.policy.common.parameters.ParameterException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Set<String> names = restProducerProperties.getKeysFromUrl();
Set<String> inputProperty = executionProperties.stringPropertyNames();
- names.stream().map(key -> Optional.of(key)).forEach(op -> {
- op.filter(str -> inputProperty.contains(str))
+ names.stream().map(Optional::of).forEach(op ->
+ op.filter(inputProperty::contains)
.orElseThrow(() -> new ApexEventRuntimeException(
- "key\"" + op.get() + "\"specified on url \"" + restProducerProperties.getUrl() +
- "\"not found in execution properties passed by the current policy"));
- });
+ "key\"" + op.get() + "\"specified on url \"" + restProducerProperties.getUrl()
+ + "\"not found in execution properties passed by the current policy"))
+ );
untaggedUrl = names.stream().reduce(untaggedUrl,
(acc, str) -> acc.replace("{" + str + "}", (String) executionProperties.get(str)));
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Optional;
import java.util.Map.Entry;
+import java.util.Optional;
import java.util.Properties;
+import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
Set<String> names = restConsumerProperties.getKeysFromUrl();
Set<String> inputProperty = inputExecutionProperties.stringPropertyNames();
- names.stream().map(key -> Optional.of(key)).forEach(op -> {
- op.filter(str -> inputProperty.contains(str))
+ names.stream().map(Optional::of).forEach(op ->
+ op.filter(inputProperty::contains)
.orElseThrow(() -> new ApexEventRuntimeException(
- "key\"" + op.get() + "\"specified on url \"" + restConsumerProperties.getUrl() +
- "\"not found in execution properties passed by the current policy"));
- });
+ "key\"" + op.get() + "\"specified on url \"" + restConsumerProperties.getUrl()
+ + "\"not found in execution properties passed by the current policy"))
+ );
untaggedUrl = names.stream().reduce(untaggedUrl,
- (acc, str) -> acc.replace("{" + str + "}", (String) inputExecutionProperties.get(str)));
+ (acc, str) -> acc.replace("{" + str + "}", (String) inputExecutionProperties.get(str)));
}
// Set the time stamp of the REST request