PLLClient.java revision 1af2df7a6d4ca36f75815037fad3be449b478a46
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 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: PLLClient.java,v 1.8 2008/06/25 05:41:33 qcheng Exp $
*
*/
/**
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* The <code>PLLClient</code> class is used to send RequestSet XML documents
* to the URL specified in the send() method. The high level services and
* application can use Naming Service to find the service specific URL. This
* class provides static methods to register notification handlers.
*
* @see com.iplanet.services.comm.share.RequestSet
* @see com.iplanet.services.comm.share.Response
* @see com.iplanet.services.comm.client.SendRequestException
* @see com.iplanet.services.comm.client.NotificationHandler
*/
public class PLLClient {
/** notification handlers */
/**
* Translates the Java object to an XML RequestSet document and sends the
* corresponding XML document to the specified URL.
*
* @param url
* The destination URL for the RequestSet XML document.
* @param set
* The RequestSet Java object to be translated to an XML
* RequestSet document.
* @exception SendRequestException
* if there is an error in sending the XML document.
*/
throws SendRequestException {
}
/**
* Translates the Java object to an XML RequestSet document and sends the
* corresponding XML document to the specified URL.
*
* @param url
* The destination URL for the RequestSet XML document.
* @param cookies
* The value for Http Request Header 'Cookie'
* @param set
* The RequestSet Java object to be translated to an XML
* RequestSet document.
* @exception SendRequestException
* if there is an error in sending the XML document.
*/
throws SendRequestException {
}
/**
* Translates the Java object to an XML RequestSet document and sends the
* corresponding XML document to the specified URL.
*
* @param url
* The destination URL for the RequestSet XML document.
* @param set
* The RequestSet Java object to be translated to an XML
* RequestSet document.
* @param cookieTable
* The HashMap that constains cookies to be replayed and stores
* cookies retrieved from the response.
* @exception SendRequestException
* if there is an error in sending the XML document.
*/
throws SendRequestException {
}
// The private method that implements the above interfaces.
// HashMap cookieTable passes in the cookies that will be replayed. It also
// is the place holder to retrieve additional cookies if any from the
// URL connection response.
try {
if ((SiteMonitor.keepMonitoring == true) &&
throw new SendRequestException("Site is down.");
}
conn.setDoOutput(true);
// replay cookies
cookieStr = new StringBuffer();
}
.hasNext();) {
cookieStr = new StringBuffer();
} else {
}
}
}
if (debug.messageEnabled()) {
}
}
conn.setRequestProperty(TransactionId.HTTP_HEADER, AuditRequestContext.createSubTransactionIdValue());
// Output ...
// compute and set length, just in case iWS set arbitrary length
// Input ...
.getInputStream(), "UTF-8"));
int len;
char[] buf = new char[1024];
}
// retrieves cookies from the response
if (cookieTable != null) {
}
return resset.getResponses();
} catch (Exception e) {
throw new SendRequestException(e.getMessage());
} finally {
// to allow connection re-use when an IOException occurs, the
// error stream should be read and then closed.
if (errorStream != null) {
try {
} catch (IOException ioe) {
}
}
}
}
}
/**
* Parses the cookies from the response header and stores them in
* in cookieTable
*
* @param headers
* The Map containig headers
* @param cookieTable
* The HashMap that constains cookies to be replayed and stores
* cookies retrieved from the response.
*/
return;
}
if (debug.messageEnabled()) {
}
continue;
}
if (debug.messageEnabled()) {
}
if (stz.hasMoreTokens()) {
if (index == -1) {
continue;
}
}
}
}
}
}
/**
* Adds a notification handler for a service. This handler is used by the
* Platform Low Level servlet to pass notifications for processing.
*
* @param service
* The name of the service such as session, profile
* @param handler
* The handler for notification processing
*/
throw new AlreadyRegisteredException(PLLBundle
.getString("alreadyRegistered")
+ service);
}
}
/**
* Removes a notification handler of a service.
*
* @param service
* The name of the service whose handler needs to be removed
*/
}
/**
* Gets a notification handler of a service.
*
* @param service
* The name of the service whose handler needs to be returned
*/
}
}