Exemple #1
0
        public IFreeformEntity_Msg CopyTo(FF_FlowDirection direction, FFCreateEntityRequest request)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "CopyTo"))
            {
                IFreeformEntity_Msg result = null;

                try
                {
                    result            = FreeformEntityFactory.CreateEntity <IFreeformEntity_Msg>(direction, request);
                    result.IpAddress  = this.IpAddress;
                    result.DeviceType = this.DeviceType;
                    result.SessionID  = this.SessionID;
                    if (!request.SkipTransactionId)
                    {
                        result.TransactionID = this.TransactionID;
                    }
                    result.IsSecured = this.IsSecured;
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
        public static FFMsg_H2G CreateH2GMessageAckNack(string ipAddress, bool nack)
        {
            FFMsg_H2G msg = FreeformEntityFactory.CreateEntity <FFMsg_H2G>(FF_FlowDirection.H2G,
                                                                           new FFCreateEntityRequest_H2G()
            {
                PollCode           = FF_AppId_H2G_PollCodes.Override,
                SessionID          = FF_AppId_SessionIds.Override,
                IPAddress          = ipAddress,
                SkipTransactionId  = true,
                IsResponseRequired = false,
            });

            msg.AddTarget(new FFTgt_H2G_AckNack()
            {
                Nack = nack,
            });
            return(msg);
        }
        public static FFMsg_H2G CreateH2GMessage(string ipAddress, FF_AppId_H2G_PollCodes pollcode,
                                                 FF_AppId_SessionIds sessionId, bool isResponseRequired,
                                                 params IFreeformEntity_MsgTgt[] targets)
        {
            FFMsg_H2G msg = FreeformEntityFactory.CreateEntity <FFMsg_H2G>(FF_FlowDirection.H2G,
                                                                           new FFCreateEntityRequest_H2G_ResponseRequired()
            {
                PollCode           = pollcode,
                SessionID          = sessionId,
                IPAddress          = ipAddress,
                SkipTransactionId  = true,
                IsResponseRequired = isResponseRequired,
            });

            if (targets != null)
            {
                msg.AddTargets(targets);
            }
            return(msg);
        }
        public static FFMsg_G2H CreateG2HMessage(string ipAddress, FF_AppId_G2H_Commands command, FF_AppId_G2H_MessageTypes messageType,
                                                 FF_AppId_SessionIds sessionId, bool isResponseRequired,
                                                 params IFreeformEntity_MsgTgt[] targets)
        {
            FFMsg_G2H msg = FreeformEntityFactory.CreateEntity <FFMsg_G2H>(FF_FlowDirection.G2H,
                                                                           new FFCreateEntityRequest_G2H_ResponseRequired()
            {
                Command            = command,
                MessageType        = messageType,
                SessionID          = sessionId,
                IPAddress          = ipAddress,
                SkipTransactionId  = true,
                IsResponseRequired = isResponseRequired,
            });

            if (targets != null)
            {
                msg.AddTargets(targets);
            }
            return(msg);
        }