import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
import org.opendaylight.netconf.sal.streams.listeners.ListenerAdapter;
private static final BrokerFacade INSTANCE = new BrokerFacade();
private volatile DOMRpcService rpcService;
- private volatile ConsumerSession context;
private DOMDataBroker domDataBroker;
private DOMNotificationService domNotification;
this.domNotification = domNotification;
}
- public void setContext(final ConsumerSession context) {
- this.context = context;
- }
-
public static BrokerFacade getInstance() {
return BrokerFacade.INSTANCE;
}
private void checkPreconditions() {
- if (this.context == null || this.domDataBroker == null) {
+ if (this.domDataBroker == null) {
throw new RestconfDocumentedException(Status.SERVICE_UNAVAILABLE);
}
}
boolean withoutError = true;
for (final PatchEntity patchEntity : patchContext.getData()) {
- final PatchEditOperation operation = PatchEditOperation.valueOf(patchEntity.getOperation().toUpperCase());
-
+ final PatchEditOperation operation = patchEntity.getOperation();
switch (operation) {
case CREATE:
if (withoutError) {
final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
Builders.leafBuilder((LeafSchemaNode) childSchema);
if (keys.contains(child.getNodeType())) {
- leafBuilder.withValue(((LeafNode) child).getValue());
+ leafBuilder.withValue(((LeafNode<?>) child).getValue());
builder.withChild(leafBuilder.build());
} else {
if (trim) {
if (defaultVal == null || !defaultVal.equals(nodeVal)) {
- leafBuilder.withValue(((LeafNode) child).getValue());
+ leafBuilder.withValue(((LeafNode<?>) child).getValue());
builder.withChild(leafBuilder.build());
}
} else {
if (defaultVal != null && defaultVal.equals(nodeVal)) {
- leafBuilder.withValue(((LeafNode) child).getValue());
+ leafBuilder.withValue(((LeafNode<?>) child).getValue());
builder.withChild(leafBuilder.build());
}
}
Builders.leafBuilder((LeafSchemaNode) childSchema);
if (trim) {
if (defaultVal == null || !defaultVal.equals(nodeVal)) {
- leafBuilder.withValue(((LeafNode) child).getValue());
+ leafBuilder.withValue(((LeafNode<?>) child).getValue());
builder.withChild(leafBuilder.build());
}
} else {
if (defaultVal != null && defaultVal.equals(nodeVal)) {
- leafBuilder.withValue(((LeafNode) child).getValue());
+ leafBuilder.withValue(((LeafNode<?>) child).getValue());
builder.withChild(leafBuilder.build());
}
}