use of org.mobicents.slee.resource.diameter.sh.events.avp.UserIdentityAvpImpl in project jain-slee.diameter by RestComm.
the class ShClientSubscriptionActivityImpl method fetchSessionData.
/**
* @param request
*/
public void fetchSessionData(DiameterMessage msg, boolean incoming) {
if (msg.getHeader().isRequest()) {
// Well it should always be getting this on request and only once ?
if (incoming) {
if (this.userIdentity == null) {
// FIXME: make this diff.
AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(DiameterShAvpCodes.USER_IDENTITY, DiameterShAvpCodes.SH_VENDOR_ID);
this.userIdentity = new UserIdentityAvpImpl(DiameterShAvpCodes.USER_IDENTITY, DiameterShAvpCodes.SH_VENDOR_ID, rep.getRuleMandatoryAsInt(), rep.getRuleProtectedAsInt(), AvpUtilities.getAvpAsGrouped(DiameterShAvpCodes.USER_IDENTITY, DiameterShAvpCodes.SH_VENDOR_ID, ((DiameterMessageImpl) msg).getGenericData().getAvps()));
}
if (this.authSessionState == null) {
this.authSessionState = AuthSessionStateType.fromInt(AvpUtilities.getAvpAsInteger32(277, ((DiameterMessageImpl) msg).getGenericData().getAvps()));
}
stateMessages.add((DiameterMessageImpl) msg);
} else {
// FIXME: this should be up there... in incoming?
if (destinationRealm == null) {
this.remoteRealm = msg.getDestinationRealm();
}
if (msg instanceof SubscribeNotificationsRequest) {
SubscribeNotificationsRequest snr = (SubscribeNotificationsRequest) msg;
if (dataReferenceType == null || dataReferenceType.length == 0) {
dataReferenceType = snr.getDataReferences();
}
if (authSessionState == null && snr.hasAuthSessionState()) {
authSessionState = snr.getAuthSessionState();
}
if (userIdentity == null && snr.hasUserIdentity()) {
userIdentity = snr.getUserIdentity();
}
}
}
}
}
Aggregations