2 * ============LICENSE_START=======================================================
3 * feature-active-standby-management
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.onap.policy.drools.activestandby;
23 import java.util.Collection;
25 public interface DroolsPdpsConnector {
28 //return a list of PDPs, NOT including this PDP
29 public Collection<DroolsPdp> getDroolsPdps();
31 public void update(DroolsPdp pdp);
33 //determines if the DroolsPdp parameter is considered "current" or expired (has it been too long since the Pdp sent an update)
34 public boolean isPdpCurrent(DroolsPdp pdp);
36 // Updates DESIGNATED boolean in PDP record.
37 public void setDesignated(DroolsPdp pdp, boolean designated);
39 // Marks droolspdpentity.DESIGNATED=false, so another PDP-D will go active.
40 public void standDownPdp(String pdpId);
42 // This is used in a JUnit test environment to manually
44 public void insertPdp(DroolsPdp pdp);
46 // This is used in a JUnit test environment to manually
48 public void deletePdp(String pdpId);
50 // This is used in a JUnit test environment to manually
51 // clear the droolspdpentity table.
52 public void deleteAllPdps();
54 // This is used in a JUnit test environment to manually
56 public DroolsPdpEntity getPdp(String pdpId);
58 // Used by DroolsPdpsElectionHandler to determine if the currently designated
60 public boolean hasDesignatedPdpFailed(Collection<DroolsPdp> pdps);