public void init() throws AxisFault, ServerException {
try {
boolean isInitial = false;
IdentityPersistenceManager dbAdmin = IdentityPersistenceManager
.getPersistanceManager();
if (dbAdmin.getParameter(IdentityTenantUtil.getRegistry(null,null), IdentityConstants.PARAM_CARD_NAME).getValue() == null) {
isInitial = true;
}
CryptoUtil.getDefaultCryptoUtil();
IdentityProviderUtil.setIntial(isInitial);
if(!isKeyStoreExisting(IdentityUtil.getProperty(IdentityConstants.ServerConfig.USER_TRUSTED_RP_STORE_LOCATION))
|| "true".equals(System.getProperty("identity.server.reload.userrp"))){
addKeyStores();
log.info("userRP.jks is reloaded.");
}
if (isInitial) {
addParameters(IdentityTenantUtil.getRegistry(null,null));
// Add the globally trusted relying party
RelyingPartyDO rp = new RelyingPartyDO();
ServerConfiguration serverConfig = ServerConfiguration.getInstance();
if (serverConfig.getFirstProperty("HostName") != null) {
rp.setHostName(serverConfig.getFirstProperty("HostName"));
rp.setAlias(serverConfig.getFirstProperty("HostName"));
} else {
rp.setHostName("localhost");
rp.setAlias("localhost");
}
rp.setAlias(serverConfig.getFirstProperty("Security.KeyStore.KeyAlias"));
dbAdmin.createGloabllyTrustedRelyingParty(IdentityTenantUtil.getRegistry(null,null), rp);
}
} catch (Exception e) {
throw new AxisFault(e.getMessage(), e);
}