For me it work like this
Open protocol:
protocol = new SolutionControlServerProtocol(new Endpoint(new URI(âtcp://â + host + â:â + port)));
protocol.setMessageHandler(handler);
protocol.addChannelListener(handler);
protocol.open();
Send request get info:
sendRequest(req.requestGetHostInfo(101));
101 - is my host DBID from configuration.
Request code looks like this:
public RequestGetHostInfo requestGetHostInfo(int dbid) {
RequestGetHostInfo req = RequestGetHostInfo.create();
req.setControlObjectId(dbid);
return req;
}
The handler is public class SCSHandler implements MessageHandler, ChannelListener and onChannelOpened { sendRequest(req.requestGetHostInfo(101)); }
log looks like this:
SCS Channel Opened = java.util.EventObject[source=com.genesyslab.platform.management.protocol.SolutionControlServerProtocol@59b3beac@{psdkendpoint - tcp://appsrv6:5010}]
sendRequest req=âRequestGetHostInfoâ (13) attributes:
attr_cfg_obj_id [int] = 101
attr_ref_id [int] = 2
sendRequest refid=2
SCS Message = âEventInfoâ (1) attributes:
attr_obj_live_status [int] = 2
attr_message [str] = âHOST_STATUS_RUNNINGâ
attr_cfg_obj_type [int] = 10 [Host]
attr_cfg_obj_id [int] = 101
attr_ref_id [int] = 2
attr_client [int] = 19
The RequestSubscribe is not required if you want to use RequestGetHostInfo only. RequestSubscribe will allow you to receive unsolicited host status changes.
for me it works and request code is:
public RequestSubscribe requestSubscribe(int dbid, ControlObjectType objType) {
RequestSubscribe req = RequestSubscribe.create();
req.setControlObjectType(objType);
req.setControlObjectId(dbid);
return req;
}
103 is my host dbid, I did switch on/off LCA on that machine and log looks like this.
sendRequest req=âRequestSubscribeâ (15) attributes:
attr_cfg_obj_id [int] = 103
attr_cfg_obj_type [int] = 10 [Host]
attr_ref_id [int] = 2
..on registered
SCS Message = âEventInfoâ (1) attributes:
attr_obj_live_status [int] = 0
attr_message [str] = âRegisteredâ
attr_cfg_obj_type [int] = 10 [Host]
attr_cfg_obj_id [int] = 103
attr_ref_id [int] = 2
attr_client [int] = 19
⌠ON LCA down
SCS Message = âEventInfoâ (1) attributes:
attr_obj_live_status [int] = 3
attr_message [str] = âHOST_STATUS_UNAVAILABLEâ
attr_cfg_obj_type [int] = 10 [Host]
attr_cfg_obj_id [int] = 103
attr_ref_id [int] = 0
.. then lots of disconnected messages
SCS Message = âEventInfoâ (1) attributes:
attr_obj_live_status [int] = 1
attr_message [str] = âHOST_STATUS_DISCONNECTEDâ
attr_cfg_obj_type [int] = 10 [Host]
attr_cfg_obj_id [int] = 103
attr_ref_id [int] = 0
⌠on LCA back UP
SCS Message = âEventInfoâ (1) attributes:
attr_obj_live_status [int] = 2
attr_message [str] = âHOST_STATUS_RUNNINGâ
attr_cfg_obj_type [int] = 10 [Host]
attr_cfg_obj_id [int] = 103
attr_ref_id [int] = 0
Maybe you did use wrong DBID?