Class: SystemControllerBase

Inherits:
ApplicationControllerBase show all
Includes:
ActionView::Helpers::DateHelper
Defined in:
lib/mrpin/controllers/system_controller_base.rb

Instance Method Summary collapse

Constructor Details

#initializeSystemControllerBase

Returns a new instance of SystemControllerBase.



85
86
87
# File 'lib/mrpin/controllers/system_controller_base.rb', line 85

def initialize
  super
end

Instance Method Details

#cleanup_dataObject



136
137
138
139
140
141
142
143
144
145
146
# File 'lib/mrpin/controllers/system_controller_base.rb', line 136

def cleanup_data
  result = nil

  begin
    result = get_response_ok(AppInfo.instance.cleanup_data)
  rescue Exception => e
    result = get_response_error(e)
  end

  render json: result
end

#downloadObject



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/mrpin/controllers/system_controller_base.rb', line 149

def download
  begin
    url = get_url_for_download(params['type'])

    assert(!url.nil?, "url is not specified for param #{params['type']}")

    redirect_to(url)

  rescue Exception => e
    result = get_response_error(e)

    render json: result
  end

end

#gc_statObject



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/mrpin/controllers/system_controller_base.rb', line 68

def gc_stat
  result = nil

  begin
    result = get_response_ok(GC.stat)
  rescue Exception => e
    result = get_response_error(e)
  end

  render json: result
end

#generate_client_jsonObject



189
190
191
# File 'lib/mrpin/controllers/system_controller_base.rb', line 189

def generate_client_json
  call_in_all_managers('generate_client_json')
end

#infoObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/mrpin/controllers/system_controller_base.rb', line 90

def info
  result = nil

  begin
    response = get_system_info

    result = get_response_ok(response)

  rescue Exception => e
    result = get_response_error(e)
  end

  render json: result
end

#invalidate_cacheObject



194
195
196
# File 'lib/mrpin/controllers/system_controller_base.rb', line 194

def invalidate_cache
  call_in_all_managers('invalidate_cache')
end

#send_notificationsObject



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/mrpin/controllers/system_controller_base.rb', line 117

def send_notifications
  result = nil

  begin
    manager_notifications = AppInfo.instance.manager_notifications

    unless manager_notifications.nil?
      manager_notifications.send_notifications
    end

    result = get_response_ok
  rescue Exception => e
    result = get_response_error(e)
  end

  render json: result
end