2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.dmaap.mr.cambria.metabroker;
25 import org.onap.dmaap.dmf.mr.metabroker.Topic;
26 import com.att.nsa.configs.ConfigDbException;
27 import com.att.nsa.security.NsaAcl;
28 import com.att.nsa.security.NsaApiKey;
30 public class TopicImplem implements Topic {
31 private String name, owner, description;
32 boolean isTransactionEnabled;
33 private Set<String> set = null;
34 private NsaAcl readerAcl, writerAcl;
36 public TopicImplem() {
39 description = getDescription();
40 isTransactionEnabled = true;
41 readerAcl = getReaderAcl();
42 writerAcl = getWriterAcl();
45 public TopicImplem(String topic, String description, String ownerApiKey, boolean transactionEnabled) {
48 this.owner = ownerApiKey;
49 this.description = description;
50 isTransactionEnabled = transactionEnabled;
55 public Set<String> getOwners() {
56 // TODO Auto-generated method stub
57 for (int i = 0; i < 5; i++) {
58 set.add("string" + (i + 1));
64 public String getName() {
65 // TODO Auto-generated method stub
70 public String getOwner() {
71 // TODO Auto-generated method stub
76 public String getDescription() {
77 // TODO Auto-generated method stub
78 return "topic for testing purposes";
82 public boolean isTransactionEnabled() {
83 // TODO Auto-generated method stub
88 public NsaAcl getReaderAcl() {
89 // TODO Auto-generated method stub
94 public NsaAcl getWriterAcl() {
95 // TODO Auto-generated method stub
100 public void checkUserRead(NsaApiKey user) throws AccessDeniedException {
101 // TODO Auto-generated method stub
106 public void checkUserWrite(NsaApiKey user) throws AccessDeniedException {
107 // TODO Auto-generated method stub
113 public void permitWritesFromUser(String publisherId, NsaApiKey asUser)
114 throws AccessDeniedException, ConfigDbException {
115 // TODO Auto-generated method stub
116 String id = publisherId;
121 public void denyWritesFromUser(String publisherId, NsaApiKey asUser)
122 throws AccessDeniedException, ConfigDbException {
123 // TODO Auto-generated method stub
124 String id = publisherId;
129 public void permitReadsByUser(String consumerId, NsaApiKey asUser) throws AccessDeniedException, ConfigDbException {
130 // TODO Auto-generated method stub
131 String id = consumerId;
135 public void denyReadsByUser(String consumerId, NsaApiKey asUser) throws AccessDeniedException, ConfigDbException {
136 // TODO Auto-generated method stub
137 String id = consumerId;