public class DefaultPolicyStore extends Object implements PolicyStore
| Modifier and Type | Field and Description |
|---|---|
static String |
POLICY_CONFIG_XML_FILE_NAME |
static String |
POLICY_DEFINITION_JSON_FILE_NAME |
| Constructor and Description |
|---|
DefaultPolicyStore(EncryptedPropertiesSerializer encryptedPropertiesSerializer) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanDeploymentFailure(PolicyDefinition policyDefinition,
com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey)
Deletes the stored deployment failure log of a policy to a specific API
|
void |
cleanDeploymentFailures(String policyName)
Deletes every stored deployment failure log of a policy
|
boolean |
contains(String policyName)
Checks whether the specified policy is present in the store
|
File |
getEncryptedPropertiesFile(String policyName)
Returns the properties file of the specified policy
|
File |
getPolicyConfigFile(String policyName)
Returns the physical config file of the specified policy
|
List<PolicyDefinition> |
load()
Returns every stored Policy definition
|
List<PolicyDefinition> |
offlinePolicies()
Reads and returns every offline policy that is present in the store
|
List<PolicyDefinition> |
onlinePolicies()
Reads and returns every online policy that is present in the store
|
boolean |
remove(String policyName)
Removes the specified policy, valid or failed, from the store.
|
void |
store(Policy policy)
Stores the complete policy.
|
void |
store(PolicyDefinition policyDefinition)
Stores just the policy definition.
|
void |
storeDeploymentFailure(PolicyDefinition policyDefinition,
com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey,
Exception exception)
Stores the deployment failure exception in the failed policies folder
|
public static final String POLICY_DEFINITION_JSON_FILE_NAME
public static final String POLICY_CONFIG_XML_FILE_NAME
public DefaultPolicyStore(EncryptedPropertiesSerializer encryptedPropertiesSerializer)
public List<PolicyDefinition> load()
PolicyStoreload in interface PolicyStorepublic List<PolicyDefinition> onlinePolicies()
PolicyStoreonlinePolicies in interface PolicyStorepublic List<PolicyDefinition> offlinePolicies()
PolicyStoreofflinePolicies in interface PolicyStorepublic boolean contains(String policyName)
PolicyStorecontains in interface PolicyStorepolicyName - name of the policy to checkpublic File getPolicyConfigFile(String policyName)
PolicyStoregetPolicyConfigFile in interface PolicyStorepolicyName - name of the policypublic File getEncryptedPropertiesFile(String policyName)
PolicyStoregetEncryptedPropertiesFile in interface PolicyStorepolicyName - name of the policypublic boolean remove(String policyName)
PolicyStoreremove in interface PolicyStorepolicyName - name of the policy to removepublic void store(PolicyDefinition policyDefinition)
PolicyStorestore in interface PolicyStorepolicyDefinition - policy definition to storepublic void store(Policy policy)
PolicyStorestore in interface PolicyStorepolicy - policy to storepublic void storeDeploymentFailure(PolicyDefinition policyDefinition, com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey, Exception exception)
PolicyStorestoreDeploymentFailure in interface PolicyStorepolicyDefinition - the policy that failedapiKey - the API where the policy deployment was being deployedexception - the failurepublic void cleanDeploymentFailure(PolicyDefinition policyDefinition, com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey)
PolicyStorecleanDeploymentFailure in interface PolicyStorepolicyDefinition - the policy that failedapiKey - the API where the policy deployment was being deployedpublic void cleanDeploymentFailures(String policyName)
PolicyStorecleanDeploymentFailures in interface PolicyStorepolicyName - name of the policyCopyright © 2014–2022 MuleSoft, Inc.. All rights reserved.