Package org.bedework.synch.shared.cnctrs
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 ClassesModifier and TypeInterfaceDescriptionstatic classInformation used to synch ends A and B This information is only valid in the context of a given subscription.static classStatus OK and no items is end of batch. -
Method Summary
Modifier and TypeMethodDescriptionorg.oasis_open.docs.ws_calendar.ns.soap.AddItemResponseTypeaddItem(ietf.params.xml.ns.icalendar_2.IcalendarType val) Add a calendar componentbooleanchanged()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.DeleteItemResponseTypedeleteItem(String uid) Delete a calendar component.org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseTypeFetch a calendar component.List<org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseType>fetchItems(List<String> uids) Fetch a batch of calendar components.Get information about items in the subscribed calendar.org.oasis_open.docs.ws_calendar.ns.soap.BaseResponseTypeopen()Called when a subscription is activated on synch engine startup or after creation of a new subscription.voidvoidbooleansubscribe(org.bedework.synch.wsmessages.SubscribeResponseType sr) Do whatever is required to set up a subscription to the end point for this connector instance.booleanunsubscribe(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.UpdateItemResponseTypeupdateItem(org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemType updates) Update a calendar component.booleanvalidateActiveSubInfo(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
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. pathsThis 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
-
open
Called when a subscription is activated on synch engine startup or after creation of a new subscription.- Returns:
- status + messages
- Throws:
SynchException
-
getConnector
- Returns:
- the connector for this instance
- Throws:
SynchException
-
getSubInfo
- Returns:
- the info for the subscription this instance is handling.
- Throws:
SynchException
-
changed
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
-
getLastCrudCts
- Returns:
- cts
- 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
-