X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2Fosgi%2FNetconfOperationServiceFactoryListenerImpl.java;fp=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2Fosgi%2FNetconfOperationServiceFactoryListenerImpl.java;h=134c38ba971bcfd510386f112ed6cf00c1a941c4;hp=0000000000000000000000000000000000000000;hb=a92d9d6a21a0f6ca8d2153795721f500eaf29ee9;hpb=fbc3092ca33990f0fc4a47f008786a416c484488 diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java new file mode 100644 index 0000000000..134c38ba97 --- /dev/null +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * 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.controller.netconf.impl.osgi; + +import java.util.HashSet; +import java.util.Set; + +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; + +public class NetconfOperationServiceFactoryListenerImpl implements NetconfOperationServiceFactoryListener { + private final Set allFactories = new HashSet<>(); + + @Override + public synchronized void onAddNetconfOperationServiceFactory(NetconfOperationServiceFactory service) { + allFactories.add(service); + } + + @Override + public synchronized void onRemoveNetconfOperationServiceFactory(NetconfOperationServiceFactory service) { + allFactories.remove(service); + } + + @Override + public synchronized NetconfOperationServiceSnapshot getSnapshot(long sessionId) { + return new NetconfOperationServiceSnapshot(allFactories, sessionId); + } + +}