Create A1P actor to talk to A1 PMS.
[policy/models.git] / models-interactions / model-actors / actor.a1p / src / main / java / org / onap / policy / controlloop / actor / a1p / A1pActor.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP
4  * ================================================================================
5  * Copyright (C) 2022 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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.policy.controlloop.actor.a1p;
22
23 import org.onap.policy.controlloop.actor.sdnr.SdnrOperation;
24 import org.onap.policy.controlloop.actorserviceprovider.Operator;
25 import org.onap.policy.controlloop.actorserviceprovider.impl.BidirectionalTopicActor;
26 import org.onap.policy.controlloop.actorserviceprovider.impl.BidirectionalTopicOperator;
27 import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicActorParams;
28
29 /**
30  * A1-PMS actor extends the SDN-R Actor and observes the same protocol but over
31  * different topics.
32  */
33 public class A1pActor extends BidirectionalTopicActor<BidirectionalTopicActorParams> {
34     public static final String NAME = "A1P";
35
36     /**
37      * Constructor.
38      */
39     public A1pActor() {
40         super(NAME, BidirectionalTopicActorParams.class);
41
42         addOperator(new BidirectionalTopicOperator(NAME, SdnrOperation.NAME, this, SdnrOperation.SELECTOR_KEYS,
43             A1pOperation::new));
44     }
45
46     @Override
47     public Operator getOperator(String name) {
48         /*
49          * All operations are managed by the same operator, regardless of the name.
50          */
51         return super.getOperator(SdnrOperation.NAME);
52     }
53 }