public abstract class GateKeeper extends Object implements PolicySetDeploymentListener, ApiContractsListener, ApiDeploymentListener
| Modifier and Type | Field and Description |
|---|---|
protected ApiService |
apiService |
| Constructor and Description |
|---|
GateKeeper(ApiService apiService) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
blockApi(Api api) |
protected boolean |
everyPolicySuccessfullyApplied(List<PolicyDefinition> policyDefinitions,
List<PolicyDeploymentStatus> deploymentStatuses) |
protected Optional<Api> |
getBlockedMonitoredApi(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey) |
protected Optional<Api> |
getMonitoredApi(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey) |
protected abstract boolean |
isMonitored(Api api) |
void |
onApiDeploymentStart(Api api)
Block API before listener is started
|
void |
onContractsLoaded(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey)
Updates the gatekeeper status to indicate that contracts where correctly loaded.
|
void |
onContractsRequired(Api api) |
void |
onNoContractsRequired(Api api) |
void |
onPolicySetDeploymentCompleted(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey,
PolicySet policySet,
List<PolicyDeploymentStatus> deploymentStatuses)
Check whether the API can be unblocked after a fresh
PolicySet has been applied to it |
protected abstract void |
unblockApi(Api api) |
protected abstract boolean |
validOrigin(PolicySet set) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonPoliciesRemovedonApiDeploymentSuccess, onApiRedeploymentStart, onApiUndeploymentStartprotected final ApiService apiService
public GateKeeper(ApiService apiService)
public void onPolicySetDeploymentCompleted(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey, PolicySet policySet, List<PolicyDeploymentStatus> deploymentStatuses)
PolicySet has been applied to itonPolicySetDeploymentCompleted in interface PolicySetDeploymentListenerapiKey - key of the APIpolicySet - set of policies that were deployeddeploymentStatuses - statuses of policies that were deployedpublic void onContractsLoaded(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey)
onContractsLoaded in interface ApiContractsListenerpublic void onContractsRequired(Api api)
onContractsRequired in interface ApiContractsListenerpublic void onNoContractsRequired(Api api)
onNoContractsRequired in interface ApiContractsListenerprotected Optional<Api> getMonitoredApi(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey)
apiKey - the key of the API to retrieve.protected Optional<Api> getBlockedMonitoredApi(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey)
apiKey - the key of the API to retrieve.protected boolean everyPolicySuccessfullyApplied(List<PolicyDefinition> policyDefinitions, List<PolicyDeploymentStatus> deploymentStatuses)
protected abstract boolean validOrigin(PolicySet set)
set - PolicySet who's origin needs to be checked.protected abstract boolean isMonitored(Api api)
protected abstract void blockApi(Api api)
protected abstract void unblockApi(Api api)
public void onApiDeploymentStart(Api api)
onApiDeploymentStart in interface ApiDeploymentListenerapi - API implementation that it's deployment startedCopyright © 2014–2022 MuleSoft, Inc.. All rights reserved.