K8s doesn't necessarily support DNS
[aaf/authz.git] / cadi / client / src / main / java / org / onap / aaf / cadi / locator / SingleEndpointLocator.java
index 3b79dba..b0654cf 100644 (file)
@@ -24,10 +24,9 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Date;
 
-import org.onap.aaf.cadi.Locator;
 import org.onap.aaf.cadi.LocatorException;
 
-public class SingleEndpointLocator implements Locator<URI> {
+public class SingleEndpointLocator implements SizedLocator<URI> {
     private final URI uri;
     private final static Item item = new Item() {};  
     private Date noRetryUntil;
@@ -36,8 +35,12 @@ public class SingleEndpointLocator implements Locator<URI> {
         this.uri = uri;
     }
     
-    public SingleEndpointLocator(final String endpoint) throws URISyntaxException {
-        this.uri = new URI(endpoint);
+    public SingleEndpointLocator(final String endpoint) throws LocatorException {
+        try {
+                       this.uri = new URI(endpoint);
+               } catch (URISyntaxException e) {
+                       throw new LocatorException(e);
+               }
     }
 
     @Override
@@ -84,6 +87,11 @@ public class SingleEndpointLocator implements Locator<URI> {
         // Never refreshed
         return true;
     }
+    
+    @Override
+    public int size() {
+       return 1;
+    }
 
     @Override
     public void destroy() {