Search in sources :

Example 6 with DiameterMessage

use of net.java.slee.resource.diameter.base.events.DiameterMessage in project jain-slee.diameter by RestComm.

the class DiameterGqResourceAdaptor method fireEvent.

@Override
public void fireEvent(String sessionId, Message message) {
    DiameterMessage event = (DiameterMessage) createEvent(message);
    FireableEventType eventId = eventIdCache.getEventId(eventLookup, message);
    this.fireEvent(event, getActivityHandle(sessionId), eventId, null, true, message.isRequest());
}
Also used : DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) FireableEventType(javax.slee.resource.FireableEventType)

Example 7 with DiameterMessage

use of net.java.slee.resource.diameter.base.events.DiameterMessage in project jain-slee.diameter by RestComm.

the class DiameterRoResourceAdaptor method fireEvent.

/*
   * (non-Javadoc)
   * @see org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener#fireEvent(java.lang.String, org.jdiameter.api.Request, org.jdiameter.api.Answer)
   */
public void fireEvent(String sessionId, Message message) {
    DiameterMessage event = (DiameterMessage) createEvent(message);
    FireableEventType eventId = eventIdCache.getEventId(eventLookup, message);
    this.fireEvent(event, getActivityHandle(sessionId), eventId, null, true, message.isRequest());
}
Also used : DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) FireableEventType(javax.slee.resource.FireableEventType)

Example 8 with DiameterMessage

use of net.java.slee.resource.diameter.base.events.DiameterMessage in project jain-slee.diameter by RestComm.

the class DiameterRxResourceAdaptor method fireEvent.

/**
 * {@inheritDoc}
 */
@Override
public void fireEvent(final String sessionId, final Message message) {
    final DiameterMessage event = (DiameterMessage) createEvent(message);
    final FireableEventType eventId = eventIdCache.getEventId(eventLookup, message);
    this.fireEvent(event, getActivityHandle(sessionId), eventId, null, true, message.isRequest());
}
Also used : DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) FireableEventType(javax.slee.resource.FireableEventType)

Example 9 with DiameterMessage

use of net.java.slee.resource.diameter.base.events.DiameterMessage in project jain-slee.diameter by RestComm.

the class RxSessionActivityImpl method doSendMessage.

// some override from base
protected Message doSendMessage(DiameterMessage message) {
    Message receivedMessage = null;
    try {
        if (message instanceof DiameterMessageImpl) {
            Future<Message> future = session.send(((DiameterMessageImpl) message).getGenericData());
            receivedMessage = future.get();
        } else {
            throw new OperationNotSupportedException((new StringBuilder()).append("Trying to send wrong type of message? [").append(message.getClass()).append("] \n").append(message).toString());
        }
    } catch (AvpNotAllowedException e) {
        throw new net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        logger.error("Failure sending sync request.", e);
    }
    return receivedMessage;
}
Also used : OperationNotSupportedException(javax.naming.OperationNotSupportedException) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) Message(org.jdiameter.api.Message) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(org.jdiameter.api.validation.AvpNotAllowedException) AvpNotAllowedException(org.jdiameter.api.validation.AvpNotAllowedException) OperationNotSupportedException(javax.naming.OperationNotSupportedException)

Example 10 with DiameterMessage

use of net.java.slee.resource.diameter.base.events.DiameterMessage in project jain-slee.diameter by RestComm.

the class DiameterS13ResourceAdaptor method fireEvent.

/*
   * (non-Javadoc)
   * @see org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener#fireEvent(java.lang.String, org.jdiameter.api.Request, org.jdiameter.api.Answer)
   */
public void fireEvent(String sessionId, Message message) {
    DiameterMessage event = (DiameterMessage) createEvent(message);
    FireableEventType eventId = eventIdCache.getEventId(eventLookup, message);
    this.fireEvent(event, getActivityHandle(sessionId), eventId, null, true, message.isRequest());
}
Also used : DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) FireableEventType(javax.slee.resource.FireableEventType)

Aggregations

DiameterMessage (net.java.slee.resource.diameter.base.events.DiameterMessage)34 Message (org.jdiameter.api.Message)14 FireableEventType (javax.slee.resource.FireableEventType)12 ErrorAnswerImpl (org.mobicents.slee.resource.diameter.base.events.ErrorAnswerImpl)7 ArrayList (java.util.ArrayList)6 Test (org.junit.Test)4 ExtensionDiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.ExtensionDiameterMessageImpl)4 OperationNotSupportedException (javax.naming.OperationNotSupportedException)3 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)3 IOException (java.io.IOException)2 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)2 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)2 UserDataRequest (net.java.slee.resource.diameter.sh.events.UserDataRequest)2 ServerShSession (org.jdiameter.api.sh.ServerShSession)2 ShServerSessionDataLocalImpl (org.jdiameter.server.impl.app.sh.ShServerSessionDataLocalImpl)2 ShServerSessionImpl (org.jdiameter.server.impl.app.sh.ShServerSessionImpl)2 DiameterMessageFactoryImpl (org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl)2 AbortSessionAnswerImpl (org.mobicents.slee.resource.diameter.base.events.AbortSessionAnswerImpl)2 AccountingAnswerImpl (org.mobicents.slee.resource.diameter.base.events.AccountingAnswerImpl)2 CapabilitiesExchangeAnswerImpl (org.mobicents.slee.resource.diameter.base.events.CapabilitiesExchangeAnswerImpl)2