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));
}
}
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));
}
}
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);
}
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));
}
}
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));
}
}
Aggregations