//events from this operationId are never delivered to a external listeners
//they are delivered to internal listeners only.
//addInternalMessagingNetworkListener() adds an internal listener.
//removeInternalMessagingNetworkListener() removes an internal listener.
MessagingNetworkListener l =
new MessagingNetworkAdapter()
{
public final void getUserDetailsFailed(byte networkId, long operationId,
String originalSrcLoginId, String originalDstLoginId,
MessagingNetworkException ex)
{
if (loginId.equals(originalSrcLoginId) && loginId.equals(originalDstLoginId))
authReq(false, ex);
}
public final void getUserDetailsSuccess(byte networkId, long operationId,
String originalSrcLoginId, String originalDstLoginId,
UserDetails userDetails)
{
if (loginId.equals(originalSrcLoginId) && loginId.equals(originalDstLoginId))
{
boolean ar = false;
try
{
ar = userDetails.isAuthorizationRequired();
}
catch (MessagingNetworkException exar)
{
ar = false;
}
authReq(ar, null);
}
}
private final void authReq(boolean authorizationRequired, MessagingNetworkException mex)
{
Session.this.authorizationRequired = authorizationRequired;
if (mex == null
|| mex.getLogger() == MessagingNetworkException.CATEGORY_STILL_CONNECTED)
{
if (Defines.DEBUG && CAT.isDebugEnabled())
CAT.debug("login(): fetching my authorizationRequired flag done.");
setupSessionTasks();
opLogin.success();
opLogin = null;
}
}
}
;
// try
// {
// ctx.getGal().addForcedAop();
// AsyncOperationImpl aop = null;
// try
// {
// Session.this.enqueue(aop = new AsyncOperations.
// OpGetUserDetails(loginId, Session.this, false, ctx), l);
// }
// catch (MessagingNetworkException mex)
// {
// ctx.getPlug().handleEarlyException(aop, mex);
// throw mex;
// }
// }
// catch (MessagingNetworkException mex1)
// {
// l.getUserDetailsFailed((byte) -1, -1L, loginId, loginId, mex1);
// }
l.getUserDetailsFailed((byte) -1, -1L, loginId, loginId, new MessagingNetworkException(MessagingNetworkException.CATEGORY_STILL_CONNECTED,MessagingNetworkException.ENDUSER_NO_ERROR));
break;
}
case 40: //mainloop state case; must deliver events to Rx handlers etc etc etc
{