Class ClusterAwareConfiguration.ClusterAwareCondition

java.lang.Object
org.springframework.geode.config.annotation.ClusterAwareConfiguration.ClusterAwareCondition
All Implemented Interfaces:
org.springframework.context.annotation.Condition
Direct Known Subclasses:
ClusterAvailableConfiguration.AbstractCloudPlatformAvailableCondition, ClusterAvailableConfiguration.StandaloneClusterAvailableCondition, ClusterNotAvailableConfiguration.ClusterNotAvailableCondition
Enclosing class:
ClusterAwareConfiguration

public static class ClusterAwareConfiguration.ClusterAwareCondition extends Object implements org.springframework.context.annotation.Condition
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    close(Socket socket)
     
    protected void
    configureTopology(org.springframework.core.env.Environment environment, org.springframework.data.gemfire.support.ConnectionEndpointList connectionEndpoints, int connectionCount)
     
    protected Socket
    connect(org.springframework.data.gemfire.support.ConnectionEndpoint connectionEndpoint)
     
    protected int
    countConnections(org.springframework.data.gemfire.support.ConnectionEndpointList connectionEndpoints)
     
    protected boolean
    doCachedMatch(org.springframework.context.annotation.ConditionContext conditionContext)
    Caches the result of the computed doMatch(ConditionContext) operation.
    protected boolean
    doMatch(org.springframework.context.annotation.ConditionContext conditionContext)
    Performs the actual conditional match to determine whether this Spring Boot for Apache Geode application can connect to an available Apache Geode cluster available in any environment (e.g.
    protected void
    failOnStrictMatchAndNoMatches(boolean strictMatch, boolean matches)
     
    protected List<org.springframework.data.gemfire.support.ConnectionEndpoint>
    getConfiguredConnectionEndpoints(org.springframework.core.env.Environment environment)
     
    protected org.springframework.data.gemfire.support.ConnectionEndpointList
    getConnectionEndpoints(org.springframework.core.env.Environment environment)
     
    protected List<org.springframework.data.gemfire.support.ConnectionEndpoint>
    getDefaultConnectionEndpoints(org.springframework.core.env.Environment environment)
     
    protected org.slf4j.Logger
     
    protected List<org.springframework.data.gemfire.support.ConnectionEndpoint>
    getPooledConnectionEndpoints(org.springframework.core.env.Environment environment)
     
    protected Collection<org.apache.geode.cache.client.Pool>
     
    protected String
    Returns a String containing a description of the runtime environment.
    static boolean
    Determines whether an Apache Geode-based Cluster is available in the runtime environment.
    protected boolean
    isConnected(int connectionCount)
     
    protected boolean
     
    protected boolean
    isNotConnected(int connectionCount)
     
    protected boolean
    isStrictMatch(org.springframework.context.annotation.ConditionContext conditionContext, org.springframework.core.type.AnnotatedTypeMetadata typeMetadata)
     
    protected boolean
    isStrictMatchAndNoMatches(boolean strictMatch, boolean matches)
     
    protected void
    logConnectedRuntimeEnvironment(org.slf4j.Logger logger)
     
    protected void
    logConnectedRuntimeEnvironment(org.slf4j.Logger logger, int connectionCount)
     
    protected void
    logRuntimeEnvironment(org.slf4j.Logger logger, int connectionCount)
     
    protected void
    logUnconnectedRuntimeEnvironment(org.slf4j.Logger logger)
     
    boolean
    matches(org.springframework.context.annotation.ConditionContext conditionContext, org.springframework.core.type.AnnotatedTypeMetadata typeMetadata)
     
    protected Socket
    newSocket(org.springframework.data.gemfire.support.ConnectionEndpoint connectionEndpoint)
     
    protected Socket
     
    protected org.springframework.context.annotation.ConditionContext
    registerApplicationListener(org.springframework.context.annotation.ConditionContext conditionContext)
     
    static void
    Resets the state of this Condition to reevaluate whether an Apache Geode-based Cluster is available in the runtime environment.
    protected static void
    set(Boolean available)
    Sets the state of the clusterAvailable variable.
    static boolean
    Determines whether the Condition that determines whether an Apache Geode-based Cluster is available in the runtime environment has been evaluated.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ClusterAwareCondition

      public ClusterAwareCondition()
  • Method Details

    • isAvailable

      public static boolean isAvailable()
      Determines whether an Apache Geode-based Cluster is available in the runtime environment.
      Returns:
      a boolean value indicating whether an Apache Geode-based Cluster is available in the runtime environment.
      See Also:
    • reset

      public static void reset()
      Resets the state of this Condition to reevaluate whether an Apache Geode-based Cluster is available in the runtime environment.
      See Also:
    • set

      protected static void set(@Nullable Boolean available)
      Sets the state of the clusterAvailable variable.
      Parameters:
      available - state to set the clusterAvailable variable to.
      See Also:
    • wasClusterAvailabilityEvaluated

      public static boolean wasClusterAvailabilityEvaluated()
      Determines whether the Condition that determines whether an Apache Geode-based Cluster is available in the runtime environment has been evaluated.
      Returns:
      a boolean value indicating whether the Condition that determines whether an Apache Geode-based Cluster is available in the runtime environment has been evaluated.
      See Also:
    • getRuntimeEnvironmentName

      protected String getRuntimeEnvironmentName()
      Returns a String containing a description of the runtime environment.
      Returns:
      a String containing a description of the runtime environment.
    • matches

      public boolean matches(@NonNull org.springframework.context.annotation.ConditionContext conditionContext, @NonNull org.springframework.core.type.AnnotatedTypeMetadata typeMetadata)
      Specified by:
      matches in interface org.springframework.context.annotation.Condition
    • isStrictMatch

      protected boolean isStrictMatch(@NonNull org.springframework.context.annotation.ConditionContext conditionContext, @NonNull org.springframework.core.type.AnnotatedTypeMetadata typeMetadata)
    • isStrictMatchAndNoMatches

      protected boolean isStrictMatchAndNoMatches(boolean strictMatch, boolean matches)
    • failOnStrictMatchAndNoMatches

      protected void failOnStrictMatchAndNoMatches(boolean strictMatch, boolean matches)
    • doCachedMatch

      protected boolean doCachedMatch(@NonNull org.springframework.context.annotation.ConditionContext conditionContext)
      Caches the result of the computed doMatch(ConditionContext) operation. Subsequent calls returns the cached value of the computed (once) doMatch(ConditionContext) operation.
      Parameters:
      conditionContext - Spring ConditionContext capturing the context in which the conditions are evaluated; must not be null.
      Returns:
      a boolean value indicating whether the conditions match (i.e. true).
      See Also:
    • registerApplicationListener

      @NonNull protected org.springframework.context.annotation.ConditionContext registerApplicationListener(@NonNull org.springframework.context.annotation.ConditionContext conditionContext)
    • doMatch

      protected boolean doMatch(@NonNull org.springframework.context.annotation.ConditionContext conditionContext)
      Performs the actual conditional match to determine whether this Spring Boot for Apache Geode application can connect to an available Apache Geode cluster available in any environment (e.g. Standalone or Cloud).
      Parameters:
      conditionContext - Spring ConditionContext capturing the context in which the condition(s) are evaluated; must not be null.
      Returns:
      the given ConditionContext.
      See Also:
    • getLogger

      @NonNull protected org.slf4j.Logger getLogger()
    • getConnectionEndpoints

      protected org.springframework.data.gemfire.support.ConnectionEndpointList getConnectionEndpoints(@NonNull org.springframework.core.env.Environment environment)
    • getDefaultConnectionEndpoints

      protected List<org.springframework.data.gemfire.support.ConnectionEndpoint> getDefaultConnectionEndpoints(@NonNull org.springframework.core.env.Environment environment)
    • getConfiguredConnectionEndpoints

      protected List<org.springframework.data.gemfire.support.ConnectionEndpoint> getConfiguredConnectionEndpoints(@NonNull org.springframework.core.env.Environment environment)
    • getPooledConnectionEndpoints

      protected List<org.springframework.data.gemfire.support.ConnectionEndpoint> getPooledConnectionEndpoints(@NonNull org.springframework.core.env.Environment environment)
    • getPoolsFromApacheGeode

      protected Collection<org.apache.geode.cache.client.Pool> getPoolsFromApacheGeode()
    • countConnections

      protected int countConnections(@NonNull org.springframework.data.gemfire.support.ConnectionEndpointList connectionEndpoints)
    • isConnected

      protected boolean isConnected(@NonNull Socket socket)
    • connect

      @NonNull protected Socket connect(@NonNull org.springframework.data.gemfire.support.ConnectionEndpoint connectionEndpoint) throws IOException
      Throws:
      IOException
    • newSocket

      @NonNull protected Socket newSocket(@NonNull org.springframework.data.gemfire.support.ConnectionEndpoint connectionEndpoint) throws IOException
      Throws:
      IOException
    • newSocket

      @NonNull protected Socket newSocket(@NonNull ClusterAwareConfiguration.PoolConnectionEndpoint poolConnectionEndpoint)
    • close

      protected boolean close(@Nullable Socket socket)
    • isConnected

      protected boolean isConnected(int connectionCount)
    • isNotConnected

      protected boolean isNotConnected(int connectionCount)
    • configureTopology

      protected void configureTopology(@NonNull org.springframework.core.env.Environment environment, @NonNull org.springframework.data.gemfire.support.ConnectionEndpointList connectionEndpoints, int connectionCount)
    • logConnectedRuntimeEnvironment

      protected void logConnectedRuntimeEnvironment(@NonNull org.slf4j.Logger logger)
    • logConnectedRuntimeEnvironment

      protected void logConnectedRuntimeEnvironment(@NonNull org.slf4j.Logger logger, int connectionCount)
    • logRuntimeEnvironment

      protected void logRuntimeEnvironment(@NonNull org.slf4j.Logger logger, int connectionCount)
    • logUnconnectedRuntimeEnvironment

      protected void logUnconnectedRuntimeEnvironment(@NonNull org.slf4j.Logger logger)