Search in sources :

Example 16 with DiameterIdentity

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];
}
Also used : DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) Peer(org.jdiameter.api.Peer) PeerTable(org.jdiameter.api.PeerTable) SleeEndpoint(javax.slee.resource.SleeEndpoint) AvpDataException(org.jdiameter.api.AvpDataException) InternalException(org.jdiameter.api.InternalException) IllegalDiameterStateException(org.jdiameter.api.IllegalDiameterStateException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 17 with DiameterIdentity

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];
}
Also used : DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) Peer(org.jdiameter.api.Peer) PeerTable(org.jdiameter.api.PeerTable) SleeEndpoint(javax.slee.resource.SleeEndpoint) AvpDataException(org.jdiameter.api.AvpDataException) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 18 with DiameterIdentity

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;
}
Also used : DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) CreditControlRequest(net.java.slee.resource.diameter.cca.events.CreditControlRequest)

Example 19 with DiameterIdentity

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();
}
Also used : ShClientActivity(net.java.slee.resource.diameter.sh.client.ShClientActivity) SubscribeNotificationsRequest(net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest) DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) UserIdentityAvp(net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)

Example 20 with DiameterIdentity

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();
}
Also used : ShClientActivity(net.java.slee.resource.diameter.sh.client.ShClientActivity) UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) UserIdentityAvp(net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)

Aggregations

DiameterIdentity (net.java.slee.resource.diameter.base.events.avp.DiameterIdentity)29 ShClientActivity (net.java.slee.resource.diameter.sh.client.ShClientActivity)17 UserIdentityAvp (net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)17 UserDataRequest (net.java.slee.resource.diameter.sh.events.UserDataRequest)10 InvalidConfigurationException (javax.slee.resource.InvalidConfigurationException)9 SleeEndpoint (javax.slee.resource.SleeEndpoint)9 CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)9 AvpDataException (org.jdiameter.api.AvpDataException)9 Peer (org.jdiameter.api.Peer)9 PeerTable (org.jdiameter.api.PeerTable)9 OperationNotSupportedException (javax.naming.OperationNotSupportedException)8 IOException (java.io.IOException)5 SubscribeNotificationsRequest (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest)5 IllegalDiameterStateException (org.jdiameter.api.IllegalDiameterStateException)4 InternalException (org.jdiameter.api.InternalException)4 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)2 ProfileUpdateRequest (net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest)2 ArrayList (java.util.ArrayList)1 ActivityContextInterface (javax.slee.ActivityContextInterface)1 CreateException (javax.slee.CreateException)1