Class: RestFtpDaemon::Notification

Inherits:
Object
  • Object
show all
Includes:
LoggerHelper
Defined in:
lib/rest-ftp-daemon/notification.rb

Overview

Handles a notification POST using a dedicated thread

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, params) ⇒ Notification

Returns a new instance of Notification.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rest-ftp-daemon/notification.rb', line 16

def initialize url, params
  # Remember params
  @url = url
  @params = params

  # Generate a random key
  @id = Helpers.identifier(NOTIFY_IDENTIFIER_LEN)
  @jid = nil

  # Logger
  @logger = RestFtpDaemon::LoggerPool.instance.get :notify

  # Handle the notification
  log_info "initialized [#{@url}]"
  process
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



10
11
12
# File 'lib/rest-ftp-daemon/notification.rb', line 10

def error
  @error
end

#jobObject

Returns the value of attribute job.



14
15
16
# File 'lib/rest-ftp-daemon/notification.rb', line 14

def job
  @job
end

#job_idObject

Returns the value of attribute job_id.



8
9
10
# File 'lib/rest-ftp-daemon/notification.rb', line 8

def job_id
  @job_id
end

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/rest-ftp-daemon/notification.rb', line 6

def logger
  @logger
end

#messageObject

Returns the value of attribute message.



11
12
13
# File 'lib/rest-ftp-daemon/notification.rb', line 11

def message
  @message
end

#signalObject

Returns the value of attribute signal.



9
10
11
# File 'lib/rest-ftp-daemon/notification.rb', line 9

def signal
  @signal
end

#statusObject

Returns the value of attribute status.



12
13
14
# File 'lib/rest-ftp-daemon/notification.rb', line 12

def status
  @status
end

#urlObject

Returns the value of attribute url.



13
14
15
# File 'lib/rest-ftp-daemon/notification.rb', line 13

def url
  @url
end