OMElement childElement =
AxiomXpathParserUtil.getFirstChildElement(element,
CloudControllerConstants.BAM_SERVER_ELEMENT);
OMElement elt;
DataPublisherConfig config = new DataPublisherConfig();
dataHolder.setDataPubConfig(config);
if (childElement != null) {
// set bam user name
elt =
AxiomXpathParserUtil.getFirstChildElement(childElement,
CloudControllerConstants.BAM_SERVER_ADMIN_USERNAME_ELEMENT);
if (elt != null) {
config.setBamUsername(elt.getText());
}
// set bam password
elt =
AxiomXpathParserUtil.getFirstChildElement(childElement,
CloudControllerConstants.BAM_SERVER_ADMIN_PASSWORD_ELEMENT);
if (elt != null) {
String password = AxiomXpathParserUtil.resolveSecret(rootElt, elt);
if (password == null) {
AxiomXpathParserUtil.plainTextWarn(CloudControllerConstants.BAM_SERVER_ADMIN_PASSWORD_ELEMENT);
password = elt.getText();
}
if (password != null) {
config.setBamPassword(password);
}
}
}
// set cron
childElement = AxiomXpathParserUtil.getFirstChildElement(element, CloudControllerConstants.CRON_ELEMENT);
if (childElement != null) {
config.setDataPublisherCron(childElement.getText());
}
// set cassandra info
childElement = AxiomXpathParserUtil.getFirstChildElement(element, CloudControllerConstants.CASSANDRA_INFO_ELEMENT);
if (childElement != null) {
// set connection url
elt = AxiomXpathParserUtil.getFirstChildElement(childElement, CloudControllerConstants.CONNECTION_URL_ELEMENT);
if (elt != null) {
config.setCassandraConnUrl(elt.getText());
}
// set user name
elt = AxiomXpathParserUtil.getFirstChildElement(childElement, CloudControllerConstants.USER_NAME_ELEMENT);
if (elt != null) {
config.setCassandraUser(elt.getText());
}
// set password
elt = AxiomXpathParserUtil.getFirstChildElement(childElement, CloudControllerConstants.PASSWORD_ELEMENT);
if (elt != null) {
String password = AxiomXpathParserUtil.resolveSecret(rootElt, elt);
if (password == null) {
AxiomXpathParserUtil.plainTextWarn(CloudControllerConstants.PASSWORD_ELEMENT);
password = elt.getText();
}
if (password != null) {
config.setCassandraPassword(password);
}
}
}
}