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
    • Method Detail

      • 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
      • 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
      • 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