Imports CharterDotCom.CommonEntities.Library.Enumerations


<Serializable()> _
Public Class Notification
  Implements INotification

  Private actionItem As NotificationAction
  Private nSource As String = String.Empty
  Private toItem As String = String.Empty
  Private fromItem As String = String.Empty
  Private rCode As NotificationCode
  Private rSeverity As NotificationSeverity

  Public Sub New()

  End Sub

  Public Sub New(ByVal action As NotificationAction, ByVal source As String, ByVal resultcode As NotificationCode)
    actionItem = action
    nSource = source
    rCode = resultcode
  End Sub

  Public ReadOnly Property Action() As NotificationAction Implements INotification.Action
    Get
      Return actionItem
    End Get
  End Property

  Public ReadOnly Property Source() As String Implements INotification.Source
    Get
      Return nSource
    End Get
  End Property

  Public ReadOnly Property ResultCode() As NotificationCode Implements INotification.ResultCode
    Get
      Return rCode
    End Get
  End Property

  Public ReadOnly Property FromTarget() As String Implements INotification.FromTarget
    Get
      Return fromItem
    End Get
  End Property

  Public ReadOnly Property ToTarget() As String Implements INotification.ToTarget
    Get
      Return toItem
    End Get
  End Property

  Public ReadOnly Property Severity() As NotificationSeverity Implements INotification.Severity
    Get
      Return rSeverity
    End Get
  End Property


  Public Sub ClearMessage()
    nSource = String.Empty
    fromItem = String.Empty
    toItem = String.Empty
  End Sub

  Public Sub SetMessage(ByVal action As NotificationAction, ByVal source As String, ByVal fItem As String, ByVal tItem As String, ByVal Code As String, ByVal severity As NotificationSeverity)
    actionItem = action
    nSource = source
    fromItem = fItem
    toItem = tItem
    rCode = rCode
    rSeverity = severity
  End Sub

  Public Sub SetMessageInput(ByVal action As NotificationAction, ByVal source As String)
    actionItem = action
    nSource = source
  End Sub

  Public Sub SetMessageResult(ByVal fItem As String, ByVal tItem As String, ByVal code As NotificationCode, ByVal severity As NotificationSeverity)
    fromItem = fItem
    toItem = tItem
    rCode = code
    rSeverity = severity
  End Sub

End Class
