*/
package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.provider.impl.rev140328;
+import com.google.common.base.MoreObjects;
import java.net.InetAddress;
import java.net.UnknownHostException;
-
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration;
import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Objects;
-
/**
*
*/
* @param identifier
* @param dependencyResolver
*/
- public SwitchConnectionProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ public SwitchConnectionProviderModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
* @param oldModule
* @param oldInstance
*/
- public SwitchConnectionProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
- SwitchConnectionProviderModule oldModule, java.lang.AutoCloseable oldInstance) {
+ public SwitchConnectionProviderModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ final SwitchConnectionProviderModule oldModule, final java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
@Override
public java.lang.AutoCloseable createInstance() {
LOG.info("SwitchConnectionProvider started.");
- SwitchConnectionProviderImpl switchConnectionProviderImpl = new SwitchConnectionProviderImpl();
+ final SwitchConnectionProviderImpl switchConnectionProviderImpl = new SwitchConnectionProviderImpl();
try {
- ConnectionConfiguration connConfiguration = createConnectionConfiguration();
+ final ConnectionConfiguration connConfiguration = createConnectionConfiguration();
switchConnectionProviderImpl.setConfiguration(connConfiguration);
- } catch (UnknownHostException e) {
+ } catch (final UnknownHostException e) {
throw new IllegalArgumentException(e.getMessage(), e);
}
return switchConnectionProviderImpl;
final long switchIdleTimeout = getSwitchIdleTimeout();
final Tls tlsConfig = getTls();
final Threads threads = getThreads();
+ final Boolean useBarrier = getUseBarrier();
final TransportProtocol transportProtocol = getTransportProtocol();
return new ConnectionConfiguration() {
return new TlsConfiguration() {
@Override
public KeystoreType getTlsTruststoreType() {
- return Objects.firstNonNull(tlsConfig.getTruststoreType(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getTruststoreType(), null);
}
@Override
public String getTlsTruststore() {
- return Objects.firstNonNull(tlsConfig.getTruststore(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getTruststore(), null);
}
@Override
public KeystoreType getTlsKeystoreType() {
- return Objects.firstNonNull(tlsConfig.getKeystoreType(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getKeystoreType(), null);
}
@Override
public String getTlsKeystore() {
- return Objects.firstNonNull(tlsConfig.getKeystore(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getKeystore(), null);
}
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType getTlsKeystorePathType() {
- return Objects.firstNonNull(tlsConfig.getKeystorePathType(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getKeystorePathType(), null);
}
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType getTlsTruststorePathType() {
- return Objects.firstNonNull(tlsConfig.getTruststorePathType(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getTruststorePathType(), null);
}
@Override
public String getKeystorePassword() {
- return Objects.firstNonNull(tlsConfig.getKeystorePassword(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getKeystorePassword(), null);
}
@Override
public String getCertificatePassword() {
- return Objects.firstNonNull(tlsConfig.getCertificatePassword(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getCertificatePassword(), null);
}
@Override
public String getTruststorePassword() {
- return Objects.firstNonNull(tlsConfig.getTruststorePassword(), null);
+ return MoreObjects.firstNonNull(tlsConfig.getTruststorePassword(), null);
}
};
}
}
};
}
+
+ @Override
+ public boolean useBarrier() {
+ return useBarrier;
+ }
};
}
* @return
* @throws UnknownHostException
*/
- private static InetAddress extractIpAddressBin(IpAddress address) throws UnknownHostException {
+ private static InetAddress extractIpAddressBin(final IpAddress address) throws UnknownHostException {
byte[] addressBin = null;
if (address != null) {
if (address.getIpv4Address() != null) {
* @param value
* @return
*/
- private static byte[] address2bin(String value) {
+ private static byte[] address2bin(final String value) {
//TODO: translate ipv4 or ipv6 into byte[]
return null;
}