1 24 package org.objectweb.joram.mom.notifications; 25 26 30 public class ReceiveRequest extends AbstractRequest { 31 34 private String selector; 35 39 private long timeOut; 40 41 private long expirationTime; 42 46 private boolean autoAck; 47 51 public fr.dyade.aaa.agent.AgentId requester; 52 53 private String [] msgIds; 54 55 private int msgCount; 56 57 69 public ReceiveRequest(int clientContext, 70 int requestId, 71 String selector, 72 long timeOut, 73 boolean autoAck, 74 String [] msgIds, 75 int msgCount) { 76 super(clientContext, requestId); 77 this.selector = selector; 78 this.timeOut = timeOut; 79 this.autoAck = autoAck; 80 this.msgIds = msgIds; 81 this.msgCount = msgCount; 82 } 83 84 85 86 public String getSelector() { 87 return selector; 88 } 89 90 94 public long getTimeOut() { 95 return timeOut; 96 } 97 98 99 public boolean getAutoAck() { 100 return autoAck; 101 } 102 103 public final String [] getMessageIds() { 104 return msgIds; 105 } 106 107 114 public void setExpiration(long startTime) { 115 if (timeOut > 0) 116 this.expirationTime = startTime + timeOut; 117 } 118 119 124 public boolean isValid(long currentTime) { 125 if (timeOut > 0) 126 return currentTime < expirationTime; 127 return true; 128 } 129 130 public final int getMessageCount() { 131 return msgCount; 132 } 133 } 134 | Popular Tags |