bump the version
[dmaap/messagerouter/msgrtr.git] / src / test / java / com / att / nsa / cambria / metabroker / TopicImplem.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP Policy Engine\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
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \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
19  */\r
20 \r
21 package com.att.nsa.cambria.metabroker;\r
22 \r
23 import java.util.Set;\r
24 \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
29 \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
35         \r
36         public TopicImplem() {\r
37                 name = getName();\r
38                 owner = getOwner();\r
39                 description = getDescription();\r
40                 isTransactionEnabled = true;\r
41                 readerAcl = getReaderAcl();\r
42                 writerAcl = getWriterAcl();\r
43         }\r
44         \r
45         public TopicImplem(String topic, String description, String ownerApiKey, boolean transactionEnabled) {\r
46                 \r
47                 this.name = topic;\r
48                 this.owner = ownerApiKey;\r
49                 this.description = description;\r
50                 isTransactionEnabled = transactionEnabled;\r
51                 \r
52                 \r
53         }\r
54         @Override\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
59                 }\r
60                 return set;\r
61         }\r
62 \r
63         @Override\r
64         public String getName() {\r
65                 // TODO Auto-generated method stub\r
66                 return "testTopic";\r
67         }\r
68 \r
69         @Override\r
70         public String getOwner() {\r
71                 // TODO Auto-generated method stub\r
72                 return "owner";\r
73         }\r
74 \r
75         @Override\r
76         public String getDescription() {\r
77                 // TODO Auto-generated method stub\r
78                 return "topic for testing purposes";\r
79         }\r
80 \r
81         @Override\r
82         public boolean isTransactionEnabled() {\r
83                 // TODO Auto-generated method stub\r
84                 return true;\r
85         }\r
86 \r
87         @Override\r
88         public NsaAcl getReaderAcl() {\r
89                 // TODO Auto-generated method stub\r
90                 return new NsaAcl();\r
91         }\r
92 \r
93         @Override\r
94         public NsaAcl getWriterAcl() {\r
95                 // TODO Auto-generated method stub\r
96                 return new NsaAcl();\r
97         }\r
98 \r
99         @Override\r
100         public void checkUserRead(NsaApiKey user) throws AccessDeniedException {\r
101                 // TODO Auto-generated method stub\r
102                 NsaApiKey u = user;\r
103         }\r
104 \r
105         @Override\r
106         public void checkUserWrite(NsaApiKey user) throws AccessDeniedException {\r
107                 // TODO Auto-generated method stub\r
108                 \r
109                 NsaApiKey u = user;\r
110         }\r
111 \r
112         @Override\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
117                 \r
118         }\r
119 \r
120         @Override\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
125                 \r
126         }\r
127 \r
128         @Override\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
132         }\r
133 \r
134         @Override\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
138         }\r
139 \r
140 }\r