From eb0016df9ea97ad226445fffeb53b578ba8c714b Mon Sep 17 00:00:00 2001 From: Sajinie Date: Fri, 13 Dec 2024 10:44:58 +0530 Subject: [PATCH] Remove preserveState parameter support --- .../synapse/inbound/InboundEndpoint.java | 32 +------------------ 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/modules/core/src/main/java/org/apache/synapse/inbound/InboundEndpoint.java b/modules/core/src/main/java/org/apache/synapse/inbound/InboundEndpoint.java index ca5c05acad..9d53d866c0 100644 --- a/modules/core/src/main/java/org/apache/synapse/inbound/InboundEndpoint.java +++ b/modules/core/src/main/java/org/apache/synapse/inbound/InboundEndpoint.java @@ -69,11 +69,6 @@ public class InboundEndpoint implements AspectConfigurable, ManagedLifecycle { private SynapseEnvironment synapseEnvironment; private InboundRequestProcessor inboundRequestProcessor; private Registry registry; - /** - * This property determines whether the inbound endpoint should preserve its state - * across server restarts or configuration updates. - * */ - private boolean preserveState = false; /** car file name which this endpoint deployed from */ private String artifactContainerName; /** Whether the deployed inbound endpoint is edited via the management console */ @@ -88,7 +83,6 @@ public void init(SynapseEnvironment se) { log.info("Initializing Inbound Endpoint: " + getName()); synapseEnvironment = se; registry = se.getSynapseConfiguration().getRegistry(); - setPreserveState(); startInPausedMode = startInPausedMode(); inboundRequestProcessor = getInboundRequestProcessor(); if (inboundRequestProcessor != null) { @@ -175,24 +169,6 @@ private void resolveSystemSecureVaultProperties(Properties props) { } } - /** - * Configures the `preserveState` property for the inbound endpoint. - *

- * This method checks if the parameter {@code INBOUND_ENDPOINT_PRESERVE_STATE} is defined. - * If the parameter exists, its value is parsed as a boolean and assigned to the `preserveState` variable. - *

- * - * @see InboundEndpointConstants#INBOUND_ENDPOINT_PRESERVE_STATE - */ - private void setPreserveState() { - if (getParameter(InboundEndpointConstants.INBOUND_ENDPOINT_PRESERVE_STATE) != null) { - preserveState = Boolean.parseBoolean(getParameter(InboundEndpointConstants.INBOUND_ENDPOINT_PRESERVE_STATE)); - } - if (!preserveState) { - deleteInboundEndpointStateInRegistry(); - } - } - /** * Remove inbound endpoints. *

@@ -209,9 +185,6 @@ public void destroy(boolean removeTask) { } else { inboundRequestProcessor.destroy(); } - if (!preserveState) { - deleteInboundEndpointStateInRegistry(); - } } catch (Exception e) { log.error("Unable to destroy Inbound endpoint", e); } @@ -478,7 +451,7 @@ public void addHandler(MessagingHandler handler) { * @param state the {@link InboundEndpointState} to be saved in the registry */ private void setInboundEndpointStateInRegistry(InboundEndpointState state) { - if (Objects.isNull(registry) && preserveState) { + if (Objects.isNull(registry)) { log.warn("Registry not available! The state of the Inbound Endpoint will not be saved."); return; } @@ -517,9 +490,6 @@ private void deleteInboundEndpointStateInRegistry() { */ private boolean startInPausedMode() { - if (!preserveState) { - return isSuspend(); - } if (getInboundEndpointStateFromRegistry() == InboundEndpointState.INITIAL) { return isSuspend(); }