Interface ConnectorInstance<InfoT extends BaseSubscriptionInfo>

All Known Implementing Classes:
AbstractConnectorInstance, BaseConnectorInstance

public interface ConnectorInstance<InfoT extends BaseSubscriptionInfo>
The interface implemented by connectors. A connector instance is obtained from a connector to handle a specific end of a specific subscription - items of inforamtion handed to the getConnectorInstance method.
Author:
Mike Douglass
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Information used to synch ends A and B This information is only valid in the context of a given subscription.
    static class 
    Status OK and no items is end of batch.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.oasis_open.docs.ws_calendar.ns.soap.AddItemResponseType
    addItem(ietf.params.xml.ns.icalendar_2.IcalendarType val)
    Add a calendar component
    boolean
    Called before a resynch takes place to determine if the end point has changed and needs resynch.
    org.oasis_open.docs.ws_calendar.ns.soap.DeleteItemResponseType
    Delete a calendar component.
    org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseType
    Fetch a calendar component.
    List<org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseType>
    Fetch a batch of calendar components.
     
    Get information about items in the subscribed calendar.
     
     
     
    org.oasis_open.docs.ws_calendar.ns.soap.BaseResponseType
    Called when a subscription is activated on synch engine startup or after creation of a new subscription.
    void
     
    void
     
    boolean
    subscribe(org.bedework.synch.wsmessages.SubscribeResponseType sr)
    Do whatever is required to set up a subscription to the end point for this connector instance.
    boolean
    unsubscribe(org.bedework.synch.wsmessages.UnsubscribeRequestType usreq, org.bedework.synch.wsmessages.UnsubscribeResponseType usresp)
    Check to see if an unsubscribe can go ahead.
    org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemResponseType
    updateItem(org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemType updates)
    Update a calendar component.
    boolean
    validateActiveSubInfo(org.bedework.synch.wsmessages.ActiveSubscriptionRequestType req, org.oasis_open.docs.ws_calendar.ns.soap.BaseResponseType resp, Connector cnctr, BaseSubscriptionInfo info)
    Ensure active subscription info matches the subscription
  • Method Details

    • subscribe

      boolean subscribe(org.bedework.synch.wsmessages.SubscribeResponseType sr) throws SynchException
      Do whatever is required to set up a subscription to the end point for this connector instance. This is a one time call when a new subscription is created and allows the connector instance to validate the information.

      This method should set the appropriate status if an error occurs.

      the open method handles any dynamic creation of a connection to the subscribed-to service.

      Parameters:
      sr -
      Returns:
      false if the subscription fails - status has been set in response
      Throws:
      SynchException
    • unsubscribe

      boolean unsubscribe(org.bedework.synch.wsmessages.UnsubscribeRequestType usreq, org.bedework.synch.wsmessages.UnsubscribeResponseType usresp) throws SynchException
      Check to see if an unsubscribe can go ahead. This method should ensure that the important properties in the request match those set in the subscription, e.g. paths

      This method should set the appropriate status and return false if an error occurs.

      Parameters:
      usreq -
      usresp -
      Returns:
      false if the unsubscribe fails - status has been set in response
      Throws:
      SynchException
    • validateActiveSubInfo

      boolean validateActiveSubInfo(org.bedework.synch.wsmessages.ActiveSubscriptionRequestType req, org.oasis_open.docs.ws_calendar.ns.soap.BaseResponseType resp, Connector cnctr, BaseSubscriptionInfo info) throws SynchException
      Ensure active subscription info matches the subscription
      Parameters:
      req -
      resp -
      cnctr -
      info -
      Returns:
      true if all ok
      Throws:
      SynchException
    • open

      org.oasis_open.docs.ws_calendar.ns.soap.BaseResponseType open() throws SynchException
      Called when a subscription is activated on synch engine startup or after creation of a new subscription.
      Returns:
      status + messages
      Throws:
      SynchException
    • getConnector

      Connector getConnector() throws SynchException
      Returns:
      the connector for this instance
      Throws:
      SynchException
    • getSubInfo

      InfoT getSubInfo() throws SynchException
      Returns:
      the info for the subscription this instance is handling.
      Throws:
      SynchException
    • changed

      boolean changed() throws SynchException
      Called before a resynch takes place to determine if the end point has changed and needs resynch. Only the source end of a subscription will be checked. Note that false positives may occur if changes happen outside of the synch time boundaries. For notification driven endpoints this can probably always return false.
      Returns:
      true if a change occurred
      Throws:
      SynchException
    • setLastCrudCts

      void setLastCrudCts(BaseSubscriptionInfo.CrudCts val) throws SynchException
      Parameters:
      val -
      Throws:
      SynchException
    • getLastCrudCts

      Returns:
      cts
      Throws:
      SynchException
    • setTotalCrudCts

      void setTotalCrudCts(BaseSubscriptionInfo.CrudCts val) throws SynchException
      Parameters:
      val -
      Throws:
      SynchException
    • getTotalCrudCts

      Returns:
      cts
      Throws:
      SynchException
    • getItemsInfo

      Get information about items in the subscribed calendar. Used for initial synch.
      Returns:
      List of items - never null, maybe empty.
      Throws:
      SynchException
    • addItem

      org.oasis_open.docs.ws_calendar.ns.soap.AddItemResponseType addItem(ietf.params.xml.ns.icalendar_2.IcalendarType val) throws SynchException
      Add a calendar component
      Parameters:
      val -
      Returns:
      response
      Throws:
      SynchException
    • fetchItem

      org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseType fetchItem(String uid) throws SynchException
      Fetch a calendar component. The uid is required as a key as it is the only value which is guaranteed to be available at both ends.
      Parameters:
      uid - of item
      Returns:
      response
      Throws:
      SynchException
    • fetchItems

      List<org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseType> fetchItems(List<String> uids) throws SynchException
      Fetch a batch of calendar components. The number and order of the result set must match that of the parameter uids.
      Parameters:
      uids - of items
      Returns:
      responses
      Throws:
      SynchException
    • updateItem

      org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemResponseType updateItem(org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemType updates) throws SynchException
      Update a calendar component.
      Parameters:
      updates - has the change token, href, and the component selection fields set.
      Returns:
      response
      Throws:
      SynchException
    • deleteItem

      org.oasis_open.docs.ws_calendar.ns.soap.DeleteItemResponseType deleteItem(String uid) throws SynchException
      Delete a calendar component.
      Parameters:
      uid - - of the component to delete.
      Returns:
      response
      Throws:
      SynchException