</properties>
<dependencies>
+ <!-- Java -->
<dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>features-yangtools</artifactId>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ </dependency>
+
+ <!-- Google -->
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+
+ <!-- Jackson -->
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.datatype</groupId>
+ <artifactId>jackson-datatype-json-org</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-jaxb-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-base</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ </dependency>
+
+ <!-- Jersey -->
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-servlet</artifactId>
+ </dependency>
+
+ <!-- Netty -->
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-buffer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-codec-http</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-handler</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport</artifactId>
+ </dependency>
+
+ <!-- OpenDaylight -->
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>features-akka</artifactId>
+ <version>${commons.opendaylight.version}</version>
<classifier>features</classifier>
<type>xml</type>
</dependency>
<classifier>features</classifier>
<type>xml</type>
</dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>features-akka</artifactId>
- <version>${commons.opendaylight.version}</version>
- <classifier>features</classifier>
+ <artifactId>md-sal-config</artifactId>
+ <version>${mdsal.version}</version>
<type>xml</type>
+ <classifier>config</classifier>
</dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
+ <artifactId>sal-akka-raft</artifactId>
+ <version>${mdsal.version}</version>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-broker-impl</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-dom-xsql</artifactId>
- </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-karaf-xsql</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-dom-xsql-config</artifactId>
- <classifier>config</classifier>
- <type>xml</type>
- </dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-binding-api</artifactId>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-connector-api</artifactId>
</dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-inmemory-datastore</artifactId>
+ <artifactId>sal-dom-xsql</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>md-sal-config</artifactId>
- <version>${mdsal.version}</version>
- <type>xml</type>
+ <artifactId>sal-dom-xsql-config</artifactId>
<classifier>config</classifier>
+ <type>xml</type>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-distributed-datastore</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-remoterpc-connector</artifactId>
- </dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-clustering-commons</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-akka-raft</artifactId>
- <version>${mdsal.version}</version>
- </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-clustering-config</artifactId>
<type>xml</type>
<classifier>config</classifier>
</dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-netconf-connector</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller.model</groupId>
- <artifactId>model-inventory</artifactId>
+ <artifactId>sal-distributed-datastore</artifactId>
</dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>netconf-config-dispatcher</artifactId>
+ <artifactId>sal-inmemory-datastore</artifactId>
</dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>netconf-connector-config</artifactId>
- <version>${netconf.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
+ <artifactId>sal-netconf-connector</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-rest-connector</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-server</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-servlet</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-buffer</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-codec</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-codec-http</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-common</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-handler</artifactId>
+ <artifactId>sal-remote</artifactId>
</dependency>
<dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport</artifactId>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-remoterpc-connector</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-remote</artifactId>
+ <artifactId>sal-rest-connector</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<classifier>config</classifier>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller.samples</groupId>
- <artifactId>sample-toaster</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller.samples</groupId>
- <artifactId>sample-toaster-provider</artifactId>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-rest-docgen</artifactId>
</dependency>
+
<dependency>
- <groupId>org.opendaylight.controller.samples</groupId>
- <artifactId>sample-toaster-consumer</artifactId>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>netconf-config-dispatcher</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller.samples</groupId>
- <artifactId>toaster-config</artifactId>
- <version>${mdsal.version}</version>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>netconf-connector-config</artifactId>
+ <version>${netconf.version}</version>
<type>xml</type>
<classifier>config</classifier>
</dependency>
+
<dependency>
- <groupId>org.opendaylight.controller.samples</groupId>
- <artifactId>clustering-it-model</artifactId>
- <version>${mdsal.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller.samples</groupId>
- <artifactId>clustering-it-provider</artifactId>
- <version>${mdsal.version}</version>
+ <groupId>org.opendaylight.controller.model</groupId>
+ <artifactId>model-inventory</artifactId>
</dependency>
+
<dependency>
<groupId>org.opendaylight.controller.samples</groupId>
<artifactId>clustering-it-config</artifactId>
<artifactId>clustering-it-config</artifactId>
<version>${mdsal.version}</version>
<type>xml</type>
- <classifier>testmoduleshardconf</classifier>
+ <classifier>testmoduleconf</classifier>
</dependency>
<dependency>
<groupId>org.opendaylight.controller.samples</groupId>
<artifactId>clustering-it-config</artifactId>
<version>${mdsal.version}</version>
<type>xml</type>
- <classifier>testmoduleconf</classifier>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-rest-docgen</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
+ <classifier>testmoduleshardconf</classifier>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
+ <groupId>org.opendaylight.controller.samples</groupId>
+ <artifactId>clustering-it-model</artifactId>
+ <version>${mdsal.version}</version>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
+ <groupId>org.opendaylight.controller.samples</groupId>
+ <artifactId>clustering-it-provider</artifactId>
+ <version>${mdsal.version}</version>
</dependency>
+
+ <!-- toaster -->
<dependency>
- <groupId>com.fasterxml.jackson.datatype</groupId>
- <artifactId>jackson-datatype-json-org</artifactId>
+ <groupId>org.opendaylight.controller.samples</groupId>
+ <artifactId>sample-toaster</artifactId>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.module</groupId>
- <artifactId>jackson-module-jaxb-annotations</artifactId>
+ <groupId>org.opendaylight.controller.samples</groupId>
+ <artifactId>sample-toaster-consumer</artifactId>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-base</artifactId>
+ <groupId>org.opendaylight.controller.samples</groupId>
+ <artifactId>sample-toaster-provider</artifactId>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <groupId>org.opendaylight.controller.samples</groupId>
+ <artifactId>toaster-config</artifactId>
+ <version>${mdsal.version}</version>
+ <type>xml</type>
+ <classifier>config</classifier>
</dependency>
+
+ <!-- yang -->
<dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>features-yangtools</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
</dependency>
+
<!-- test to validate features.xml -->
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
return null;
}
for (String cacheName : manager.getCacheNames()) {
- if (!manager.isRunning(cacheName)) continue;
+ if (!manager.isRunning(cacheName)) {
+ continue;
+ }
if (cacheName.startsWith("{" + containerName + "}_")) {
String[] res = cacheName.split("[{}]");
if (res.length >= 4 && res[1].equals(containerName)
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
IPHostId other = (IPHostId) obj;
if (ipAddress == null) {
- if (other.ipAddress != null)
+ if (other.ipAddress != null) {
return false;
- } else if (!ipAddress.equals(other.ipAddress))
+ }
+ } else if (!ipAddress.equals(other.ipAddress)) {
return false;
+ }
return true;
}
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
IPMacHostId other = (IPMacHostId) obj;
if (ipAddress == null) {
- if (other.ipAddress != null)
+ if (other.ipAddress != null) {
return false;
- } else if (!ipAddress.equals(other.ipAddress))
+ }
+ } else if (!ipAddress.equals(other.ipAddress)) {
return false;
+ }
if (macAddr == null) {
- if (other.macAddr != null)
+ if (other.macAddr != null) {
return false;
- } else if (!macAddr.equals(other.macAddr))
+ }
+ } else if (!macAddr.equals(other.macAddr)) {
return false;
+ }
return true;
}
@Override
public HostNodeConnector call() throws Exception {
HostNodeConnector h = hostTracker.hostFind(trackedHost);
- if (h != null)
+ if (h != null) {
return h;
+ }
hostTracker.setCallableOnPendingARP(trackedHost, this);
Thread.sleep(2000); // wait 2sec to see if the host responds
return hostTracker.hostQuery(trackedHost);
@Override
protected void configureGlobalInstance(Component c, Object imp) {
- if (!imp.equals(BundleScanServiceImpl.class)) return;
+ if (!imp.equals(BundleScanServiceImpl.class)) {
+ return;
+ }
// export service
c.setInterface(
new String[] { IBundleScanService.class.getName() },
}
private boolean matches(Pattern pattern, Set<String> values) {
- if (pattern == null) return true;
+ if (pattern == null) {
+ return true;
+ }
//LOGGER.debug("Matching: {} {}", pattern.toString(), values);
for (String s : values) {
- if (pattern.matcher(s).find()) return true;
+ if (pattern.matcher(s).find()) {
+ return true;
+ }
}
return false;
}
Bundle initBundle, Set<String> excludes)
{
for (BundleInfo other : bundlesToScan) {
- if (other.getId() == target.getId()) continue;
+ if (other.getId() == target.getId()) {
+ continue;
+ }
if (target.isDependantOn(other)) {
if (!visited.contains(other)) {
classes.addAll(BundleScanner.loadClasses(
private boolean isDependantOn(BundleInfo other) {
for (String pkg : importPkgs) {
- if (other.exportPkgs.contains(pkg)) return true;
+ if (other.exportPkgs.contains(pkg)) {
+ return true;
+ }
}
return false;
}
public List<BundleInfo> getDependencies(Collection<BundleInfo> bundles) {
List<BundleInfo> result = new ArrayList<BundleInfo>();
for(BundleInfo bundle : bundles) {
- if (isDependantOn(bundle)) result.add(bundle);
+ if (isDependantOn(bundle)) {
+ result.add(bundle);
+ }
}
return result;
}
private static Set<String> parsePackages(String packageString) {
- if (packageString == null) return Collections.emptySet();
+ if (packageString == null) {
+ return Collections.emptySet();
+ }
String[] packages = packageString.split(",");
Set<String> result = new HashSet<String>();
for (int i=0; i<packages.length; i++) {
boolean includeDependentBundleClasses)
{
BundleInfo info = bundleAnnotations.get(context.getBundle().getBundleId());
- if (info == null) return Collections.emptyList();
+ if (info == null) {
+ return Collections.emptyList();
+ }
Pattern pattern = mergePatterns(annotations, false);
List<Class<?>> result = null;
if (includeDependentBundleClasses) {
StringBuilder errors = new StringBuilder();
for (String name : annotatedClasses) {
try {
- if (excludes != null && excludes.contains(name)) continue;
+ if (excludes != null && excludes.contains(name)) {
+ continue;
+ }
result.add(initBundle.loadClass(name));
} catch (ClassNotFoundException e) {
errors.append(name).append(", ");
if (c.endsWith("*")) {
c = c.substring(0, c.length() - 1);
}
- if (regex.length() > 0) regex.append("|");
+ if (regex.length() > 0) {
+ regex.append("|");
+ }
regex.append("^");
if (convert2signature) {
regex.append("L").append(c.replaceAll("\\.", "/"));
}
private void validate(List<Class<?>> classes) {
- if (classes == null || classes.size() == 0) return;
+ if (classes == null || classes.size() == 0) {
+ return;
+ }
Map<String,String> names = new HashMap<String,String>();
StringBuilder conflictsMsg = new StringBuilder();
for (Class<?> c : classes) {
XmlRootElement root = c.getAnnotation(XmlRootElement.class);
- if (root == null) continue;
+ if (root == null) {
+ continue;
+ }
String rootName = root.name();
if ("##default".equals(rootName)) {
String clsName = c.getSimpleName();
}
@Context
public void setSecurityContext(SecurityContext context) {
- if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+ if (context != null && context.getUserPrincipal() != null) {
+ username = context.getUserPrincipal().getName();
+ }
}
protected String getUserName() {
return username;
@Context
public void setSecurityContext(SecurityContext context) {
- if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+ if (context != null && context.getUserPrincipal() != null) {
+ username = context.getUserPrincipal().getName();
+ }
}
protected String getUserName() {
@Context
public void setSecurityContext(SecurityContext context) {
- if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+ if (context != null && context.getUserPrincipal() != null) {
+ username = context.getUserPrincipal().getName();
+ }
}
protected String getUserName() {
return username;
@Context
public void setSecurityContext(SecurityContext context) {
- if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+ if (context != null && context.getUserPrincipal() != null) {
+ username = context.getUserPrincipal().getName();
+ }
}
protected String getUserName() {
return username;
}
@Context
public void setSecurityContext(SecurityContext context) {
- if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+ if (context != null && context.getUserPrincipal() != null) {
+ username = context.getUserPrincipal().getName();
+ }
}
protected String getUserName() {
import org.opendaylight.controller.sal.utils.INodeFactory;
import org.opendaylight.controller.sal.core.Node;
-public class StubNodeFactory implements INodeFactory
- {
- void init() {
- }
+public class StubNodeFactory implements INodeFactory {
+ void init() {
+ }
- /**
- * Function called by the dependency manager when at least one dependency
- * become unsatisfied or when the component is shutting down because for
- * example bundle is being stopped.
- *
- */
- void destroy() {
- }
+ /**
+ * Function called by the dependency manager when at least one dependency
+ * become unsatisfied or when the component is shutting down because for
+ * example bundle is being stopped.
+ *
+ */
+ void destroy() {
+ }
- /**
- * Function called by dependency manager after "init ()" is called and after
- * the services provided by the class are registered in the service registry
- *
- */
- void start() {
- }
+ /**
+ * Function called by dependency manager after "init ()" is called and after
+ * the services provided by the class are registered in the service registry
+ *
+ */
+ void start() {
+ }
- /**
- * Function called by the dependency manager before the services exported by
- * the component are unregistered, this will be followed by a "destroy ()"
- * calls
- *
- */
- void stop() {
- }
+ /**
+ * Function called by the dependency manager before the services exported by
+ * the component are unregistered, this will be followed by a "destroy ()"
+ * calls
+ *
+ */
+ void stop() {
+ }
- public Node fromString(String nodeType, String nodeId){
- if(nodeType.equals("STUB"))
- try{
- return new Node("STUB", Integer.parseInt(nodeId));
- } catch(ConstructionException e)
- {
- return null;
- }
- return null;
- }
+ public Node fromString(String nodeType, String nodeId){
+ if(nodeType.equals("STUB")) {
+ try {
+ return new Node("STUB", Integer.parseInt(nodeId));
+ } catch(ConstructionException e) {
+ return null;
+ }
+ }
+ return null;
+ }
}
@Override
public ConnectionLocality getLocalityStatus(Node node) {
- if (this.connectionListener == null) return ConnectionLocality.NOT_CONNECTED;
+ if (this.connectionListener == null) {
+ return ConnectionLocality.NOT_CONNECTED;
+ }
return connectionListener.getLocalityStatus(node);
}
@Override
public Status disconnect(Node node) {
IPluginInConnectionService s = pluginService.get(node.getType());
- if (s != null) return s.disconnect(node);
+ if (s != null) {
+ return s.disconnect(node);
+ }
return new Status(StatusCode.NOTFOUND);
}
@Override
public boolean memberExists(String name, String poolName) {
- if(this.pools.containsKey(poolName)){
- if(this.pools.get(poolName).getMember(name) != null )
+ if (this.pools.containsKey(poolName)) {
+ if (this.pools.get(poolName).getMember(name) != null) {
return true;
+ }
}
return false;
}
@Override
- public boolean memberExists(String name, String memberIP,String poolName){
- if(!this.pools.containsKey(poolName))
+ public boolean memberExists(String name, String memberIP,String poolName) {
+ if (!this.pools.containsKey(poolName)) {
return false;
+ }
return this.pools.get(poolName).poolMemberExists(new PoolMember(name, memberIP, poolName));
}
* requires
*/
public String getContainerName() {
- if (containerName == null)
+ if (containerName == null) {
return GlobalConstants.DEFAULT.toString();
+ }
return containerName;
}
private String checkPasswordRecovery() {
final String fileDescription = "Default Network Administrator password recovery file";
File recoveryFile = new File(UserManager.RECOVERY_FILE);
- if (!recoveryFile.exists()) return null;
+ if (!recoveryFile.exists()) {
+ return null;
+ }
// read the recovery file
String pwd = null;
try {
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>clustering.services</artifactId>
javax.servlet.resources,
javax.xml.parsers,
javax.xml.transform,
+ org.apache.commons.io,
org.apache.commons.logging,
org.apache.taglibs.standard.functions,
org.apache.taglibs.standard.resources,
/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2014 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,
package org.opendaylight.controller.web;
import java.io.FileInputStream;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import org.apache.commons.io.IOUtils;
import org.opendaylight.controller.configuration.IConfigurationContainerService;
import org.opendaylight.controller.configuration.IConfigurationService;
import org.opendaylight.controller.containermanager.IContainerAuthorization;
@ResponseBody
public String getVersion(HttpServletRequest request, @PathVariable("property") String property) {
Properties prop = new Properties();
+ FileInputStream propertiesFile = null;
try {
- prop.load(new FileInputStream("version.properties"));
+ propertiesFile = new FileInputStream("version.properties");
+ prop.load(propertiesFile);
return prop.getProperty(property+".version");
- } catch (Exception e) {
+ } catch (IOException e) {
+ // TODO: We should be logging the exception here
+ // "Failed to open version.properties."
return null;
+ } finally {
+ IOUtils.closeQuietly(propertiesFile);
}
}
@RequestMapping(value = "web.json")
int value = 0;
for (int i = 0; i < length; i++) {
value = array[i];
- if (value < 0)
+ if (value < 0) {
value += 256;
+ }
ret = ret
| (long) ((long) value << ((length - i - 1) * NetUtils.NumBitsInAByte));
}
for (int i = startOffset; i < array.length; i++) {
value = array[i];
- if (value < 0)
+ if (value < 0) {
value += 256;
+ }
ret = ret
| (long) ((long) value << ((array.length - i - 1) * NetUtils.NumBitsInAByte));
}
}
} else {
for (i = 0; i < numBytes; i++) {
- if (i != 0)
+ if (i != 0) {
InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+ }
InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
- extraOffsetBits)));
InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
InputMSBbits = InputLSBbits = 0;
}
if (RestBits < (NetUtils.NumBitsInAByte - extraOffsetBits)) {
- if (numBytes != 0)
+ if (numBytes != 0) {
InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+ }
InputMSBbits = (byte) (inputdata[i] & (getMSBMask(RestBits)));
InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
: InputMSBbits + 256;
data[startByteOffset + i] = (byte) ((data[startByteOffset + i])
| (InputLSBbits << (NetUtils.NumBitsInAByte - extraOffsetBits)) | (InputMSBbits >> extraOffsetBits));
} else if (RestBits == (NetUtils.NumBitsInAByte - extraOffsetBits)) {
- if (numBytes != 0)
+ if (numBytes != 0) {
InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+ }
InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
- extraOffsetBits)));
InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
data[startByteOffset + i] = (byte) (data[startByteOffset + i]
| (InputLSBbits << (NetUtils.NumBitsInAByte - extraOffsetBits)) | (InputMSBbits >> extraOffsetBits));
} else {
- if (numBytes != 0)
+ if (numBytes != 0) {
InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+ }
InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
- extraOffsetBits)));
InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
DataLinkAddress other = (DataLinkAddress) obj;
if (name == null) {
- if (other.name != null)
+ if (other.name != null) {
return false;
- } else if (!name.equals(other.name))
+ }
+ } else if (!name.equals(other.name)) {
return false;
+ }
return true;
}
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (!super.equals(obj))
+ }
+ if (!super.equals(obj)) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
EthernetAddress other = (EthernetAddress) obj;
- if (!Arrays.equals(macAddress, other.macAddress))
+ if (!Arrays.equals(macAddress, other.macAddress)) {
return false;
+ }
return true;
}
LOG.debug("Storage file does not exist, creating empty file");
try {
boolean result = storage.createNewFile();
- if (result == false)
+ if (result == false) {
throw new RuntimeException("Unable to create storage file " + storage);
+ }
} catch (IOException e) {
throw new RuntimeException("Unable to create storage file " + storage, e);
}
}
public static Config fromXml(File from) {
- if(isEmpty(from))
+ if(isEmpty(from)) {
return new Config();
+ }
try {
JAXBContext jaxbContext = JAXBContext.newInstance(Config.class);
@Override
public void close() throws IOException {
- if (reg != null)
+ if (reg != null) {
reg.close();
+ }
unregisterFromLogback();
}
public void setMavenProject(MavenProject project) {
this.projectBaseDir = project.getBasedir();
- if (LOG != null)
+ if (LOG != null) {
LOG.debug(getClass().getCanonicalName(), " project base dir: ",
projectBaseDir);
+ }
}
@VisibleForTesting
}
static List<String> checkCardinality(List<String> extendedClass) {
- if (extendedClass.size() > 1)
+ if (extendedClass.size() > 1) {
throw new IllegalArgumentException(
"Class cannot have more than one super " + "class");
+ }
return extendedClass;
}
Lists.<MethodDeclaration> newArrayList());
sieTemplate.setJavadoc(sie.getNullableDescription());
- if (sie.getNullableDescription() != null)
+ if (sie.getNullableDescription() != null) {
sieTemplate.getAnnotations().add(
Annotation.createDescriptionAnnotation(sie
.getNullableDescription()));
+ }
sieTemplate.getAnnotations().addAll(Annotation.createSieAnnotations(sie));
return sieTemplate;
attrProcessor.getMethods(), generateRuntime,
registratorFullyQualifiedName);
- if (mbe.getNullableDescription() != null)
+ if (mbe.getNullableDescription() != null) {
abstractModuleTemplate.getAnnotations().add(
Annotation.createDescriptionAnnotation(mbe
.getNullableDescription()));
+ }
return abstractModuleTemplate;
}
private static boolean needsDepResolver(AttributeIfc value) {
- if(value instanceof TOAttribute)
+ if(value instanceof TOAttribute) {
return true;
+ }
if(value instanceof ListAttribute) {
AttributeIfc innerAttribute = ((ListAttribute) value).getInnerAttribute();
return needsDepResolver(innerAttribute);
@Override
public boolean equals(Object o) {
- if (this == o)
+ if (this == o) {
return true;
- if (o == null || getClass() != o.getClass())
+ }
+ if (o == null || getClass() != o.getClass()) {
return false;
+ }
Dependency that = (Dependency) o;
- if (mandatory != that.mandatory)
+ if (mandatory != that.mandatory) {
return false;
- if (!sie.equals(that.sie))
+ }
+ if (!sie.equals(that.sie)) {
return false;
+ }
return true;
}
// TODO verify
private boolean isPrimitive(String innerTypeFullyQName) {
- if (innerTypeFullyQName.contains("."))
+ if (innerTypeFullyQName.contains(".")) {
return false;
+ }
return true;
}
public static String getFullyQualifiedName(String packageName,
String className) {
- if (packageName.isEmpty())
+ if (packageName.isEmpty()) {
return className;
+ }
return packageName + "." + className;
}
}
</parent>
<artifactId>sal-clustering-commons</artifactId>
-
<packaging>bundle</packaging>
- <dependencies>
-
+ <dependencies>
+ <!-- Java -->
<dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_${scala.version}</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
-
<dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-cluster_${scala.version}</artifactId>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
</dependency>
<dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence-experimental_${scala.version}</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
</dependency>
-
<dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_${scala.version}</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
</dependency>
+ <!-- Apache -->
<dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_${scala.version}</artifactId>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
</dependency>
-
+ <!-- Akka -->
<dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-actor_${scala.version}</artifactId>
</dependency>
-
-
<dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_${scala.version}</artifactId>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-cluster_${scala.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-osgi_${scala.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-persistence-experimental_${scala.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-remote_${scala.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-slf4j_${scala.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-testkit_${scala.version}</artifactId>
</dependency>
+ <!-- Codahale -->
+ <dependency>
+ <groupId>com.codahale.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.codahale.metrics</groupId>
+ <artifactId>metrics-graphite</artifactId>
+ </dependency>
+ <!-- Google -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<artifactId>protobuf-java</artifactId>
<version>2.5.0</version>
</dependency>
+
+ <!-- Scala -->
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </dependency>
+
+ <!-- OpenDaylight -->
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>netconf-util</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-model-util</artifactId>
</dependency>
-
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-impl</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>netconf-util</artifactId>
- </dependency>
-
- <dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-model-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-model-util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-binding</artifactId>
- </dependency>
-
-
- <dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-osgi_${scala.version}</artifactId>
- </dependency>
- <dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_${scala.version}</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-parser-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- </dependency>
- <dependency>
- <groupId>com.codahale.metrics</groupId>
- <artifactId>metrics-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.codahale.metrics</groupId>
- <artifactId>metrics-graphite</artifactId>
- </dependency>
</dependencies>
- <build>
+ <build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
}
private final void checkMutable() {
- if (!NEW.equals(this.getStatus()))
+ if (!NEW.equals(this.getStatus())) {
throw new IllegalStateException("Transaction was already submitted");
+ }
}
@Override
}
RouteChangeImpl<?, ?> other = (RouteChangeImpl<?, ?>) obj;
if (announcement == null) {
- if (other.announcement != null)
+ if (other.announcement != null) {
return false;
- } else if (!announcement.equals(other.announcement))
+ }
+ } else if (!announcement.equals(other.announcement)) {
return false;
+ }
if (removal == null) {
if (other.removal != null) {
return false;
}
- } else if (!removal.equals(other.removal))
+ } else if (!removal.equals(other.removal)) {
return false;
+ }
return true;
}
}
*/
@SuppressWarnings("unchecked")
public static <T> T checkInstanceOf(Object value, Class<T> type) {
- if(!type.isInstance(value))
+ if(!type.isInstance(value)) {
throw new IllegalArgumentException(String.format("Value %s is not of type %s", value, type));
+ }
return (T) value;
}
}
<packaging>bundle</packaging>
<dependencies>
+ <!-- Java -->
<dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
</dependency>
+ <!-- Akka -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_${scala.version}</artifactId>
</dependency>
-
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-cluster_${scala.version}</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-osgi_${scala.version}</artifactId>
+ </dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-persistence-experimental_${scala.version}</artifactId>
</dependency>
-
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-remote_${scala.version}</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-slf4j_${scala.version}</artifactId>
+ </dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${scala.version}</artifactId>
</dependency>
+ <!-- Codahale -->
<dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_${scala.version}</artifactId>
+ <groupId>com.codahale.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.codahale.metrics</groupId>
+ <artifactId>metrics-graphite</artifactId>
</dependency>
+ <!-- Google -->
<dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-osgi_${scala.version}</artifactId>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
- <!-- SAL Dependencies -->
+ <!-- Scala -->
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </dependency>
+ <!-- OpenDaylight -->
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>config-api</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-akka-raft</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-binding-api</artifactId>
</dependency>
-
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-binding-config</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-impl</artifactId>
- </dependency>
-
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-inmemory-datastore</artifactId>
+ <artifactId>sal-clustering-commons</artifactId>
</dependency>
-
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-common-api</artifactId>
</dependency>
-
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-common-util</artifactId>
</dependency>
-
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-core-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-inmemory-datastore</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>concepts</artifactId>
</dependency>
-
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-binding</artifactId>
</dependency>
-
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-common</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- </dependency>
-
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-clustering-commons</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-akka-raft</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>com.codahale.metrics</groupId>
- <artifactId>metrics-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.codahale.metrics</groupId>
- <artifactId>metrics-graphite</artifactId>
- </dependency>
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <scope>test</scope>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-api</artifactId>
</dependency>
-
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-impl</artifactId>
</dependency>
-
</dependencies>
<build>
<plugins>
-
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
String odlTableName) {
Map<String, XSQLBluePrintNode> map = this.odlNameToBluePrint
.get(odlTableName);
- if (map == null)
+ if (map == null) {
return null;
+ }
return map.values().toArray(new XSQLBluePrintNode[map.size()]);
}
XSQLBluePrintNode other = (XSQLBluePrintNode) obj;
if (odlNode != null) {
return getBluePrintNodeName().equals(other.getBluePrintNodeName());
- } else if (this.odlTableName == null && other.odlTableName != null)
+ } else if (this.odlTableName == null && other.odlTableName != null) {
return false;
- if (this.odlTableName != null && other.odlTableName == null)
+ }
+ if (this.odlTableName != null && other.odlTableName == null) {
return false;
- else
+ }
+ else {
return this.odlTableName.equals(other.odlTableName);
+ }
}
@Override
}
private void init() throws Exception {
- if (addr.startsWith("http://"))
+ if (addr.startsWith("http://")) {
addr = addr.substring(7);
+ }
System.err.print("Address is:" + addr);
socket = new Socket(addr, 40004);
try {
}
public JDBCResultSet addSubQuery(String _sql,String logicalName) {
- if(subQueries == null)
+ if (subQueries == null) {
subQueries = new HashMap<String,JDBCResultSet>();
+ }
JDBCResultSet rs = new JDBCResultSet(_sql);
this.subQueries.put(logicalName,rs);
return rs;
}
public Map<String,JDBCResultSet> getSubQueries() {
- if(this.subQueries==null)
+ if (this.subQueries==null) {
this.subQueries = new HashMap<>();
+ }
return this.subQueries;
}
for (Object child : children) {
String odlNodeName = XSQLODLUtils.getNodeIdentiofier(child);
- if (odlNodeName == null)
+ if (odlNodeName == null) {
continue;
+ }
XSQLBluePrintNode eNodes[] = bluePrint
.getBluePrintNodeByODLTableName(odlNodeName);
- if (eNodes == null)
+ if (eNodes == null) {
continue;
+ }
boolean match = false;
for (XSQLBluePrintNode enode : eNodes) {
}
}
- if (!match)
+ if (!match) {
continue;
+ }
if (child.getClass().getName().endsWith("ImmutableContainerNode")) {
result.add(child);
for (XSQLBluePrintNode eNode : eNodes) {
bpn = this.tablesInQueryMap.get(eNode
.getBluePrintNodeName());
- if (bpn != null)
+ if (bpn != null) {
break;
+ }
}
boolean isObjectInCriteria = true;
if (bpn != null) {
if (isObjectInCriteria) {
if (root) {
- if (!rec.data.isEmpty())
+ if (!rec.data.isEmpty()) {
addRecord(rec.data);
+ }
} else {
result.add(rec);
}
int braketCount = 0;
int endSubQuery = startSubQuery;
do {
- if (sql.charAt(endSubQuery) == '(')
+ if (sql.charAt(endSubQuery) == '(') {
braketCount++;
- else if (sql.charAt(endSubQuery) == ')')
+ }
+ else if (sql.charAt(endSubQuery) == ')') {
braketCount--;
+ }
endSubQuery++;
} while (braketCount > 0 || endSubQuery == sql.length());
String subQuerySQL = sql.substring(startSubQuery + 1,endSubQuery - 1);
whereTo = order;
}
- if(whereTo==-1)
+ if(whereTo==-1) {
whereTo=lowSQL.length();
+ }
String whereStatement = rs.getSQL().substring(where + 5, whereTo)
.trim();
@Override
public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
final RemoteYangSchema that = (RemoteYangSchema) o;
- if (!qname.equals(that.qname)) return false;
+ if (!qname.equals(that.qname)) {
+ return false;
+ }
return true;
}
@Override
public boolean equals(final Object o) {
- if (this == o) return true;
- if (!(o instanceof RemoteDeviceId)) return false;
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof RemoteDeviceId)) {
+ return false;
+ }
final RemoteDeviceId that = (RemoteDeviceId) o;
- if (!name.equals(that.name)) return false;
- if (!bindingPath.equals(that.bindingPath)) return false;
+ if (!name.equals(that.name)) {
+ return false;
+ }
+ if (!bindingPath.equals(that.bindingPath)) {
+ return false;
+ }
return true;
}
@Override
public void stop(BundleContext context) throws Exception {
- if (brokerServiceTracker != null)
+ if (brokerServiceTracker != null) {
brokerServiceTracker.close();
+ }
- if (session != null)
+ if (session != null) {
session.close();
+ }
synchronized (toClose) {
for (AutoCloseable close : toClose) {
@Override
public void modifiedService(ServiceReference<Broker> reference, Broker service) {
- if (session != null)
+ if (session != null) {
session.close();
+ }
Broker broker = bundleContext.getService(reference);
session = broker.registerProvider(this, bundleContext);
if (statsFlow == storedFlow) {
return true;
}
- if (storedFlow == null && statsFlow != null) return false;
- if (statsFlow == null && storedFlow != null) return false;
+ if (storedFlow == null && statsFlow != null) {
+ return false;
+ }
+ if (statsFlow == null && storedFlow != null) {
+ return false;
+ }
if (storedFlow.getEthernetMatch() == null) {
if (statsFlow.getEthernetMatch() != null) {
return false;
public synchronized ObjectName getOrCreateTransaction() {
Optional<ObjectName> ta = getTransaction();
- if (ta.isPresent())
+ if (ta.isPresent()) {
return ta.get();
+ }
transaction = configRegistryClient.beginConfig();
allOpenedTransactions.add(transaction);
return transaction;
@Override
public void handleNotification(final Notification notification, final Object handback) {
- if (!(notification instanceof NetconfJMXNotification))
+ if (!(notification instanceof NetconfJMXNotification)) {
return;
+ }
// Socket should not be closed at this point
// Activator unregisters this as JMX listener before close is called