public QueueService( IQueueQuery queueQueryHelper, IQueueCommand queueCommandHelper, IQueueLocker queueLocker, IGetQueueMessagesQuery queueMessages, IQueueMessageRecorder historyRecorder, IGetAiringQuery airingQueryHelper, IAiringMessagePusherQueueApi messagePusher, IQueueSaveCommand queueSaveCommand, CurrentAiringsQuery currentAiringQuery, IHangfireRecurringJobCommand hangfireCommand, IRemoteQueueHandler remoteQueueHandler, IQueueDeleteCommand queueDeleteCommand) { this.queueQueryHelper = queueQueryHelper; this.queueCommandHelper = queueCommandHelper; this.queueLocker = queueLocker; this.queueMessages = queueMessages; this.historyRecorder = historyRecorder; this.airingQueryHelper = airingQueryHelper; this.messagePusher = messagePusher; this.queueSaveCommand = queueSaveCommand; this.currentAiringQuery = currentAiringQuery; this.hangfireCommand = hangfireCommand; this.remoteQueueHandler = remoteQueueHandler; this.queueDeleteCommand = queueDeleteCommand; }
protected void addQueueCommandInt(IQueueCommand pCmd) { LOG.INFO("addCommand: " + pCmd.toString()); lock (m_mxStackCommands) { boolean bExist = false; if (isSkipDuplicateCmd()) { for (int i = 0; i < (int)m_stackCommands.size(); i++) { if (m_stackCommands.get(i).equals(pCmd)) { LOG.INFO("Command already exists in queue. Skip it."); bExist = true; break; } } } if (!bExist) { m_stackCommands.add(pCmd); } } }
public IQueueCommand selectMethod(string msgData) { IQueueCommand method = null; Type[] typeList = getTypesInNamespace(Assembly.GetExecutingAssembly(), m_asseblyName); foreach (Type currType in typeList) { if (currType.IsInterface) { continue; } method = (IQueueCommand)Activator.CreateInstance(currType); method = (IQueueCommand)JsonConvert.DeserializeObject(msgData, currType); if (!method.isNull) { break; } method = null; } if (method == null) { method = (IQueueCommand)JsonConvert.DeserializeObject <DefaultMethodClass>(msgData); } return(method); }
public boolean equals(IQueueCommand obj) { SyncCommand oSyncCmd = (SyncCommand)obj; return m_nCmdCode == oSyncCmd.m_nCmdCode && m_nCmdParam == oSyncCmd.m_nCmdParam && (m_strCmdParam == oSyncCmd.m_strCmdParam || (m_strCmdParam != null && oSyncCmd.m_strCmdParam != null && m_strCmdParam.equals(oSyncCmd.m_strCmdParam))); }
public boolean equals(IQueueCommand obj) { SyncCommand oSyncCmd = (SyncCommand)obj; return(m_nCmdCode == oSyncCmd.m_nCmdCode && m_nCmdParam == oSyncCmd.m_nCmdParam && (m_strCmdParam == oSyncCmd.m_strCmdParam || (m_strCmdParam != null && oSyncCmd.m_strCmdParam != null && m_strCmdParam.equals(oSyncCmd.m_strCmdParam)))); }
public void addQueueCommand(IQueueCommand pCmd) { addQueueCommandInt(pCmd); if ( isNoThreadedMode() ) processCommands(); else if ( isAlive() ) stopWait(); }
private void Config() { FilterGraph fg = new FilterGraph(); m_qc = fg as IQueueCommand; m_mc = (IMediaControl)fg; int hr = ((IGraphBuilder)fg).RenderFile(@"foo.avi", null); }
public ModifiedTitleService(IQueueCommand resetDeliveryCommand, ITitleIdsQuery titlIdsQuery, ITitleIdsCommand titleIDsCommand, AppSettings _appSettings) { _resetDeliveryCommand = resetDeliveryCommand; _titlIdsQuery = titlIdsQuery; _titleIDsCommand = titleIDsCommand; this.appSettings = _appSettings; _client = new RestClient(appSettings.GetExternalService("Flow").Url); }
public void addQueueCommand(IQueueCommand pCmd) { addQueueCommandInt(pCmd); if (isNoThreadedMode()) { processCommands(); } else if (isAlive()) { stopWait(); } }
void processCommands()//throws Exception { while (!isStopping() && !isNoCommands()) { IQueueCommand pCmd = null; lock (m_mxStackCommands) { pCmd = (IQueueCommand)m_stackCommands.removeFirst(); } processCommandBase(pCmd); } }
protected void processCommandBase(IQueueCommand pCmd) { lock (m_mxStackCommands) { m_pCurCmd = pCmd; } processCommand(pCmd); lock (m_mxStackCommands) { m_pCurCmd = null; } }
public override void processCommand(IQueueCommand pCmd) { SyncCommand oSyncCmd = (SyncCommand)pCmd; switch (oSyncCmd.m_nCmdCode) { case scSyncAll: checkShowStatus(oSyncCmd); m_oSyncEngine.doSyncAllSources(); break; case scSyncOne: { checkShowStatus(oSyncCmd); m_oSyncEngine.doSyncSource(new SyncEngine.SourceID(oSyncCmd.m_nCmdParam, oSyncCmd.m_strCmdParam)); } break; case scSearchOne: { checkShowStatus(oSyncCmd); m_oSyncEngine.doSearch(((SyncSearchCommand)oSyncCmd).m_arSources, oSyncCmd.m_strCmdParam, ((SyncSearchCommand)oSyncCmd).m_strFrom, ((SyncSearchCommand)oSyncCmd).m_bSyncChanges, oSyncCmd.m_nCmdParam); } break; case scLogin: { SyncLoginCommand oLoginCmd = (SyncLoginCommand)oSyncCmd; checkShowStatus(oSyncCmd); m_oSyncEngine.login(oLoginCmd.m_strName, oLoginCmd.m_strPassword, oLoginCmd.m_pNotify); } break; } }
public void BasicPublish(string exchangeName, IQueueCommand command, string routingKey = "", bool isDoChannelClose = true) { try { var basicProperties = this.Channel.CreateBasicProperties(); basicProperties.Headers = new Dictionary <string, object> { { commandTypeName, command.GetType().AssemblyQualifiedName }, { "host", Environment.MachineName } }; var message = JsonConvert.SerializeObject(command); var body = Encoding.UTF8.GetBytes(message); var address = new PublicationAddress(ExchangeType.Fanout, exchangeName, routingKey); Retry.Do(() => { this.Channel.BasicPublish(address, basicProperties, body); }, TimeSpan.FromSeconds(1)); } catch (Exception e) { //var erroMsg = "Rabbitmq Message published failed."; //this.logger.Error(e, erroMsg); //this.slackSimpleClient.PostException(SlackSetting.ERROR_EXCEPTION_WEB_HOOK, e, erroMsg); Console.WriteLine(e); } //this.logger.Info($"Publish to {exchangeName}"); if (isDoChannelClose) { CloseChannel(); } }
protected void addQueueCommandInt(IQueueCommand pCmd) { LOG.INFO("addCommand: " + pCmd.toString()); lock(m_mxStackCommands) { boolean bExist = false; if ( isSkipDuplicateCmd() ) { for ( int i = 0; i < (int)m_stackCommands.size(); i++ ) { if ( m_stackCommands.get(i).equals(pCmd) ) { LOG.INFO("Command already exists in queue. Skip it."); bExist = true; break; } } } if ( !bExist ) m_stackCommands.add(pCmd); } }
public override void processCommand(IQueueCommand pCmd) { ((HttpCommand)pCmd).execute(); }
public override void processCommand(IQueueCommand pCmd) { SyncCommand oSyncCmd = (SyncCommand)pCmd; switch(oSyncCmd.m_nCmdCode) { case scSyncAll: checkShowStatus(oSyncCmd); m_oSyncEngine.doSyncAllSources(); break; case scSyncOne: { checkShowStatus(oSyncCmd); m_oSyncEngine.doSyncSource(new SyncEngine.SourceID(oSyncCmd.m_nCmdParam,oSyncCmd.m_strCmdParam)); } break; case scSearchOne: { checkShowStatus(oSyncCmd); m_oSyncEngine.doSearch( ((SyncSearchCommand)oSyncCmd).m_arSources, oSyncCmd.m_strCmdParam, ((SyncSearchCommand)oSyncCmd).m_strFrom, ((SyncSearchCommand)oSyncCmd).m_bSyncChanges, oSyncCmd.m_nCmdParam); } break; case scLogin: { SyncLoginCommand oLoginCmd = (SyncLoginCommand)oSyncCmd; checkShowStatus(oSyncCmd); m_oSyncEngine.login(oLoginCmd.m_strName, oLoginCmd.m_strPassword, oLoginCmd.m_pNotify ); } break; } }
public MutableString addHttpCommand(IQueueCommand pCmd) { if (((HttpCommand)pCmd).m_strCallback.length() == 0) { processCommandBase(pCmd); return ((HttpCommand)pCmd).getRetValue(); } else { addQueueCommand(pCmd); start(epLow); return ((HttpCommand)pCmd).getRetValue(); } }
public abstract void processCommand(IQueueCommand pCmd);
protected void processCommandBase(IQueueCommand pCmd) { lock(m_mxStackCommands) { m_pCurCmd = pCmd; } processCommand(pCmd); lock(m_mxStackCommands) { m_pCurCmd = null; } }
public override void processCommand(IQueueCommand pCmd) { (pCmd as CServerCommand).execute(); }
public EtlEnqueueHandler(ICensusFileCommand censusFileCommand, IQueueCommand queueCommand) { this.censusFileCommand = censusFileCommand; this.queueCommand = queueCommand; }
public boolean equals(IQueueCommand cmd) { return(false); }
public boolean equals(IQueueCommand cmd){ return false; }