org.jlab.coda.cMsg
Class cMsgGetHelper

java.lang.Object
  extended by org.jlab.coda.cMsg.cMsgGetHelper

public class cMsgGetHelper
extends java.lang.Object

This class is used to help in implementing subscribeAndGet and sendAndGet methods. This is true in the cMsg domain for the client and in the RCBroadcast and RCServer domains for servers. An object of this class stores a msg from a sender to the method's caller and is used to synchronize/wait/notify on. It also indicates whether the call timed out or not.


Constructor Summary
cMsgGetHelper()
          Constructor used in sendAndGet.
cMsgGetHelper(java.lang.String subject, java.lang.String type)
          Constructor used in subscribeAndGet.
 
Method Summary
 boolean areWildCardsInSub()
          Returns true if there are * or ? characters in subject.
 boolean areWildCardsInType()
          Returns true if there are * or ? characters in type.
 int getErrorCode()
          Gets the error code from when a "subscribeAndGet" or "sendAndGet" is woken up by an error condition.
 cMsgMessageFull getMessage()
          Returns the message object.
 java.lang.String getSubject()
          Gets subject subscribed to.
 java.util.regex.Pattern getSubjectPattern()
          Gets subject turned into compiled regular expression pattern.
 java.lang.String getSubjectRegexp()
          Gets subject turned into regular expression that understands * and ?.
 java.lang.String getType()
          Gets type subscribed to.
 java.util.regex.Pattern getTypePattern()
          Gets type turned into compiled regular expression pattern.
 java.lang.String getTypeRegexp()
          Gets type turned into regular expression that understands * and ?.
 boolean isTimedOut()
          Returns true if the "subscribeAndGet" or "sendAndGet" call timed out.
 void setErrorCode(int errorCode)
          Sets the error code from when a "subscribeAndGet" or "sendAndGet" is woken up by an error condition.
 void setMessage(cMsgMessageFull message)
          Sets the messge object;
 void setTimedOut(boolean timedOut)
          Set boolean telling whether he "subscribeAndGet" or "sendAndGet" call timed out or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

cMsgGetHelper

public cMsgGetHelper()
Constructor used in sendAndGet.


cMsgGetHelper

public cMsgGetHelper(java.lang.String subject,
                     java.lang.String type)
Constructor used in subscribeAndGet.

Parameters:
subject - subject of subscription
type - type of subscription
Method Detail

getMessage

public cMsgMessageFull getMessage()
Returns the message object.

Returns:
the message object.

setMessage

public void setMessage(cMsgMessageFull message)
Sets the messge object;

Parameters:
message - the message object

isTimedOut

public boolean isTimedOut()
Returns true if the "subscribeAndGet" or "sendAndGet" call timed out.

Returns:
true if the "subscribeAndGet" or "sendAndGet" call timed out.

setTimedOut

public void setTimedOut(boolean timedOut)
Set boolean telling whether he "subscribeAndGet" or "sendAndGet" call timed out or not.

Parameters:
timedOut - boolean telling whether he "subscribeAndGet" or "sendAndGet" call timed out or not.

getErrorCode

public int getErrorCode()
Gets the error code from when a "subscribeAndGet" or "sendAndGet" is woken up by an error condition.

Returns:
error code

setErrorCode

public void setErrorCode(int errorCode)
Sets the error code from when a "subscribeAndGet" or "sendAndGet" is woken up by an error condition.

Parameters:
errorCode - error code

areWildCardsInSub

public boolean areWildCardsInSub()
Returns true if there are * or ? characters in subject.

Returns:
true if there are * or ? characters in subject.

areWildCardsInType

public boolean areWildCardsInType()
Returns true if there are * or ? characters in type.

Returns:
true if there are * or ? characters in type.

getSubject

public java.lang.String getSubject()
Gets subject subscribed to.

Returns:
subject subscribed to

getSubjectRegexp

public java.lang.String getSubjectRegexp()
Gets subject turned into regular expression that understands * and ?.

Returns:
subject subscribed to in regexp form

getSubjectPattern

public java.util.regex.Pattern getSubjectPattern()
Gets subject turned into compiled regular expression pattern.

Returns:
subject subscribed to in compiled regexp form

getType

public java.lang.String getType()
Gets type subscribed to.

Returns:
type subscribed to

getTypeRegexp

public java.lang.String getTypeRegexp()
Gets type turned into regular expression that understands * and ?.

Returns:
type subscribed to in regexp form

getTypePattern

public java.util.regex.Pattern getTypePattern()
Gets type turned into compiled regular expression pattern.

Returns:
type subscribed to in compiled regexp form