* UEB Topic Name Index
*/
protected HashMap<String, UebTopicSource> uebTopicSources =
- new HashMap<String, UebTopicSource>();
+ new HashMap<>();
/**
* {@inheritDoc}
logger.info("{}: no topic for UEB Source", this);
return new ArrayList<UebTopicSource>();
}
- List<String> readTopicList = new ArrayList<String>(Arrays.asList(readTopics.split("\\s*,\\s*")));
+ List<String> readTopicList = new ArrayList<>(Arrays.asList(readTopics.split("\\s*,\\s*")));
- List<UebTopicSource> newUebTopicSources = new ArrayList<UebTopicSource>();
+ List<UebTopicSource> newUebTopicSources = new ArrayList<>();
synchronized(this) {
for (String topic: readTopicList) {
if (this.uebTopicSources.containsKey(topic)) {
continue;
}
- List<String> serverList = new ArrayList<String>(Arrays.asList(servers.split("\\s*,\\s*")));
+ List<String> serverList = new ArrayList<>(Arrays.asList(servers.split("\\s*,\\s*")));
String apiKey = properties.getProperty(PolicyProperties.PROPERTY_UEB_SOURCE_TOPICS +
"." + topic +
@Override
public synchronized List<UebTopicSource> inventory() {
List<UebTopicSource> readers =
- new ArrayList<UebTopicSource>(this.uebTopicSources.values());
+ new ArrayList<>(this.uebTopicSources.values());
return readers;
}
if (servers == null || servers.isEmpty())
throw new IllegalArgumentException("No DMaaP servers or DME2 partner provided");
- ArrayList<String> dmaapServers = new ArrayList<String>();
+ ArrayList<String> dmaapServers = new ArrayList<>();
if(useHttps){
for (String server: servers) {
dmaapServers.add(server + ":3905");
this.publisher.setProtocolFlag(ProtocolTypeConstants.AAF_AUTH.getValue());
} else if (protocol == ProtocolTypeConstants.DME2) {
- ArrayList<String> dmaapServers = new ArrayList<String>();
+ ArrayList<String> dmaapServers = new ArrayList<>();
dmaapServers.add("0.0.0.0:3904");
this.publisher =
props.setProperty("TransportType", "DME2");
props.setProperty("MethodType", "POST");
- for (String key : additionalProps.keySet()) {
- String value = additionalProps.get(key);
+ for (Map.Entry<String,String> entry : additionalProps.entrySet()) {
+ String key = entry.getKey();
+ String value = entry.getValue();
if (value != null)
props.setProperty(key, value);
/**
* All my subscribers for new message notifications
*/
- protected final ArrayList<TopicListener> topicListeners = new ArrayList<TopicListener>();
+ protected final ArrayList<TopicListener> topicListeners = new ArrayList<>();
/**
@Override
public void unregister(TopicListener topicListener) {
- boolean stop = false;
+ boolean stop;
synchronized (this) {
super.unregister(topicListener);
- stop = (this.topicListeners.isEmpty());
+ stop = this.topicListeners.isEmpty();
}
if (stop) {
/**
* event cache
*/
- protected CircularFifoQueue<String> recentEvents = new CircularFifoQueue<String>(10);
+ protected CircularFifoQueue<String> recentEvents = new CircularFifoQueue<>(10);
/**
* Am I running?
/**
* All my subscribers for new message notifications
*/
- protected final ArrayList<TopicListener> topicListeners = new ArrayList<TopicListener>();
+ protected final ArrayList<TopicListener> topicListeners = new ArrayList<>();
/**
* Instantiates a new Topic Base