}
LOG.trace("Datastore {} committed successfully: {}", Datastore.candidate, status);
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
}
}
LOG.trace("Changes discarded successfully from datastore {}", Datastore.candidate);
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
}
}
// Since candidate datastore instances are allocated per session and not accessible anywhere else, no need to lock
LOG.debug("Locking {} datastore on session: {}", targetDatastore, getNetconfSessionIdForReporting());
// TODO should this fail if we are already locked ?
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
}
// Not supported running lock
// Since candidate datastore instances are allocated per session and not accessible anywhere else, no need to lock
LOG.debug("Unlocking {} datastore on session: {}", targetDatastore, getNetconfSessionIdForReporting());
// TODO this should fail if we are not locked
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
}
// Not supported running lock
LOG.trace("Datastore {} validated successfully", Datastore.candidate);
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
}
}
private static final Logger LOG = LoggerFactory.getLogger(EditConfig.class);
- private EditConfigXmlParser editConfigXmlParser;
+ private final EditConfigXmlParser editConfigXmlParser;
public EditConfig(final ConfigSubsystemFacade configSubsystemFacade, final String netconfSessionIdForReporting) {
super(configSubsystemFacade, netconfSessionIdForReporting);
@Override
protected Element handleWithNoSubsequentOperations(Document document, XmlElement xml) throws DocumentedException {
- ConfigExecution configExecution;
// FIXME config mapping getter works on dynamic yang store service and so does later executeConfigExecution method
// They might have different view of current yangs in ODL and might cause race conditions
Config cfg = getConfigSubsystemFacade().getConfigMapping();
- configExecution = editConfigXmlParser.fromXml(xml, cfg);
+ ConfigExecution configExecution = editConfigXmlParser.fromXml(xml, cfg);
return getResponseInternal(document, configExecution);
}
XmlElement sourceNode = sourceElement.getOnlyChildElement();
String sourceParsed = sourceNode.getName();
LOG.debug("Setting source datastore to '{}'", sourceParsed);
- Datastore sourceDatastore = Datastore.valueOf(sourceParsed);
// Filter option: ignore for now, TODO only load modules specified by the filter
- return sourceDatastore;
+ return Datastore.valueOf(sourceParsed);
}
@Override
public HandlingPriority canHandle(Document message) throws DocumentedException {
- XmlElement requestElement = null;
- requestElement = getRequestElementWithCheck(message);
+ XmlElement requestElement = getRequestElementWithCheck(message);
XmlElement operationElement = requestElement.getOnlyChildElement();
final String netconfOperationName = operationElement.getName();
execution.getOn(), execution.getAttributes(), result);
if (execution.isVoid()) {
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
} else {
return getConfigSubsystemFacade().getRpcFacade().toXml(document, result, execution);
}
String netconfSessionIdForReporting) {
Set<NetconfOperation> ops = Sets.newHashSet();
- GetConfig getConfigOp = new GetConfig(configSubsystemFacade, Optional.<String> absent(), netconfSessionIdForReporting);
+ GetConfig getConfigOp = new GetConfig(configSubsystemFacade, Optional.absent(), netconfSessionIdForReporting);
ops.add(getConfigOp);
ops.add(new EditConfig(configSubsystemFacade, netconfSessionIdForReporting));
import java.util.Set;
import org.opendaylight.controller.config.facade.xml.ConfigSubsystemFacadeFactory;
import org.opendaylight.controller.config.util.capability.Capability;
-import org.opendaylight.controller.config.util.capability.ModuleListener;
import org.opendaylight.netconf.api.monitoring.CapabilityListener;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
@Override
public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
- return configFacadeFactory.getYangStoreService().registerModuleListener(new ModuleListener() {
- @Override
- public void onCapabilitiesChanged(Set<Capability> added, Set<Capability> removed) {
- listener.onCapabilitiesChanged(added, removed);
- }
- });
+ return configFacadeFactory.getYangStoreService().registerModuleListener(listener::onCapabilitiesChanged);
}
}
public class NetconfOperationServiceImpl implements NetconfOperationService {
private final NetconfOperationProvider operationProvider;
- private ConfigSubsystemFacade configSubsystemFacade;
+ private final ConfigSubsystemFacade configSubsystemFacade;
public NetconfOperationServiceImpl(final ConfigSubsystemFacade configSubsystemFacade,
final String netconfSessionIdForReporting) {
this.configSubsystemFacade = configSubsystemFacade;
- operationProvider = new NetconfOperationProvider(configSubsystemFacade, netconfSessionIdForReporting);
+ this.operationProvider = new NetconfOperationProvider(configSubsystemFacade, netconfSessionIdForReporting);
}
@Override