</properties>
<dependencies>
- <dependency>
- <groupId>org.apache.aries.blueprint</groupId>
- <artifactId>blueprint-maven-plugin-annotation</artifactId>
- <optional>true</optional>
- </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</testResource>
</testResources>
<plugins>
- <plugin>
- <groupId>org.apache.aries.blueprint</groupId>
- <artifactId>blueprint-maven-plugin</artifactId>
- <configuration>
- <scanPaths>org.opendaylight.ovsdb.lib</scanPaths>
- </configuration>
- </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLEngineResult.HandshakeStatus;
import javax.net.ssl.SSLPeerUnverifiedException;
-import org.apache.aries.blueprint.annotation.service.Reference;
-import org.apache.aries.blueprint.annotation.service.Service;
-import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.aaa.cert.api.ICertificateManager;
import org.opendaylight.ovsdb.lib.OvsdbClient;
import org.opendaylight.ovsdb.lib.OvsdbConnection;
* and a Singleton object in a non-OSGi environment.
*/
@Singleton
-@Service(classes = OvsdbConnection.class)
public class OvsdbConnectionService implements AutoCloseable, OvsdbConnection {
private class ClientChannelInitializer extends ChannelInitializer<SocketChannel> {
@Override
.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("OVSDBConnNotifSer-%d").build());
private static final StalePassiveConnectionService STALE_PASSIVE_CONNECTION_SERVICE =
- new StalePassiveConnectionService((client) -> {
+ new StalePassiveConnectionService(client -> {
notifyListenerForPassiveConnection(client);
return null;
});
@Inject
public OvsdbConnectionService(final NettyBootstrapFactory bootstrapFactory,
- @Reference(filter = "type=default-certificate-manager") final ICertificateManager certManagerSrv) {
+ final ICertificateManager certManagerSrv) {
this.bootstrapFactory = requireNonNull(bootstrapFactory);
this.certManagerSrv = certManagerSrv;
}
*/
@Override
public synchronized boolean startOvsdbManager() {
- final int ovsdbListenerPort = this.listenerPort;
- final String ovsdbListenerIp = this.listenerIp;
+ final int ovsdbListenerPort = listenerPort;
+ final String ovsdbListenerIp = listenerIp;
if (singletonCreated.getAndSet(true)) {
return false;
}
@SuppressWarnings("checkstyle:IllegalCatch")
private static void handleNewPassiveConnection(final OvsdbClient client) {
ListenableFuture<List<String>> echoFuture = client.echo();
- LOG.debug("Send echo message to probe the OVSDB switch {}",client.getConnectionInfo());
+ LOG.debug("Send echo message to probe the OVSDB switch {}", client.getConnectionInfo());
Futures.addCallback(echoFuture, new FutureCallback<List<String>>() {
@Override
- public void onSuccess(@Nullable List<String> result) {
- LOG.info("Probe was successful to OVSDB switch {}",client.getConnectionInfo());
+ public void onSuccess(final List<String> result) {
+ LOG.info("Probe was successful to OVSDB switch {}", client.getConnectionInfo());
//List<OvsdbClient> clientsFromSameNode = getPassiveClientsFromSameNode(client);
try {
getPassiveClientsFromSameNode(client);
<property name="jsonRpcDecoderMaxFrameLength" value="${json-rpc-decoder-max-frame-length}"/>
</bean>
+ <reference id="certificateManager" interface="org.opendaylight.aaa.cert.api.ICertificateManager"
+ filter="type=default-certificate-manager"/>
+
+ <bean id="nettyBootstrapFactory" class="org.opendaylight.ovsdb.lib.impl.NettyBootstrapFactory" destroy-method="close"/>
+ <bean id="ovsdbConnectionService" class="org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService">
+ <argument ref="nettyBootstrapFactory"/>
+ <argument ref="certificateManager"/>
+ </bean>
+
+ <service ref="ovsdbConnectionService" interface="org.opendaylight.ovsdb.lib.OvsdbConnection"/>
</blueprint>