diff options
Diffstat (limited to 'src')
3 files changed, 19 insertions, 7 deletions
diff --git a/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/CambriaPublisherUtility.java b/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/CambriaPublisherUtility.java index 4f072ac..1572835 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/CambriaPublisherUtility.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/CambriaPublisherUtility.java @@ -98,7 +98,10 @@ public class CambriaPublisherUtility final ArrayList<HttpHost> convertedHosts = new ArrayList<>(); for ( String host : hosts ) { - if ( host.length () == 0 ) continue; + if ( host.length () == 0 ){ + continue; + } + convertedHosts.add ( hostForString ( host ) ); } return convertedHosts; @@ -115,13 +118,18 @@ public class CambriaPublisherUtility */ public static HttpHost hostForString ( String host ) { - if ( host.length() < 1 ) throw new IllegalArgumentException ( "An empty host entry is invalid." ); + if ( host.length() < 1 ){ + throw new IllegalArgumentException ( "An empty host entry is invalid." ); + } String hostPart = host; int port = kStdCambriaServicePort; final int colon = host.indexOf ( ':' ); - if ( colon == 0 ) throw new IllegalArgumentException ( "Host entry '" + host + "' is invalid." ); + if ( colon == 0 ){ + throw new IllegalArgumentException ( "Host entry '" + host + "' is invalid." ); + } + if ( colon > 0 ) { hostPart = host.substring ( 0, colon ).trim(); diff --git a/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/impl/CambriaBaseClient.java b/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/impl/CambriaBaseClient.java index 6bedd18..050bf29 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/impl/CambriaBaseClient.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/metrics/publisher/impl/CambriaBaseClient.java @@ -69,8 +69,10 @@ public class CambriaBaseClient extends HttpClient implements org.onap.dmaap.dmf. public Set<String> jsonArrayToSet ( JSONArray a ) throws JSONException { - if ( a == null ) return null; - + if ( a == null ){ + return null; + } + final TreeSet<String> set = new TreeSet<>(); for ( int i=0; i<a.length (); i++ ) { diff --git a/src/main/java/org/onap/dmaap/dmf/mr/resources/streamReaders/CambriaRawStreamReader.java b/src/main/java/org/onap/dmaap/dmf/mr/resources/streamReaders/CambriaRawStreamReader.java index 93baee0..1000f15 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/resources/streamReaders/CambriaRawStreamReader.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/resources/streamReaders/CambriaRawStreamReader.java @@ -63,8 +63,10 @@ public class CambriaRawStreamReader implements reader */ public message next () throws CambriaApiException { - if ( fClosed ) return null; - + if ( fClosed ){ + return null; + } + try { final byte[] rawBytes = StreamTools.readBytes ( fStream ); |