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
Improve support for http to MR
[dmaap/dbcapi.git]
/
src
/
main
/
java
/
org
/
onap
/
dmaap
/
dbcapi
/
service
/
DmaapService.java
diff --git
a/src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java
b/src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java
index
8436820
..
e7d4e04
100644
(file)
--- a/
src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java
+++ b/
src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java
@@
-35,8
+35,8
@@
import org.onap.dmaap.dbcapi.aaf.AafService;
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.DmaapGrant;
import org.onap.dmaap.dbcapi.aaf.DmaapPerm;
import org.onap.dmaap.dbcapi.aaf.AafService.ServiceType;
-import org.onap.dmaap.dbcapi.a
af.a
uthentication.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;
import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
import org.onap.dmaap.dbcapi.logging.DmaapbcLogMessageEnum;
import org.onap.dmaap.dbcapi.model.ApiError;
@@
-52,12
+52,11
@@
public class DmaapService extends BaseLoggingClass {
private Singleton<Dmaap> dmaapholder = DatabaseClass.getDmaap();
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";
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";
String dcaeTopicNs; // = "org.openecomp.dcae.dmaap";
+ private boolean multiSite;
public DmaapService() {
public DmaapService() {
@@
-65,6
+64,7
@@
public class DmaapService extends BaseLoggingClass {
topicFactory = p.getProperty("MR.TopicFactoryNS", "MR.topicFactoryNS.not.set");
topicMgrRole = p.getProperty("MR.TopicMgrRole", "MR.TopicMgrRole.not.set" );
dcaeTopicNs = dmaapholder.get().getTopicNsRoot();
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"));
}
}
@@
-85,7
+85,11
@@
public class DmaapService extends BaseLoggingClass {
AafService aaf = new AafService( ServiceType.AAF_Admin);
ApiPerms p = new ApiPerms();
p.setEnvMap();
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);
if ( anythingWrong ) {
dmaap.setStatus(DmaapObject_Status.INVALID);
@@
-121,7
+125,9
@@
public class DmaapService extends BaseLoggingClass {
ApiPerms p = new ApiPerms();
p.setEnvMap();
AafService aaf = new AafService( ServiceType.AAF_Admin);
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 ) {
}
if ( anythingWrong ) {
@@
-204,6
+210,16
@@
public class DmaapService extends BaseLoggingClass {
}
return false;
}
}
return false;
}
+
+ public boolean testCreateMmaTopic() {
+
+ DmaapConfig p = (DmaapConfig)DmaapConfig.getConfig();
+ String unit_test = p.getProperty( "UnitTest", "No" );
+ if ( unit_test.equals( "Yes" ) ) {
+ return createMmaTopic();
+ }
+ return false;
+ }
// create the special topic for MMA provisioning.
// return true indicating a problem in topic creation,
// create the special topic for MMA provisioning.
// return true indicating a problem in topic creation,