Merge "Fixed bug in BridgeResource.java"
authorvarun gudisena <varuneshwar.gudisena@att.com>
Fri, 18 Jan 2019 14:40:57 +0000 (14:40 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 18 Jan 2019 14:40:57 +0000 (14:40 +0000)
1  2 
src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java

@@@ -4,6 -4,8 +4,8 @@@
   * ================================================================================
   * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
   * ================================================================================
+  * Modifications Copyright (C) 2018 IBM.
+  * ================================================================================
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
@@@ -35,6 -37,7 +37,6 @@@ import javax.ws.rs.core.Response.Status
  import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
  import org.onap.dmaap.dbcapi.model.ApiError;
  import org.onap.dmaap.dbcapi.model.BrTopic;
 -import org.onap.dmaap.dbcapi.model.Dmaap;
  import org.onap.dmaap.dbcapi.model.MirrorMaker;
  import org.onap.dmaap.dbcapi.service.ApiService;
  import org.onap.dmaap.dbcapi.service.MirrorMakerService;
@@@ -59,7 -62,7 +61,7 @@@ public class BridgeResource extends Bas
                        + "If detail param is true, list topics names, else just a count is returned.", 
        response = BrTopic.class)
  @ApiResponses( value = {
 -    @ApiResponse( code = 200, message = "Success", response = Dmaap.class),
 +    @ApiResponse( code = 200, message = "Success", response = BrTopic.class),
      @ApiResponse( code = 400, message = "Error", response = ApiError.class )
  })
        public Response getBridgedTopics(@QueryParam("mmagent") String mmagent,
                        }
                        logger.info( "Count for "+ key + ": " + mCnt);
                        totCnt += mCnt;
-                       if (showDetail) {
+                       if (showDetail && mm!=null) {
                                brTopic[s] =  new BrTopic();
                                brTopic[s].setBrSource( mm.getSourceCluster());
                                brTopic[s].setBrTarget(mm.getTargetCluster());
                                + "If split param is true, spread whitelist over smaller mmagents.", 
                response = MirrorMaker.class)
        @ApiResponses( value = {
 -          @ApiResponse( code = 200, message = "Success", response = Dmaap.class),
 +          @ApiResponse( code = 200, message = "Success", response = BrTopic.class),
            @ApiResponse( code = 400, message = "Error", response = ApiError.class )
        })
        public Response putBridgedTopics(@QueryParam("mmagent") String mmagent,