Exemplo n.º 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="id">Task's identifier.</param>
        /// <param name="queueId">The queue's identifier where the task will be put.</param>
        /// <param name="activationData">Task's activation data.</param>
        /// <param name="taskState">Task's state.</param>
        /// <param name="scheduleInformation"></param>
        /// <exception cref="ArgumentOutOfRangeException">The task identifier should be greate than 0.</exception>
        /// <exception cref="ArgumentOutOfRangeException">The queue identifier should be greate than 0.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="activationData"/> is <see langword="null" />.</exception>
        /// <remarks>This constructor should be used only for a tasks entities that have been panding.</remarks>
        public TaskModel(long id, long queueId, ActivationData activationData, TaskStates taskState, ScheduleInformation scheduleInformation)
        {
            if (id <= 0)
            {
                throw new ArgumentOutOfRangeException("id", "The task identifier should be greate than 0.");
            }
            if (queueId <= 0)
            {
                throw new ArgumentOutOfRangeException("queueId", "The queue identifier should be greate than 0.");
            }
            if (activationData == null)
            {
                throw new ArgumentNullException("activationData");
            }
            if (scheduleInformation == null)
            {
                throw new ArgumentNullException(nameof(scheduleInformation));
            }

            this.id             = id;
            this.queueId        = queueId;
            ActivationData      = activationData;
            ScheduleInformation = scheduleInformation;
            this.taskState      = taskState;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="id">Task's identifier.</param>
        /// <param name="queueId">The queue's identifier where the task will be put.</param>
        /// <param name="serverId">The server's identifier that is used for processing the task.</param>
        /// <param name="activationData">Task's activation data.</param>
        /// <param name="taskState">Task's state.</param>
        /// <param name="scheduleInformation"></param>
        /// <exception cref="ArgumentNullException"><paramref name="activationData"/> is <see langword="null" />.</exception>
        /// <remarks>This constructor should be used only for a tasks entities that have been panding.</remarks>
        public TaskModel(Int64 id, Int64 queueId, Int64 serverId, ActivationData activationData, TaskStates taskState, ScheduleInformation scheduleInformation) : base(id, queueId, serverId, taskState)
        {
            if (activationData == null)
            {
                throw new ArgumentNullException("activationData");
            }
            if (scheduleInformation == null)
            {
                throw new ArgumentNullException(nameof(scheduleInformation));
            }

            ActivationData      = activationData;
            ScheduleInformation = scheduleInformation;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="queueId">The queue's identifier where the task will be put.</param>
        /// <param name="activationData">Task's activation data.</param>
        /// <param name="scheduleInformation"></param>
        /// <exception cref="ArgumentNullException"><paramref name="activationData"/> is <see langword="null" />.</exception>
        /// <remarks>This constructor should be used only for new tasks entities.</remarks>
        public TaskModel(Int64 queueId, ActivationData activationData, ScheduleInformation scheduleInformation) : base(queueId)
        {
            if (activationData == null)
            {
                throw new ArgumentNullException("activationData");
            }
            if (scheduleInformation == null)
            {
                throw new ArgumentNullException(nameof(scheduleInformation));
            }

            ActivationData      = activationData;
            ScheduleInformation = scheduleInformation;
        }