DumontEXE 0.0.1
cmcSyncProxy.h
00001 /* ***************************************************************************
00002 **
00003 ** Copyright (C) 2007 Lorimark Solutions, LLC. All rights reserved.
00004 **
00005 ** This file is part of the DumontEXE Scripting Extension Kit
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://dumont.showoff-db.org/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://dumont.showoff-db.org/licensing.html 
00017 ** or contact the sales department at sales@lorimarksolutions.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ** author: Mark Petryk ~ Lorimark Solutions, LLC
00023 ** **************************************************************************/
00024 
00025 #ifndef CDA_SYNC_PROXY_H_422FD07F_0597_4cbb_A034_9AE85166472E
00026 #define CDA_SYNC_PROXY_H_422FD07F_0597_4cbb_A034_9AE85166472E
00027 
00028 class cmcApplication;
00029 
00030 #include "cmcObject.h"
00031 
00032 namespace cmcDatabaseApi {
00033 
00034 /*!
00035 ** \brief Synchronization Proxy
00036 **
00037 ** The Synchronization Proxy is a tool that is designed to add an additional
00038 **  transport layer to the existing Commence synchronization engine.  Why would
00039 **  you want to do this, you ask?  Because, the synchronization engine, as
00040 **  robust as it is, suffers a few, slight, defficiencies.
00041 **
00042 ** One of these is the lack of a vbScript interface.  There are times when being
00043 **  able to check the status of a synchronization client would be a very handy
00044 **  thing to do.  Also, it would be very handy to disable a single client's
00045 **  synchronization process either from the client or the server.  There are times,
00046 **  when working on a large dataset, on a client, that having a synchronization
00047 **  event occur right in the middle can be a real problem.  Especially if the
00048 **  sync packet is large, or if it occurs over a slow ftp connection.  With the
00049 **  cmcSyncProxy it is possible to disable syncing either from the client or
00050 **  from the server, for any client or for all clients.
00051 **
00052 ** There is also a lack of ability to check the status of client synchronization
00053 **  at any time.  In order to do this one has to check the sync directories and
00054 **  workgroup directories looking for stale sync packets or failure packets.
00055 **  This can require a great deal of scripting and coordination.  The 
00056 **  cmcDatabaseApi makes checking sync status a trivial matter.
00057 **
00058 ** Another problem is when the synchronization of a client fails, at the client,
00059 **  due to network difficulties.  This is especially prevalent over ftp where
00060 **  connections can be slow and quite sporatic.  Commence generates errors in
00061 **  synchronization very quickly and cannot be restarted without user intervention.
00062 **
00063 ** With the cmcDatabaseApi::cmcSyncProxy module, all synchronization is 
00064 **  marshalled through the proxy intermediary.  When a commence database (client
00065 **  or server) outputs a sync packet, it is set to output this packet to a local
00066 **  directory, rather than a shared network resource.  The cmcSyncProxy picks up 
00067 **  this packet and forwards it along to the shared network resource for that 
00068 **  client.  This shared resource can be different for each client as well, or to
00069 **  say it another way, different clients can use different network directories
00070 **  or different ftp servers.  The sync proxy also checks the repositories (client
00071 **  and server) for incomming packets, and when it sees one, it picks it up and 
00072 **  deposits it into the local directory for that database.  In this configuration, 
00073 **  the database (either client or server) is never required to access any network 
00074 **  resources directly.  The proxy has robust error handling and recovery and
00075 **  even provides for vbScript and agent notification of various states and events.
00076 **
00077 ** A diagram for the process might look something like this:
00078 **
00079 ** \dot
00080 ** digraph syncproxy
00081 ** {
00082 **   node [shape=ellipse, color=lightblue2, fontname=helvetica, fontsize=10];
00083 **
00084 **   CommenceServer -> localDirServer;
00085 **   localDirServer -> serverSyncProxy;
00086 **   serverSyncProxy -> networkResourceA;
00087 **   serverSyncProxy -> networkResourceB;
00088 **   serverSyncProxy -> networkResourceC;
00089 **
00090 **   networkResourceA -> syncProxyA;
00091 **   syncProxyA -> localDirA;
00092 **   localDirA -> CommenceA;
00093 **
00094 **   networkResourceA -> syncProxyB;
00095 **   syncProxyB -> localDirB;
00096 **   localDirB -> CommenceB;
00097 **   
00098 **   networkResourceA -> syncProxyC;
00099 **   syncProxyC -> localDirC;
00100 **   localDirC -> CommenceC;
00101 **
00102 **   networkResourceB -> syncProxyD;
00103 **   syncProxyD -> localDirD;
00104 **   localDirD -> CommenceD;
00105 **
00106 **   networkResourceC -> syncProxyE;
00107 **   syncProxyE -> localDirE;
00108 **   localDirE -> CommenceE;
00109 **
00110 **   networkResourceC -> syncProxyF;
00111 **   syncProxyF -> localDirF;
00112 **   localDirF -> CommenceF;
00113 ** }
00114 ** \enddot
00115 **
00116 ** In the above example, a single server is syncing to six clients, all through
00117 **  network resources of some sort.  These network resources can be shared drives,
00118 **  ftp sites, direct IP connections and so on.  The client and server executables are
00119 **  configured to sync to a local directory on their immediate hard drive.  Then,
00120 **  the cmcSyncProxy module is configured to watch the local directory for each
00121 **  copy of Commence, and it is also configured to watch the shared network 
00122 **  resource.  The client and server never access the network directly.  In this
00123 **  configuration the syncProxy can make more intelligent decisions about when
00124 **  syncing should be allowed, and when an error actually occurs and what to
00125 **  do about it.  The system can be easily configured to send email notifications
00126 **  to whomever regarding the failure of a sync process.
00127 **
00128 ** \todo Disable Syncing.  The application object should include a synchronization
00129 **  control module that would provide for the ability to disable syncing through 
00130 **  scripting.  It can accomplish this by subclassing admineng.dll and overriding the 
00131 **  various synchronization functions in it, but this would probably be complicated.  
00132 **  Another option is for Dumont to provide its own synchronization proxy.  The 
00133 **  advantage to the synchronization proxy is that no disturbance to the existing 
00134 **  synchronization engine is done.  Also, a synchronization proxy would provide
00135 **  a much needed fix to the ftp synchronization engine which falters constantly
00136 **  from disconnects.  One particularily annoying "feature" of the synchronization
00137 **  engine is that after a failure user intervention is required to get synchrnization
00138 **  going again.  A sync proxy in Dumont would fix this.  The sync proxy would move
00139 **  sync packets from a database (client or server) into and out of a shared sync 
00140 **  proxy repository. It would be a trivial matter, then, to turn the proxy off to 
00141 **  disable syncing. The proxy could also handle other media types beyond network 
00142 **  share and ftp if desired.
00143 **
00144 */
00145 class cmcSyncProxy:
00146   public cmcObject
00147 {
00148   Q_OBJECT
00149   public:
00150 
00151     /*!
00152     ** \brief Copy Constructor
00153     **
00154     */
00155     cmcSyncProxy( const cmcSyncProxy & copy );
00156 
00157     /*!
00158     ** \brief Default Destructor
00159     **
00160     ** This destructor handles cleanup of the object.
00161     **
00162     */
00163     virtual ~cmcSyncProxy();
00164 
00165   public slots:
00166 
00167   signals:
00168 
00169   protected:
00170 
00171   private:
00172 
00173 }; // endclass cmcSyncProxy
00174 
00175 } // namespace cmcDatabaseApi
00176 
00177 #endif // #ifndef CDA_SYNC_PROXY_H
00178 
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com