use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class ScriptingSchemaStep method perform.
@Override
public void perform() throws UpgradeException {
try {
ServiceConfigManager configManager = new ServiceConfigManager(SCRIPTING_SERVICE_NAME, getAdminToken());
ServiceConfig globalConfig = configManager.getGlobalConfig(null);
upgradeEngineConfiguration(globalConfig);
upgradeScriptConfiguration(globalConfig);
} catch (SMSException | SSOException e) {
UpgradeProgress.reportEnd("upgrade.failed");
DEBUG.error("An error occurred while trying to upgrade the Scripting global settings", e);
throw new UpgradeException("Unable to upgrade Scripting global settings", e);
}
}
use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class ScriptingSchemaStep method initialize.
@Override
public void initialize() throws UpgradeException {
try {
captureScriptedAuthModuleConfiguration();
captureDeviceIdMatchConfiguration();
} catch (ServiceNotFoundException e) {
DEBUG.message("Scripted auth modules not found. Nothing to upgrade", e);
} catch (SMSException | SSOException e) {
DEBUG.error("An error occurred while trying to look for upgradable global Scripting settings", e);
throw new UpgradeException("Unable to retrieve global Scripting settings", e);
}
}
use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class UpgradeResourceTypeStep method getApplicationTypeData.
private Map<String, Set<String>> getApplicationTypeData(String appTypeName) throws UpgradeException {
try {
ServiceConfig config = configManager.getGlobalConfig(null).getSubConfig("applicationTypes");
if (config == null) {
throw new UpgradeException("Expected sub config applicationTypes under service " + EntitlementUtils.SERVICE_NAME);
}
config = config.getSubConfig(appTypeName);
if (config == null) {
throw new UpgradeException("Expected to find application type " + appTypeName);
}
@SuppressWarnings("unchecked") Map<String, Set<String>> attributes = config.getAttributes();
return attributes;
} catch (SSOException | SMSException e) {
throw new UpgradeException("Failed to retrieve application type data for " + appTypeName, e);
}
}
use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class ServerConfiguration method getDefaults.
/**
* Returns the default server properties.
*
* @param ssoToken Single Sign-On Token which is used to access to the
* service management datastore.
* @return the default server properties.
*/
public static Properties getDefaults(SSOToken ssoToken) {
Properties prop = null;
try {
createDefaults(ssoToken);
prop = getServerInstance(ssoToken, DEFAULT_SERVER_CONFIG);
} catch (SSOException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (UnknownPropertyNameException ex) {
// ignore Default values should not have unknown property names.
} catch (SMSException ex) {
// amPlatform does not exist
ResourceBundle res = ResourceBundle.getBundle(SERVER_DEFAULTS);
prop = new Properties();
for (Enumeration i = res.getKeys(); i.hasMoreElements(); ) {
String key = (String) i.nextElement();
prop.setProperty(key, res.getString(key));
}
}
return prop;
}
use of com.iplanet.sso.SSOException in project OpenAM by OpenRock.
the class TokenCleanupRunnable method run.
public void run() {
if (!runCleanup()) {
// no need to run cleanup on this instance
return;
}
CoreTokenUtils.debug.message("TokenCleanupRunnable.run : START");
Set<String> tokenSet = getAllTokens();
Iterator<String> tokens = tokenSet.iterator();
if (CoreTokenUtils.debug.messageEnabled()) {
CoreTokenUtils.debug.message("TokenCleanupRunnable.run : found " + tokenSet.size() + " tokens");
}
while (tokens.hasNext()) {
String token = tokens.next();
String dn = OpenSSOCoreTokenStore.getCoreTokenDN(token);
SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
if (SMSEntry.checkIfEntryExists(dn, adminToken)) {
try {
SMSEntry s = new SMSEntry(adminToken, dn);
String tokenExpiry = getTokenExpiry(s);
if (CoreTokenUtils.isTokenExpired(tokenExpiry)) {
s.delete();
// add logging
TokenLogUtils.access(Level.INFO, TokenLogUtils.EXPIRED_TOKEN_DELETE_SUCCESS, null, null, token);
if (CoreTokenUtils.debug.messageEnabled()) {
CoreTokenUtils.debug.message("TokenCleanupRunnable" + ".run: removed expired token " + token);
}
}
} catch (SMSException ex) {
CoreTokenUtils.debug.error("TokenCleanupRunnable.run", ex);
} catch (SSOException ex) {
CoreTokenUtils.debug.error("TokenCleanupRunnable.run", ex);
} catch (CoreTokenException ce) {
CoreTokenUtils.debug.error("TokenCleanupRunnable.run", ce);
}
}
}
CoreTokenUtils.debug.message("TokenCleanupRunnable.run : END");
}
Aggregations