| Line 63... |
Line 63... |
| 63 |
private String thinkWalnutDigitalRechargePassword;
|
63 |
private String thinkWalnutDigitalRechargePassword;
|
| 64 |
|
64 |
|
| 65 |
@Value("${think.walnut.digital.recharge.auth.key}")
|
65 |
@Value("${think.walnut.digital.recharge.auth.key}")
|
| 66 |
private String thinkWalnutDigitalRechargeAuthKey;
|
66 |
private String thinkWalnutDigitalRechargeAuthKey;
|
| 67 |
|
67 |
|
| 68 |
|
- |
|
| 69 |
@Autowired
|
68 |
@Autowired
|
| 70 |
private OxigenRechargeProviderService oxigenRechargeProviderService;
|
69 |
private OxigenRechargeProviderService oxigenRechargeProviderService;
|
| 71 |
|
70 |
|
| 72 |
@Autowired
|
71 |
@Autowired
|
| 73 |
private ThinkWalnutDigitalRechargeProviderService thinkWalnutDigitalRechargeProviderService;
|
72 |
private ThinkWalnutDigitalRechargeProviderService thinkWalnutDigitalRechargeProviderService;
|
| 74 |
|
73 |
|
| 75 |
@Autowired
|
74 |
@Autowired
|
| 76 |
private RestClient restClient;
|
75 |
private RestClient restClient;
|
| 77 |
|
76 |
|
| 78 |
@Autowired
|
77 |
@Autowired
|
| 79 |
ItemRepository itemRepository;
|
78 |
ItemRepository itemRepository;
|
| 80 |
|
79 |
|
| 81 |
@Autowired
|
80 |
@Autowired
|
| 82 |
private RechargeService rechargeService;
|
81 |
private RechargeService rechargeService;
|
| 83 |
|
82 |
|
| 84 |
@Autowired
|
83 |
@Autowired
|
| 85 |
private WriteToPropertiesFile writeToPropertiesFile;
|
84 |
private WriteToPropertiesFile writeToPropertiesFile;
|
| 86 |
|
- |
|
| 87 |
String nagiosPropertiesFile="/var/log/services/nagios-Monitoring.properties";
|
- |
|
| 88 |
|
85 |
|
| - |
|
86 |
String nagiosPropertiesFile = "/var/log/services/nagios-Monitoring.properties";
|
| 89 |
|
87 |
|
| 90 |
public void reportSmsCount() throws Throwable {
|
88 |
public void reportSmsCount() throws Throwable {
|
| 91 |
String htmlpage;
|
89 |
String htmlpage;
|
| 92 |
int currentSmsCount = 0;
|
90 |
int currentSmsCount = 0;
|
| 93 |
LinkedHashMap<String,String> propertiesDetails = new LinkedHashMap<>();
|
91 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
| 94 |
String uri = "/MessagingGateway/LoginAction";
|
92 |
String uri = "/MessagingGateway/LoginAction";
|
| 95 |
Map<String, String> params = new HashMap<>();
|
93 |
Map<String, String> params = new HashMap<>();
|
| 96 |
params.put("user", "srlsaholic");
|
94 |
params.put("user", "srlsaholic");
|
| 97 |
params.put("password", "sr18mar");
|
95 |
params.put("password", "sr18mar");
|
| 98 |
String response = restClient.post(SchemeType.HTTP, "103.15.179.45", 8085, uri, params, new HashMap<>());
|
96 |
String response = restClient.post(SchemeType.HTTP, "103.15.179.45", 8085, uri, params, new HashMap<>());
|
| Line 104... |
Line 102... |
| 104 |
response.substring(response.indexOf("Current Balance"), response.indexOf("</div>")).length())
|
102 |
response.substring(response.indexOf("Current Balance"), response.indexOf("</div>")).length())
|
| 105 |
.trim();
|
103 |
.trim();
|
| 106 |
/// System.out.println(htmlpage);
|
104 |
/// System.out.println(htmlpage);
|
| 107 |
currentSmsCount = Integer.parseInt(htmlpage);
|
105 |
currentSmsCount = Integer.parseInt(htmlpage);
|
| 108 |
log.info("Got successfully parsed {}", currentSmsCount);
|
106 |
log.info("Got successfully parsed {}", currentSmsCount);
|
| 109 |
propertiesDetails.put("currentSmsCount",Integer.toString(currentSmsCount));
|
107 |
propertiesDetails.put("currentSmsCount", Integer.toString(currentSmsCount));
|
| 110 |
writeToPropertiesFile.saveParamChanges(propertiesDetails,nagiosPropertiesFile);
|
108 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosPropertiesFile);
|
| 111 |
|
- |
|
| 112 |
|
109 |
|
| 113 |
}
|
110 |
}
|
| 114 |
|
111 |
|
| 115 |
}
|
112 |
}
|
| 116 |
|
113 |
|
| 117 |
public void currentOxygenBalance() throws ProfitMandiBusinessException, IOException
|
114 |
public void currentOxygenBalance() throws ProfitMandiBusinessException, IOException {
|
| 118 |
{
|
- |
|
| 119 |
LinkedHashMap<String,String> propertiesDetails = new LinkedHashMap<>();
|
115 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
| 120 |
float oxygenBalance =oxigenRechargeProviderService.doCheckBalanceRequest(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey);
|
116 |
float oxygenBalance = oxigenRechargeProviderService.doCheckBalanceRequest(oxigenRechargeTransactionUrl,
|
| - |
|
117 |
oxigenRechargeAuthKey);
|
| 121 |
log.info("Got oxygenBalance successfully parsed {}",oxygenBalance);
|
118 |
log.info("Got oxygenBalance successfully parsed {}", oxygenBalance);
|
| 122 |
propertiesDetails.put("oxigenBalance",Float.toString(oxygenBalance));
|
119 |
propertiesDetails.put("oxigenBalance", Float.toString(oxygenBalance));
|
| 123 |
writeToPropertiesFile.saveParamChanges(propertiesDetails,nagiosPropertiesFile);
|
120 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosPropertiesFile);
|
| 124 |
|
- |
|
| 125 |
|
121 |
|
| 126 |
}
|
122 |
}
|
| - |
|
123 |
|
| 127 |
public void currentThinkWalnutBalace() throws ProfitMandiBusinessException, IOException
|
124 |
public void currentThinkWalnutBalace() throws ProfitMandiBusinessException, IOException {
|
| 128 |
{
|
- |
|
| 129 |
LinkedHashMap<String,String> propertiesDetails = new LinkedHashMap<>();
|
125 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
| 130 |
RechargeCredential thinkWalnutDigitalRechargeCredential = new RechargeCredential();
|
126 |
RechargeCredential thinkWalnutDigitalRechargeCredential = new RechargeCredential();
|
| 131 |
thinkWalnutDigitalRechargeCredential.setRechargeUrl(thinkWalnutDigitalRechargeBalanceUrl);
|
127 |
thinkWalnutDigitalRechargeCredential.setRechargeUrl(thinkWalnutDigitalRechargeBalanceUrl);
|
| 132 |
thinkWalnutDigitalRechargeCredential.setRechargeUserName(thinkWalnutDigitalRechargeUserName);
|
128 |
thinkWalnutDigitalRechargeCredential.setRechargeUserName(thinkWalnutDigitalRechargeUserName);
|
| 133 |
thinkWalnutDigitalRechargeCredential.setRechargePassword(thinkWalnutDigitalRechargePassword);
|
129 |
thinkWalnutDigitalRechargeCredential.setRechargePassword(thinkWalnutDigitalRechargePassword);
|
| 134 |
thinkWalnutDigitalRechargeCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
130 |
thinkWalnutDigitalRechargeCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 135 |
float thinkWalnutBalance=thinkWalnutDigitalRechargeProviderService.doCheckBalanceRequest(thinkWalnutDigitalRechargeCredential);
|
131 |
float thinkWalnutBalance = thinkWalnutDigitalRechargeProviderService
|
| - |
|
132 |
.doCheckBalanceRequest(thinkWalnutDigitalRechargeCredential);
|
| 136 |
log.info("ThinkWalnut Balance {}",thinkWalnutBalance);
|
133 |
log.info("ThinkWalnut Balance {}", thinkWalnutBalance);
|
| 137 |
propertiesDetails.put("thinkWalnutBalance", Float.toString(thinkWalnutBalance));
|
134 |
propertiesDetails.put("thinkWalnutBalance", Float.toString(thinkWalnutBalance));
|
| 138 |
writeToPropertiesFile.saveParamChanges(propertiesDetails,nagiosPropertiesFile);
|
135 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosPropertiesFile);
|
| 139 |
|
136 |
|
| 140 |
}
|
137 |
}
|
| 141 |
}
|
138 |
}
|
| 142 |
|
139 |
|