Class: UU::OperationRegistry::MessageBusRepository

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

Overview

Message bus repository represents a cluster of messaging servers.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session = nil) ⇒ MessageBusRepository

Creates a new instance of MessageBusRepository.

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_repository.rb', line 18

def initialize(session = nil)
  super
end

Class Method Details

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

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

Parameters:

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

    Resource pool URI.

  • attributes (Hash)

    Message bus repository attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created message bus repository.



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

.delete(msg_bus_repository_uri) ⇒ void

This method returns an undefined value.

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

Parameters:

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

    Message bus repository URI.



# File 'lib/uu/operation_registry/message_bus_repository.rb', line 132

.get_attributes(msg_bus_repository_uri) ⇒ Hash

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

Parameters:

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

    Message bus repository URI.

Returns:

  • (Hash)

    Message bus repository attributes.



# File 'lib/uu/operation_registry/message_bus_repository.rb', line 79

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

Returns list of message bus repositories. This method is a convenience shortcut for the #get_message_bus_repository_list instance method.

Returns:

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

    Paged result set.

See Also:



167
168
169
# File 'lib/uu/operation_registry/message_bus_repository.rb', line 167

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

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

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

Parameters:

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

    Message bus repository URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated message bus repository.



# File 'lib/uu/operation_registry/message_bus_repository.rb', line 119

Instance Method Details

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

Creates a new message bus repository.

Examples:

client = UU::OperationRegistry::MessageBusRepository.new(UU::OS::Security::Session.current_session)
msg_bus_repository_uri = client.create(resource_pool_uri,
  name: "Message Bus Repository 01",
  code: "MSG_BUS_REPOSITORY_01",
  executorImageName: "job_executor_cmd:2.0.0",
  executorNodeSize: "G1_M",
  dispatcherHostnames: ["10.30.0.163"],
  serverHostnames: [{hostname: "10.30.0.163", port: 5302, jmxPort: 12345}],
  gatewayHostnames: ["10.30.4.4"],
  gatewayUrl: "http://async.internal.plus4u.net",
  callbackGatewayUrl: "https://cmd.plus4u.net"
)

Parameters:

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

    Resource pool URI.

  • attributes (Hash)

    Message bus repository attributes.

Options Hash (attributes):

  • name (String)

    Message bus repository name. May be nil.

  • code (String)

    Message bus repository code. May be nil.

  • description (String)

    Message bus repository description. May be nil.

  • executorImageName (String)

    Name of node image for executor containers.

  • executorNodeSize (String)

    Default node size of executor container. Each message bus may optionally use another node size if needed.

  • dispatcherHostnames (Array<String>)

    Host names or IP addresses of UESAsyncCommandExecutor (Tomcat) servers for this message bus repository.

  • serverHostnames (Array<Hash>)

    Addresses and ports (format is {hostname: address, jmxPort: port, port: port where address is either host name or IP) of JBoss servers.

  • gatewayHostnames (Array<String>)

    Addresses of Docker hosts where async command gateways for this message bus repository are deployed.

  • gatewayUrl (String)

    Base URL of async command gateway.

  • callbackGatewayUrl (String)

    Base URL of command gateway.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created message bus repository.



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

#delete(msg_bus_repository_uri) ⇒ void

This method returns an undefined value.

Deletes the specified message bus repository from the registry.

Parameters:

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

    Message bus repository URI.



# File 'lib/uu/operation_registry/message_bus_repository.rb', line 126

#get_attributes(msg_bus_repository_uri) ⇒ Hash

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

Parameters:

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

    Message bus repository URI.

Returns:

  • (Hash)

    Message bus repository attributes.



# File 'lib/uu/operation_registry/message_bus_repository.rb', line 72

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

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

Parameters:

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

    Message bus repository URI.

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

    Criteria for listing message bus repositories.

Options Hash (criteria):

  • query (String)

    Mongo Query to filter the result set. See Mongo Query tutorial. Allowed query filter document fields:

    code, resourcePoolUri, executorImageName, executorNodeSize,
    dispatcherHostnames, serverHostnames, gatewayHostnames, 
    gatewayUrl, callbackGatewayUrl, tenantUri
  • pageIndex (Fixnum)

    Result set page index.

  • pageSize (Fixnum)

    Result set page size.

Returns:

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

    Paged result set.



158
159
160
# File 'lib/uu/operation_registry/message_bus_repository.rb', line 158

def get_message_bus_repository_list(resource_pool_uri, criteria = {})
  @client.invoke(:getMessageBusRepositoryList, resource_pool_uri, parameters: criteria)
end

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

Sets attributes of a message bus repository.

Parameters:

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

    Message bus repository URI.

  • attributes (Hash)

    Message bus repository attributes.

Options Hash (attributes):

  • name (String)

    Message bus repository name. May be nil.

  • code (String)

    Message bus repository code. May be nil.

  • description (String)

    Message bus repository description. May be nil.

  • executorImageName (String)

    Name of node image for executor containers. May be nil.

  • executorNodeSize (String)

    Default node size of executor container. Each message bus may optionally use another node size if needed. May be nil.

  • dispatcherHostnames (Array<String>)

    Host names or IP addresses of UESAsyncCommandExecutor (Tomcat) servers for this message bus repository. May be nil.

  • serverHostnames (Array<Hash>)

    Addresses and ports (format is {hostname: address, jmxPort: port, port: port where address is either host name or IP) of JBoss servers.

  • gatewayHostnames (Array<String>)

    Addresses of Docker hosts where async command gateways for this message bus repository are deployed. May be nil.

  • gatewayUrl (String)

    Base URL of async command gateway. May be nil.

  • callbackGatewayUrl (String)

    Base URL of command gateway. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated message bus repository.



# File 'lib/uu/operation_registry/message_bus_repository.rb', line 88