From 09c6155a4569167ccba320d28cc30ef80cc679f9 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 16 Feb 2023 14:21:32 +0100 Subject: [PATCH] changed profile class to ServiceEndpoint --- .../resources/ServiceEndpointResource.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/icproxy/resources/ServiceEndpointResource.java b/src/main/java/org/gcube/informationsystem/icproxy/resources/ServiceEndpointResource.java index fc99bce..949fedb 100644 --- a/src/main/java/org/gcube/informationsystem/icproxy/resources/ServiceEndpointResource.java +++ b/src/main/java/org/gcube/informationsystem/icproxy/resources/ServiceEndpointResource.java @@ -87,19 +87,21 @@ public class ServiceEndpointResource { @POST @Produces(MediaType.APPLICATION_XML) @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public ServiceEndpoint create(ServiceEndpointProfile resourceProfile) { + public ServiceEndpoint create(ServiceEndpoint resourceProfile) { log.info("Try to create new serviceEndpoint profile {} in {}",resourceProfile, ScopeProvider.instance.get()); if (Objects.nonNull(resourceProfile) && isRoleEnabled()){ - ServiceEndpoint newResource= new ServiceEndpoint(); - ServiceEndpoint.Profile profile=newResource.newProfile().category(resourceProfile.getCategory()).name(resourceProfile.getName()); - ServiceEndpoint. platform=profile.newPlatform().name(resourceProfile.getPlatform()).version(1).minorVersion(0).platformVersion(0).revisionVersion(0).buildVersion(0); - ServiceEndpoint.AccessPoint ap=new ServiceEndpoint.AccessPoint(); - ap.name(resourceProfile.getAccessPointName()); - ap.address(resourceProfile.getAccessPointAddress()); - ap.credentials(resourceProfile.getAccessPointPass(), resourceProfile.getAccessPointUsername()); - profile.accessPoints().add(ap); - registerSE(newResource); - return newResource; +// ServiceEndpoint newResource= new ServiceEndpoint(); +// ServiceEndpoint.Profile profile=newResource.newProfile().category(resourceProfile.getCategory()).name(resourceProfile.getName()); +// ServiceEndpoint. platform=profile.newPlatform().name(resourceProfile.getPlatform()).version(1).minorVersion(0).platformVersion(0).revisionVersion(0).buildVersion(0); +// ServiceEndpoint.AccessPoint ap=new ServiceEndpoint.AccessPoint(); +// ap.name(resourceProfile.getAccessPointName()); +// ap.address(resourceProfile.getAccessPointAddress()); +// ap.credentials(resourceProfile.getAccessPointPass(), resourceProfile.getAccessPointUsername()); +// profile.accessPoints().add(ap); +// registerSE(newResource); +// return newResource; + registerSE(resourceProfile); + return resourceProfile; }else{ throw new RuntimeException("ServiceEndpoint profile is null or user not enabled"); }