org.opendaylight.restconf.server.spi.ServerDataOperations Maven / Gradle / Ivy
/*
* Copyright (c) 2024 PANTHEON.tech, s.r.o. 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.restconf.server.spi;
import com.google.common.annotations.Beta;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.opendaylight.restconf.server.api.ChildBody.PrefixAndBody;
import org.opendaylight.restconf.server.api.CreateResourceResult;
import org.opendaylight.restconf.server.api.DataGetParams;
import org.opendaylight.restconf.server.api.DataGetResult;
import org.opendaylight.restconf.server.api.DataPatchResult;
import org.opendaylight.restconf.server.api.DataPutResult;
import org.opendaylight.restconf.server.api.DataYangPatchResult;
import org.opendaylight.restconf.server.api.DatabindPath.Data;
import org.opendaylight.restconf.server.api.PatchContext;
import org.opendaylight.restconf.server.api.ServerRequest;
import org.opendaylight.yangtools.yang.common.Empty;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
/**
* A concrete implementation of RESTCONF datastore resource, as specified by
* RFC8040 {+restconf}/data, based on
* {@code yang-data-api}.
*/
@NonNullByDefault
public interface ServerDataOperations {
/**
* Create a resource, as specified by
* RFC8040 Create Resource Mode.
*
* @param request {@link ServerRequest} for this request
* @param path resource path
* @param data resource data
*/
void createData(ServerRequest super CreateResourceResult> request, Data path, PrefixAndBody data);
/**
* Create a resource, as specified by
* RFC8040 Create Resource Mode, at specified
* insertion point.
*
* @param request {@link ServerRequest} for this request
* @param path resource path
* @param insert {@link Insert} parameter
* @param data resource data
*/
void createData(ServerRequest super CreateResourceResult> request, Data path, Insert insert, PrefixAndBody data);
/**
* Delete a resource, as specified by
* RFC8040 DELETE.
*
* @param request {@link ServerRequest} for this request
* @param path resource path
*/
void deleteData(ServerRequest request, Data path);
/**
* Get the contents of a resource, as specified by
* RFC8040 GET.
*
* @param request {@link ServerRequest} for this request
* @param path resource path
* @param params operation parameters
*/
@Beta
void getData(ServerRequest request, Data path, DataGetParams params);
/**
* Merge the contents of a resource, as specified by
* RFC8040 Plain Patch.
*
* @param request {@link ServerRequest} for this request
* @param path resource path
* @param data resource data
*/
void mergeData(ServerRequest request, Data path, NormalizedNode data);
/**
* Patch a resource, as specified by RFC8040 PATH
* and RFC8072 YANG Patch.
*
* @param request {@link ServerRequest} for this request
* @param path resource path
* @param patch {@link PatchContext} to be processed
*/
void patchData(ServerRequest request, Data path, PatchContext patch);
/**
* Create or replace a resource, as specified by
* RFC8040 PUT.
*
* @param request {@link ServerRequest} for this request
* @param path path of data
* @param data data
*/
void putData(ServerRequest request, Data path, NormalizedNode data);
/**
* Create or replace a resource, as specified by
* RFC8040 PUT, at specified insertion point.
*
* @param request {@link ServerRequest} for this request
* @param path path of data
* @param insert {@link Insert} parameter
* @param data data
*/
void putData(ServerRequest request, Data path, Insert insert, NormalizedNode data);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy