PollManager
Date: 2014-11-12

org.gcube.informationsystem.cache.consistency.manager.poll

## Class PollManager

- java.lang.Object
- - org.gcube.informationsystem.cache.consistency.manager.poll.PollManager

- All Implemented Interfaces:
    ConsistencyManagerIF, PollManagerMBean

      public class PollManager
      extends java.lang.Object
      implements PollManagerMBean

  Implements the `PollManagerMBean` interface. Basically it exposes the CacheRefresher instance
  Author:
    UoA

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) CacheRefresher` | `cr` instance of the `CacheRefresher` class
    `(package private) long` | `ttr` time to refresh; default value set to 10 minutes

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PollManager()` Constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Set<org.apache.axis.message.addressing.EndpointReference>` | `getEPRs(Srv service)` Get EPRs for the given service
    `java.util.Set<org.apache.axis.message.addressing.EndpointReference>` | `getEPRs(Srv service, java.lang.String serviceType)` Get EPRs for the given type of the given service
    `java.util.Date` | `getLastRefreshTimestamp()` Get the last cache refresh timestamp
    `long` | `getRefreshTimeInMillis()` Get refresh interval in milliseconds
    `void` | `initialize(SrvRegistry registry)` Initialize PollManager
    `boolean` | `isRefreshing()` True if currently the cache is being refreshed
    `void` | `refresh()` Perform an on-demand cache refresh
    `long` | `refreshCycleTime()` Get refresh cycle time
    `protected static void` | `refreshService(Srv service)`
    `void` | `setRefreshTimeInMillis(long refreshTimeInMillis)` Set refresh interval in milliseconds

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cr

          CacheRefresher cr

      instance of the `CacheRefresher` class

    - #### ttr

          long ttr

      time to refresh; default value set to 10 minutes

  - ### Constructor Detail

    - #### PollManager

          public PollManager()

      Constructor

  - ### Method Detail

    - #### getLastRefreshTimestamp

          public java.util.Date getLastRefreshTimestamp()

      Description copied from interface: `PollManagerMBean`
      Get the last cache refresh timestamp
      Specified by:
        `getLastRefreshTimestamp` in interface `PollManagerMBean`
      Returns:
        the last cache refresh timestamp
      See Also:
        `PollManagerMBean.getLastRefreshTimestamp()`

    - #### getRefreshTimeInMillis

          public long getRefreshTimeInMillis()

      Get refresh interval in milliseconds
      Specified by:
        `getRefreshTimeInMillis` in interface `PollManagerMBean`
      Returns:
        Refresh interval in milliseconds
      See Also:
        `PollManagerMBean.getRefreshTimeInMillis()`

    - #### refresh

          public void refresh()

      Description copied from interface: `PollManagerMBean`
      Perform an on-demand cache refresh
      Specified by:
        `refresh` in interface `PollManagerMBean`
      See Also:
        `PollManagerMBean.refresh()`

    - #### refreshCycleTime

          public long refreshCycleTime()

      Get refresh cycle time
      Specified by:
        `refreshCycleTime` in interface `PollManagerMBean`
      Returns:
        Refresh cycle time
      See Also:
        `PollManagerMBean.refreshCycleTime()`

    - #### setRefreshTimeInMillis

          public void setRefreshTimeInMillis(long refreshTimeInMillis)

      Set refresh interval in milliseconds
      Specified by:
        `setRefreshTimeInMillis` in interface `PollManagerMBean`
      Parameters:
        `refreshTimeInMillis` - Refresh interval in milliseconds
      See Also:
        `PollManagerMBean.setRefreshTimeInMillis(long)`

    - #### isRefreshing

          public boolean isRefreshing()

      True if currently the cache is being refreshed
      Specified by:
        `isRefreshing` in interface `PollManagerMBean`
      Returns:
        true if currently the cache is being refreshed
      See Also:
        `PollManagerMBean.isRefreshing()`

    - #### initialize

          public void initialize(SrvRegistry registry)
                          throws java.lang.Exception

      Initialize PollManager
      Specified by:
        `initialize` in interface `ConsistencyManagerIF`
      Parameters:
        `registry` - `SrvRegistry` instance
      Throws:
        `java.lang.Exception` - in case of error
      See Also:
        `ConsistencyManagerIF#initialize()`

    - #### getEPRs

          public java.util.Set<org.apache.axis.message.addressing.EndpointReference> getEPRs(Srv service)
                                                                                      throws java.lang.Exception

      Get EPRs for the given service
      Specified by:
        `getEPRs` in interface `ConsistencyManagerIF`
      Parameters:
        `service` - service
      Returns:
        EPRs for the given type of the given service
      Throws:
        `java.lang.Exception` - in case of error

    - #### getEPRs

          public java.util.Set<org.apache.axis.message.addressing.EndpointReference> getEPRs(Srv service,
                                                                                    java.lang.String serviceType)
                                                                                      throws java.lang.Exception

      Get EPRs for the given type of the given service
      Specified by:
        `getEPRs` in interface `ConsistencyManagerIF`
      Parameters:
        `service` - service
        `serviceType` - service type
      Returns:
        EPRs for the given type of the given service
      Throws:
        `java.lang.Exception` - in case of error

    - #### refreshService

          protected static void refreshService(Srv service)
                                        throws java.lang.Exception

      Throws:
        `java.lang.Exception`