use of net.java.slee.resource.diameter.base.events.avp.DiameterIdentity in project jain-slee.diameter by RestComm.
the class DiameterS13ResourceAdaptor method getConnectedPeers.
public DiameterIdentity[] getConnectedPeers() {
if (this.stack != null) {
try {
// Get the list of peers from the stack
List<Peer> peers = stack.unwrap(PeerTable.class).getPeerTable();
DiameterIdentity[] result = new DiameterIdentity[peers.size()];
int i = 0;
// Get each peer from the list and make a DiameterIdentity
for (Peer peer : peers) {
DiameterIdentity identity = new DiameterIdentity(peer.getUri().toString());
result[i++] = identity;
}
return result;
} catch (Exception e) {
tracer.severe("Failure getting peer list.", e);
}
}
return new DiameterIdentity[0];
}
use of net.java.slee.resource.diameter.base.events.avp.DiameterIdentity in project jain-slee.diameter by RestComm.
the class DiameterRxResourceAdaptor method getConnectedPeers.
public DiameterIdentity[] getConnectedPeers() {
if (this.stack != null) {
try {
// Get the list of peers from the stack
final List<Peer> peers = stack.unwrap(PeerTable.class).getPeerTable();
final DiameterIdentity[] result = new DiameterIdentity[peers.size()];
int i = 0;
// Get each peer from the list and make a DiameterIdentity
for (Peer peer : peers) {
final DiameterIdentity identity = new DiameterIdentity(peer.getUri().toString());
result[i++] = identity;
}
return result;
} catch (Exception e) {
tracer.severe("Failure getting peer list.", e);
}
}
return new DiameterIdentity[0];
}
use of net.java.slee.resource.diameter.base.events.avp.DiameterIdentity in project jain-slee.diameter by RestComm.
the class CreditControlMessageFactoryImpl method createCreditControlRequest.
/*
* (non-Javadoc)
*
* @see net.java.slee.resource.diameter.cca.CreditControlMessageFactory#createCreditControlRequest()
*/
public CreditControlRequest createCreditControlRequest() {
CreditControlRequest req = (CreditControlRequest) createCreditControlMessage(null, new DiameterAvp[0]);
req.setOriginRealm(new DiameterIdentity(stack.getMetaData().getLocalPeer().getRealmName()));
req.setOriginHost(new DiameterIdentity(stack.getMetaData().getLocalPeer().getUri().getFQDN().toString()));
if (session != null) {
req.setSessionId(session.getSessionId());
}
return req;
}
use of net.java.slee.resource.diameter.base.events.avp.DiameterIdentity in project jain-slee.diameter by RestComm.
the class HSSClientChildSbb method subscribeInitialFilterCriteria.
public String subscribeInitialFilterCriteria(String publicIdentity, String serverName, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException {
UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);
SubscribeNotificationsRequest snr = diameterShClientMessageFactory.createSubscribeNotificationsRequest(publicIdentityAvp, DataReferenceType.INITIAL_FILTER_CRITERIA, SubsReqType.fromInt(subscriptionRequestType));
snr.setAuthSessionState(AuthSessionStateType.NO_STATE_MAINTAINED);
snr.setServerName(serverName);
// Set destination -- Realm is mandatory, host is optional
snr.setDestinationRealm(new DiameterIdentity(destinationRealm));
if (destinationHost != null) {
snr.setDestinationHost(new DiameterIdentity(destinationHost));
}
ShClientActivity activity = getShClientActivity();
activity.sendSubscribeNotificationsRequest(snr);
// Store request for future matching
storeRequestInACI(activity, snr);
// Return Session-Id, may be used as identifier
return activity.getSessionId();
}
use of net.java.slee.resource.diameter.base.events.avp.DiameterIdentity in project jain-slee.diameter by RestComm.
the class HSSClientChildSbb method getInitialFilterCriteria.
public String getInitialFilterCriteria(String publicIdentity, String serverName, String destinationRealm, String destinationHost) throws IOException {
UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);
UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.INITIAL_FILTER_CRITERIA);
udr.setAuthSessionState(AuthSessionStateType.NO_STATE_MAINTAINED);
udr.setServerName(serverName);
// Set destination -- Realm is mandatory, host is optional
udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
if (destinationHost != null) {
udr.setDestinationHost(new DiameterIdentity(destinationHost));
}
ShClientActivity activity = getShClientActivity();
activity.sendUserDataRequest(udr);
// Store request for future matching
storeRequestInACI(activity, udr);
// Return Session-Id, may be used as identifier
return activity.getSessionId();
}
Aggregations