Search in sources :

Example 11 with InternalException

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

the class S6aClientSessionImpl method createResetAnswer.

public ResetAnswer createResetAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof ResetRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        ResetAnswer rsa = (ResetAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, ResetAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(rsa);
        return rsa;
    } catch (InternalException e) {
        logger.error("Failed to create Reset-Answer.", e);
    }
    return null;
}
Also used : DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) ResetAnswer(net.java.slee.resource.diameter.s6a.events.ResetAnswer) ResetRequest(net.java.slee.resource.diameter.s6a.events.ResetRequest) InternalException(org.jdiameter.api.InternalException)

Example 12 with InternalException

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

the class S6aServerSessionImpl method createUpdateLocationAnswer.

public UpdateLocationAnswer createUpdateLocationAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof UpdateLocationRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        UpdateLocationAnswer aia = (UpdateLocationAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, UpdateLocationAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(aia);
        return aia;
    } catch (InternalException e) {
        logger.error("Failed to create Update-Location-Answer.", e);
    }
    return null;
}
Also used : DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) InternalException(org.jdiameter.api.InternalException)

Example 13 with InternalException

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

the class S6aServerSessionImpl method createAuthenticationInformationAnswer.

public AuthenticationInformationAnswer createAuthenticationInformationAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof AuthenticationInformationRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        AuthenticationInformationAnswer aia = (AuthenticationInformationAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, AuthenticationInformationAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(aia);
        return aia;
    } catch (InternalException e) {
        logger.error("Failed to create Authentication-Information-Answer.", e);
    }
    return null;
}
Also used : AuthenticationInformationAnswer(net.java.slee.resource.diameter.s6a.events.AuthenticationInformationAnswer) DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) AuthenticationInformationRequest(net.java.slee.resource.diameter.s6a.events.AuthenticationInformationRequest) InternalException(org.jdiameter.api.InternalException)

Example 14 with InternalException

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

the class CxDxServerSessionImpl method createServerAssignmentAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#createServerAssignmentAnswer()
   */
public ServerAssignmentAnswer createServerAssignmentAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof ServerAssignmentRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        ServerAssignmentAnswer saa = (ServerAssignmentAnswer) this.cxdxMessageFactory.createCxDxMessage(lastRequest.getHeader(), new DiameterAvp[] {}, ServerAssignmentAnswer.COMMAND_CODE, cxdxMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(saa);
        return saa;
    } catch (InternalException e) {
        logger.error("Failed to create Server-Assignment-Answer.", e);
    }
    return null;
}
Also used : ServerAssignmentRequest(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest) DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) ServerAssignmentAnswer(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentAnswer) InternalException(org.jdiameter.api.InternalException)

Example 15 with InternalException

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

the class CxDxServerSessionImpl method createUserAuthorizationAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#createUserAuthorizationAnswer()
   */
public UserAuthorizationAnswer createUserAuthorizationAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof UserAuthorizationRequest)) {
        logger.warn("Invalid type of answer for this activity. Type: " + lastRequest);
        return null;
    }
    try {
        // Create the answer
        UserAuthorizationAnswer uaa = (UserAuthorizationAnswer) this.cxdxMessageFactory.createCxDxMessage(lastRequest.getHeader(), new DiameterAvp[] {}, UserAuthorizationAnswer.COMMAND_CODE, cxdxMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(uaa);
        return uaa;
    } catch (InternalException e) {
        logger.error("Failed to create User-Authorization-Answer.", e);
    }
    return null;
}
Also used : UserAuthorizationRequest(net.java.slee.resource.diameter.cxdx.events.UserAuthorizationRequest) DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) UserAuthorizationAnswer(net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer) InternalException(org.jdiameter.api.InternalException)

Aggregations

InternalException (org.jdiameter.api.InternalException)19 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)15 IllegalDiameterStateException (org.jdiameter.api.IllegalDiameterStateException)4 DiameterMessage (net.java.slee.resource.diameter.base.events.DiameterMessage)2 ApplicationId (org.jdiameter.api.ApplicationId)2 Message (org.jdiameter.api.Message)2 IOException (java.io.IOException)1 ObjectName (javax.management.ObjectName)1 InvalidConfigurationException (javax.slee.resource.InvalidConfigurationException)1 CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 LocationInfoAnswer (net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer)1 LocationInfoRequest (net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest)1 MultimediaAuthenticationAnswer (net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer)1 MultimediaAuthenticationRequest (net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationRequest)1 PushProfileAnswer (net.java.slee.resource.diameter.cxdx.events.PushProfileAnswer)1 PushProfileRequest (net.java.slee.resource.diameter.cxdx.events.PushProfileRequest)1 RegistrationTerminationAnswer (net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationAnswer)1 RegistrationTerminationRequest (net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest)1 ServerAssignmentAnswer (net.java.slee.resource.diameter.cxdx.events.ServerAssignmentAnswer)1