Cache netconf operations
[netconf.git] / netconf / netconf-monitoring / src / main / java / org / opendaylight / netconf / monitoring / osgi / NetconfMonitoringOperationService.java
index 7bdeac6af5c1c80ecb12a6e64cfde163f3b7a6eb..e1d8b1e82ce149aadd5d876870298cd7872ddc0f 100644 (file)
@@ -5,10 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.monitoring.osgi;
 
-import com.google.common.collect.Sets;
+import com.google.common.collect.ImmutableSet;
 import java.util.Set;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.netconf.mapping.api.NetconfOperation;
@@ -18,15 +17,15 @@ import org.opendaylight.netconf.monitoring.GetSchema;
 
 public class NetconfMonitoringOperationService implements NetconfOperationService {
 
-    private final NetconfMonitoringService monitor;
+    private final ImmutableSet<NetconfOperation> netconfOperations;
 
     public NetconfMonitoringOperationService(final NetconfMonitoringService monitor) {
-        this.monitor = monitor;
+        netconfOperations = ImmutableSet.of(new Get(monitor), new GetSchema(monitor));
     }
 
     @Override
     public Set<NetconfOperation> getNetconfOperations() {
-        return Sets.newHashSet(new Get(monitor), new GetSchema(monitor));
+        return netconfOperations;
     }
 
     @Override