X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-locate%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Flocate%2Fvalidation%2FLocateValidator.java;h=4f3884d2093e185f2184a6b4561520c9d1513d16;hb=refs%2Fchanges%2F87%2F65287%2F1;hp=6dd3d92ae2d04608e82de89e28419a6e7282f6d8;hpb=ead32f193586e39b59bb366bddf70e665173a52d;p=aaf%2Fauthz.git diff --git a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/validation/LocateValidator.java b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/validation/LocateValidator.java index 6dd3d92a..4f3884d2 100644 --- a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/validation/LocateValidator.java +++ b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/validation/LocateValidator.java @@ -40,13 +40,13 @@ import locate.v1_0.MgmtEndpoints; */ public class LocateValidator extends Validator { private LocateValidator endpoint_key(Endpoint e) { - if(e==null) { + if (e==null) { msg("Endpoint Data is null."); } else { nullOrBlank("Endpoint Name", e.getName()); - if(e.getName()!=null) { + if (e.getName()!=null) { int idx = e.getName().indexOf('.'); - if(idx<=0) { + if (idx<=0) { msg("Endpoint Name must prefixed by Namespace"); } } @@ -59,7 +59,7 @@ public class LocateValidator extends Validator { public LocateValidator endpoint(Endpoint e) { endpoint_key(e); - if(e!=null) { + if (e!=null) { intRange("Endpoint Major Version",e.getMajor(),0,2000); intRange("Endpoint Minor Version",e.getMinor(),0,2000); intRange("Endpoint Patch Version",e.getPatch(),0,2000); @@ -67,7 +67,7 @@ public class LocateValidator extends Validator { floatRange("Endpoint Latitude",e.getLatitude(),-90f,90f); floatRange("Endpoint Longitude",e.getLongitude(),-180f,180f); nullOrBlank("Endpoint Protocol", e.getProtocol()); - for(String s : e.getSubprotocol()) { + for (String s : e.getSubprotocol()) { nullOrBlank("Endpoint Subprotocol", s); } } @@ -75,13 +75,13 @@ public class LocateValidator extends Validator { } public LocateValidator endpoints(Endpoints e, boolean emptyNotOK) { - if(e==null) { + if (e==null) { msg("Endpoints Data is null."); } else { - if(emptyNotOK && e.getEndpoint().size()==0) { + if (emptyNotOK && e.getEndpoint().size()==0) { msg("Endpoints contains no endpoints"); } else { - for(Endpoint ep : e.getEndpoint()) { + for (Endpoint ep : e.getEndpoint()) { endpoint(ep); } } @@ -90,10 +90,10 @@ public class LocateValidator extends Validator { } public LocateValidator mgmt_endpoint_key(MgmtEndpoints meps) { - if(meps==null) { + if (meps==null) { msg("MgmtEndpoints Data is null."); } else { - for(MgmtEndpoint ep : meps.getMgmtEndpoint()) { + for (MgmtEndpoint ep : meps.getMgmtEndpoint()) { endpoint_key(ep); } } @@ -101,13 +101,13 @@ public class LocateValidator extends Validator { } public LocateValidator mgmt_endpoints(MgmtEndpoints me, boolean emptyOK) { - if(me==null) { + if (me==null) { msg("MgmtEndpoints Data is null."); } else { - if(!emptyOK && me.getMgmtEndpoint().size()==0) { + if (!emptyOK && me.getMgmtEndpoint().size()==0) { msg("MgmtEndpoints contains no data"); } else { - for(MgmtEndpoint ep : me.getMgmtEndpoint()) { + for (MgmtEndpoint ep : me.getMgmtEndpoint()) { mgmt_endpoint(ep); } } @@ -117,21 +117,21 @@ public class LocateValidator extends Validator { private LocateValidator mgmt_endpoint(MgmtEndpoint ep) { endpoint(ep); - for(SpecialPorts sp : ep.getSpecialPorts()) { + for (SpecialPorts sp : ep.getSpecialPorts()) { specialPorts(sp); } return this; } private LocateValidator specialPorts(SpecialPorts sp) { - if(sp==null) { + if (sp==null) { msg("Special Ports is null."); } else { nullOrBlank("Special Port Name",sp.getName()); nullOrBlank("Special Port Protocol",sp.getProtocol()); intRange("Special Port",sp.getPort(),0,1000000); - for(String s : sp.getProtocolVersions()) { + for (String s : sp.getProtocolVersions()) { nullOrBlank("Special Port Protocol Version", s); } }