X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fcli%2Freader%2Fcustom%2FEditContentReader.java;fp=opendaylight%2Fnetconf%2Fnetconf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fcli%2Freader%2Fcustom%2FEditContentReader.java;h=0000000000000000000000000000000000000000;hp=edf05f1185a58a1de45b9d6e16751cd0e3147c7e;hb=23fe9ca678ada6263fec5dd996f4025e4a32fcf5;hpb=071a641d7c12c0e6112d5ce0afe806b54f116ed2 diff --git a/opendaylight/netconf/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/reader/custom/EditContentReader.java b/opendaylight/netconf/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/reader/custom/EditContentReader.java deleted file mode 100644 index edf05f1185..0000000000 --- a/opendaylight/netconf/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/reader/custom/EditContentReader.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.netconf.cli.reader.custom; - -import com.google.common.base.Preconditions; -import java.io.IOException; -import java.util.List; -import org.opendaylight.controller.netconf.cli.CommandArgHandlerRegistry; -import org.opendaylight.controller.netconf.cli.commands.CommandConstants; -import org.opendaylight.controller.netconf.cli.io.ConsoleIO; -import org.opendaylight.controller.netconf.cli.reader.ReadingException; -import org.opendaylight.controller.netconf.cli.reader.impl.ChoiceReader; -import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode; -import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; - -public class EditContentReader extends ChoiceReader { - - public static final QName EDIT_CONTENT_QNAME = QName.create(CommandConstants.NETCONF_BASE_QNAME, "edit-content"); - public static final QName CONFIG_QNAME = QName.create(EDIT_CONTENT_QNAME, "config"); - - // FIXME this could be removed if feature/if-feature are supported - - public EditContentReader(final ConsoleIO console, final CommandArgHandlerRegistry argumentHandlerRegistry, final SchemaContext schemaContext) { - super(console, argumentHandlerRegistry, schemaContext); - } - - @Override - public List> readWithContext(final ChoiceSchemaNode choiceNode) throws IOException, ReadingException { - Preconditions.checkState(choiceNode.getQName().equals(EDIT_CONTENT_QNAME), "Unexpected choice %s, expected %s", choiceNode, EDIT_CONTENT_QNAME); - final ChoiceCaseNode selectedCase = choiceNode.getCaseNodeByName(CONFIG_QNAME); - Preconditions.checkNotNull(selectedCase, "Unexpected choice %s, expected %s that contains %s", choiceNode, EDIT_CONTENT_QNAME, CONFIG_QNAME); - return readSelectedCase(selectedCase); - } - -}