use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class ShClientFactoriesTest method testGettersAndSettersPUR.
@Test
public void testGettersAndSettersPUR() throws Exception {
ProfileUpdateRequest pur = shClientFactory.createProfileUpdateRequest();
int nFailures = ShClientAvpAssistant.INSTANCE.testMethods(pur, ProfileUpdateRequest.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class ShClientFactoriesTest method isPURPublicIdentityAccessibleTwice.
@Test
public void isPURPublicIdentityAccessibleTwice() throws Exception {
String originalValue = "sip:alexandre@diameter.mobicents.org";
UserIdentityAvpImpl uiAvp = new UserIdentityAvpImpl(DiameterShAvpCodes.USER_IDENTITY, 10415L, 1, 0, new byte[] {});
uiAvp.setPublicIdentity(originalValue);
ProfileUpdateRequest udr = shClientFactory.createProfileUpdateRequest(uiAvp, DataReferenceType.IMS_PUBLIC_IDENTITY, new byte[1]);
String obtainedValue1 = udr.getUserIdentity().getPublicIdentity();
String obtainedValue2 = udr.getUserIdentity().getPublicIdentity();
assertTrue("Obtained value for Public-Identity AVP differs from original.", obtainedValue1.equals(originalValue));
assertTrue("Obtained #1 value for Public-Identity AVP differs from Obtained #2.", obtainedValue1.equals(obtainedValue2));
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class ShServerFactoriesTest method hasTFlagSetPUA.
@Test
public void hasTFlagSetPUA() throws Exception {
ProfileUpdateRequest pur = shClientFactory.createProfileUpdateRequest();
((DiameterMessageImpl) pur).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Profile-Update-Request", pur.getHeader().isPotentiallyRetransmitted());
ProfileUpdateAnswer pua = shServerFactory.createProfileUpdateAnswer(pur);
assertFalse("The 'T' flag should not be set in Profile-Update-Answer", pua.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class ShServerFactoriesTest method isProxiableCopiedPUA.
@Test
public void isProxiableCopiedPUA() throws Exception {
ProfileUpdateRequest pur = shClientFactory.createProfileUpdateRequest();
ProfileUpdateAnswer pua = shServerFactory.createProfileUpdateAnswer(pur);
assertEquals("The 'P' bit is not copied from request in Profile-Update-Answer, it should. [RFC3588/6.2]", pur.getHeader().isProxiable(), pua.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) pur).getGenericData().setProxiable(!pur.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Profile-Update-Request, it should.", pur.getHeader().isProxiable() != pua.getHeader().isProxiable());
pua = shServerFactory.createProfileUpdateAnswer(pur);
assertEquals("The 'P' bit is not copied from request in Profile-Update-Answer, it should. [RFC3588/6.2]", pur.getHeader().isProxiable(), pua.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class HSSClientChildSbb method getUserIdentityValues.
private String[] getUserIdentityValues(DiameterShMessage shMessage) {
UserIdentityAvp uIdAvp = null;
if (shMessage instanceof UserDataRequest) {
uIdAvp = ((UserDataRequest) shMessage).getUserIdentity();
} else if (shMessage instanceof ProfileUpdateRequest) {
uIdAvp = ((ProfileUpdateRequest) shMessage).getUserIdentity();
} else if (shMessage instanceof SubscribeNotificationsRequest) {
uIdAvp = ((SubscribeNotificationsRequest) shMessage).getUserIdentity();
} else if (shMessage instanceof PushNotificationRequest) {
uIdAvp = ((PushNotificationRequest) shMessage).getUserIdentity();
}
String publicIdentity = null;
String msisdn = null;
if (uIdAvp != null) {
publicIdentity = uIdAvp.getPublicIdentity();
msisdn = uIdAvp.getMsisdn();
if (publicIdentity == null && msisdn == null) {
tracer.warning("Unable to retrieve Public User/Service Identity OR MSISDN. At least one of them should be present.");
}
} else {
tracer.warning("User-Identity AVP missing in Diameter Sh Message.");
}
return new String[] { publicIdentity, msisdn };
}
Aggregations