This commit is contained in:
Francesco Mangiacrapa 2018-11-30 10:13:09 +00:00
parent b42eb0bc20
commit 72e16a1825
1 changed files with 0 additions and 44 deletions

View File

@ -37,10 +37,6 @@ import org.slf4j.LoggerFactory;
@Path("parthenos_registry")
public class PartheosRegistryResolver {
/**
*
*/
//private static final String PARTHENOS_REGISTRY_VRE_NAME = "PARTHENOS_Registry";
private static Logger logger = LoggerFactory.getLogger(PartheosRegistryResolver.class);
private static String helpURI = "https://wiki.gcube-system.org/gcube/URI_Resolver#Parthenos_URL_Resolver";
@ -119,46 +115,6 @@ public class PartheosRegistryResolver {
logger.info("Returining Catalogue URL: "+itemCatalogueURLs.getPrivateCataloguePortletURL());
return Response.ok(normalizedEntityName).header("Location", itemCatalogueURLs.getPrivateCataloguePortletURL()).build();
//TODO
/*InnerMethodName.instance.set("postCataloguePublicLink");
logger.info(CatalogueResolver.class.getSimpleName()+" POST starts...");
logger.info("The body contains the request: "+jsonRequest.toString());
//final CatalogueEntityRequest cer = new CatalogueEntityRequest();
//CHECK IF INPUT SCOPE IS VALID
String scope = jsonRequest.getGcube_scope();
if(!scope.startsWith("/")){
logger.info("Scope not start with char '/' adding it");
scope+="/"+scope;
}
String serverUrl = getServerURL(req);
final String vreName = scope.substring(scope.lastIndexOf("/")+1, scope.length());
String fullScope = null;
//CHECK IF THE vreName has a valid scope, so it is a valid VRE
try {
fullScope = LoadingVREsScopeCache.getCache().get(vreName);
}
catch (ExecutionException e1) {
logger.error("Error on getting full scope for vre name: "+vreName, e1);
}
if(fullScope==null)
ExceptionManager.throwNotFoundException(req, "The scope '"+scope+"' does not matching any scope in the infrastructure. Is it valid?", this.getClass(), helpURI);
ResourceCatalogueCodes rc = ResourceCatalogueCodes.valueOfCodeValue(jsonRequest.getEntity_context());
if(rc==null){
logger.error("Entity context is null/malformed");
ExceptionManager.throwBadRequestException(req, "Entity context is null/malformed", this.getClass(), helpURI);
//throw new WebApplicationException("Entity context is null/malformed", Status.BAD_REQUEST);
}
String linkURL = String.format("%s/%s/%s/%s", serverUrl, rc.getId(), vreName, jsonRequest.getEntity_name());
logger.info("Returining Catalogue URL: "+linkURL);
return Response.ok(linkURL).header("Location", linkURL).build();*/
}catch (Exception e) {
logger.error("Exception:", e);
String error = "Error occurred on transforming the "+jsonRequest+". Please, contact the support!";