//****************************************************************************************************** // ServiceResponse.cs - Gbtc // // Copyright © 2012, Grid Protection Alliance. All Rights Reserved. // // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See // the NOTICE file distributed with this work for additional information regarding copyright ownership. // The GPA licenses this file to you under the Eclipse Public License -v 1.0 (the "License"); you may // not use this file except in compliance with the License. You may obtain a copy of the License at: // // http://www.opensource.org/licenses/eclipse-1.0.php // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // // Code Modification History: // ---------------------------------------------------------------------------------------------------- // 08/29/2006 - Pinal C. Patel // Generated original version of source code. // 09/30/2008 - J. Ritchie Carroll // Converted to C#. // 03/09/2009 - Pinal C. Patel // Edited code comments. // 09/14/2009 - Stephen C. Wills // Added new header and license agreement. // 12/20/2012 - Starlynn Danyelle Gilliam // Modified Header. // //****************************************************************************************************** using System; using System.Collections.Generic; namespace GSF.ServiceProcess { /// /// Represents a response sent by the to a from the . /// /// /// /// [Serializable] public class ServiceResponse { #region [ Members ] // Fields private string m_type; private string m_message; private readonly List m_attachments; #endregion #region [ Constructors ] /// /// Initializes a new instance of the class. /// public ServiceResponse() : this("UNDETERMINED") { } /// /// Initializes a new instance of the class. /// /// Type of the in plain text. public ServiceResponse(string type) : this(type, "") { } /// /// Initializes a new instance of the class. /// /// Type of the in plain-text. /// Message associated with the . public ServiceResponse(string type, string message) { m_type = type.ToUpper(); m_message = message; m_attachments = new List(); } #endregion #region [ Properties ] /// /// Gets or sets the plain-text type of the . /// /// The value being assigned is either a null or empty string. public string Type { get { return m_type; } set { if (string.IsNullOrEmpty(value)) throw new ArgumentNullException("value"); m_type = value.ToUpper(); } } /// /// Gets or sets the palin-text message associated with the . /// public string Message { get { return m_message; } set { m_message = value; } } /// /// Gets a list of serializable attachments of the . /// public List Attachments { get { return m_attachments; } } #endregion } }