import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.restconf.api.ApiPath;
-import org.opendaylight.restconf.api.FormattableBody;
import org.opendaylight.restconf.api.MediaTypes;
import org.opendaylight.restconf.api.QueryParameters;
import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
MediaTypes.APPLICATION_YANG_DATA_JSON, MediaType.APPLICATION_JSON
})
public void operationsGET(@Suspended final AsyncResponse ar) {
- completeOperationsGet(server.operationsGET(), ar);
+ server.operationsGET().addCallback(new FormattableBodyCallback(ar));
}
/**
MediaTypes.APPLICATION_YANG_DATA_JSON, MediaType.APPLICATION_JSON
})
public void operationsGET(@PathParam("operation") final ApiPath operation, @Suspended final AsyncResponse ar) {
- completeOperationsGet(server.operationsGET(operation), ar);
- }
-
- private static void completeOperationsGet(final RestconfFuture<FormattableBody> future, final AsyncResponse ar) {
- future.addCallback(new JaxRsRestconfCallback<FormattableBody>(ar) {
- @Override
- Response transform(final FormattableBody result) {
- return Response.ok().entity(result).build();
- }
- });
+ server.operationsGET(operation).addCallback(new FormattableBodyCallback(ar));
}
/**
MediaType.TEXT_XML
})
public void yangLibraryVersionGET(@Suspended final AsyncResponse ar) {
- server.yangLibraryVersionGET().addCallback(new JaxRsRestconfCallback<NormalizedNodePayload>(ar) {
- @Override
- Response transform(final NormalizedNodePayload result) {
- return Response.ok().entity(result).build();
- }
- });
+ server.yangLibraryVersionGET().addCallback(new FormattableBodyCallback(ar));
}
// FIXME: References to these resources are generated by our yang-library implementation. That means: