Package org.bedework.synch.shared.cnctrs
Class AbstractConnector<T,TI extends AbstractConnectorInstance<?,?,?>,TN extends Notification<?>,Tconf extends ConnectorConfigI,InfoT extends BaseSubscriptionInfo>
java.lang.Object
org.bedework.synch.shared.cnctrs.AbstractConnector<T,TI,TN,Tconf,InfoT>
- Type Parameters:
T- Connector subclassTI- Connector instance subclassTN- Notification subclassTconf- Configuration class
- All Implemented Interfaces:
Connector<TI,,TN, Tconf> org.bedework.util.logging.Logged
public abstract class AbstractConnector<T,TI extends AbstractConnectorInstance<?,?,?>,TN extends Notification<?>,Tconf extends ConnectorConfigI,InfoT extends BaseSubscriptionInfo>
extends Object
implements org.bedework.util.logging.Logged, Connector<TI,TN,Tconf>
A special connector to handle calls to the synch engine via the web context.
This is the way to call the system to add subscriptions, to unsubscribe etc.
- Author:
- Mike Douglass
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bedework.synch.shared.cnctrs.Connector
Connector.NotificationBatch<N extends Notification> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Tconfprotected booleanprotected javax.xml.bind.JAXBContextprotected org.bedework.synch.wsmessages.ObjectFactoryprotected PropertiesInfoprotected booleanprotected javax.xml.soap.MessageFactoryprotected booleanprotected SynchEngine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConnectorInstance(Subscription sub, org.bedework.synch.wsmessages.SynchEndType end) Called to obtain a connector instance for a subscription.ietf.params.xml.ns.icalendar_2.ObjectFactorygetId()org.bedework.util.logging.BwLoggerprotected org.bedework.synch.wsmessages.SynchRemoteServicePortTypeInformation about properties required for subscriptions via this connector.protected javax.xml.soap.MessageFactorybooleanCan we trust the lastmod from this connector?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.booleanisFailed()booleanbooleanIs this a read-only connector?booleanbooleanabstract TImakeInstance(Subscription sub, org.bedework.synch.wsmessages.SynchEndType end) protected voidmarshal(Object o, OutputStream out) voidrespondCallback(javax.servlet.http.HttpServletResponse resp, Connector.NotificationBatch<TN> notifications) Will respond to a notification.voidstart(String connectorId, Tconf conf, String callbackUri, SynchEngine syncher) Start the connector.voidstop()Shut down the connectorprotected ObjectunmarshalBody(javax.servlet.http.HttpServletRequest req) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
config
-
callbackUri
-
syncher
-
running
protected boolean running -
stopped
protected boolean stopped -
failed
protected boolean failed -
of
protected org.bedework.synch.wsmessages.ObjectFactory of -
soapMsgFactory
protected javax.xml.soap.MessageFactory soapMsgFactory -
jc
protected javax.xml.bind.JAXBContext jc -
propInfo
-
-
Constructor Details
-
Method Details
-
getConnectorId
- Returns:
- the connector id
-
getStatus
- Specified by:
getStatusin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- a useful status message
-
isStarted
public boolean isStarted()- Specified by:
isStartedin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- true if we started
-
isFailed
public boolean isFailed()- Specified by:
isFailedin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- true if we failed in some way
-
isStopped
public boolean isStopped()- Specified by:
isStoppedin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- true if we're stopped
-
isManager
public boolean isManager()- Specified by:
isManagerin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- true if we are the manager
-
isReadOnly
public boolean isReadOnly()Description copied from interface:ConnectorIs this a read-only connector?- Specified by:
isReadOnlyin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- boolean
-
getTrustLastmod
public boolean getTrustLastmod()Description copied from interface:ConnectorCan we trust the lastmod from this connector?- Specified by:
getTrustLastmodin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- boolean
-
getId
- Specified by:
getIdin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- id provided at start
-
getCallbackUri
- Specified by:
getCallbackUriin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- callbackUri provided at start
-
getSyncher
- Specified by:
getSyncherin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- syncher provided at start
-
getIcalObjectFactory
public ietf.params.xml.ns.icalendar_2.ObjectFactory getIcalObjectFactory()- Specified by:
getIcalObjectFactoryin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- an object factory for icalendar
-
getPropertyInfo
Description copied from interface:ConnectorInformation about properties required for subscriptions via this connector.- Specified by:
getPropertyInfoin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- list of info
-
getSkipList
- Specified by:
getSkipListin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Returns:
- list of icalendar properties to skip.
-
stop
Description copied from interface:ConnectorShut down the connector- Specified by:
stopin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> - Throws:
SynchException
-
handleCallback
public Connector.NotificationBatch<TN> handleCallback(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, List<String> resourceUri) throws SynchException Description copied from interface:ConnectorWill create a notification batch object which will be passed to a synchling for processing. When processing is complete respond will be called.The 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.
- Specified by:
handleCallbackin interfaceConnector<T,TI extends AbstractConnectorInstance<?, ?, ?>, TN extends Notification<?>> resourceUri- - elements of the path with context and connector id removed- Returns:
- Notification with 1 or more Notification items or null for no action.
- Throws:
SynchException
-
getPort
protected org.bedework.synch.wsmessages.SynchRemoteServicePortType getPort(String uri) throws SynchException - Throws:
SynchException
-
unmarshalBody
- Throws:
SynchException
-
marshal
- Throws:
SynchException
-
getSoapMsgFactory
- Throws:
SynchException
-
getLogger
public org.bedework.util.logging.BwLogger getLogger()- Specified by:
getLoggerin interfaceorg.bedework.util.logging.Logged
-