Add the ability to report known connected clients
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / FrontendMetadata.java
index 0bf23e776c563c8e42fe4bb8e3cae79f71a784d5..d5ecbf6ea416c6c283f0e06b5537293bbdef99e8 100644 (file)
@@ -11,6 +11,7 @@ import static com.google.common.base.Verify.verify;
 import static java.util.Objects.requireNonNull;
 
 import com.google.common.collect.Collections2;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Maps;
 import java.util.HashMap;
 import java.util.Map;
@@ -149,4 +150,10 @@ final class FrontendMetadata extends ShardDataTreeMetadata<FrontendShardDataTree
 
         verify(clients.replace(frontendId, client, new FrontendClientMetadataBuilder.Disabled(shardName, clientId)));
     }
+
+    ImmutableSet<ClientIdentifier> getClients() {
+        return clients.values().stream()
+                .map(FrontendClientMetadataBuilder::getIdentifier)
+                .collect(ImmutableSet.toImmutableSet());
+    }
 }