+ else {
+
+ logger.error( "source and target are required when detail=true");
+ check.setCode(Status.BAD_REQUEST.getStatusCode());
+ check.setMessage("source and target are required when detail=true");
+ return check.error();
+ }
+ }
+ }
+
+ @PUT
+ @ApiOperation( value = "update MirrorMaker details",
+ notes = "replace the topic list for a specific Bridge. Use JSON Body for value to replace whitelist, but if refreshFlag param is true, simply refresh using existing whitelist",
+ response = MirrorMaker.class)
+ @ApiResponses( value = {
+ @ApiResponse( code = 200, message = "Success", response = Dmaap.class),
+ @ApiResponse( code = 400, message = "Error", response = ApiError.class )
+ })
+ public Response putBridgedTopics(@QueryParam("source") String source,
+ @QueryParam("target") String target,
+ @QueryParam("refresh") Boolean refreshFlag,
+ MirrorMaker newBridge ){
+ ApiService check = new ApiService();
+
+ logger.info( "putBridgeTopics() detail:" + " source=" + source + ", target=" + target);
+
+ if (source != null && target != null) { // get topics between 2 bridged locations
+
+ MirrorMaker mm = mmService.getMirrorMaker(source, target);
+ if ( mm == null ) {
+ return check.notFound();
+ }
+ if ( refreshFlag != null && refreshFlag == false ) {
+ logger.info( "setting whitelist from message body");
+ mm.setTopics( newBridge.getTopics() );
+ } else {
+ logger.info( "refreshing whitelist from memory");
+ }
+ mmService.updateMirrorMaker(mm);
+ return check.success(mm);