mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-01-04 16:11:27 +01:00
minor fix in DocumentPath, DCS
Change-Id: I13f332bc3897e7fc047744c36be4f208cf820d4f
This commit is contained in:
parent
e9761740db
commit
153d3589a5
@ -125,19 +125,18 @@ public class DistributedDynamicConfigStore
|
||||
@Override
|
||||
public CompletableFuture<Boolean>
|
||||
addNode(ResourceId complete, DataNode node) {
|
||||
CompletableFuture<Boolean> eventFuture = CompletableFuture.completedFuture(true);
|
||||
String spath = ResourceIdParser.parseResId(complete);
|
||||
if (spath == null) {
|
||||
throw new FailedException("Invalid RsourceId, cannot create Node");
|
||||
}
|
||||
if (spath.compareTo(ResourceIdParser.ROOT) != 0) {
|
||||
if (!spath.equals(ResourceIdParser.ROOT)) {
|
||||
if (completeVersioned(keystore.get(DocumentPath.from(spath))) == null) {
|
||||
throw new FailedException("Node or parent does not exist for " + spath);
|
||||
}
|
||||
}
|
||||
spath = ResourceIdParser.appendNodeKey(spath, node.key());
|
||||
parseNode(spath, node);
|
||||
return eventFuture;
|
||||
return CompletableFuture.completedFuture(true);
|
||||
}
|
||||
|
||||
private void parseNode(String path, DataNode node) {
|
||||
|
||||
@ -74,8 +74,8 @@ public class DocumentPath implements Comparable<DocumentPath> {
|
||||
public DocumentPath(String nodeName, DocumentPath parentPath) {
|
||||
checkNotNull(nodeName, "Node name cannot be null");
|
||||
if (nodeName.contains(pathSeparator)) {
|
||||
throw new IllegalDocumentNameException(
|
||||
"Periods are not allowed in names.");
|
||||
throw new IllegalDocumentNameException("'" + pathSeparator + "'" +
|
||||
" are not allowed in names.");
|
||||
}
|
||||
if (parentPath != null) {
|
||||
pathElements.addAll(parentPath.pathElements());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user