Parent

OpenShift::ActiveMQPlugin

Public Class Methods

new() click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 9
def initialize
  @topic = Rails.application.config.routing_activemq[:topic]
  @conn = Stomp::Connection.open Rails.application.config.routing_activemq[:username],
                                 Rails.application.config.routing_activemq[:password],
                                 Rails.application.config.routing_activemq[:host],
                                 Rails.application.config.routing_activemq[:port],
                                 true
end

Public Instance Methods

notify_add_alias(app, alias_str) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 46
def notify_add_alias(app, alias_str)
  msg = {
    :action => :add_alias,
    :app_name => app.name,
    :namespace => app.domain.namespace,
    :alias => alias_str
  }
  send_msg msg.to_yaml
end
notify_create_application(app) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 66
def notify_create_application(app)
  msg = {
    :action => :create_application,
    :app_name => app.name,
    :namespace => app.domain.namespace,
  }
  send_msg msg.to_yaml
end
notify_create_public_endpoint(app, endpoint_name, public_ip, public_port, protocols, types, mappings) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 84
def notify_create_public_endpoint(app, endpoint_name, public_ip, public_port, protocols, types, mappings)
  msg = {
    :action => :add_gear,
    :app_name => app.name,
    :namespace => app.domain.namespace,
    :public_port_name => endpoint_name,
    :public_address => public_ip,
    :public_port => public_port,
    :protocols => protocols,
    :types => types,
    :mappings => mappings
  }
  send_msg msg.to_yaml
end
notify_delete_application(app) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 75
def notify_delete_application(app)
  msg = {
    :action => :delete_application,
    :app_name => app.name,
    :namespace => app.domain.namespace,
  }
  send_msg msg.to_yaml
end
notify_delete_public_endpoint(app, public_ip, public_port) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 99
def notify_delete_public_endpoint(app, public_ip, public_port)
  msg = {
    :action => :delete_gear,
    :app_name => app.name,
    :namespace => app.domain.namespace,
    :public_address => public_ip,
    :public_port => public_port
  }
  send_msg msg.to_yaml
end
notify_remove_alias(app, alias_str) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 56
def notify_remove_alias(app, alias_str)
  msg = {
    :action => :remove_alias,
    :app_name => app.name,
    :namespace => app.domain.namespace,
    :alias => alias_str
  }
  send_msg msg.to_yaml
end
notify_ssl_cert_add(app, fqdn, ssl_cert, pvt_key, passphrase) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 23
def notify_ssl_cert_add(app, fqdn, ssl_cert, pvt_key, passphrase)
  msg = {
    :action => :add_ssl,
    :app_name => app.name,
    :namespace => app.domain.namespace,
    :alias => fqdn,
    :ssl => ssl_cert,
    :private_key => pvt_key,
    :pass_phrase => passphrase
  }
  send_msg msg.to_yaml
end
notify_ssl_cert_remove(app, fqdn) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 36
def notify_ssl_cert_remove(app, fqdn)
  msg = {
    :action => :remove_ssl,
    :app_name => app.name,
    :namespace => app.domain.namespace,
    :alias => fqdn
  }
  send_msg msg.to_yaml
end
send_msg(msg) click to toggle source
# File lib/openshift/activemq_routing_plugin.rb, line 18
def send_msg(msg)
  # msg = encrypt_msg(msg, key)
  @conn.publish @topic, msg
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.