Implementing service

This commit is contained in:
Luca Frosini 2024-11-18 17:43:00 +01:00
parent f36f2c1334
commit f99b75aec2
1 changed files with 52 additions and 52 deletions

View File

@ -2,11 +2,11 @@ package org.gcube.resourcemanagement.rest;
import java.util.UUID; import java.util.UUID;
import javax.ws.rs.DefaultValue; import jakarta.ws.rs.DefaultValue;
import javax.ws.rs.POST; import jakarta.ws.rs.POST;
import javax.ws.rs.PathParam; import jakarta.ws.rs.PathParam;
import javax.ws.rs.Produces; import jakarta.ws.rs.Produces;
import javax.ws.rs.QueryParam; import jakarta.ws.rs.QueryParam;
import org.gcube.informationsystem.contexts.reference.entities.Context; import org.gcube.informationsystem.contexts.reference.entities.Context;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
@ -54,52 +54,52 @@ public class SharingManager extends BaseREST {
* The json contains the instantiation of templates * The json contains the instantiation of templates
* *
*/ */
// @POST @POST
// @Path("/" + SharingPath.CONTEXTS_PATH_PART + "/{" + ContextManager.CONTEXT_UUID_PATH_PARAMETER + "}/" @Path("/" + SharingPath.CONTEXTS_PATH_PART + "/{" + ContextManager.CONTEXT_UUID_PATH_PARAMETER + "}/"
// + "{" + TYPE_PATH_PARAMETER + "}" + "/{" + UUID_PATH_PARAMETER + "}") + "{" + TYPE_PATH_PARAMETER + "}" + "/{" + UUID_PATH_PARAMETER + "}")
// @Produces(BaseREST.APPLICATION_JSON_CHARSET_UTF_8) @Produces(BaseREST.APPLICATION_JSON_CHARSET_UTF_8)
// public String addRemove( public String addRemove(
// @PathParam(ContextManager.CONTEXT_UUID_PATH_PARAMETER) String contextId, @PathParam(ContextManager.CONTEXT_UUID_PATH_PARAMETER) String contextId,
// @PathParam(TYPE_PATH_PARAMETER) String type, @PathParam(TYPE_PATH_PARAMETER) String type,
// @PathParam(UUID_PATH_PARAMETER) String instanceId, @PathParam(UUID_PATH_PARAMETER) String instanceId,
// @QueryParam(SharingPath.OPERATION_QUERY_PARAMETER) SharingOperation operation, @QueryParam(SharingPath.OPERATION_QUERY_PARAMETER) SharingOperation operation,
// @QueryParam(SharingPath.DRY_RUN_QUERY_QUERY_PARAMETER) @DefaultValue("false") Boolean dryRun, @QueryParam(SharingPath.DRY_RUN_QUERY_QUERY_PARAMETER) @DefaultValue("false") Boolean dryRun,
// String json) String json)
// throws WebApplicationException { throws WebApplicationException {
//
// StringBuffer calledMethod = new StringBuffer(); StringBuffer calledMethod = new StringBuffer();
// if(dryRun==null) { if(dryRun==null) {
// dryRun = false; dryRun = false;
// } }
//
// if(dryRun) { if(dryRun) {
// calledMethod.append("dryRun"); calledMethod.append("dryRun");
// } }
//
// if(operation == SharingOperation.ADD) { if(operation == SharingOperation.ADD) {
// logger.info("Requested {} {} with UUID {} to {} with UUID {}", dryRun? "a dry run for adding": "to add", type, instanceId, Context.NAME, contextId); logger.info("Requested {} {} with UUID {} to {} with UUID {}", dryRun? "a dry run for adding": "to add", type, instanceId, Context.NAME, contextId);
// calledMethod.append("AddToContext"); calledMethod.append("AddToContext");
// }else { }else {
// logger.info("Requested {} {} with UUID {} from {} with UUID {}", dryRun? "a dry run for removing": "to remove", type, instanceId, Context.NAME, contextId); logger.info("Requested {} {} with UUID {} from {} with UUID {}", dryRun? "a dry run for removing": "to remove", type, instanceId, Context.NAME, contextId);
// calledMethod.append("RemoveFromContext"); calledMethod.append("RemoveFromContext");
// } }
// setAccountingMethod(calledMethod.toString()); setAccountingMethod(calledMethod.toString());
//
//
// UUID instanceUUID = UUID.fromString(instanceId); UUID instanceUUID = UUID.fromString(instanceId);
// UUID contextUUID = UUID.fromString(contextId); UUID contextUUID = UUID.fromString(contextId);
//
// /* /*
// * This API should share the the logic of ServiceManager and PlanManager * This API should share the the logic of ServiceManager and PlanManager
// */ */
//
// if(operation == SharingOperation.ADD) { if(operation == SharingOperation.ADD) {
//
// }else { }else {
//
// } }
//
// return ""; return "";
// } }
} }