Refactor code to support no AAF requests
[dmaap/dbcapi.git] / src / main / java / org / onap / dmaap / dbcapi / service / MR_ClusterService.java
index 977288b..529723e 100644 (file)
@@ -26,13 +26,7 @@ import java.util.Map;
 
 import javax.ws.rs.core.Response.Status;
 
-
-
-
-
-
-
-import org.onap.dmaap.dbcapi.aaf.database.DatabaseClass;
+import org.onap.dmaap.dbcapi.database.DatabaseClass;
 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
 import org.onap.dmaap.dbcapi.model.ApiError;
 import org.onap.dmaap.dbcapi.model.DcaeLocation;
@@ -120,7 +114,12 @@ public class MR_ClusterService extends BaseLoggingClass {
                mr_clusters.put( cluster.getDcaeLocationName(), cluster );
                DcaeLocationService svc = new DcaeLocationService();
                DcaeLocation loc = svc.getDcaeLocation( cluster.getDcaeLocationName() );
-               if ( loc.isCentral() ) {
+               if ( loc == null ) {
+                       logger.error( "DcaeLocation not found for cluster in " + cluster.getDcaeLocationName() );
+                       cluster.setLastMod();
+                       cluster.setStatus(DmaapObject_Status.INVALID);
+                       mr_clusters.put( cluster.getDcaeLocationName(), cluster );
+               } else if ( loc.isCentral() ) {
                        ApiError resp = TopicService.setBridgeClientPerms( cluster );
                        if ( ! resp.is2xx() ) {
                                logger.error( "Unable to provision Bridge to " + cluster.getDcaeLocationName() );