/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: JAXRPCHelper.java,v 1.6 2009/11/16 21:57:47 goodearth Exp $
*
*/
/*
* Portions Copyrighted [2010] [ForgeRock AS]
*/
/**
* The class <code>JAXRPCHelper</code> provides functions to get JAXRPC stubs to
* a valid Identity Server.
*/
public class JAXRPCHelper {
// Static constants
// Static variables
protected static boolean serverFailed = true;
/**
* Returns a valid URL endpoint for the given service name.
*
* @param serviceName Service Name.
* @return a valid URL endpoint for the given service name.
* @throws RemoteException if there are no valid servers.
*/
throws RemoteException {
// Validate service name
if (serviceName == null) {
throw (new RemoteException("invalid-service-name"));
}
// Check if there is a valid server
if (serverFailed) {
}
if (validRemoteURL == null) {
if (debug.warningEnabled()) {
}
throw (new RemoteException("no-server-found"));
}
return (validRemoteURL + serviceName);
}
/**
* Sets the service to be failed.
*/
if (validRemoteURL == null) {
if (debug.warningEnabled()) {
}
serverFailed = true;
serverFailed = true;
}
}
// Check if the properties has been set
while (st.hasMoreTokens()) {
surl += "/";
}
if (isServerValid(surl)) {
return (surl);
}
}
} else {
try {
} catch (Exception e) {
// Unable to get platform server list
if (debug.warningEnabled()) {
+ "Unable to get platform server", e);
}
return (null);
}
if (serverList != null) {
try {
surl += "/";
}
if (isServerValid(surl)) {
return (surl);
}
} catch (Exception e) {
}
}
}
}
return (null);
}
try {
url += SMS_SERVICE;
}
} catch (Exception e) {
// Server is not valid
if (debug.messageEnabled()) {
+ " failed", e);
}
return (false);
}
return (true);
}
}