Also deleted the checkstyle suppression file.
Change-Id: I93e9f9154b614b56f7826ec978e1a99bd9369348
Issue-ID: POLICY-1907
Signed-off-by: Jim Hahn <jrh3@att.com>
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
-import org.onap.policy.drools.core.PolicySessionFeatureAPI;
+import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
import org.onap.policy.drools.statemanagement.StateManagementFeatureAPI;
import org.onap.policy.drools.system.PolicyEngine;
* a separate optional feature.
*/
public class ActiveStandbyFeature implements ActiveStandbyFeatureAPI,
- PolicySessionFeatureAPI, PolicyEngineFeatureApi {
+ PolicySessionFeatureApi, PolicyEngineFeatureApi {
// get an instance of logger
private static final Logger logger =
LoggerFactory.getLogger(ActiveStandbyFeature.class);
* ============LICENSE_START=======================================================
* feature-active-standby-management
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.policy.drools.activestandby.DroolsPdpsConnector;
import org.onap.policy.drools.activestandby.DroolsPdpsElectionHandler;
import org.onap.policy.drools.activestandby.JpaDroolsPdpsConnector;
-import org.onap.policy.drools.core.PolicySessionFeatureAPI;
+import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.statemanagement.StateManagementFeatureAPI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
StateManagementFeatureAPI stateManagementFeatureApi = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeatureApi = feature;
logger.debug("testAllSeemsWell stateManagementFeature.getResourceName(): {}",
stateManagementFeatureApi.getResourceName());
// that has been created.
ActiveStandbyFeatureAPI activeStandbyFeature = null;
for (ActiveStandbyFeatureAPI feature : ActiveStandbyFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testAllSeemsWell activeStandbyFeature.getResourceName(): {}",
activeStandbyFeature.getResourceName());
* ============LICENSE_START=======================================================
* feature-active-standby-management
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.policy.drools.activestandby.DroolsPdpsElectionHandler;
import org.onap.policy.drools.activestandby.JpaDroolsPdpsConnector;
import org.onap.policy.drools.activestandby.PMStandbyStateChangeNotifier;
-import org.onap.policy.drools.core.PolicySessionFeatureAPI;
+import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.statemanagement.StateManagementFeatureAPI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
StateManagementFeatureAPI stateManagementFeature = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeature = feature;
logger.debug("testColdStandby stateManagementFeature.getResourceName(): {}",
stateManagementFeature.getResourceName());
StateManagementFeatureAPI stateManagementFeature = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeature = feature;
logger.debug("testComputeMostRecentPrimary stateManagementFeature.getResourceName(): {}",
stateManagementFeature.getResourceName());
StateManagementFeatureAPI stateManagementFeature = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeature = feature;
logger.debug("testComputeDesignatedPdp stateManagementFeature.getResourceName(): {}",
stateManagementFeature.getResourceName());
StateManagementFeatureAPI smf = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
smf = feature;
logger.debug("testColdStandby stateManagementFeature.getResourceName(): {}", smf.getResourceName());
break;
// that has been created.
ActiveStandbyFeatureAPI activeStandbyFeature = null;
for (ActiveStandbyFeatureAPI feature : ActiveStandbyFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testColdStandby activeStandbyFeature.getResourceName(): {}",
activeStandbyFeature.getResourceName());
StateManagementFeatureAPI smf = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
smf = feature;
logger.debug("testHotStandby1 stateManagementFeature.getResourceName(): {}", smf.getResourceName());
break;
// that has been created.
ActiveStandbyFeatureAPI activeStandbyFeature = null;
for (ActiveStandbyFeatureAPI feature : ActiveStandbyFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testHotStandby1 activeStandbyFeature.getResourceName(): {}",
activeStandbyFeature.getResourceName());
StateManagementFeatureAPI sm2 = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
sm2 = feature;
logger.debug("testHotStandby2 stateManagementFeature.getResourceName(): {}", sm2.getResourceName());
break;
// that has been created.
ActiveStandbyFeatureAPI activeStandbyFeature = null;
for (ActiveStandbyFeatureAPI feature : ActiveStandbyFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testHotStandby2 activeStandbyFeature.getResourceName(): {}",
activeStandbyFeature.getResourceName());
StateManagementFeatureAPI sm = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
sm = feature;
logger.debug("testLocking1 stateManagementFeature.getResourceName(): {}", sm.getResourceName());
break;
// that has been created.
ActiveStandbyFeatureAPI activeStandbyFeature = null;
for (ActiveStandbyFeatureAPI feature : ActiveStandbyFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testLocking1 activeStandbyFeature.getResourceName(): {}",
activeStandbyFeature.getResourceName());
StateManagementFeatureAPI sm = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
sm = feature;
logger.debug("testLocking2 stateManagementFeature.getResourceName(): {}", sm.getResourceName());
break;
// that has been created.
ActiveStandbyFeatureAPI activeStandbyFeature = null;
for (ActiveStandbyFeatureAPI feature : ActiveStandbyFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testLocking2 activeStandbyFeature.getResourceName(): {}",
activeStandbyFeature.getResourceName());
import org.kie.api.runtime.KieSessionConfiguration;
import org.onap.policy.drools.core.PolicyContainer;
import org.onap.policy.drools.core.PolicySession;
-import org.onap.policy.drools.core.PolicySessionFeatureAPI;
+import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
* <p>The bulk of the code here was once in other classes, such as 'PolicyContainer' and 'Main'. It
* was moved here as part of making this a separate optional feature.
*/
-public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngineFeatureApi {
+public class PersistenceFeature implements PolicySessionFeatureApi, PolicyEngineFeatureApi {
private static final Logger logger = LoggerFactory.getLogger(PersistenceFeature.class);
import org.onap.policy.common.im.AllSeemsWellException;
import org.onap.policy.common.im.StateManagement;
-import org.onap.policy.drools.core.PolicySessionFeatureAPI;
+import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
import org.onap.policy.drools.utils.PropertyUtil;
import org.slf4j.Logger;
*/
public class StateManagementFeature implements StateManagementFeatureAPI,
- PolicySessionFeatureAPI, PolicyEngineFeatureApi {
+ PolicySessionFeatureApi, PolicyEngineFeatureApi {
// get an instance of logger
private static final Logger logger =
LoggerFactory.getLogger(StateManagementFeature.class);
* ============LICENSE_START=======================================================
* policy-persistence
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.common.im.StateManagement;
-import org.onap.policy.drools.core.PolicySessionFeatureAPI;
+import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.statemanagement.DbAudit;
import org.onap.policy.drools.statemanagement.IntegrityMonitorRestManager;
import org.onap.policy.drools.statemanagement.RepositoryAudit;
StateManagementFeatureAPI stateManagementFeature = null;
for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) {
- ((PolicySessionFeatureAPI) feature).globalInit(null, configDir);
+ ((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeature = feature;
logger.debug("testStateManagementOperation stateManagementFeature.getResourceName(): "
+ stateManagementFeature.getResourceName());
+++ /dev/null
-<?xml version="1.0"?>
-<!--
- ============LICENSE_START=======================================================
- Copyright (C) 2018 AT&T Technologies. All rights reserved.
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
--->
-
-<!DOCTYPE suppressions PUBLIC
- "-//Puppy Crawl//DTD Suppressions 1.0//EN"
- "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
-
-<suppressions>
- <suppress checks="AbbreviationAsWordInName"
- files="PolicyResourceLockFeatureAPI.java|PolicySessionFeatureAPI.java"
- lines="1-9999"/>
-</suppressions>
<includeTestResources>true</includeTestResources>
<excludes>
</excludes>
- <suppressionsLocation>${project.baseUri}checkstyle-suppressions.xml</suppressionsLocation>
<consoleOutput>true</consoleOutput>
<failsOnViolation>true</failsOnViolation>
<violationSeverity>warning</violationSeverity>
* ============LICENSE_START=======================================================
* policy-core
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
// loop through all of the features, and give each one
// a chance to create the 'KieSession'
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
if ((kieSession = feature.activatePolicySession(this, name, kieBaseName)) != null) {
break;
sessions.put(name, session);
// notify features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.newPolicySession(session);
} catch (Exception e) {
sessions.put(name, policySession);
// notify features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.newPolicySession(policySession);
} catch (Exception e) {
// KLUDGE WARNING: this is a temporary workaround -- if there are
// no features, we don't have persistence, and 'activate' is never
// called. In this case, make sure the container is started.
- if (PolicySessionFeatureAPI.impl.getList().isEmpty()) {
+ if (PolicySessionFeatureApi.impl.getList().isEmpty()) {
start();
}
session.getKieSession().dispose();
// notify features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.disposeKieSession(session);
} catch (Exception e) {
session.getKieSession().destroy();
// notify features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.destroyKieSession(session);
} catch (Exception e) {
logger.info("PolicyContainer.main: configDir={}", configDir);
// invoke 'globalInit' on all of the features
- for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature : PolicySessionFeatureApi.impl.getList()) {
try {
feature.globalInit(args, configDir);
} catch (Exception e) {
* ============LICENSE_START=======================================================
* policy-core
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
// loop through all of the features, and give each one
// a chance to create the 'ThreadModel'
- for (PolicySessionFeatureAPI feature :
- PolicySessionFeatureAPI.impl.getList()) {
+ for (PolicySessionFeatureApi feature :
+ PolicySessionFeatureApi.impl.getList()) {
try {
if ((threadModel = feature.selectThreadModel(this)) != null) {
break;
* return a 'void' value. In other cases, such as 'activatePolicySession',
* may
*/
-public interface PolicySessionFeatureAPI extends OrderedService {
+public interface PolicySessionFeatureApi extends OrderedService {
/**
* 'FeatureAPI.impl.getList()' returns an ordered list of objects
* implementing the 'FeatureAPI' interface.
*/
- public static OrderedServiceImpl<PolicySessionFeatureAPI> impl =
- new OrderedServiceImpl<>(PolicySessionFeatureAPI.class);
+ public static OrderedServiceImpl<PolicySessionFeatureApi> impl =
+ new OrderedServiceImpl<>(PolicySessionFeatureApi.class);
/**
* This method is called during initialization at a point right after
* ============LICENSE_START=======================================================
* policy-core
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 'PolicySessionFeatureAPI', and providing a means to indicate
* which hooks have been invoked.
*/
-public class PolicySessionFeatureApiMock implements PolicySessionFeatureAPI {
+public class PolicySessionFeatureApiMock implements PolicySessionFeatureApi {
// contains the log entries since the most recent 'getLog()' call
private static ArrayList<String> log = new ArrayList<>();
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@Test
public void test() {
- PolicySessionFeatureAPI api = new PolicySessionFeatureAPI() {
+ PolicySessionFeatureApi api = new PolicySessionFeatureApi() {
@Override
public int getSequenceNumber() {
return 0;