because the YANG models are in srm/api, the shell doesn't need binding.
The (infrautils) quality parent enforces checkstyle, findbugs and
error-prone.
This change also deals with the impacts of these enforced additional
quality controls in the existing code.
Change-Id: I3e9b0692c138f79a6f1d6f5184c34475c6920e25
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.serviceutils</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>quality-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/quality-parent</relativePath>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.opendaylight.serviceutils</groupId>
<artifactId>srm-shell</artifactId>
<version>0.2.0-SNAPSHOT</version>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
</dependencies>
</project>
package org.opendaylight.serviceutils.srm.shell;
import java.util.concurrent.Future;
+import javax.annotation.Nullable;
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
String id;
@Override
- protected Object doExecute() throws Exception {
+ protected @Nullable Object doExecute() throws Exception {
RecoverInput input = getInput();
if (input == null) {
// We've already shown the relevant error msg
session.getConsole().println(strResult.toString());
}
- private RecoverInput getInput() {
+ private @Nullable RecoverInput getInput() {
if (type == null || name == null) {
return null;
}
package org.opendaylight.serviceutils.srm.shell;
import java.util.concurrent.Future;
+import javax.annotation.Nullable;
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
private static final Logger LOG = LoggerFactory.getLogger(ReinstallCommand.class);
- private SrmRpcsService srmRpcService;
+ private final SrmRpcsService srmRpcService;
private final Class<? extends EntityTypeBase> entityType = EntityTypeService.class;
public ReinstallCommand(SrmRpcsService srmRpcService) {
String name;
@Override
- protected Object doExecute() throws Exception {
+ protected @Nullable Object doExecute() throws Exception {
ReinstallInput input = getInput();
if (input == null) {
// We've already shown the relevant error msg
session.getConsole().println(strResult.toString());
}
- private ReinstallInput getInput() {
+ private @Nullable ReinstallInput getInput() {
Class<? extends EntityNameBase> entityName = SrmCliUtils.getEntityName(entityType, name);
if (entityName == null) {
session.getConsole().println(SrmCliUtils.getNameHelp(entityType));
import com.google.common.collect.ImmutableMap;
import java.util.Locale;
+import javax.annotation.Nullable;
import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.types.rev170711.EntityNameBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.types.rev170711.EntityTypeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.types.rev170711.EntityTypeInstance;
* @param strName Entity Name as a string
* @return EntityName for use
*/
- public static Class<? extends EntityNameBase> getEntityName(Class<? extends EntityTypeBase> type, String strName) {
+ public static @Nullable Class<? extends EntityNameBase> getEntityName(Class<? extends EntityTypeBase> type,
+ String strName) {
LOG.debug("Getting entityName for type {} and name: {}", type, strName);
if (EntityTypeService.class.equals(type)) {
return SERVICE_NAME_MAP.get(strName.toUpperCase(Locale.ROOT));
package org.opendaylight.serviceutils.srm.shell;
+import javax.annotation.Nullable;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.commands.Option;
import org.apache.karaf.shell.console.OsgiCommandSupport;
boolean clearOps;
@Override
- protected Object doExecute() throws Exception {
+ protected @Nullable Object doExecute() throws Exception {
if (clearOps) {
clearOpsDs();
}
InstanceIdentifier<ServiceOps> path = getInstanceIdentifier();
WriteTransaction tx = txDataBroker.newWriteOnlyTransaction();
tx.delete(LogicalDatastoreType.OPERATIONAL, path);
- tx.submit();
+ tx.commit().get();
}
private static InstanceIdentifier<ServiceOps> getInstanceIdentifier() {