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