FAMRecordJMQPersister.java revision f97667c80d9dd8155ff61164f82b9ad6deae5d95
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 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: FAMRecordJMQPersister.java,v 1.7 2009/11/19 22:34:55 weisun2 Exp $
*
*/
/*
* Portions Copyrighted [2010] [ForgeRock AS]
*/
/**
* This class <code>FAMRecordJMQPersister</code> implements
* </code> MessageListener</code> which is to receive
* asynchronously delivered messages. It also sends FAMRecord,
* processes return message and reformat it to FAMRecord.
*/
public class FAMRecordJMQPersister implements FAMRecordPersister,
/** Represents not found */
/** Represents Operation status */
/* JMQ Properties */
static public int TIMEOUT = 1000;
// Private data members
/* Config data */
int msgcount = 0;
/**
*
* Constructs new FAMRecordJMQPersister
* @param id SessionId
*
*/
.getProvider();
if (shutdownMan.acquireValidLock()) {
try {
new ShutdownListener() {
public void shutdown() {
try {
} catch (JMSException ex) {
}
}
}
);
} finally {
}
}
resSub.setMessageListener(this);
}
// The read timout for retrieving the session (in SFO) needs
// to be as small as possible since in the case where there
// is an existing session cookie in client's browser and
// there is no corresponding session entry in the repository
// (e.g. timeout), client is forced to wait until this timeout
// to be able to be redirected back to the login page.
// The read timout for getting the session count (for session
// constraint) is different from the SFO case because the
// master BDB node will send the response message to the
// client even though the session count is 0.
/**
* Constructs new FAMRecordJMQPersister
*/
public FAMRecordJMQPersister() throws Exception {
if (thisServerProtocol == null
|| thisServerPortAsString == null
|| thisServer == null) {
//TODO:
"propertyMustBeSet"));
}
thisURI);
.getProvider();
if (shutdownMan.acquireValidLock()) {
try {
new ShutdownListener() {
public void shutdown() {
try {
} catch (JMSException ex) {
}
}
}
);
} finally {
}
}
resSub.setMessageListener(this);
}
/**
* Passes a message to the listener.
*
* @param message the message passed to the listener
*/
try {
// Determine if we have a read thread waiting...
synchronized (rnd) {
}
}
// Since we dont know the thread, not much we can do here -
// we will just let the thread timeout.
// TODO Debug.error.
}
}
// Write Primary key
return null;
}
}
}
//Write expiration date
if (expirationTime > 0) {
}
// Write Secondary Key such as UUID
} else {
}
}
// Write AuxData such as Master ID
} else {
}
}
if (state > 0) {
} else {
}
}
}
// Write extra bytes
}
}
// Write extra String
}
}
// Call for action
return null;
// Allocate a random string for onMessage to find us.
// onMessage thread will wake us up when data is ready
synchronized (random) {
}
// TODO : process timeout
//timeout
return null;
}
else {
"notFoundSession"));
}
// Fill in the return value in FAMRecord
// Data is in blob field
return ret;
}
// Allocate a random string for onMessage to find us
// onMessage thread will wake us up when data is ready
synchronized (random) {
}
// timeout
return null;
} else {
}
//Fill in the return value in FAMRecord
int retCount = 0;
for (int i = 0; i < retCount; i++) {
}
}
return ret;
// Allocate a random string for onMessage to find us
// onMessage thread will wake us up when data is ready
synchronized (random) {
}
// timeout
return null;
} else {
}
//Fill in the return value in FAMRecord
for (int i = 0; i < retCount; i++) {
}
}
return ret;
}
return null;
}
public void close()
throws Exception {
try {
} catch (JMSException ex) {
throw ex;
}
}
}