Skip to content
Snippets Groups Projects
Commit e14cb641 authored by Brian Major's avatar Brian Major
Browse files

s1849 - changed availability check to use VOSI availability standardURI

parent f8561636
No related branches found
No related tags found
No related merge requests found
package ca.nrc.cadc.auth;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.security.Principal;
......@@ -15,12 +14,12 @@ import java.util.UUID;
import javax.security.auth.Subject;
import javax.security.auth.x500.X500Principal;
import ca.nrc.cadc.reg.Standards;
import org.apache.log4j.Logger;
import ca.nrc.cadc.ac.User;
import ca.nrc.cadc.ac.client.UserClient;
import ca.nrc.cadc.profiler.Profiler;
import ca.nrc.cadc.reg.Standards;
import ca.nrc.cadc.reg.client.LocalAuthority;
import ca.nrc.cadc.reg.client.RegistryClient;
import ca.nrc.cadc.vosi.avail.CheckResource;
......@@ -232,22 +231,10 @@ public class ACIdentityManager implements IdentityManager
*/
public static CheckResource getAvailabilityCheck()
{
try
{
RegistryClient regClient = new RegistryClient();
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI(Standards.GMS_GROUPS_01.toString());
URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_GROUPS_01, AuthMethod.ANON);
// Hack to strip off the groups endpoint to get the base url of the service.
String serviceUrl = serviceURL.toExternalForm();
int index = serviceUrl.lastIndexOf('/');
URL availURL = new URL(serviceUrl.substring(0, index)+ "/availability");
return new CheckWebService(availURL.toExternalForm());
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}
RegistryClient regClient = new RegistryClient();
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI(Standards.GMS_GROUPS_01.toString());
URL availURL = regClient.getServiceURL(serviceURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON);
return new CheckWebService(availURL.toExternalForm());
}
}
package ca.nrc.cadc.auth;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import javax.security.auth.Subject;
import javax.security.auth.x500.X500Principal;
import ca.nrc.cadc.reg.Standards;
import org.apache.log4j.Logger;
import ca.nrc.cadc.profiler.Profiler;
import ca.nrc.cadc.reg.Standards;
import ca.nrc.cadc.reg.client.LocalAuthority;
import ca.nrc.cadc.reg.client.RegistryClient;
import ca.nrc.cadc.vosi.avail.CheckResource;
......@@ -70,22 +69,10 @@ public class AuthenticatorImpl implements Authenticator
public static CheckResource getAvailabilityCheck()
{
try
{
RegistryClient regClient = new RegistryClient();
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI(Standards.GMS_GROUPS_01.toString());
URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_GROUPS_01, AuthMethod.ANON);
// Hack to strip off the groups endpoint to get the base url of the service.
String serviceUrl = serviceURL.toExternalForm();
int index = serviceUrl.lastIndexOf('/');
URL availURL = new URL(serviceUrl.substring(0, index)+ "/availability");
return new CheckWebService(availURL.toExternalForm());
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}
RegistryClient regClient = new RegistryClient();
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI(Standards.GMS_GROUPS_01.toString());
URL availURL = regClient.getServiceURL(serviceURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON);
return new CheckWebService(availURL.toExternalForm());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment