diff options
Diffstat (limited to 'src')
7 files changed, 54 insertions, 24 deletions
diff --git a/src/main/java/org/onap/dmaap/dbcapi/authentication/ApiPerms.java b/src/main/java/org/onap/dmaap/dbcapi/authentication/ApiPerms.java index f3b9ebc..bcadf40 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/authentication/ApiPerms.java +++ b/src/main/java/org/onap/dmaap/dbcapi/authentication/ApiPerms.java @@ -3,6 +3,8 @@ * org.onap.dmaap * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright (C) 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -172,8 +174,8 @@ public class ApiPerms extends BaseLoggingClass { } public void setEnvMap() { - Dmaap dmaap = new DmaapService().getDmaap(); - String dmaapName = dmaap.getDmaapName(); + Dmaap dmaapVar = new DmaapService().getDmaap(); + String dmaapName = dmaapVar.getDmaapName(); PermissionMap.initMap( envMap, dmaapName ); } diff --git a/src/main/java/org/onap/dmaap/dbcapi/model/Feed.java b/src/main/java/org/onap/dmaap/dbcapi/model/Feed.java index 648812f..b78377b 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/model/Feed.java +++ b/src/main/java/org/onap/dmaap/dbcapi/model/Feed.java @@ -3,6 +3,8 @@ * org.onap.dmaap * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright (C) 2019 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -262,8 +264,7 @@ public class Feed extends DmaapObject { } public static String getSubProvURL( String feedId ) { - String ret = new String(); - ret = new DmaapService().getDmaap().getDrProvUrl() + "/subscribe/" + feedId ; + String ret = new DmaapService().getDmaap().getDrProvUrl() + "/subscribe/" + feedId ; return ret; } diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java index e6fede7..192b63d 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java +++ b/src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -121,7 +123,7 @@ public class BridgeResource extends BaseLoggingClass { } logger.info( "Count for "+ key + ": " + mCnt); totCnt += mCnt; - if (showDetail) { + if (showDetail && mm!=null) { brTopic[s] = new BrTopic(); brTopic[s].setBrSource( mm.getSourceCluster()); brTopic[s].setBrTarget(mm.getTargetCluster()); diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/DR_SubResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/DR_SubResource.java index 58a39df..28bfdc5 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/resources/DR_SubResource.java +++ b/src/main/java/org/onap/dmaap/dbcapi/resources/DR_SubResource.java @@ -3,6 +3,8 @@ * org.onap.dmaap * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright (C) 2019 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,8 +122,6 @@ public class DR_SubResource extends BaseLoggingClass { fnew.setSubs(subs); logger.info( "update feed"); - //feeds.updateFeed( fnew, err ); - return resp.success(Status.CREATED.getStatusCode(), snew); } 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 48ee661..408d000 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java +++ b/src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java @@ -3,6 +3,8 @@ * org.onap.dmaap * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright (C) 2019 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,16 +23,6 @@ package org.onap.dmaap.dbcapi.service; import java.util.ArrayList; - - - - - - - - - - import org.onap.dmaap.dbcapi.aaf.AafService; import org.onap.dmaap.dbcapi.aaf.DmaapGrant; import org.onap.dmaap.dbcapi.aaf.DmaapPerm; @@ -43,7 +35,6 @@ import org.onap.dmaap.dbcapi.logging.DmaapbcLogMessageEnum; import org.onap.dmaap.dbcapi.model.ApiError; import org.onap.dmaap.dbcapi.model.Dmaap; import org.onap.dmaap.dbcapi.model.MR_Client; -import org.onap.dmaap.dbcapi.model.ReplicationType; import org.onap.dmaap.dbcapi.model.Topic; import org.onap.dmaap.dbcapi.model.DmaapObject.DmaapObject_Status; import org.onap.dmaap.dbcapi.util.DmaapConfig; diff --git a/src/main/java/org/onap/dmaap/dbcapi/util/Graph.java b/src/main/java/org/onap/dmaap/dbcapi/util/Graph.java index a7700a1..700c77f 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/util/Graph.java +++ b/src/main/java/org/onap/dmaap/dbcapi/util/Graph.java @@ -3,6 +3,8 @@ * org.onap.dmaap * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright (C) 2019 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,18 +22,17 @@ package org.onap.dmaap.dbcapi.util; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.onap.dmaap.dbcapi.database.DatabaseClass; import org.onap.dmaap.dbcapi.model.DcaeLocation; import org.onap.dmaap.dbcapi.model.MR_Client; import org.onap.dmaap.dbcapi.model.MR_Cluster; import org.onap.dmaap.dbcapi.service.MR_ClusterService; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class Graph { private HashMap<String, String> graph; diff --git a/src/test/java/org/onap/dmaap/dbcapi/util/FqdnTest.java b/src/test/java/org/onap/dmaap/dbcapi/util/FqdnTest.java new file mode 100644 index 0000000..7c7815f --- /dev/null +++ b/src/test/java/org/onap/dmaap/dbcapi/util/FqdnTest.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.dmaap + * ================================================================================ + * Copyright (C) 2019 IBM Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.dmaap.dbcapi.util; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class FqdnTest { + + @Test + public void testIsValid() { + assertTrue(Fqdn.isValid("www.ibm.com")); + assertFalse(Fqdn.isValid("testuser@ibm.com")); + } +}
\ No newline at end of file |