Search in sources :

Example 26 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class ServerSiteModelImpl method cloneServer.

/**
     * Clones a server.
     *
     * @param origServer Name of the server to be cloned.
     * @param cloneServer Name of clone server.
     * @throws AMConsoleException if server cannot be cloned.
     */
public void cloneServer(String origServer, String cloneServer) throws AMConsoleException {
    String[] param = { origServer, cloneServer };
    logEvent("ATTEMPT_CLONE_SERVER", param);
    try {
        ServerConfiguration.cloneServerInstance(getUserSSOToken(), origServer, cloneServer);
        logEvent("SUCCEED_CLONE_SERVER", param);
    } catch (ConfigurationException e) {
        String[] params = { origServer, cloneServer, e.getMessage() };
        logEvent("CONFIGURATION_EXCEPTION_CLONE_SERVER", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (SMSException e) {
        String[] params = { origServer, cloneServer, e.getMessage() };
        logEvent("SMS_EXCEPTION_CLONE_SERVER", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        String[] params = { origServer, cloneServer, e.getMessage() };
        logEvent("SSO_EXCEPTION_CLONE_SERVER", params);
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : ConfigurationException(com.sun.identity.common.configuration.ConfigurationException) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 27 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class ServerSiteModelImpl method modifyServer.

/**
     * Modifies server profile.
     *
     * @param serverName name of server.
     * @param parentSite Parent site.
     * @param values Property Values.
     * @throws AMConsoleException if server profile cannot be modified.
     * @throws UnknownPropertyNameException if property names are unknown.
     */
public void modifyServer(String serverName, String parentSite, Map values) throws AMConsoleException, UnknownPropertyNameException {
    String[] param = { serverName };
    try {
        SSOToken ssoToken = getUserSSOToken();
        logEvent("ATTEMPT_MODIFY_SERVER", param);
        if (parentSite != null) {
            String currentSite = ServerConfiguration.getServerSite(ssoToken, serverName);
            if ((currentSite == null) || !currentSite.equals(parentSite)) {
                ServerConfiguration.setServerSite(ssoToken, serverName, parentSite);
            }
        }
        ServerConfiguration.setServerInstance(ssoToken, serverName, values);
        logEvent("SUCCEED_MODIFY_SERVER", param);
    } catch (ConfigurationException e) {
        String[] params = { serverName, e.getMessage() };
        logEvent("CONFIGURATION_EXCEPTION_MODIFY_SERVER", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (IOException e) {
        String[] params = { serverName, e.getMessage() };
        logEvent("IO_EXCEPTION_MODIFY_SERVER", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (SMSException e) {
        String[] params = { serverName, e.getMessage() };
        logEvent("SMS_EXCEPTION_MODIFY_SERVER", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        String[] params = { serverName, e.getMessage() };
        logEvent("SSO_EXCEPTION_MODIFY_SERVER", params);
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : SSOToken(com.iplanet.sso.SSOToken) ConfigurationException(com.sun.identity.common.configuration.ConfigurationException) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException) IOException(java.io.IOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 28 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class SMDiscoEntryData method createDirectiveEntry.

private void createDirectiveEntry(DiscoEntryElement de, DirectiveType dType, List idRefs, List descriptionTypeList) throws AMConsoleException {
    if (idRefs != null && !idRefs.isEmpty()) {
        for (Iterator iter = idRefs.iterator(); iter.hasNext(); ) {
            String idRef = (String) iter.next();
            DescriptionType desc = getDescriptionType(idRef, descriptionTypeList);
            if (desc == null) {
                throw new AMConsoleException("invalidDescIdRefs.message");
            }
            dType.getDescriptionIDRefs().add(desc);
        }
    }
    de.getAny().add(dType);
}
Also used : DescriptionType(com.sun.identity.liberty.ws.disco.jaxb.DescriptionType) Iterator(java.util.Iterator) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 29 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class ServerSiteModelImpl method getSiteServers.

/**
     * Returns a set of servers that belong to site.
     *
     * @param name Name of Site.
     * @return a set of servers that belong to site.
     * @throws AMConsoleException if error occurs when getting the servers set.
     */
public Set getSiteServers(String name) throws AMConsoleException {
    String[] param = { name };
    logEvent("ATTEMPT_GET_SITE_MEMBERS", param);
    try {
        Set members = SiteConfiguration.listServers(getUserSSOToken(), name);
        logEvent("SUCCEED_GET_SITE_MEMBERS", param);
        return members;
    } catch (ConfigurationException e) {
        String[] params = { name, e.getMessage() };
        logEvent("SMS_EXCEPTION_GET_SITE_MEMBERS", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (SMSException e) {
        String[] params = { name, e.getMessage() };
        logEvent("SMS_EXCEPTION_GET_SITE_MEMBERS", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        String[] params = { name, e.getMessage() };
        logEvent("SSO_EXCEPTION_GET_SITE_MEMBERS", params);
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) ConfigurationException(com.sun.identity.common.configuration.ConfigurationException) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 30 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class ServerSiteModelImpl method getSiteNames.

/**
     * Returns a set of site names.
     *
     * @return a set of site names.
     * @throws AMConsoleException if error occurs when getting the site names.
     */
public Set getSiteNames() throws AMConsoleException {
    String[] param = getServerInstanceForLogMsg();
    logEvent("ATTEMPT_GET_SITE_NAMES", param);
    try {
        Set siteNames = SiteConfiguration.getSites(getUserSSOToken());
        logEvent("SUCCEED_GET_SITE_NAMES", param);
        return siteNames;
    } catch (SMSException e) {
        String[] params = { e.getMessage() };
        logEvent("SMS_EXCEPTION_GET_SITE_NAMES", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        String[] params = { e.getMessage() };
        logEvent("SSO_EXCEPTION_GET_SITE_NAMES", params);
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Aggregations

AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)701 Map (java.util.Map)255 Set (java.util.Set)206 HashMap (java.util.HashMap)193 HashSet (java.util.HashSet)148 SSOException (com.iplanet.sso.SSOException)126 Iterator (java.util.Iterator)122 List (java.util.List)97 SMSException (com.sun.identity.sm.SMSException)83 ArrayList (java.util.ArrayList)78 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)76 IdRepoException (com.sun.identity.idm.IdRepoException)58 SAML2MetaException (com.sun.identity.saml2.meta.SAML2MetaException)47 SAML2MetaManager (com.sun.identity.saml2.meta.SAML2MetaManager)46 AMIdentity (com.sun.identity.idm.AMIdentity)44 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)41 NameNotFoundException (com.sun.identity.policy.NameNotFoundException)41 CCActionTable (com.sun.web.ui.view.table.CCActionTable)40 TreeSet (java.util.TreeSet)39 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)38