Class JCoConnectionsSnapshotClusterHandler

java.lang.Object
de.hybris.platform.servicelayer.event.impl.AbstractEventListener<JCoConnectionsSnapshotClusterResultEvent>
de.hybris.platform.sap.core.jco.monitor.event.JCoConnectionsSnapshotClusterHandler
All Implemented Interfaces:
JCoConnectionMonitor, EventListener, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<JCoConnectionsSnapshotClusterResultEvent>

public class JCoConnectionsSnapshotClusterHandler extends de.hybris.platform.servicelayer.event.impl.AbstractEventListener<JCoConnectionsSnapshotClusterResultEvent> implements JCoConnectionMonitor
Initiates the snapshot of all cluster and collects the result if requested.
  • Constructor Details

    • JCoConnectionsSnapshotClusterHandler

      public JCoConnectionsSnapshotClusterHandler()
  • Method Details

    • setEventService

      public void setEventService(de.hybris.platform.servicelayer.event.EventService eventService)
      Injection setter for EventService.
      Parameters:
      eventService - the eventService to set
    • setJCoConnectionMonitorClusterProvider

      public void setJCoConnectionMonitorClusterProvider(JCoConnectionMonitorClusterProvider jcoConnectionMonitorClusterProvider)
      Parameters:
      jcoConnectionMonitorClusterProvider - the jcoConnectionMonitorClusterProvider to set
    • setCollectionTimeoutInSeconds

      public void setCollectionTimeoutInSeconds(long collectionTimeoutInSeconds)
      Injection setter for collection timeout.
      Parameters:
      collectionTimeoutInSeconds - collection timeout in seconds
    • setCacheLifetimeInSeconds

      public void setCacheLifetimeInSeconds(long cacheLifetimeInSeconds)
      Injection setter for cache lifetime.
      Parameters:
      cacheLifetimeInSeconds - cache lifetime in seconds
    • createSnapshotFile

      public String createSnapshotFile()
      Description copied from interface: JCoConnectionMonitor
      Create JCo connections snapshot file operation.
      Specified by:
      createSnapshotFile in interface JCoConnectionMonitor
      Returns:
      result message
    • createSnapshotXML

      public String createSnapshotXML()
      Description copied from interface: JCoConnectionMonitor
      Returns all current JCo connections as XML String.
      Specified by:
      createSnapshotXML in interface JCoConnectionMonitor
      Returns:
      XML String
    • getTotalCount

      public Integer getTotalCount()
      Description copied from interface: JCoConnectionMonitor
      Returns the total number of JCo connections.
      Specified by:
      getTotalCount in interface JCoConnectionMonitor
      Returns:
      number of JCo connections
    • getLongRunnerCount

      public Integer getLongRunnerCount()
      Description copied from interface: JCoConnectionMonitor
      Returns the number of JCo connections whose lifetime exceed a specific threshold parameter. The threshold parameter is defined in the project.properties file. Its default value is the same as the value of the default session timeout (3600 seconds).
      Specified by:
      getLongRunnerCount in interface JCoConnectionMonitor
      Returns:
      number of JCo connections whose lifetime exceed the defined threshold
    • getPoolLimitReachedCount

      public Integer getPoolLimitReachedCount()
      Description copied from interface: JCoConnectionMonitor
      Returns number of RFC destinations whose pool size is reached.
      Specified by:
      getPoolLimitReachedCount in interface JCoConnectionMonitor
      Returns:
      number of RFC destinations whose pool size is reached
    • getNodesCount

      public Integer getNodesCount()
      Returns the total number of nodes of the result.
      Returns:
      number of nodes
    • getNodesWithoutResultCount

      public Integer getNodesWithoutResultCount()
      Returns the total number of nodes with result of the result.
      Returns:
      number of nodes without result
    • getCacheTimestamp

      public Date getCacheTimestamp()
      Returns the snapshot time stamp.
      Returns:
      snapshot time stamp
    • getCacheExpirationTimestamp

      public Date getCacheExpirationTimestamp()
      Returns the snapshot buffer valid to time stamp.
      Returns:
      snapshot valid to time stamp
    • resetCache

      public void resetCache()
      Resets the snapshot buffer.
    • isSnapshotInProcess

      public boolean isSnapshotInProcess()
      Returns an indicator whether a snapshot is currently in creation.
      Returns:
      snapshot in process indicator
    • checkState

      protected void checkState()
      Check current state of snapshot in buffer and refreshes it if lifetime is outdated.
    • createClusterSnapshot

      protected String createClusterSnapshot(boolean withFile, boolean updateCache)
      Initiates the creation of one jco connections snapshot file for all cluster.
      Parameters:
      withFile - create snapshot file
      updateCache - update cache indicator
      Returns:
      status message
    • finalizeSnapshot

      protected void finalizeSnapshot(String snapshotUuid) throws JCoMonitorException
      Finalize snapshot.
      Parameters:
      snapshotUuid - snapshot uuid
      Throws:
      JCoMonitorException - JCoMonitorException
    • onEvent

      protected void onEvent(JCoConnectionsSnapshotClusterResultEvent event)
      Specified by:
      onEvent in class de.hybris.platform.servicelayer.event.impl.AbstractEventListener<JCoConnectionsSnapshotClusterResultEvent>