Sha256: 8b6cdfe7c035f3b6eb9b178524fd5444d7a59ec0b8479be5ab9389673c003209

Contents?: true

Size: 1.39 KB

Versions: 54

Compression:

Stored size: 1.39 KB

Contents

# This file is part of CPEE.
#
# CPEE is free software: you can redistribute it and/or modify it under the terms
# of the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# CPEE (file COPYING in the main directory).  If not, see
# <http://www.gnu.org/licenses/>.

module CPEE

  module Message

    def self::send(type, event, cpee, instance, instance_uuid, instance_name, content={}, backend)
      topic = ::File::dirname(event)
      name = ::File::basename(event)
      backend.publish(type.to_s + ':' + event,
        instance.to_s + ' ' +
        JSON::generate(
          { 'cpee' => cpee,
            'instance-url' => File.join(cpee,instance.to_s),
            'instance-uuid' => instance_uuid,
            'instance-name' => instance_name,
            'instance' => instance,
            'topic' => topic,
            'type' => type,
            'name' => name,
            'timestamp' =>  Time.now.xmlschema(3),
            'content' => content
          }
        )
      )
    end

  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
cpee-2.1.29 lib/cpee/message.rb
cpee-2.1.27 lib/cpee/message.rb
cpee-2.1.26 lib/cpee/message.rb
cpee-2.1.25 lib/cpee/message.rb
cpee-2.1.24 lib/cpee/message.rb
cpee-2.1.23 lib/cpee/message.rb
cpee-2.1.22 lib/cpee/message.rb
cpee-2.1.21 lib/cpee/message.rb
cpee-2.1.20 lib/cpee/message.rb
cpee-2.1.19 lib/cpee/message.rb
cpee-2.1.17 lib/cpee/message.rb
cpee-2.1.16 lib/cpee/message.rb
cpee-2.1.15 lib/cpee/message.rb
cpee-2.1.14 lib/cpee/message.rb
cpee-2.1.13 lib/cpee/message.rb
cpee-2.1.12 lib/cpee/message.rb
cpee-2.1.11 lib/cpee/message.rb
cpee-2.1.10 lib/cpee/message.rb
cpee-2.1.9 lib/cpee/message.rb
cpee-2.1.8 lib/cpee/message.rb