-/**
+/*
* Copyright (c) 2014, 2015 Brocade Communication Systems, Inc., Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import java.util.Set;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
+import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.Response.Status;
import org.opendaylight.yangtools.yang.parser.builder.impl.ContainerSchemaNodeBuilder;
import org.opendaylight.yangtools.yang.parser.builder.impl.LeafSchemaNodeBuilder;
import org.opendaylight.yangtools.yang.parser.builder.impl.ModuleBuilder;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveSchemaContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
final Set<Module> fakeRpcModules = Collections.singleton(restConfModuleBuilder.build());
-
- final YangParserImpl yangParser = new YangParserImpl();
- final SchemaContext fakeSchemaCx = yangParser.resolveSchemaContext(fakeRpcModules);
-
+ final SchemaContext fakeSchemaCx = EffectiveSchemaContext.resolveSchemaContext(fakeRpcModules);
final InstanceIdentifierContext<?> fakeIICx = new InstanceIdentifierContext<>(null, operContainerSchemaNode, mountPoint, fakeSchemaCx);
return new NormalizedNodeContext(fakeIICx, operContainerNode.build());
RpcDefinition rpc = null;
if (mountPoint == null) {
- rpc = controllerContext.getRpcDefinition(identifierDecoded);
+ rpc = controllerContext.getRpcDefinition(identifierDecoded, null);
} else {
rpc = findRpc(mountPoint.getSchemaContext(), identifierDecoded);
}
return Response.status(Status.OK).location(uriToWebsocketServer).build();
}
+ @Override
+ public PATCHStatusContext patchConfigurationData(String identifier, PATCHContext context, UriInfo uriInfo) {
+ if (context == null) {
+ throw new RestconfDocumentedException("Input is required.", ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE);
+ }
+ return broker.patchConfigurationDataWithinTransaction(context, controllerContext.getGlobalSchema());
+ }
+
+ @Override
+ public PATCHStatusContext patchConfigurationData(PATCHContext context, @Context UriInfo uriInfo) {
+ if (context == null) {
+ throw new RestconfDocumentedException("Input is required.", ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE);
+ }
+ return broker.patchConfigurationDataWithinTransaction(context, controllerContext.getGlobalSchema());
+ }
+
/**
* Load parameter for subscribing to stream from input composite node
*