Class AbstractWebPlatform

java.lang.Object
io.guise.framework.platform.AbstractPlatform
io.guise.framework.platform.web.AbstractWebPlatform
All Implemented Interfaces:
Platform, WebPlatform
Direct Known Subclasses:
HTTPServletWebPlatform

public abstract class AbstractWebPlatform extends AbstractPlatform implements WebPlatform
An abstract implementation of a web platform for Guise. This class registers no depictors.
Author:
Garret Wilson
  • Field Details

    • DEPICT_ID_STRING_PREFIX

      protected static final String DEPICT_ID_STRING_PREFIX
      The prefix used for creating depict ID strings on this platform.
      See Also:
    • DEFAULT_POLL_INTERVAL

      public static final int DEFAULT_POLL_INTERVAL
      The default polling interval in milliseconds.
      See Also:
  • Constructor Details

    • AbstractWebPlatform

      public AbstractWebPlatform(GuiseApplication application)
      Application. This version copies the current application environment to a new environment for this platform.
      Parameters:
      application - The Guise application running on this platform.
      Throws:
      NullPointerException - if the given application is null.
  • Method Details

    • getEnvironment

      public Environment getEnvironment()
      Specified by:
      getEnvironment in interface Platform
      Returns:
      The user local environment.
    • getSendMessageQueue

      public Queue<WebPlatformMessage> getSendMessageQueue()
      Specified by:
      getSendMessageQueue in interface Platform
      Specified by:
      getSendMessageQueue in interface WebPlatform
      Overrides:
      getSendMessageQueue in class AbstractPlatform
      Returns:
      The thread-safe queue of messages to be delivered to the platform.
    • getPollInterval

      public int getPollInterval()
      Specified by:
      getPollInterval in interface WebPlatform
      Returns:
      The current polling interval in milliseconds.
    • setPollInterval

      public void setPollInterval(int newPollInterval)
      Description copied from interface: WebPlatform
      Sets the polling interval in milliseconds.
      Specified by:
      setPollInterval in interface WebPlatform
      Parameters:
      newPollInterval - The polling interval in milliseconds.
    • requestPollInterval

      public boolean requestPollInterval(DepictedObject depictedObject, int pollInterval)
      Description copied from interface: WebPlatform
      Requests a polling interval for a given depicted object. The actual polling interval will be updated if the given polling interval is smaller than the current actual polling interval.
      Specified by:
      requestPollInterval in interface WebPlatform
      Parameters:
      depictedObject - The depicted object requesting a polling interval.
      pollInterval - The polling interval in milliseconds.
      Returns:
      true if the polling interval changed as a result of this request.
      See Also:
    • discontinuePollInterval

      public boolean discontinuePollInterval(DepictedObject depictedObject)
      Description copied from interface: WebPlatform
      Indicates that a depicted object no longer requests a particular polling interval. The actual polling interval will be updated if the relinquished poll interval is less than or equal to the current poll interval.
      Specified by:
      discontinuePollInterval in interface WebPlatform
      Parameters:
      depictedObject - The depicted object that is relinquishing a polling interval.
      Returns:
      true if the polling interval changed as a result of this relinquishment.
      See Also:
    • getDepictIDString

      public String getDepictIDString(long depictID)
      Generates an ID for the given depicted object appropriate for using on the platform.
      Specified by:
      getDepictIDString in interface WebPlatform
      Parameters:
      depictID - The depict ID to be converted to a platform ID.
      Returns:
      The form of the depict ID appropriate for using on the platform.
    • getDepictID

      public long getDepictID(String depictIDString)
      Description copied from interface: WebPlatform
      Returns the depicted object ID represented by the given platform-specific ID string.
      Specified by:
      getDepictID in interface WebPlatform
      Parameters:
      depictIDString - The platform-specific form of the depict ID.
      Returns:
      The depict ID the platform-specific form represents.