changed profile class to ServiceEndpoint
This commit is contained in:
parent
aba203b651
commit
09c6155a45
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue