Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dtp-dev] Integration of "Work Offline" Connection State

Hey all,

> > I've finally integrated a "work offline" connection state into the
> > connection profile framework.  I've attached a patch with the changes
> > the BZ (
> >
> > Still to do:
> > Add actions for "save offline" and "work offline"
> > Update connected check in extension point filters to use the
> > state
> > as opposed to using a boolean state.
> > Migrate the SQL model connection factory (ConnectionInfo) to the new
> > framework.
> >
> > I should have the remaining work completed tomorrow (Thursday at the
> > latest).
> >
> > Please review the patch for any potential impacts (since some of these
> > changes do affect API, in an additive way).
> >
> I've completed the remaining items (listed above) and have updated the
> patch file attached to the BZ entry.  I made one small change to the new
> API that was included in the original patch.
> The functionality is implemented in such a way that existing consumers
> should not be impacted.  The deprecated IConnectionProfile.isConnected()
> method will return true only if the profile is in a "connected" state.
> the profile is in a "working offline" state, it will return false.  To
> integrate your code with any profiles that provide "offline"
> you will need to use the new IConnectionProfile.getConnectionState()
> method.  Currently, this is only applicable to consumers of
> (the SQL model) as it is the only connection that supports offline
> capabilities.
> Offline connections can only be acquired through managed connections on
> connection profile (IConnectionProfile.getManagedConnection()).  Because
> this, offline connections are singletons.
> A connection profile can be moved into an offline state from either a
> connected or disconnected state.  Likewise, a profile can be moved into a
> connected state from either a disconnected or offline state.  And...a
> profile can be moved into a disconnected state from either an offline
> or a connected state.

This work has been committed.  Please note that if you want to take
advantage of offline connections, you will need to use
IConnectionProfile.getConnectionState() instead of
IConnectionProfile.isConnected() (which returns false for the offline
state).  Also, there is a new interface which extends
IManagedConnectionListener, IManagedConnectionOfflineListener, which
provides hooks for state changes involving offline connections.  The base
implementation, ManagedConnectionAdapter, implements both.

Please let me know if you have any problems.

Best regards,
Rob Cernich
DTP Connectivity Project Lead

Back to the top