Class: UU::OperationRegistry::MessageBus

Inherits:
BaseMethods
  • Object
show all
Defined in:
lib/uu/operation_registry/message_bus.rb

Overview

Message bus is a logical set of queues.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session = nil) ⇒ MessageBus

Creates a new instance of MessageBus.

Parameters:

  • session (UU::OS::Security::Session) (defaults to: nil)

    Session to use for remote calls.



18
19
20
# File 'lib/uu/operation_registry/message_bus.rb', line 18

def initialize(session = nil)
  super
end

Class Method Details

.allocate_queue_pairs(msg_bus_repository_uri, attributes = {}) ⇒ Array<String>

Allocates new queue pairs. This method is a convenience shortcut for the #allocate_queue_pairs instance method.

Returns:

  • (Array<String>)

See Also:



147
148
149
# File 'lib/uu/operation_registry/message_bus.rb', line 147

def self.allocate_queue_pairs(msg_bus_repository_uri, attributes = {})
  self.new(UU::OS::Security::Session.current_session).allocate_queue_pairs(msg_bus_repository_uri, attributes)
end

.create(msg_bus_repository_uri, attributes) ⇒ UU::OS::UESURI

Creates a new message bus. This method is a convenience shortcut for the #create instance method.

Parameters:

  • msg_bus_repository_uri (String, UU::OS::UESURI)

    Message bus repository URI.

  • attributes (Hash)

    Message bus attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created message bus.



# File 'lib/uu/operation_registry/message_bus.rb', line 44

.delete(msg_bus_uri) ⇒ void

This method returns an undefined value.

Deletes the specified message bus from the registry. This method is a convenience shortcut for the #delete instance method.

Parameters:

  • msg_bus_uri (String, UU::OS::UESURI)

    Message bus URI.



# File 'lib/uu/operation_registry/message_bus.rb', line 94

.get_attributes(msg_bus_uri) ⇒ Hash

Gets the attributes of the message bus specified by message bus URI and returns its detail. This method is a convenience shortcut for the #get_attributes instance method.

Parameters:

  • msg_bus_uri (String, UU::OS::UESURI)

    Message bus URI.

Returns:

  • (Hash)

    Message bus attributes.



# File 'lib/uu/operation_registry/message_bus.rb', line 58

.get_message_bus_list(msg_bus_repository_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>

Returns list of message buses. This method is a convenience shortcut for the #get_message_bus_list instance method.

Returns:

  • (UU::OS::Persistence::PagedResult<Hash>)

    Paged result set.

See Also:



125
126
127
# File 'lib/uu/operation_registry/message_bus.rb', line 125

def self.get_message_bus_list(msg_bus_repository_uri, criteria = {})
  self.new(UU::OS::Security::Session.current_session).get_message_bus_list(msg_bus_repository_uri, criteria)
end

.release_queue_pairs(msg_bus_repository_uri, attributes = {}) ⇒ void

This method returns an undefined value.

Releases allocated queue pairs. This method is a convenience shortcut for the #release_queue_pairs instance method.



169
170
171
# File 'lib/uu/operation_registry/message_bus.rb', line 169

def self.release_queue_pairs(msg_bus_repository_uri, attributes = {})
  self.new(UU::OS::Security::Session.current_session).release_queue_pairs(msg_bus_repository_uri, attributes)
end

.set_attributes(msg_bus_uri, attributes) ⇒ UU::OS::UESURI

Sets attributes of a message bus. This method is a convenience shortcut for the #set_attributes instance method.

Parameters:

  • msg_bus_uri (String, UU::OS::UESURI)

    Message bus URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated message bus.



# File 'lib/uu/operation_registry/message_bus.rb', line 83

Instance Method Details

#allocate_queue_pairs(msg_bus_repository_uri, attributes = {}) ⇒ Array<String>

Allocates new queue pairs.

Parameters:

  • msg_bus_repository_uri (String, UU::OS::UESURI)

    Message bus repository URI.

  • attributes (Hash) (defaults to: {})

    Attributes.

Options Hash (attributes):

  • count (Fixnum)
  • appDeploymentUri (String, UU::OS::UESURI)

    UESURI of deployment that this message bus belongs to.

Returns:

  • (Array<String>)


138
139
140
# File 'lib/uu/operation_registry/message_bus.rb', line 138

def allocate_queue_pairs(msg_bus_repository_uri, attributes = {})
  @client.invoke(:allocateQueuePairs, msg_bus_repository_uri, parameters: attributes)
end

#create(msg_bus_repository_uri, attributes) ⇒ UU::OS::UESURI

Creates a new message bus.

Parameters:

  • msg_bus_repository_uri (String, UU::OS::UESURI)

    Message bus repository URI.

  • attributes (Hash)

    Message bus attributes.

Options Hash (attributes):

  • name (String)

    Message bus name. May be nil.

  • code (String)

    Message bus code. May be nil.

  • labels (Array)

    Array of message bus labels. Supported labels are: DEDICATED May be nil.

  • state (String)

    Message bus state. One from UU::OperationRegistry::MessageBusState. May be nil.

  • queuePairsLimit (Fixnum)

    Message bus capacity. May be nil.

  • description (String)

    Message bus description. May be nil.

  • executorNodeSize (String)

    Node size of executor container. May be nil. Default node size defined in the given message bus repository is used if not specified.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created message bus.



# File 'lib/uu/operation_registry/message_bus.rb', line 22

#delete(msg_bus_uri) ⇒ void

This method returns an undefined value.

Deletes the specified message bus from the registry.

Parameters:

  • msg_bus_uri (String, UU::OS::UESURI)

    Message bus URI.



# File 'lib/uu/operation_registry/message_bus.rb', line 89

#get_attributes(msg_bus_uri) ⇒ Hash

Gets the attributes of the message bus specified by message bus URI and returns its detail.

Parameters:

  • msg_bus_uri (String, UU::OS::UESURI)

    Message bus URI.

Returns:

  • (Hash)

    Message bus attributes.



# File 'lib/uu/operation_registry/message_bus.rb', line 52

#get_message_bus_list(msg_bus_repository_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>

Returns a list of message buses in the given message bus repository. Command does not return all message buses, only a sublist. The list of returned message buses could be filtered using Mongo Query.

Parameters:

  • msg_bus_repository_uri (String, UU::OS::UESURI)

    Message bus repository URI.

  • criteria (Hash) (defaults to: {})

    Criteria for listing message buses.

Options Hash (criteria):

  • query (String)

    Mongo Query to filter the result set. See Mongo Query tutorial. Allowed query filter document fields: code, repositoryUri, tenantUri

  • pageIndex (Fixnum)

    Result set page index.

  • pageSize (Fixnum)

    Result set page size.

Returns:

  • (UU::OS::Persistence::PagedResult<Hash>)

    Paged result set.



116
117
118
# File 'lib/uu/operation_registry/message_bus.rb', line 116

def get_message_bus_list(msg_bus_repository_uri, criteria = {})
  @client.invoke(:getMessageBusList, msg_bus_repository_uri, parameters: criteria)
end

#release_queue_pairs(msg_bus_repository_uri, attributes = {}) ⇒ void

This method returns an undefined value.

Releases allocated queue pairs.

Parameters:

  • msg_bus_repository_uri (String, UU::OS::UESURI)

    Message bus repository URI.

  • attributes (Hash) (defaults to: {})

    Attributes.

Options Hash (attributes):

  • count (Fixnum)
  • appDeploymentUri (String, UU::OS::UESURI)

    UESURI of deployment that this message bus belongs to.



160
161
162
# File 'lib/uu/operation_registry/message_bus.rb', line 160

def release_queue_pairs(msg_bus_repository_uri, attributes = {})
  @client.invoke(:releaseQueuePairs, msg_bus_repository_uri, parameters: attributes)
end

#set_attributes(msg_bus_uri, attributes) ⇒ UU::OS::UESURI

Sets attributes of a message bus.

Parameters:

  • msg_bus_uri (String, UU::OS::UESURI)

    Message bus URI.

  • attributes (Hash)

    Message bus attributes.

Options Hash (attributes):

  • name (String)

    Message bus name. May be nil.

  • code (String)

    Message bus code. May be nil.

  • labels (Array)

    Array of message bus labels. Supported labels are: DEDICATED May be nil.

  • state (String)

    Message bus state. One from UU::OperationRegistry::MessageBusState. May be nil.

  • description (String)

    Message bus description. May be nil.

  • executorNodeSize (String)

    Node size of executor container. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated message bus.



# File 'lib/uu/operation_registry/message_bus.rb', line 65