本文整理了Java中org.jdiameter.api.Message.getCommandCode()
方法的一些代码示例,展示了Message.getCommandCode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getCommandCode()
方法的具体详情如下:
包路径:org.jdiameter.api.Message
类名称:Message
方法名:getCommandCode
暂无
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
@Override
public int getCommandCode() {
return message.getCommandCode();
}
代码示例来源:origin: org.mobicents.servers.diameter.resources/base-common-events
public int getCommandCode() {
return this.msg.getCommandCode();
}
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events
public int getCommandCode() {
return this.msg.getCommandCode();
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
@Override
public void validate(Message msg, boolean incoming) throws AvpNotAllowedException {
if (!enabled || !configured) {
return;
}
MessageRepresentationImpl rep = new MessageRepresentationImpl(msg.getCommandCode(), msg.getApplicationId(), msg.isRequest());
rep = (MessageRepresentationImpl) this.commandMap.get(rep);
if (rep == null) {
// no notion, lets leave it.
logger.warn("Validation could not be performed, command not defined!. Code={}, Application-Id={}, Req={}",
new Object[] { msg.getCommandCode(), msg.getApplicationId(), msg.isRequest() });
return;
}
rep.validate(msg, (incoming ? receiveValidationLevel : sendValidationLevel));
}
代码示例来源: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/restcomm-slee-ra-diameter-cx-dx-ra
private DiameterActivity createActivity(Message message) throws CreateActivityException {
DiameterActivity activity = activities.get(getActivityHandle(message.getSessionId()));
if(activity == null) {
if (message.isRequest()) {
if(message.getCommandCode() == PushProfileRequest.COMMAND_CODE || message.getCommandCode() == RegistrationTerminationRequest.COMMAND_CODE) {
return createCxDxClientSessionActivity((Request) message, false);
}
else {
return createCxDxServerSessionActivity((Request) message);
}
}
else {
throw new IllegalStateException("Got answer, there should already be activity.");
}
}
return activity;
}
代码示例来源: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/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-s6a-ra
private DiameterActivity createActivity(Message message) throws CreateActivityException {
DiameterActivity activity = activities.get(getActivityHandle(message.getSessionId()));
if (activity == null) {
if (message.isRequest()) {
switch(message.getCommandCode()) {
case UpdateLocationRequest.COMMAND_CODE:
case AuthenticationInformationRequest.COMMAND_CODE:
case PurgeUERequest.COMMAND_CODE:
case NotifyRequest.COMMAND_CODE:
return createS6aServerSessionActivity((Request) message);
case CancelLocationRequest.COMMAND_CODE:
case InsertSubscriberDataRequest.COMMAND_CODE:
case DeleteSubscriberDataRequest.COMMAND_CODE:
case ResetRequest.COMMAND_CODE:
return createS6aClientSessionActivity((Request) message);
}
}
else {
throw new IllegalStateException("Got answer, there should already be activity.");
}
}
return activity;
}
代码示例来源: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.resources/mobicents-slee-ra-diameter-base-common-events
public DiameterCommand getCommand() {
return new DiameterCommandImpl(this.message.getCommandCode(), this.message.getApplicationId(), this.getShortName(), this.getLongName(), this.message.isRequest(), this.message.isProxiable());
}
代码示例来源:origin: org.mobicents.servers.diameter.resources/base-common-events
public DiameterCommand getCommand() {
return new DiameterCommandImpl(this.message.getCommandCode(), this.message.getApplicationId(), this.getShortName(), this.getLongName(), this.message.isRequest(), this.message.isProxiable());
}
代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-sh-client-ra
/**
* This method is for internal use only, it creates activities for requests that
* do not fall in certain app range or no activities were found <br>
* It should distinguish between initial requests, requests with different domains etc.
* Answer for creating XXXServerSession or basic diameter activity lies in this method
*
* @param message
* @return
*/
DiameterActivity createActivity(Message message) throws CreateActivityException {
DiameterActivity activity = activities.get(getActivityHandle(message.getSessionId()));
if (activity == null) {
//FIXME: baranowb: here we can receive only (valid) PNR, other message are errors?
if(message.getCommandCode() != PushNotificationRequestImpl.commandCode) {
throw new CreateActivityException("Cant create activity for unexpected message:\r\n" + message);
}
return (ShClientSubscriptionActivityImpl) this.createShClientSubscriptionActivity(new PushNotificationRequestImpl( message));
}
return activity;
}
内容来源于网络,如有侵权,请联系作者删除!