Package org.bedework.synch.shared.cnctrs
Class AbstractConnectorInstance<CnctrT extends AbstractConnector,InfoT extends BaseSubscriptionInfo,ConfigT extends ConnectorConfigI>
java.lang.Object
org.bedework.synch.shared.cnctrs.AbstractConnectorInstance<CnctrT,InfoT,ConfigT>
- All Implemented Interfaces:
ConnectorInstance<InfoT>,org.bedework.util.logging.Logged
- Direct Known Subclasses:
BaseConnectorInstance
public abstract class AbstractConnectorInstance<CnctrT extends AbstractConnector,InfoT extends BaseSubscriptionInfo,ConfigT extends ConnectorConfigI>
extends Object
implements org.bedework.util.logging.Logged, ConnectorInstance<InfoT>
Abstract connector instance to handle some trivia.
- Author:
- Mike Douglass
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bedework.synch.shared.cnctrs.ConnectorInstance
ConnectorInstance.ItemInfo, ConnectorInstance.SynchItemsInfo -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConnectorInstance(Subscription sub, org.bedework.synch.wsmessages.SynchEndType end, InfoT info, CnctrT cnctr, ConfigT config) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.http.impl.client.CloseableHttpClientorg.bedework.util.logging.BwLoggerorg.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.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 subscriptionprotected booleanvalidateSubInfo(org.bedework.synch.wsmessages.SubscribeResponseType sr, Connector cnctr, BaseSubscriptionInfo info) Ensure subscription info is validMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bedework.synch.shared.cnctrs.ConnectorInstance
addItem, changed, deleteItem, fetchItem, fetchItems, getItemsInfo, updateItemMethods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
-
Field Details
-
sub
-
end
protected org.bedework.synch.wsmessages.SynchEndType end -
info
-
cnctr
-
config
-
-
Constructor Details
-
Method Details
-
getConnector
- Specified by:
getConnectorin interfaceConnectorInstance<CnctrT extends AbstractConnector>- Returns:
- the connector for this instance
-
getSubInfo
- Specified by:
getSubInfoin interfaceConnectorInstance<CnctrT extends AbstractConnector>- Returns:
- the info for the subscription this instance is handling.
-
open
Description copied from interface:ConnectorInstanceCalled when a subscription is activated on synch engine startup or after creation of a new subscription.- Specified by:
openin interfaceConnectorInstance<CnctrT extends AbstractConnector>- Returns:
- status + messages
- Throws:
SynchException
-
subscribe
public boolean subscribe(org.bedework.synch.wsmessages.SubscribeResponseType sr) throws SynchException Description copied from interface:ConnectorInstanceDo 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.
- Specified by:
subscribein interfaceConnectorInstance<CnctrT extends AbstractConnector>- Returns:
- false if the subscription fails - status has been set in response
- Throws:
SynchException
-
unsubscribe
public boolean unsubscribe(org.bedework.synch.wsmessages.UnsubscribeRequestType usreq, org.bedework.synch.wsmessages.UnsubscribeResponseType usresp) throws SynchException Description copied from interface:ConnectorInstanceCheck 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.
- Specified by:
unsubscribein interfaceConnectorInstance<CnctrT extends AbstractConnector>- Returns:
- false if the unsubscribe fails - status has been set in response
- Throws:
SynchException
-
getLastCrudCts
- Specified by:
getLastCrudCtsin interfaceConnectorInstance<CnctrT extends AbstractConnector>- Returns:
- cts
- Throws:
SynchException
-
getTotalCrudCts
- Specified by:
getTotalCrudCtsin interfaceConnectorInstance<CnctrT extends AbstractConnector>- Returns:
- cts
- Throws:
SynchException
-
getClient
- Throws:
SynchException
-
getLogger
public org.bedework.util.logging.BwLogger getLogger()- Specified by:
getLoggerin interfaceorg.bedework.util.logging.Logged
-