Actually remove pubs and subs on Feed delete
[dmaap/dbcapi.git] / src / main / java / org / onap / dmaap / dbcapi / resources / FeedResource.java
index 361491a..c0fdd0d 100644 (file)
@@ -37,6 +37,7 @@ import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.GenericEntity;
 import javax.ws.rs.core.MediaType;
@@ -45,26 +46,7 @@ import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.core.UriInfo;
 
 import org.apache.log4j.Logger;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-import org.onap.dmaap.dbcapi.aaf.authentication.AuthenticationErrorException;
+import org.onap.dmaap.dbcapi.authentication.AuthenticationErrorException;
 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
 import org.onap.dmaap.dbcapi.logging.DmaapbcLogMessageEnum;
 import org.onap.dmaap.dbcapi.model.ApiError;
@@ -92,12 +74,16 @@ public class FeedResource extends BaseLoggingClass {
            @ApiResponse( code = 200, message = "Success", response = DR_Pub.class),
            @ApiResponse( code = 400, message = "Error", response = ApiError.class )
        })
-       public Response getFeeds() {
+       public Response getFeeds(
+                       @QueryParam("feedName") String feedName,
+                       @QueryParam("version") String version,
+                       @QueryParam("match") String match
+                       ) {
 
                ApiService resp = new ApiService();
 
                FeedService feedService = new FeedService();
-               List<Feed> nfeeds =  feedService.getAllFeeds();
+               List<Feed> nfeeds =  feedService.getAllFeeds( feedName, version, match );
                GenericEntity<List<Feed>> list = new GenericEntity<List<Feed>>(nfeeds) {
         };
         return resp.success(list);
@@ -141,7 +127,8 @@ public class FeedResource extends BaseLoggingClass {
                                return resp.error();                    
                        }
                } else if ( nfeed.getStatus() == DmaapObject_Status.DELETED ) {
-                       nfeed =  feedService.updateFeed(nfeed, resp.getErr());
+                       feed.setFeedId( nfeed.getFeedId());
+                       nfeed =  feedService.updateFeed(feed, resp.getErr());
                        if ( nfeed != null ) {
                                return resp.success(nfeed);
                        } else {