org.jdiameter.api.Message.isError()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(13.1k)|赞(0)|评价(0)|浏览(961)

本文整理了Java中org.jdiameter.api.Message.isError()方法的一些代码示例,展示了Message.isError()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.isError()方法的具体详情如下:
包路径:org.jdiameter.api.Message
类名称:Message
方法名:isError

Message.isError介绍

暂无

代码示例

代码示例来源:origin: org.mobicents.servers.diameter.resources/base-common-events

public boolean isError() {
 return this.msg.isError();
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events

public boolean isError() {
 return this.msg.isError();
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-rf-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
 FireableEventType eventID = null;
 // Error is always the same.
 if (message.isError()) {
  //eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
  //TODO: x?
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  String eventName = eventNames.get(commandCode);
  if(eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-cca-common-ra

@Override
public DiameterMessage sendSyncMessage(DiameterMessage message) {
 DiameterMessage answer = null;
 Message receivedMessage = doSendMessage(message);
 if(receivedMessage != null) {
  if (!receivedMessage.isRequest()) {
   if(receivedMessage.isError()) {
    answer = new ErrorAnswerImpl(receivedMessage);
   }
   else {
    switch (receivedMessage.getCommandCode()) {
     case CreditControlRequest.commandCode:
      answer = new CreditControlAnswerImpl(receivedMessage);
      break;
     default:
      logger.error("Received an unknown type of Message for Credit-Control Activity: " + receivedMessage);
      break;
    }
   }
  }
  else {
   logger.error("Received a REQUEST message when expecting an ANSWER.");
  }
 }
 else {
  logger.debug("No answer received. Returning null.");
 }
 return answer;
}

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-cca-common-ra

@Override
public DiameterMessage sendSyncMessage(DiameterMessage message) {
 DiameterMessage answer = null;
 Message receivedMessage = doSendMessage(message);
 if(receivedMessage != null) {
  if (!receivedMessage.isRequest()) {
   if(receivedMessage.isError()) {
    answer = new ErrorAnswerImpl(receivedMessage);
   }
   else {
    switch (receivedMessage.getCommandCode()) {
     case CreditControlRequest.commandCode:
      answer = new CreditControlAnswerImpl(receivedMessage);
      break;
     default:
      logger.error("Received an unknown type of Message for Credit-Control Activity: " + receivedMessage);
      break;
    }
   }
  }
  else {
   logger.error("Received a REQUEST message when expecting an ANSWER.");
  }
 }
 else {
  logger.debug("No answer received. Returning null.");
 }
 return answer;
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-rf-ra

if(receivedMessage.isError()) {
 answer = new ErrorAnswerImpl(receivedMessage);

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-gx-ra

/**
 *
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(final EventLookupFacility eventLookupFacility, final Message message) {
  FireableEventType eventID;
  // Error is always the same.
  if (message.isError()) {
    eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
  } else {
    final int commandCode = message.getCommandCode();
    final boolean isRequest = message.isRequest();
    final String eventName = eventNames.get(commandCode);
    if (eventName != null) {
      eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
    } else {
      eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
    }
  }
  return eventID;
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-s6a-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
  FireableEventType eventID = null;
  // Error is always the same.
  if (message.isError()) {
    eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
  } else {
    final int commandCode = message.getCommandCode();
    final boolean isRequest = message.isRequest();
    String eventName = eventNames.get(commandCode);
    if (eventName != null) {
      eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
    } else {
      eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
    }
  }
  return eventID;
}

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-gq-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
 FireableEventType eventID = null;
 // Error is always the same.
 if (message.isError()) {
  eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  String eventName = eventNames.get(commandCode);
  if (eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
  else {
   eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-cca-common-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
 FireableEventType eventID = null;
 // Error is always the same.
 if (message.isError()) {
  eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  String eventName = eventNames.get(commandCode);
  if(eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
  else {
   eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-cca-common-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
 FireableEventType eventID = null;
 // Error is always the same.
 if (message.isError()) {
  eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  String eventName = eventNames.get(commandCode);
  if(eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
  else {
   eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-base-common-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
 FireableEventType eventID = null;
 // Error is always the same.
 if (message.isError()) {
  eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  String eventName = eventNames.get(commandCode);
  if(eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
  else {
   eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-ro-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
 FireableEventType eventID = null;
 // Error is always the same.
 if (message.isError()) {
  eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  String eventName = eventNames.get(commandCode);
  if(eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
  else {
   eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-ro-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
 FireableEventType eventID = null;
 // Error is always the same.
 if (message.isError()) {
  eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  String eventName = eventNames.get(commandCode);
  if(eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
  else {
   eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-rx-ra

/**
 *
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(final EventLookupFacility eventLookupFacility, final Message message) {
 FireableEventType eventID;
 // Error is always the same.
 if (message.isError()) {
  eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  final String eventName = eventNames.get(commandCode);
  if (eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
  else {
   eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-cx-dx-ra

/**
 * 
 * @param eventLookupFacility
 * @param message
 * @return
 */
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Message message) {
 FireableEventType eventID = null;
 // Error is always the same.
 if (message.isError()) {
  eventID = getEventId(eventLookupFacility, ERROR_ANSWER);
 }
 else {
  final int commandCode = message.getCommandCode();
  final boolean isRequest = message.isRequest();
  String eventName = eventNames.get(commandCode);
  if(eventName != null) {
   eventID = getEventId(eventLookupFacility, eventName + (isRequest ? "Request" : "Answer"));
  }
  else {
   eventID = getEventId(eventLookupFacility, EXTENSION_DIAMETER_MESSAGE);
  }
 }
 return eventID;
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-cca-ra

/**
 * Create Event object from a JDiameter message (request or answer)
 * 
 * @return a DiameterMessage object wrapping the request/answer
 */
private DiameterMessage createEvent(Message message) {
 if (message == null) {
  throw new NullPointerException("Message argument cannot be null while creating event.");
 }
 if (message.isError()) {
  return new ErrorAnswerImpl(message);
 }
 switch (message.getCommandCode()) {
 case CreditControlMessage.commandCode: // CCR/CCA
  return message.isRequest() ? new CreditControlRequestImpl(message) : new CreditControlAnswerImpl(message);
 default:
  return new ExtensionDiameterMessageImpl(message);
 }
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-rf-ra

/**
 * Create Event object from a JDiameter message (request or answer)
 * 
 * @return a DiameterMessage object wrapping the request/answer
 * @throws OperationNotSupportedException
 */
private DiameterMessage createEvent(Message message) {
 if (message == null) {
  throw new NullPointerException("Message argument cannot be null while creating event.");
 }
 int commandCode = message.getCommandCode();
 if (message.isError()) {
  return new ErrorAnswerImpl(message);
 }
 boolean isRequest = message.isRequest();
 switch (commandCode) {
 case RfAccountingAnswer.commandCode: // ACR/ACA
  return isRequest ? new RfAccountingRequestImpl(message) : new RfAccountingAnswerImpl(message);
 default:
  return new ExtensionDiameterMessageImpl(message);
 }
}

代码示例来源:origin: org.mobicents.diameter/jdiameter-impl

@Override
public Message createMessage(Message message, boolean copyAvps) {
 if ( isValid ) {
  setLastAccessTime();
  IMessage newMessage = null;
  IMessage inner = (IMessage) message;
  if (copyAvps) {
   newMessage = parser.createEmptyMessage(inner);
   MessageUtility.addOriginAvps(newMessage, container.getMetaData());
  } else {
   newMessage = (IMessage) createMessage(
     inner.getCommandCode(),
     inner.getSingleApplicationId(),
     -1,
     -1
     );
  }
  newMessage.setRequest(message.isRequest());
  newMessage.setProxiable(message.isProxiable());
  newMessage.setError(message.isError());
  newMessage.setReTransmitted(message.isReTransmitted());
  return newMessage;
 } else {
  throw new IllegalStateException("Session already released");
 }
}

代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-ro-ra

/**
 * Create Event object from a JDiameter message (request or answer)
 * 
 * @return a DiameterMessage object wrapping the request/answer
 * @throws OperationNotSupportedException
 */
private DiameterMessage createEvent(Message message) {
 if (message == null) {
  throw new NullPointerException("Message argument cannot be null while creating event.");
 }
 int commandCode = message.getCommandCode();
 if (message.isError()) {
  return new ErrorAnswerImpl(message);
 }
 boolean isRequest = message.isRequest();
 switch (commandCode) {
 case RoCreditControlRequest.commandCode: // CCR/CCA
  return isRequest ? new RoCreditControlRequestImpl(message) : new RoCreditControlAnswerImpl(message);
 case AbortSessionAnswer.commandCode: // ASR/ASA
  return isRequest ? new AbortSessionRequestImpl(message) : new AbortSessionAnswerImpl(message);
 case SessionTerminationAnswer.commandCode: // STR/STA
  return isRequest ? new SessionTerminationRequestImpl(message) : new SessionTerminationAnswerImpl(message);
 case ReAuthAnswer.commandCode: // RAR/RAA
  return isRequest ? new ReAuthRequestImpl(message) : new ReAuthAnswerImpl(message);
 case AccountingAnswer.commandCode: // ACR/ACA
  return isRequest ? new AccountingRequestImpl(message) : new AccountingAnswerImpl(message);
 default:
  return new ExtensionDiameterMessageImpl(message);
 }
}

相关文章