/** * Creates a new ConversationMessage with the specified command type and * reference message. * * @param commandType * The command type for this message. Command is an optional * extension for creating services that can respond to different * specific commands. Must not be null. * @param inReplyTo * the incoming message. Must not be null. */ public static ConversationMessage create(String commandType, Message inReplyTo) { ConversationMessage message = new ConversationMessage(inReplyTo); message.command(commandType); return message; }
private ConversationMessage(Message inReplyTo) { super(); if (inReplyTo.hasResource("Session")) { setResource("Session", inReplyTo.getResource(Object.class, "Session")); } if (inReplyTo.hasPart(MessageParts.ReplyTo)) { set(MessageParts.ToSubject, inReplyTo.get(String.class, MessageParts.ReplyTo)); } if (!inReplyTo.hasResource("Session") && !inReplyTo.hasPart(MessageParts.ReplyTo)) { throw new RuntimeException( "cannot have a conversation. there is no session data or ReplyTo field." + " Are you sure you referenced an incoming message?"); } } }
/** * Creates a new ConversationMessage using an incoming message as a reference. * * @param inReplyTo * the incoming message. * * @return a ConversationMessage that will be routed to the MessageBus that * sent the {@code inReplyTo} message. */ public static ConversationMessage create(Message inReplyTo) { return new ConversationMessage(inReplyTo); }
private ConversationMessage(Message inReplyTo) { super(); if (inReplyTo.hasResource("Session")) { setResource("Session", inReplyTo.getResource(Object.class, "Session")); } if (inReplyTo.hasPart(MessageParts.ReplyTo)) { set(MessageParts.ToSubject, inReplyTo.get(String.class, MessageParts.ReplyTo)); } if (!inReplyTo.hasResource("Session") && !inReplyTo.hasPart(MessageParts.ReplyTo)) { throw new RuntimeException( "cannot have a conversation. there is no session data or ReplyTo field." + " Are you sure you referenced an incoming message?"); } } }
/** * Creates a new ConversationMessage using an incoming message as a reference. * * @param inReplyTo * the incoming message. * * @return a ConversationMessage that will be routed to the MessageBus that * sent the {@code inReplyTo} message. */ public static ConversationMessage create(Message inReplyTo) { return new ConversationMessage(inReplyTo); }
/** * Creates a new ConversationMessage with the specified command type and * reference message. * * @param commandType * The command type for this message. Command is an optional * extension for creating services that can respond to different * specific commands. Must not be null. * @param inReplyTo * the incoming message. Must not be null. */ public static ConversationMessage create(Enum<?> commandType, Message inReplyTo) { ConversationMessage message = new ConversationMessage(inReplyTo); message.command(commandType.name()); return message; }
/** * Creates a new ConversationMessage with the specified command type and * reference message. * * @param commandType * The command type for this message. Command is an optional * extension for creating services that can respond to different * specific commands. Must not be null. * @param inReplyTo * the incoming message. Must not be null. */ public static ConversationMessage create(String commandType, Message inReplyTo) { ConversationMessage message = new ConversationMessage(inReplyTo); message.command(commandType); return message; }
/** * Creates a new ConversationMessage with the specified command type and * reference message. * * @param commandType * The command type for this message. Command is an optional * extension for creating services that can respond to different * specific commands. Must not be null. * @param inReplyTo * the incoming message. Must not be null. */ public static ConversationMessage create(Enum<?> commandType, Message inReplyTo) { ConversationMessage message = new ConversationMessage(inReplyTo); message.command(commandType.name()); return message; }