* @param properties - properties with values
*/
public void addBrokerConfiguration(String brokerName, String brokerType,
BrokerProperty[] properties)
throws BrokerManagerAdminServiceException {
BrokerManagerHolder brokerManager = BrokerManagerHolder.getInstance();
BrokerConfiguration brokerConfiguration = new BrokerConfiguration();
brokerConfiguration.setName(brokerName);
brokerConfiguration.setType(brokerType);
int tenantId = CarbonContext.getCurrentContext().getTenantId();
// add broker properties
for (BrokerProperty brokerProperty : properties) {
brokerConfiguration.addProperty(brokerProperty.getKey(), brokerProperty.getValue());
}
// add broker configuration
try {
brokerManager.getBrokerManagerService().addBrokerConfiguration(brokerConfiguration, tenantId);
testBrokerConfiguration(brokerName);
} catch (BMConfigurationException e) {
throw new BrokerManagerAdminServiceException("Error in adding broker Configuration", e);
}
}