Package org.bedework.synch.shared.cnctrs
Class BaseConnectorInstance<CnctrT extends AbstractConnector,InfoT extends BaseSubscriptionInfo,ConfigT extends ConnectorConfigI>
- java.lang.Object
-
- org.bedework.synch.shared.cnctrs.AbstractConnectorInstance<CnctrT,InfoT,ConfigT>
-
- org.bedework.synch.shared.cnctrs.BaseConnectorInstance<CnctrT,InfoT,ConfigT>
-
- All Implemented Interfaces:
ConnectorInstance<InfoT>,org.bedework.util.logging.Logged
public abstract class BaseConnectorInstance<CnctrT extends AbstractConnector,InfoT extends BaseSubscriptionInfo,ConfigT extends ConnectorConfigI> extends AbstractConnectorInstance<CnctrT,InfoT,ConfigT>
User: mike Date: 3/12/18 Time: 21:32 Basic implementation with some commonly used methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseConnectorInstance.MapEntry-
Nested classes/interfaces inherited from interface org.bedework.synch.shared.cnctrs.ConnectorInstance
ConnectorInstance.ItemInfo, ConnectorInstance.SynchItemsInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected ietf.params.xml.ns.icalendar_2.IcalendarTypefetchedIcalprotected ietf.params.xml.ns.icalendar_2.ObjectFactoryofprotected Stringprodidprotected Map<String,BaseConnectorInstance.MapEntry>uidMap
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseConnectorInstance(Subscription sub, org.bedework.synch.wsmessages.SynchEndType end, InfoT info, CnctrT cnctr, ConfigT config)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.oasis_open.docs.ws_calendar.ns.soap.AddItemResponseTypeaddItem(ietf.params.xml.ns.icalendar_2.IcalendarType val)Add a calendar componentprotected booleanchanged(boolean headSupported, String contentType)org.oasis_open.docs.ws_calendar.ns.soap.DeleteItemResponseTypedeleteItem(String uid)Delete a calendar component.org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseTypefetchItem(String uid)Fetch a calendar component.List<org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseType>fetchItems(List<String> uids)Fetch a batch of calendar components.StringgetHttpChangeToken(org.apache.http.client.methods.CloseableHttpResponse hresp)abstract booleangetIcal()protected booleangetIcal(String contentType)ConnectorInstance.SynchItemsInfogetItemsInfo()Get information about items in the subscribed calendar.<T extends ietf.params.xml.ns.icalendar_2.TextPropertyType>
StringgetText(Class<T> cl, javax.xml.bind.JAXBElement<? extends ietf.params.xml.ns.icalendar_2.BaseComponentType> comp, QName tag)abstract URIgetUri()abstract ietf.params.xml.ns.icalendar_2.IcalendarTypemakeXcal(InputStream is)org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemResponseTypeupdateItem(org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemType updates)Update a calendar component.-
Methods inherited from class org.bedework.synch.shared.cnctrs.AbstractConnectorInstance
getClient, getConnector, getLastCrudCts, getLogger, getSubInfo, getTotalCrudCts, open, setLastCrudCts, setTotalCrudCts, subscribe, unsubscribe, validateActiveSubInfo, validateSubInfo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bedework.synch.shared.cnctrs.ConnectorInstance
changed
-
Methods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, warn
-
-
-
-
Field Detail
-
fetchedIcal
protected ietf.params.xml.ns.icalendar_2.IcalendarType fetchedIcal
-
prodid
protected String prodid
-
of
protected final ietf.params.xml.ns.icalendar_2.ObjectFactory of
-
uidMap
protected Map<String,BaseConnectorInstance.MapEntry> uidMap
-
-
Constructor Detail
-
BaseConnectorInstance
protected BaseConnectorInstance(Subscription sub, org.bedework.synch.wsmessages.SynchEndType end, InfoT info, CnctrT cnctr, ConfigT config)
-
-
Method Detail
-
getUri
public abstract URI getUri() throws SynchException
- Throws:
SynchException
-
makeXcal
public abstract ietf.params.xml.ns.icalendar_2.IcalendarType makeXcal(InputStream is) throws SynchException
- Throws:
SynchException
-
getIcal
public abstract boolean getIcal() throws SynchException- Throws:
SynchException
-
addItem
public org.oasis_open.docs.ws_calendar.ns.soap.AddItemResponseType addItem(ietf.params.xml.ns.icalendar_2.IcalendarType val) throws SynchExceptionDescription copied from interface:ConnectorInstanceAdd a calendar component- Returns:
- response
- Throws:
SynchException
-
updateItem
public org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemResponseType updateItem(org.oasis_open.docs.ws_calendar.ns.soap.UpdateItemType updates) throws SynchExceptionDescription copied from interface:ConnectorInstanceUpdate a calendar component.- Parameters:
updates- has the change token, href, and the component selection fields set.- Returns:
- response
- Throws:
SynchException
-
deleteItem
public org.oasis_open.docs.ws_calendar.ns.soap.DeleteItemResponseType deleteItem(String uid) throws SynchException
Description copied from interface:ConnectorInstanceDelete a calendar component.- Parameters:
uid- - of the component to delete.- Returns:
- response
- Throws:
SynchException
-
fetchItem
public org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseType fetchItem(String uid) throws SynchException
Description copied from interface:ConnectorInstanceFetch 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
public List<org.oasis_open.docs.ws_calendar.ns.soap.FetchItemResponseType> fetchItems(List<String> uids) throws SynchException
Description copied from interface:ConnectorInstanceFetch 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
-
changed
protected boolean changed(boolean headSupported, String contentType) throws SynchException- Throws:
SynchException
-
getItemsInfo
public ConnectorInstance.SynchItemsInfo getItemsInfo() throws SynchException
Description copied from interface:ConnectorInstanceGet information about items in the subscribed calendar. Used for initial synch.- Returns:
- List of items - never null, maybe empty.
- Throws:
SynchException
-
getText
public <T extends ietf.params.xml.ns.icalendar_2.TextPropertyType> String getText(Class<T> cl, javax.xml.bind.JAXBElement<? extends ietf.params.xml.ns.icalendar_2.BaseComponentType> comp, QName tag)
-
getIcal
protected boolean getIcal(String contentType) throws SynchException
- Throws:
SynchException
-
getHttpChangeToken
public final String getHttpChangeToken(org.apache.http.client.methods.CloseableHttpResponse hresp)
-
-