Changes for Checkstyle 8.32
[policy/models.git] / models-provider / src / main / java / org / onap / policy / models / provider / impl / DatabasePolicyModelsProviderImpl.java
index 3cae650..7d28b61 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2020 Nordix Foundation.
- *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2019-2020 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.
@@ -24,13 +24,9 @@ package org.onap.policy.models.provider.impl;
 import java.util.Base64;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 import java.util.Properties;
-
 import javax.ws.rs.core.Response;
-
 import lombok.NonNull;
-
 import org.eclipse.persistence.config.PersistenceUnitProperties;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
@@ -55,8 +51,6 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeFilter;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 import org.onap.policy.models.tosca.authorative.provider.AuthorativeToscaProvider;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyInput;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyOutput;
 import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
 import org.onap.policy.models.tosca.legacy.provider.LegacyProvider;
 import org.slf4j.Logger;
@@ -128,7 +122,7 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
     }
 
     private String getValue(final String value) {
-        if (value != null && value.matches("[$][{].*[}]$")) {
+        if (value != null && value.startsWith("${") && value.endsWith("}")) {
             return System.getenv(value.substring(2, value.length() - 1));
         }
         return value;
@@ -279,38 +273,6 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
         return new LegacyProvider().deleteOperationalPolicy(pfDao, policyId, policyVersion);
     }
 
-    @Override
-    public Map<String, LegacyGuardPolicyOutput> getGuardPolicy(@NonNull final String policyId,
-            final String policyVersion) throws PfModelException {
-        assertInitialized();
-        return new LegacyProvider().getGuardPolicy(pfDao, policyId, policyVersion);
-    }
-
-    @Override
-    public Map<String, LegacyGuardPolicyOutput>
-            createGuardPolicy(@NonNull final LegacyGuardPolicyInput legacyGuardPolicy) throws PfModelException {
-        assertInitialized();
-        return new LegacyProvider().createGuardPolicy(pfDao, legacyGuardPolicy);
-    }
-
-    @Override
-    public Map<String, LegacyGuardPolicyOutput>
-            updateGuardPolicy(@NonNull final LegacyGuardPolicyInput legacyGuardPolicy) throws PfModelException {
-        assertInitialized();
-        return new LegacyProvider().updateGuardPolicy(pfDao, legacyGuardPolicy);
-    }
-
-    @Override
-    public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(@NonNull final String policyId,
-            @NonNull final String policyVersion) throws PfModelException {
-        assertInitialized();
-
-        assertPolicyNotDeployedInPdpGroup(
-                new ToscaPolicyIdentifier(policyId, policyVersion + LegacyProvider.LEGACY_MINOR_PATCH_SUFFIX));
-
-        return new LegacyProvider().deleteGuardPolicy(pfDao, policyId, policyVersion);
-    }
-
     @Override
     public List<PdpGroup> getPdpGroups(final String name) throws PfModelException {
         assertInitialized();