2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019-2020 Bell Canada. All rights reserved.
4 * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ============LICENSE_END=========================================================
20 package org.onap.policy.controlloop.actor.cds;
22 import org.onap.policy.controlloop.actor.cds.constants.CdsActorConstants;
23 import org.onap.policy.controlloop.actorserviceprovider.Operator;
24 import org.onap.policy.controlloop.actorserviceprovider.impl.ActorImpl;
27 * CDS is an unusual actor in that it uses a single, generic operator to initiate all
28 * operation types. The action taken is always the same, only the operation name changes.
30 public class CdsActor extends ActorImpl {
31 public static final String NAME = CdsActorConstants.CDS_ACTOR;
34 * Constructs the object.
37 super(CdsActorConstants.CDS_ACTOR);
39 addOperator(new GrpcOperator(CdsActorConstants.CDS_ACTOR, GrpcOperation.NAME, GrpcOperation::new));
43 public Operator getOperator(String name) {
45 * All operations are managed by the same operator, regardless of the name.
47 return super.getOperator(GrpcOperation.NAME);