Search in sources :

Example 1 with Peer

use of org.jdiameter.api.Peer in project jain-slee.diameter by RestComm.

the class DiameterShServerResourceAdaptor method getConnectedPeers.

public DiameterIdentity[] getConnectedPeers() {
    if (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 null;
}
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) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 2 with Peer

use of org.jdiameter.api.Peer in project jain-slee.diameter by RestComm.

the class DiameterCxDxResourceAdaptor 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 3 with Peer

use of org.jdiameter.api.Peer in project jain-slee.diameter by RestComm.

the class DiameterRfResourceAdaptor method getConnectedPeers.

/**
 * @return
 */
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 4 with Peer

use of org.jdiameter.api.Peer in project jain-slee.diameter by RestComm.

the class DiameterGqResourceAdaptor 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) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 5 with Peer

use of org.jdiameter.api.Peer in project jain-slee.diameter by RestComm.

the class DiameterS6aResourceAdaptor 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)

Aggregations

InvalidConfigurationException (javax.slee.resource.InvalidConfigurationException)9 SleeEndpoint (javax.slee.resource.SleeEndpoint)9 CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)9 DiameterIdentity (net.java.slee.resource.diameter.base.events.avp.DiameterIdentity)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 IllegalDiameterStateException (org.jdiameter.api.IllegalDiameterStateException)4 InternalException (org.jdiameter.api.InternalException)4 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1