~ibmcharmers/interface-ibm-mq/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Overview
-----------

This interface layer handles the communication between `IBM MQ` and other charms that tries to communicate by sending each other data in messages through IBM-MQ rather than by calling each other directly.
The provider end of this interface provides the Queue Manager name, Queue Name, IP Address and Port.
The consumer/requires part will be any other charm and can get all the above values viz. Queue Manager name, Queue Name, IP Address and Port to send or receive messages. Here we are describing consumer charm as `ibm-was-base`


Usage
------

#### Provides 
IBM MQ product will provide this interface. This interface layer will set the following states, as appropriate:

 - `{relation_name}.connected`: The relation is established, IBM-MQ is ready to send it's information.
 
	- `get_consumer_hostname()` - returns/gets the consumer hostname to create a channel authentication rule that allows client system to use the channel by entering the MQSC command.

	- `set_mq_details()` - Sets Queue Manager name, Queue Name, IP Address and Port for the connected services. 
						As a Queue Name it sets a filename where MQSC Commands can be edited for further operation. 
						
	
 - `{relation_name}.departed` : The relation has been removed. Any cleanup related to the consumer charm (e.g IBM WebSphere Server) should happen now on the Consumer charm since the consumer is going away.

#### Requires

Consumer charms e.g `IBM WebSphere Application Server` will require this interface to connect to IBM-MQ so that they can get the necessary information about `IBM-MQ` to send/receive messages to other Applications. 
This interface layer will set the following states, as appropriate:

- `{relation_name}.connected` : The consumer charm has been related to a IBM-MQ provider charm. 
	At this point, the charm waits for Provider charm to send details like Queue Manager name, Queue Name, IP Address and Port.
	
	- `set_hostname()` - sets the `hostname`, so that IBM-MQ can get the consumer/client hostname to allow to send/receive messages.

- `{relation_name}.ready` : The consumer charm e.g `IBM WebSphere Application Server` is now ready to access the details of IBM-MQ to send/recieve messages. Such as Queue Manager name, Queue Name, IP Address/hostname and Port.

    - `get_qm_name()` - returns the `QM_Name` that IBM-MQ has created.
	- `get_qname()`  - returns the `QName` that IBM-MQ has created.
	- `get_mq_hostname()` - returns the `hostname` that IBM-MQ has created.
	- `get_mq_port()` - returns the `MQ Port` that IBM-MQ has created.

- `{relation_name}.departed` : The relation has been removed. Any cleanup related to the provider charm should happen now.