Code Review
/
dmaap
/
dbcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Actually remove pubs and subs on Feed delete
[dmaap/dbcapi.git]
/
src
/
main
/
java
/
org
/
onap
/
dmaap
/
dbcapi
/
service
/
DR_SubService.java
diff --git
a/src/main/java/org/onap/dmaap/dbcapi/service/DR_SubService.java
b/src/main/java/org/onap/dmaap/dbcapi/service/DR_SubService.java
index
0fe1d9e
..
138ff57
100644
(file)
--- a/
src/main/java/org/onap/dmaap/dbcapi/service/DR_SubService.java
+++ b/
src/main/java/org/onap/dmaap/dbcapi/service/DR_SubService.java
@@
-167,14
+167,21
@@
public class DR_SubService extends BaseLoggingClass {
public void removeDr_Sub( String key, ApiError apiError ) {
logger.debug( "enter removeDR_Subs()");
public void removeDr_Sub( String key, ApiError apiError ) {
logger.debug( "enter removeDR_Subs()");
+
DR_Sub sub = dr_subs.get( key );
if ( sub == null ) {
apiError.setCode(Status.NOT_FOUND.getStatusCode());
apiError.setFields( "subId");
apiError.setMessage("subId " + key + " not found");
} else {
DR_Sub sub = dr_subs.get( key );
if ( sub == null ) {
apiError.setCode(Status.NOT_FOUND.getStatusCode());
apiError.setFields( "subId");
apiError.setMessage("subId " + key + " not found");
} else {
- dr_subs.remove(key);
- apiError.setCode(200);
+ DrProvConnection prov = new DrProvConnection();
+ prov.makeSubPutConnection( key );
+ String resp = prov.doDeleteDr_Sub( sub, apiError );
+ logger.debug( "resp=" + resp );
+
+ if ( apiError.is2xx() ) {
+ dr_subs.remove(key);
+ }
}
return;
}
return;