public void initialize() throws Exception {
if (this.caCertPath == null) {
final String msg = "No CA certificate path was provided.";
logger.error(msg); // hard to see amidst JNDI problem
throw new ContextBrokerException(msg);
}
logger.debug("caCertPath provided: '" + this.caCertPath + "'");
if (this.caKeyPath == null) {
final String msg = "No CA key path was provided.";
logger.error(msg); // hard to see amidst JNDI problem
throw new ContextBrokerException(msg);
}
logger.debug("caKeyPath provided: '" + this.caKeyPath + "'");
File cert = new File(this.caCertPath);
if (!cert.isAbsolute()) {
final String msg = "Configured CA certificate path ('" +
this.caCertPath + "') is not an absolute path.";
logger.error(msg); // hard to see amidst JNDI problem
throw new ContextBrokerException(msg);
}
if (!cert.canRead()) {
final String msg = "Configured CA certificate path ('" +
this.caCertPath + "') can not be read.";
logger.error(msg); // hard to see amidst JNDI problem
throw new ContextBrokerException(msg);
}
cert = new File(this.caKeyPath);
if (!cert.isAbsolute()) {
final String msg = "Configured CA key path ('" + this.caKeyPath +
"') is not an absolute path.";
logger.error(msg); // hard to see amidst JNDI problem
throw new ContextBrokerException(msg);
}
if (!cert.canRead()) {
final String msg = "Configured CA key path ('" +
this.caKeyPath + "') can not be read.";
logger.error(msg); // hard to see amidst JNDI problem
throw new ContextBrokerException(msg);
}
final GlobusCredential caGlobusCred =
new GlobusCredential(this.caCertPath, this.caKeyPath);