001: /******************************************************************************
002: * Copyright (C) Lars Ivar Almli. All rights reserved. *
003: * ---------------------------------------------------------------------------*
004: * This file is part of MActor. *
005: * *
006: * MActor is free software; you can redistribute it and/or modify *
007: * it under the terms of the GNU General Public License as published by *
008: * the Free Software Foundation; either version 2 of the License, or *
009: * (at your option) any later version. *
010: * *
011: * MActor is distributed in the hope that it will be useful, *
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
014: * GNU General Public License for more details. *
015: * *
016: * You should have received a copy of the GNU General Public License *
017: * along with MActor; if not, write to the Free Software *
018: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
019: ******************************************************************************/package org.mactor.brokers;
020:
021: import java.util.Calendar;
022: import org.mactor.framework.spec.SpecNode;
023:
024: /**
025: * Context information about a message
026: *
027: * @author Lars Ivar Almli
028: */
029: public class MessageContextInfo {
030:
031: private String archivePath;
032: private SpecNode node;
033: private String channel;
034: private Message responseToMessage;
035: private Message responseMessage;
036: private Calendar createdTime = Calendar.getInstance();
037: private boolean incoming;
038: private long messageSequenceNumber;
039:
040: public boolean isIncoming() {
041: return incoming;
042: }
043:
044: public boolean isResponseMessage() {
045: return responseToMessage != null;
046: }
047:
048: public boolean hasResponseMessage() {
049: return responseMessage != null;
050: }
051:
052: public void setIncoming(boolean incoming) {
053: this .incoming = incoming;
054: }
055:
056: public MessageContextInfo(long messageSequenceNumber) {
057: this .messageSequenceNumber = messageSequenceNumber;
058: }
059:
060: public String getArchivePath() {
061: return archivePath;
062: }
063:
064: public String getChannel() {
065: return channel;
066: }
067:
068: public SpecNode getNode() {
069: return node;
070: }
071:
072: public Message getResponseToMessage() {
073: return responseToMessage;
074: }
075:
076: public void setResponseToMessage(Message responseToMessage) {
077: this .responseToMessage = responseToMessage;
078: }
079:
080: public void setArchivePath(String archivePath) {
081: this .archivePath = archivePath;
082: }
083:
084: public void setChannel(String channel) {
085: this .channel = channel;
086: }
087:
088: public void setNode(SpecNode node) {
089: this .node = node;
090: }
091:
092: public Calendar getCreatedTime() {
093: return createdTime;
094: }
095:
096: public long getMessageSequenceNumber() {
097: return messageSequenceNumber;
098: }
099:
100: public Message getResponseMessage() {
101: return responseMessage;
102: }
103:
104: public void setResponseMessage(Message responseMessage) {
105: this.responseMessage = responseMessage;
106: }
107:
108: }
|