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.openecomp.policy.drools.controller.internal;
23 import java.util.ArrayList;
24 import java.util.HashMap;
25 import java.util.List;
28 import org.openecomp.policy.drools.controller.DroolsController;
29 import org.openecomp.policy.drools.event.comm.TopicSink;
30 import org.openecomp.policy.drools.protocol.coders.TopicCoderFilterConfiguration;
33 * no-op Drools Controller
35 public class NullDroolsController implements DroolsController {
41 public boolean start() throws IllegalStateException {
49 public boolean stop() throws IllegalStateException {
57 public void shutdown() throws IllegalStateException {
65 public void halt() throws IllegalStateException {
73 public boolean isAlive() {
81 public boolean lock() {
89 public boolean unlock() {
97 public boolean isLocked() {
105 public String getGroupId() {
113 public String getArtifactId() {
114 return NO_ARTIFACT_ID;
121 public String getVersion() {
129 public List<String> getSessionNames() {
130 return new ArrayList<String>();
137 public List<String> getCanonicalSessionNames() {
138 return new ArrayList<String>();
145 public boolean offer(String topic, String event) {
153 public boolean deliver(TopicSink sink, Object event)
154 throws IllegalArgumentException, IllegalStateException, UnsupportedOperationException {
155 throw new IllegalArgumentException(this.getClass().getCanonicalName() + " invoked");
162 public Object[] getRecentSourceEvents() {
163 return new String[0];
170 public String[] getRecentSinkEvents() {
171 return new String[0];
178 public boolean ownsCoder(Class<? extends Object> coderClass, int modelHash) throws IllegalStateException {
179 throw new IllegalArgumentException(this.getClass().getCanonicalName() + " invoked");
186 public Class<?> fetchModelClass(String className) throws IllegalArgumentException {
187 throw new IllegalArgumentException(this.getClass().getCanonicalName() + " invoked");
194 public boolean isBrained() {
202 public String toString() {
203 StringBuilder builder = new StringBuilder();
204 builder.append("NullDroolsController []");
205 return builder.toString();
212 public void updateToVersion(String newGroupId, String newArtifactId, String newVersion,
213 List<TopicCoderFilterConfiguration> decoderConfigurations,
214 List<TopicCoderFilterConfiguration> encoderConfigurations)
215 throws IllegalArgumentException, LinkageError, Exception {
216 throw new IllegalArgumentException(this.getClass().getCanonicalName() + " invoked");
223 public Map<String, Integer> factClassNames(String sessionName)
224 throws IllegalArgumentException {
225 return new HashMap<String,Integer>();
232 public long factCount(String sessionName) throws IllegalArgumentException {
240 public List<Object> facts(String sessionName, String className, boolean delete) {
241 return new ArrayList<Object>();
248 public List<Object> factQuery(String sessionName, String queryName,
249 String queriedEntity,
250 boolean delete, Object... queryParams) {
251 return new ArrayList<Object>();