From 42cba77339bbf7c8ab664ba06cb0c813b1fe49b3 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 12 Apr 2022 18:31:09 +0200 Subject: [PATCH] Move OperationsContent This is a purely server-side implementation thing, move it to its sole user. JIRA: NETCONF-837 Change-Id: I545f9f444c548a8366b6cf6bb0ac85c859ef632c Signed-off-by: Robert Varga --- .../nb/rfc8040/rests/services/impl}/OperationsContent.java | 5 ++--- .../rests/services/impl/RestconfOperationsServiceImpl.java | 1 - .../nb/rfc8040/rests/services/impl}/Netconf822Test.java | 2 +- .../src/test/resources/nc822/foo@2021-09-29.yang | 0 .../src/test/resources/nc822/foo@2021-09-30.yang | 0 5 files changed, 3 insertions(+), 5 deletions(-) rename restconf/{restconf-common/src/main/java/org/opendaylight/restconf/common => restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl}/OperationsContent.java (97%) rename restconf/{restconf-common/src/test/java/org/opendaylight/restconf/common => restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl}/Netconf822Test.java (95%) rename restconf/{restconf-common => restconf-nb-rfc8040}/src/test/resources/nc822/foo@2021-09-29.yang (100%) rename restconf/{restconf-common => restconf-nb-rfc8040}/src/test/resources/nc822/foo@2021-09-30.yang (100%) diff --git a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/OperationsContent.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/OperationsContent.java similarity index 97% rename from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/OperationsContent.java rename to restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/OperationsContent.java index 199728f223..3dee0dc199 100644 --- a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/OperationsContent.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/OperationsContent.java @@ -5,7 +5,7 @@ * 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.restconf.common; +package org.opendaylight.restconf.nb.rfc8040.rests.services.impl; import static java.util.Objects.requireNonNull; @@ -28,8 +28,7 @@ import org.opendaylight.yangtools.yang.model.api.stmt.RpcEffectiveStatement; * RESTCONF {@code /operations} content for a {@code GET} operation as per * RFC8040. */ -// FIXME: when bierman02 is gone, this should be folded to nb-rfc8040, as it is a server-side thing. -public enum OperationsContent { +enum OperationsContent { JSON("{ \"ietf-restconf:operations\" : { } }") { @Override String createBody(final List>> rpcsByPrefix) { diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsServiceImpl.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsServiceImpl.java index dfa708274b..8cfa859799 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsServiceImpl.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsServiceImpl.java @@ -15,7 +15,6 @@ import javax.ws.rs.core.UriInfo; import org.opendaylight.mdsal.dom.api.DOMMountPoint; import org.opendaylight.mdsal.dom.api.DOMMountPointService; import org.opendaylight.mdsal.dom.api.DOMSchemaService; -import org.opendaylight.restconf.common.OperationsContent; import org.opendaylight.restconf.common.context.InstanceIdentifierContext; import org.opendaylight.restconf.common.errors.RestconfDocumentedException; import org.opendaylight.restconf.common.util.OperationsResourceUtils; diff --git a/restconf/restconf-common/src/test/java/org/opendaylight/restconf/common/Netconf822Test.java b/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/Netconf822Test.java similarity index 95% rename from restconf/restconf-common/src/test/java/org/opendaylight/restconf/common/Netconf822Test.java rename to restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/Netconf822Test.java index 70f56bfeac..9c66d59350 100644 --- a/restconf/restconf-common/src/test/java/org/opendaylight/restconf/common/Netconf822Test.java +++ b/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/Netconf822Test.java @@ -5,7 +5,7 @@ * 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.restconf.common; +package org.opendaylight.restconf.nb.rfc8040.rests.services.impl; import static org.junit.Assert.assertEquals; diff --git a/restconf/restconf-common/src/test/resources/nc822/foo@2021-09-29.yang b/restconf/restconf-nb-rfc8040/src/test/resources/nc822/foo@2021-09-29.yang similarity index 100% rename from restconf/restconf-common/src/test/resources/nc822/foo@2021-09-29.yang rename to restconf/restconf-nb-rfc8040/src/test/resources/nc822/foo@2021-09-29.yang diff --git a/restconf/restconf-common/src/test/resources/nc822/foo@2021-09-30.yang b/restconf/restconf-nb-rfc8040/src/test/resources/nc822/foo@2021-09-30.yang similarity index 100% rename from restconf/restconf-common/src/test/resources/nc822/foo@2021-09-30.yang rename to restconf/restconf-nb-rfc8040/src/test/resources/nc822/foo@2021-09-30.yang -- 2.36.6