Search in sources :

Example 46 with SSOException

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);
    }
}
Also used : UpgradeException(org.forgerock.openam.upgrade.UpgradeException) ServiceConfig(com.sun.identity.sm.ServiceConfig) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException) ServiceConfigManager(com.sun.identity.sm.ServiceConfigManager)

Example 47 with SSOException

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);
    }
}
Also used : UpgradeException(org.forgerock.openam.upgrade.UpgradeException) SMSException(com.sun.identity.sm.SMSException) ServiceNotFoundException(com.sun.identity.sm.ServiceNotFoundException) SSOException(com.iplanet.sso.SSOException)

Example 48 with SSOException

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);
    }
}
Also used : UpgradeException(org.forgerock.openam.upgrade.UpgradeException) Set(java.util.Set) CollectionUtils.transformSet(org.forgerock.openam.utils.CollectionUtils.transformSet) HashSet(java.util.HashSet) ServiceConfig(com.sun.identity.sm.ServiceConfig) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException)

Example 49 with SSOException

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;
}
Also used : Enumeration(java.util.Enumeration) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException) ResourceBundle(java.util.ResourceBundle) IOException(java.io.IOException) SystemProperties(com.iplanet.am.util.SystemProperties) Properties(java.util.Properties)

Example 50 with SSOException

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");
}
Also used : SSOToken(com.iplanet.sso.SSOToken) SMSException(com.sun.identity.sm.SMSException) CoreTokenException(com.sun.identity.coretoken.CoreTokenException) SMSEntry(com.sun.identity.sm.SMSEntry) SSOException(com.iplanet.sso.SSOException)

Aggregations

SSOException (com.iplanet.sso.SSOException)1002 SMSException (com.sun.identity.sm.SMSException)553 Set (java.util.Set)374 SSOToken (com.iplanet.sso.SSOToken)336 IdRepoException (com.sun.identity.idm.IdRepoException)291 HashSet (java.util.HashSet)289 Map (java.util.Map)223 HashMap (java.util.HashMap)205 AMIdentity (com.sun.identity.idm.AMIdentity)193 Iterator (java.util.Iterator)189 CLIException (com.sun.identity.cli.CLIException)170 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)126 ServiceConfig (com.sun.identity.sm.ServiceConfig)126 IOutput (com.sun.identity.cli.IOutput)121 ServiceSchemaManager (com.sun.identity.sm.ServiceSchemaManager)104 ServiceSchema (com.sun.identity.sm.ServiceSchema)101 ServiceConfigManager (com.sun.identity.sm.ServiceConfigManager)93 AMIdentityRepository (com.sun.identity.idm.AMIdentityRepository)88 IOException (java.io.IOException)65 PolicyException (com.sun.identity.policy.PolicyException)62