import org.onap.dmaap.dbcapi.aaf.DmaapGrant;
import org.onap.dmaap.dbcapi.aaf.DmaapPerm;
import org.onap.dmaap.dbcapi.aaf.AafService.ServiceType;
-import org.onap.dmaap.dbcapi.aaf.authentication.ApiPerms;
-import org.onap.dmaap.dbcapi.aaf.database.DatabaseClass;
+import org.onap.dmaap.dbcapi.authentication.ApiPerms;
+import org.onap.dmaap.dbcapi.database.DatabaseClass;
import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
import org.onap.dmaap.dbcapi.logging.DmaapbcLogMessageEnum;
import org.onap.dmaap.dbcapi.model.ApiError;
private Singleton<Dmaap> dmaapholder = DatabaseClass.getDmaap();
- // TODO put these in properties file
+
String topicFactory; // = "org.openecomp.dcae.dmaap.topicFactory";
String topicMgrRole; // = "org.openecomp.dmaapBC.TopicMgr";
-
- // TODO confirm this is equivalent to dmaap.getTopicNsRoot() so we can retire it
String dcaeTopicNs; // = "org.openecomp.dcae.dmaap";
+ private boolean multiSite;
public DmaapService() {
topicFactory = p.getProperty("MR.TopicFactoryNS", "MR.topicFactoryNS.not.set");
topicMgrRole = p.getProperty("MR.TopicMgrRole", "MR.TopicMgrRole.not.set" );
dcaeTopicNs = dmaapholder.get().getTopicNsRoot();
+ multiSite = "true".equalsIgnoreCase(p.getProperty("MR.multisite", "true"));
}
AafService aaf = new AafService( ServiceType.AAF_Admin);
ApiPerms p = new ApiPerms();
p.setEnvMap();
- boolean anythingWrong = setTopicMgtPerms( nd, aaf ) || createMmaTopic();
+ boolean anythingWrong = false;
+
+ if ( multiSite ) {
+ anythingWrong = setTopicMgtPerms( nd, aaf ) || createMmaTopic();
+ }
if ( anythingWrong ) {
dmaap.setStatus(DmaapObject_Status.INVALID);
ApiPerms p = new ApiPerms();
p.setEnvMap();
AafService aaf = new AafService( ServiceType.AAF_Admin);
- anythingWrong = setTopicMgtPerms( nd, aaf ) || createMmaTopic();
+ if ( multiSite ) {
+ anythingWrong = setTopicMgtPerms( nd, aaf ) || createMmaTopic();
+ }
}
if ( anythingWrong ) {