T - Connector subclassTI - Connector instance subclassTN - Notification subclassTconf - Configuration classpublic abstract class AbstractConnector<T,TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI,InfoT extends BaseSubscriptionInfo> extends org.bedework.util.misc.Logged implements Connector<TI,TN,Tconf>
This is the way to call the system to add subscriptions, to unsubscribe etc.
Connector.NotificationBatch<N extends Notification>| Modifier and Type | Field and Description |
|---|---|
protected String |
callbackUri |
protected Tconf |
config |
protected boolean |
failed |
protected JAXBContext |
jc |
protected org.bedework.synch.wsmessages.ObjectFactory |
of |
protected PropertiesInfo |
propInfo |
protected boolean |
running |
protected MessageFactory |
soapMsgFactory |
protected boolean |
stopped |
protected SynchEngine |
syncher |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConnector(PropertiesInfo propInfo) |
| Modifier and Type | Method and Description |
|---|---|
String |
getCallbackUri() |
String |
getConnectorId() |
TI |
getConnectorInstance(Subscription sub,
org.bedework.synch.wsmessages.SynchEndType end)
Called to obtain a connector instance for a subscription.
|
ietf.params.xml.ns.icalendar_2.ObjectFactory |
getIcalObjectFactory() |
String |
getId() |
protected org.bedework.synch.wsmessages.SynchRemoteServicePortType |
getPort(String uri) |
PropertiesInfo |
getPropertyInfo()
Information about properties required for subscriptions via this
connector.
|
List<Object> |
getSkipList() |
protected MessageFactory |
getSoapMsgFactory() |
String |
getStatus() |
SynchEngine |
getSyncher() |
boolean |
getTrustLastmod()
Can we trust the lastmod from this connector?
|
Connector.NotificationBatch<TN> |
handleCallback(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
List<String> resourceUri)
Will create a notification batch object which will be passed to a synchling for
processing.
|
boolean |
isFailed() |
boolean |
isManager() |
boolean |
isReadOnly()
Is this a read-only connector?
|
boolean |
isStarted() |
boolean |
isStopped() |
abstract TI |
makeInstance(Subscription sub,
org.bedework.synch.wsmessages.SynchEndType end) |
protected void |
marshal(Object o,
OutputStream out) |
void |
respondCallback(javax.servlet.http.HttpServletResponse resp,
Connector.NotificationBatch<TN> notifications)
Will respond to a notification.
|
void |
start(String connectorId,
Tconf conf,
String callbackUri,
SynchEngine syncher)
Start the connector.
|
void |
stop()
Shut down the connector
|
protected Object |
unmarshalBody(javax.servlet.http.HttpServletRequest req) |
audit, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, getAuditLoggerIfEnabled, getErrorLoggerIfEnabled, getLogger, getLogger, getMetricsLoggerIfEnabled, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsLoggerEnabled, metrics, warnprotected Tconf extends ConnectorConfigI config
protected String callbackUri
protected SynchEngine syncher
protected boolean running
protected boolean stopped
protected boolean failed
protected org.bedework.synch.wsmessages.ObjectFactory of
protected MessageFactory soapMsgFactory
protected JAXBContext jc
protected PropertiesInfo propInfo
protected AbstractConnector(PropertiesInfo propInfo)
public String getConnectorId()
public void start(String connectorId, Tconf conf, String callbackUri, SynchEngine syncher)
ConnectorThe callback url is unique to the connector. It will be used as a path prefix to allow the callback service to locate the handler for incoming callback requests.
For example, if the callback context is /synchcb/ and the connector id is "bedework" then the callback uri might be /synchcb/bedework/. The connector might append a uid to that path to allow it to locate the active subscription for which the callback is intended.
start in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>connectorId - - registered id for the connectorpublic String getStatus()
getStatus in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public boolean isStarted()
isStarted in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public boolean isFailed()
isFailed in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public boolean isStopped()
isStopped in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public boolean isManager()
isManager in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public boolean isReadOnly()
ConnectorisReadOnly in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public boolean getTrustLastmod()
ConnectorgetTrustLastmod in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public String getId()
getId in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public String getCallbackUri()
getCallbackUri in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public SynchEngine getSyncher()
getSyncher in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public ietf.params.xml.ns.icalendar_2.ObjectFactory getIcalObjectFactory()
getIcalObjectFactory in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public PropertiesInfo getPropertyInfo()
ConnectorgetPropertyInfo in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public List<Object> getSkipList()
getSkipList in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>public void stop()
throws SynchException
Connectorstop in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>SynchExceptionpublic abstract TI makeInstance(Subscription sub, org.bedework.synch.wsmessages.SynchEndType end) throws SynchException
SynchExceptionpublic TI getConnectorInstance(Subscription sub, org.bedework.synch.wsmessages.SynchEndType end) throws SynchException
ConnectorgetConnectorInstance in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>sub - - the subscriptionend - - which endSynchExceptionpublic Connector.NotificationBatch<TN> handleCallback(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, List<String> resourceUri) throws SynchException
ConnectorThe resource URI has been stripped of the context element and the element which identifies the connector. What remains is used by the connector to determine a subscription id allowing retrieval of the subscription from the synch engine.
handleCallback in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>resourceUri - - elements of the path with context and connector id removedSynchExceptionpublic void respondCallback(javax.servlet.http.HttpServletResponse resp,
Connector.NotificationBatch<TN> notifications)
throws SynchException
ConnectorrespondCallback in interface Connector<TI extends AbstractConnectorInstance,TN extends Notification,Tconf extends ConnectorConfigI>notifications - from handleCallback.SynchExceptionprotected org.bedework.synch.wsmessages.SynchRemoteServicePortType getPort(String uri) throws SynchException
SynchExceptionprotected Object unmarshalBody(javax.servlet.http.HttpServletRequest req) throws SynchException
SynchExceptionprotected void marshal(Object o, OutputStream out) throws SynchException
SynchExceptionprotected MessageFactory getSoapMsgFactory() throws SynchException
SynchExceptionCopyright © 2018 Bedework. All rights reserved.