/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: ConfigFedMonitoring.java,v 1.2 2009/10/29 00:03:51 exu Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* This class gathers the configuration information for the
* monitoring service, which is initially started in WebtopNaming.java
* Configuration information can be gathered after Session services
* have started up.
*/
public class ConfigFedMonitoring {
public ConfigFedMonitoring() {
}
/*
* this method is called by AMSetupServlet, when it's done
* configuring the OpenAM server after deployment. it's also
* called by the MonitoringConfiguration load-on-startup servlet
* when the OpenAM server is restarted any time after being
* configured. it completes the configuring of the monitoring
* agent with the config information that requires an SSOToken
* to retrieve. there is another part of the configuration supplied
* to the agent by WebtopNaming.
*/
public void configureFedMonitoring() {
if (!MonitoringUtil.isRunning()) {
if (debug.warningEnabled()) {
}
return;
}
try {
ssoToken = getSSOToken();
} catch (SSOException ssoe) {
return;
}
/*
* get the SAML1.x trusted partners and sent to the Agent.
* these are global
*/
getSAML1TPs();
// now all the realms' federation configs
getAllRealms("/");
if (debug.messageEnabled()) {
}
return;
}
}
private void getSAML1TPs() {
try {
// get SAML service attributes
}
}
}
}
// get the trusted partners
"iplanet-am-saml-partner-urls");
if (debug.messageEnabled()) {
}
if (ovsize > 0) {
if (debug.messageEnabled()) {
append("\n");
}
while (st.hasMoreTokens()) {
if (debug.messageEnabled()) {
}
}
}
}
if (debug.messageEnabled()) {
}
}
}
if (debug.messageEnabled()) {
}
// send SAML1.x trusted partners list, s1List, to the Agent
} catch (SSOException e) {
e.getMessage());
} catch (SMSException e) {
e.getMessage());
}
}
/*
* get the list of realms, starting from "startRealm", usu. "/".
* return List with realms, with leading "/".
*/
try {
}
return(realmList);
} catch (SMSException e) {
"SMSException getting OrgConfigMgr: " + e.getMessage());
}
return (new ArrayList());
}
boolean skipSAML2Entities = true; // until IDPs/SPs per realm instrum
try {
if (!skipSAML2Entities) {
}
/*
* getCOTMembers(thisRealm, cot, cotmgr, cotsb)
* can get the members of the COT, but there isn't
* a (MIB) entry that right now.
*/
}
} catch (SAML2MetaException e) {
} catch (COTException e) {
} catch (IDFFMetaException e) {
}
}
boolean isSP = true;
int cnt = 0;
try {
}
}
//to handle dual roles specifically for WSFED
{
if (o instanceof UriNamedClaimTypesOfferedElement) {
isSP = false;
} else if (o instanceof TokenIssuerEndpointElement) {
cnt++;
}
}
}
}
}
} catch (WSFederationMetaException e) {
}
}
/*
* This is used to determine what 'roles' a particular entity is
* acting as. It will producs a list of role names which can then
* be used by the calling routine for whatever purpose it needs.
*/
try {
if (d != null) {
// find out what role this dude is playing
}
}
{
}
null)
{
}
if (SAML2MetaUtils.
getAttributeAuthorityDescriptor(d) != null) {
}
}
}
null)
{
}
}
} catch (SAML2MetaException s) {
if (debug.warningEnabled()) {
"Couldn't get SAMLMetaManager");
}
}
}
/*
* This is used to determine what 'roles' a particular entity is
* acting as. It will producs a list of role names which can then
* be used by the calling routine for whatever purpose it needs.
*/
try {
// find out what role this dude is playing
}
}
}
} catch (IDFFMetaException s) {
if (debug.warningEnabled()) {
"Couldn't get SAMLMetaManager");
}
}
return roles;
}
/**
* This is a convenience routine that can be used
* to convert a List of String objects to a single String in the format of
* "one; two; three"
*/
}
}
}
return key;
}
try {
} catch (COTException e) {
}
return cotSet;
}
{
if (debug.messageEnabled()) {
}
try {
if (debug.messageEnabled()) {
append("\n");
}
} else {
}
append("\n");
}
} else {
}
append("\n");
}
} else {
}
}
} catch (COTException cx) {
}
}
if (debug.messageEnabled()) {
}
return cotMap;
}
// s2entMap: entity name => Map of ("location", "roles") -> values
try {
} else {
}
}
} catch (SAML2MetaException e) {
e.getMessage());
}
return s2entMap;
}
// wsentMap: entity name => Map of ("location", "roles") -> values
try {
} else {
}
}
} catch (WSFederationMetaException e) {
}
return wsentMap;
}
// idffentMap: entity name => Map of ("location", "roles") -> values
try {
} else {
}
}
} catch (IDFFMetaException e) {
e.getMessage());
}
return idffentMap;
}
}