Interface Subscription


public interface Subscription
Represents a subscription for the synch engine.

A subscription has 2 connections, one for each end of the subscription. We will refer to these as endA and endB.

Each connection has a kind which is a name used to retrieve a connector from the synch engine. The retrieved connector implements the Connector interface. This connector object can then be used to retrieve a ConnectionInst implementation which uses information stored in a serializable object to obtain connection specific properties such as id and password.

These properties are obtained by presenting the user with a list of required properties and then encrypting and storing the response. The serialized result is stored as a field in the subscription.

Connections are either polling or notify. Polling means that the host will be polled to see if anything has changed. Notify means that the subscription will be activated when the system is notified of a change.

Connections are also resynch only - that is the far end does not support fetching of individual items but must be completely resynched each time, or the support the full synch feature set.

Resynch connections support relatively simple protocols or file synch.

The full feature connections are used for bedework, Exchange etc.

Skip Lists

A skip list allows the diffing process to skip properties that are not to be considered, for example lastmod. We create a skip list from 3 lists;
  • one for each end of the subscription. This marks properties used exclusively by that end, for example x-properties.
  • One for the middle which might skip properties we want to ignore such as alarms

An empty list means exactly that, no skip properties. A null list means the default diff skip list - probably more useful.

Author:
Mike Douglass
  • Method Details

    • setSubscriptionId

      void setSubscriptionId(String val)
      Our generated subscriptionId.
      Parameters:
      val - String
    • getSubscriptionId

      String getSubscriptionId()
      Our generated subscriptionId.
      Returns:
      String
    • setLastRefresh

      void setLastRefresh(String val)
      Parameters:
      val - A UTC dtstamp value
    • getLastRefresh

      String getLastRefresh()
      Returns:
      String lastRefresh
    • setErrorCt

      void setErrorCt(int val)
      Parameters:
      val - int consecutive errors
    • getErrorCt

      int getErrorCt()
      Returns:
      int consecutive errors
    • setMissingTarget

      void setMissingTarget(boolean val)
      Parameters:
      val - True if either target is missing
    • getMissingTarget

      boolean getMissingTarget()
      Returns:
      True if either target is missing
    • setOwner

      void setOwner(String val)
      The owner. This is the (verified) account that set up the subscription. It is either the authenticated user or provided by a proxy that has verified the account. The owner is only needed for subcribing, unsubscribing and display of and updates to the subscription itself.

      Interactions with the end points use information contained within the subscription.

      Parameters:
      val - String
    • getOwner

      String getOwner()
      Owner
      Returns:
      String
    • setEndAConnectorInfo

      void setEndAConnectorInfo(SubscriptionConnectorInfo<?> val)
      Info for the endA connector.
      Parameters:
      val - SubscriptionConnectorInfo
    • getEndAConnectorInfo

      SubscriptionConnectorInfo<?> getEndAConnectorInfo()
      Returns:
      SubscriptionConnectorInfo
    • setEndBConnectorInfo

      void setEndBConnectorInfo(SubscriptionConnectorInfo<?> val)
      Info for the endB connector.
      Parameters:
      val - SubscriptionConnectorInfo
    • getEndBConnectorInfo

      SubscriptionConnectorInfo<?> getEndBConnectorInfo()
      Returns:
      SubscriptionConnectorInfo
    • setInfo

      void setInfo(SubscriptionInfo<?> val)
      Info for the subscription.
      Parameters:
      val - SubscriptionInfo
    • getInfo

      SubscriptionInfo<?> getInfo()
      Returns:
      SubscriptionInfo
    • setDirection

      void setDirection(String val)
      Parameters:
      val - Which way?
    • getDirection

      String getDirection()
      Which way?
      Returns:
      direction
    • setMaster

      void setMaster(String val)
      Parameters:
      val - Which end is master?
    • getMaster

      String getMaster()
      Returns:
      who's master
    • setOutstandingSubscription

      void setOutstandingSubscription(Subscription val)
      An outstanding request that requires an unsubscribe to complete first
      Parameters:
      val - Subscription
    • getOutstandingSubscription

      Subscription getOutstandingSubscription()
      An outstanding request that requires an unsubscribe to complete first
      Returns:
      Subscription
    • setDeleted

      void setDeleted(boolean val)
      Parameters:
      val - True if subscription deleted
    • getDeleted

      boolean getDeleted()
      Returns:
      True if deleted
    • setEndAConn

      void setEndAConn(Connector<?,?,?> val)
      Parameters:
      val - a connection
    • getEndAConn

      Connector<?,?,?> getEndAConn()
      Returns:
      a connection or null
    • setEndBConn

      void setEndBConn(Connector<?,?,?> val)
      Parameters:
      val - a connection
    • getEndBConn

      Connector<?,?,?> getEndBConn()
      Returns:
      a connection or null
    • setEndAConnInst

      void setEndAConnInst(ConnectorInstance<?> val)
      Parameters:
      val - a connection instance
    • getEndAConnInst

      ConnectorInstance<?> getEndAConnInst()
      Returns:
      a connection instance or null
    • setEndBConnInst

      void setEndBConnInst(ConnectorInstance<?> val)
      Parameters:
      val - a connection instance
    • getEndBConnInst

      ConnectorInstance<?> getEndBConnInst()
      Returns:
      a connection instance or null
    • changed

      boolean changed()
      Returns:
      true if any connector info changed
    • resetChanged

      void resetChanged()
      reset the changed flag.
    • polling

      boolean polling()
      Returns:
      true if this has to be put on a poll queue
    • refreshDelay

      long refreshDelay() throws SynchException
      Returns:
      the delay in millisecs.
      Throws:
      SynchException - on properties error
    • updateLastRefresh

      void updateLastRefresh()
      Set the lastRefresh from the current time
    • nextRefresh

      Date nextRefresh() throws SynchException
      Get a next refresh date based on the last refresh value
      Returns:
      date value incremented by delay.
      Throws:
      SynchException - on properties error
    • setDirectionEnum

      void setDirectionEnum(org.bedework.synch.wsmessages.SynchDirectionType val)
      Which way?
      Parameters:
      val -
    • getDirectionEnum

      org.bedework.synch.wsmessages.SynchDirectionType getDirectionEnum()
      Which way?
      Returns:
      direction
    • setMasterEnum

      void setMasterEnum(org.bedework.synch.wsmessages.SynchMasterType val)
      Which end is master?
      Parameters:
      val -
    • getMasterEnum

      org.bedework.synch.wsmessages.SynchMasterType getMasterEnum()
      Returns:
      who's master