Send policy query message 89/6189/1
authorsubhash kumar singh <subh.singh@samsung.com>
Tue, 1 Jun 2021 14:08:57 +0000 (19:38 +0530)
committersubhash kumar singh <subh.singh@samsung.com>
Tue, 1 Jun 2021 14:12:05 +0000 (19:42 +0530)
Send policy query message to A1-mediator to get policy instance list.

Change-Id: Ib11aa4ab49c266a1def7c4171b743e841fda21d3
Signed-off-by: subhash kumar singh <subh.singh@samsung.com>
config/uta_rtg.rt
hwApp.go

index 2b08655..14d77aa 100755 (executable)
@@ -1,4 +1,6 @@
 newrt|start
 rte|10004|localhost:4560
 rte|10005|localhost:4591
+rte|20011|service-ricplt-a1mediator-rmr.ricplt:4562
+rte|20012|service-ricplt-a1mediator-rmr.ricplt:4562
 newrt|end
index 2f82210..dc4e4f7 100755 (executable)
--- a/hwApp.go
+++ b/hwApp.go
@@ -27,6 +27,29 @@ import (
 type HWApp struct {
 }
 
+var (
+       A1_POLICY_QUERY      = 20013
+       POLICY_QUERY_PAYLOAD = "{\"policy_type_id\":20000}"
+)
+
+func (e *HWApp) sendPolicyQuery() {
+       xapp.Logger.Info("Invoked method to send  policy query message")
+
+       // prepare and send policy query message over RMR
+       rmrParams := new(xapp.RMRParams)
+       rmrParams.Mtype = A1_POLICY_QUERY // A1_POLICY_QUERY
+       rmrParams.Payload = []byte(POLICY_QUERY_PAYLOAD)
+
+       // send rmr message
+       flg := xapp.Rmr.SendMsg(rmrParams)
+
+       if flg {
+               xapp.Logger.Info("Successfully sent policy query message over RMR")
+       } else {
+               xapp.Logger.Info("Failed to send policy query message over RMR")
+       }
+}
+
 func (e *HWApp) ConfigChangeHandler(f string) {
        xapp.Logger.Info("Config file changed")
 }