8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2005 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: ServerGroup.java,v 1.5 2009/01/28 05:34:49 ww203982 Exp $
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington * Portions Copyrighted 2011-2015 ForgeRock AS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpublic class ServerGroup implements ParseOutput {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Not to be called. This is a method to be called by the parser to read the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * xml information.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster DSConfigMgr.debugger.message("in ServerGroup.process()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // get the group ID.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster groupName = (String) atts.get(DSConfigMgr.NAME);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Get the Servers
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // if it is generic node, its probably the base dn.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (x._name.equals(DSConfigMgr.MISC_CONFIG)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster errorMsg = "No server object found in the server group:"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster errorMsg = "No base DN string defined in the server group:"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Get the rest of the attributes
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String maxConnPoolStr = System.getProperty("max_conn_pool");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster maxConnPoolStr = (String) atts.get(DSConfigMgr.MAX_CONN_POOL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String minConnPoolStr = System.getProperty("min_conn_pool");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster minConnPoolStr = (String) atts.get(DSConfigMgr.MIN_CONN_POOL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster maxConnPool = Integer.parseInt(maxConnPoolStr);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster minConnPool = Integer.parseInt(minConnPoolStr);
9d1321897216c79ea0639b6d8e0f92d0565876b6Jason Lemay String ldapHeartbeatStr = System.getProperty(Constants.LDAP_HEARTBEAT);
9d1321897216c79ea0639b6d8e0f92d0565876b6Jason Lemay ldapHeartbeatStr = (String) atts.get(Constants.LDAP_HEARTBEAT);
9d1321897216c79ea0639b6d8e0f92d0565876b6Jason Lemay ldapHeartbeat = Integer.parseInt(ldapHeartbeatStr);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster .getString(IUMSConstants.DSCFG_SERVERGROUP_NODE_EXPECTED));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Put it in the list of groups.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster parser.getGroupContainer().put(groupName, this);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get the server instance that's currently active.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param authType
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Defined in LDAPUser.java there are four types of users.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return ServerInstance The active instance is returned. If no instance is
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * active, null is returned.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @see LDAPUser.Type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public ServerInstance getServerInstance(LDAPUser.Type authType) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (serv != null && serv.getActiveStatus() == true) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (user != null && user.getAuthType().equals(authType)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The list of servers that are defined in this server group.