8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: SsoServerSAML2SvcImpl.java,v 1.3 2009/10/21 00:03:14 bigfatrat Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Portions Copyrighted 2011 ForgeRock AS
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This class extends the "SsoServerSAML2Svc" class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpublic class SsoServerSAML2SvcImpl extends SsoServerSAML2Svc {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String IDP_ARTIF_CACHE = "idpArtifCache";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String IDP_ARTIF_ISSUED = "idpArtifIssued";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String IDP_ASSERT_CACHE = "idpAssertCache";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String IDP_ASSERT_ISSUED = "idpAssertIssued";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String IDP_RQTS_RCVD = "idpRqtRcvd";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String IDP_INVAL_RQTS_RCVD = "idpInvalRqtRcvd";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String SP_VAL_ASSERTS_RCVD = "spValidAssertRcvd";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String SP_RQTS_SENT = "spRqtSent";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String SP_INVAL_ARTIFS_RCVD = "spInvalArtifRcvd";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Constructor
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public SsoServerSAML2SvcImpl (SnmpMib myMib, MBeanServer server) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private void init (SnmpMib myMib, MBeanServer server) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void incIDPCounter (String realm, String idpName, String counter) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String classMethod = "SsoServerSAML2SvcImpl.incIDPCounter:";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * given the realm's and IDP's name, get the corresponding
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * entry in the SAML2IDP table.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * remember that the IDP's name must be "colon-corrected".
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * realm name might have to be orgDN, then converted to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "/"-separated form like in SsoServerAuthSvcImpl.java.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SsoServerSAML2IDPEntryImpl ssei = Agent.getSAML2IDPEntry(entName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.error(classMethod + "no SAML2IDP entry for realm/idp: " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (counter.equals(SsoServerSAML2SvcImpl.IDP_ARTIF_CACHE)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (counter.equals(SsoServerSAML2SvcImpl.IDP_ARTIF_ISSUED)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (counter.equals(SsoServerSAML2SvcImpl.IDP_ASSERT_CACHE)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (counter.equals(SsoServerSAML2SvcImpl.IDP_ASSERT_ISSUED)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (counter.equals(SsoServerSAML2SvcImpl.IDP_RQTS_RCVD)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (counter.equals(SsoServerSAML2SvcImpl.IDP_INVAL_RQTS_RCVD)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.error(classMethod + "unknown SAML2IDP counter: " + counter);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void decIDPCounter (String realm, String idpName, String counter) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String classMethod = "SsoServerSAML2SvcImpl.decIDPCounter:";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * given the realm's and IDP's name, get the corresponding
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * entry in the SAML2IDP table.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * remember that the IDP's name must be "colon-corrected".
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * realm name might have to be orgDN, then converted to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "/"-separated form like in SsoServerAuthSvcImpl.java.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SsoServerSAML2IDPEntryImpl ssei = Agent.getSAML2IDPEntry(entName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.error(classMethod + "no SAML2IDP entry for realm/idp: " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // only artifacts and assertions in cache counts decremented
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (counter.equals(SsoServerSAML2SvcImpl.IDP_ARTIF_CACHE)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (counter.equals(SsoServerSAML2SvcImpl.IDP_ASSERT_CACHE)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.error(classMethod + "unknown SAML2IDP counter: " + counter);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void incSPCounter (String realm, String spName, String counter) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String classMethod = "SsoServerSAML2SvcImpl.incSPCounter:";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * given the realm's and SP's name, get the corresponding
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * entry in the SAML2SP table.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * remember that the SP's name must be "colon-corrected".
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * realm name might have to be orgDN, then converted to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "/"-separated form like in SsoServerAuthSvcImpl.java.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SsoServerSAML2SPEntryImpl ssei = Agent.getSAML2SPEntry(entName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.error(classMethod + "no SAML2SP entry for realm/sp: " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (counter.equals(SsoServerSAML2SvcImpl.SP_VAL_ASSERTS_RCVD)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (counter.equals(SsoServerSAML2SvcImpl.SP_RQTS_SENT)) {