public static void set_syncserver(RubyModule /*!*/ self, [NotNull] String /*!*/ syncserver) { try { SyncThread.stopSync(); SyncThread.getSyncEngine().setSyncServer(syncserver); if (syncserver != null && syncserver.length() > 0) { SyncThread.getInstance().start(SyncThread.epLow); if (ClientRegister.getInstance() != null) { ClientRegister.getInstance().startUp(); } } } catch (Exception ex) { Exception rubyEx = self.Context.CurrentException; if (rubyEx == null) { rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message); } LOG.ERROR("set_syncserver", ex); throw rubyEx; } }
public static object dosearch(RubyModule /*!*/ self, [NotNull] RubyArray /*!*/ arSourcesR, [NotNull] String /*!*/ from, [NotNull] String /*!*/ strParams, [NotNull] bool /*!*/ bSearchSyncChanges, [NotNull] int /*!*/ nProgressStep, String /*!*/ strCallback, String /*!*/ strCallbackParams) { object res = null; try { SyncThread.stopSync(); if (strCallback != null && strCallback.Length > 0) { SyncThread.getSyncEngine().getNotify().setSearchNotification(strCallback, strCallbackParams); } Vector <String> arSources = RhoRuby.makeVectorStringFromArray(arSourcesR); SyncThread.getInstance().addQueueCommand(new SyncThread.SyncSearchCommand(from, strParams, arSources, bSearchSyncChanges, nProgressStep)); res = SyncThread.getInstance().getRetValue(); } catch (Exception ex) { Exception rubyEx = self.Context.CurrentException; if (rubyEx == null) { rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message); } LOG.ERROR("dosearch", ex); throw rubyEx; } return(res); }
public static void set_syncserver(RubyModule /*!*/ self, [NotNull] String /*!*/ syncserver) { SyncThread.stopSync(); SyncThread.getSyncEngine().setSyncServer(syncserver); if (syncserver != null && syncserver.length() > 0) { SyncThread.getInstance().start(SyncThread.epLow); if (ClientRegister.getInstance() != null) { ClientRegister.getInstance().startUp(); } } }
public static object dosearch(RubyModule /*!*/ self, [NotNull] RubyArray /*!*/ arSourcesR, [NotNull] String /*!*/ from, [NotNull] String /*!*/ strParams, [NotNull] bool /*!*/ bSearchSyncChanges, [NotNull] int /*!*/ nProgressStep, String /*!*/ strCallback, String /*!*/ strCallbackParams) { SyncThread.stopSync(); if (strCallback != null && strCallback.Length > 0) { SyncThread.getSyncEngine().getNotify().setSearchNotification(strCallback, strCallbackParams); } Vector <String> arSources = RhoRuby.makeVectorStringFromArray(arSourcesR); SyncThread.getInstance().addQueueCommand(new SyncThread.SyncSearchCommand(from, strParams, arSources, bSearchSyncChanges, nProgressStep)); return(SyncThread.getInstance().getRetValue()); }
public static object login(RubyModule /*!*/ self, [NotNull] String /*!*/ name, [NotNull] String /*!*/ pwd, [NotNull] String /*!*/ callback) { try{ SyncThread.stopSync(); SyncThread.getInstance().addQueueCommand(new SyncThread.SyncLoginCommand(name, pwd, callback, new SyncNotify.SyncNotification(callback, "", false))); return(SyncThread.getInstance().getRetValue()); } catch (Exception e) { LOG.ERROR("SyncEngine.login", e); RhoRuby.raise_RhoError(RhoAppAdapter.ERR_RUNTIME); } return(null); }
public static void stop_sync(RubyModule /*!*/ self) { try { SyncThread.stopSync(); } catch (Exception ex) { Exception rubyEx = self.Context.CurrentException; if (rubyEx == null) { rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message); } LOG.ERROR("stop_sync", ex); throw rubyEx; } }
public static void set_pollinterval(RubyModule /*!*/ self) { SyncThread.stopSync(); }
public static void logout(RubyModule /*!*/ self) { SyncThread.stopSync(); SyncThread.getSyncEngine().stopSyncByUser(); SyncThread.getSyncEngine().logout(); }