/*
(non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.LocalizationPoint#getOldestMessageAge()
333841
public long getOldestMessageAge()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getOldestMessageAge");
    MessageItem oldestItem=null;
    try
    {
      oldestItem = (MessageItem)this.findOldestItem();
    }
    catch (MessageStoreException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.itemstreams.PtoPMessageItemStream.getOldestMessageAge",
        "1:825:1.93.1.14",
        this);        
            
      SibTr.exception(tc, e);       
    }
        
    long age = 0;
        
    if (null != oldestItem)
    {
      age = oldestItem.calculateWaitTimeUpdate(
        java.lang.System.currentTimeMillis());
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getOldestMessageAge", new Long(age));
    return age;
  }
599423
@Override
  public MessageRepresentation getMessage(int commandCode, long applicationId, boolean isRequest) {
    if (!this.configured) {
      return null;
    }
    MessageRepresentation key = new MessageRepresentationImpl(commandCode, applicationId, isRequest);
    return this.commandMap.get(key);
  }
89560
@Override
    public MessageResourcesGateway getMessageResourceGateway() {
        final MessageResourcesGateway gateway = messageResourcesHolder.getGateway();
        if (gateway == null) {
            String msg = "Not found the gateway for message resource: holder=" + messageResourcesHolder;
            throw new IllegalStateException(msg);
        }
        return gateway;
    }
32279
@Override
    public String getFormattedMessage() {
        return message = message == null ? String.valueOf(charSequence) : message ;
    }
1167184
public int getRemainingMessageCount() 
  throws SISessionUnavailableException, SISessionDroppedException,
         SIIncorrectCallException
  {
    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.entry(CoreSPILockedMessageEnumeration.tc, "getRemainingMessageCount", this);
          
    checkValidState("getRemainingMessageCount");
          
    _localConsumerPoint.checkNotClosed();
    
    int remaining = 0;
    
    if(!_seenSingleMessage)
    {
      remaining = 1;
    }
    
    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.exit(CoreSPILockedMessageEnumeration.tc, "getRemainingMessageCount", 
        new Integer(remaining));    
      
    return remaining;
  }
827296
private int getUnSeenMessageCount() 
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"getUnseenMessageCount");
      
      int remain = 0;
      for (int x = nextIndex; x < messages.length; x++)
      {
         if (messages[x] != null) remain++;
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"getUnseenMessageCount", ""+remain);
      return remain;
   }
1368545
public BaseConvertToMessage getConvertToMessage()
    {
        if (m_convertToMessage == null)
        {
            BaseMessageHeader trxMessageHeader = this.getMessage().getMessageHeader();
            String strMessageClass = (String)trxMessageHeader.get(TrxMessageHeader.MESSAGE_MARSHALLER_CLASS);
            String strPackage = (String)trxMessageHeader.get(TrxMessageHeader.BASE_PACKAGE);
            strMessageClass = ClassServiceUtility.getFullClassName(strPackage, strMessageClass);
            m_convertToMessage = (BaseConvertToMessage)ClassServiceUtility.getClassService().makeObjectFromClassName(strMessageClass);
            if (m_convertToMessage != null)
            	m_convertToMessage.init(this);
        }
        return m_convertToMessage;
    }
424267
public JsMessage getJsMessage()
  {
		if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
			SibTr.entry(tc, "getJsMessage");

    InvalidOperationException finalE =
      new InvalidOperationException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0005",
          new Object[] {"RemoteMessageRequest.getJsMessage",
                        "1:127:1.34",
                        this},
          null));

    SibTr.exception(tc, finalE);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getJsMessage");
    throw finalE;
  }
1172972
public String getMessage ()
    {
    String message = super.getMessage();

    if (message == null && exception != null) {
        return exception.getMessage();
    } else {
        return message;
    }
    }
1286389
public int getRemainingMessageCount()
      throws SISessionUnavailableException, SISessionDroppedException,
             SIConnectionUnavailableException, SIConnectionDroppedException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"getRemainingMessageCount");
      checkValid();
      
      int remain = getUnSeenMessageCount();
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"getRemainingMessageCount", ""+remain);
      return remain;
   }
688415
public String getMessage(Throwable t) {

        if ((t instanceof I_CmsThrowable) && (((I_CmsThrowable)t).getMessageContainer() != null)) {
            StringBuffer result = new StringBuffer(256);
            if (m_throwable instanceof CmsMultiException) {
                CmsMultiException exc = (CmsMultiException)m_throwable;
                String message = exc.getMessage(m_locale);
                if (CmsStringUtil.isNotEmpty(message)) {
                    result.append(message);
                    result.append('\n');
                }

            }

            I_CmsThrowable cmsThrowable = (I_CmsThrowable)t;
            result.append(cmsThrowable.getLocalizedMessage(m_locale));
            return result.toString();
        } else {
            String message = t.getMessage();
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(message)) {
                // no error message found (e.g. for NPE), provide default message text
                message = m_messages.key(Messages.GUI_ERROR_UNKNOWN_0);
            }
            return message;
        }
    }
321476
public String getDetailedMessage() {
        String prepend = getSourceInfoMessage();
        if (prepend == null || prepend.length() == 0) {
            return mMessage;
        }
        else {
            return prepend + ": " + mMessage;
        }
    }
614974
private String getMessage(boolean localized) {
        String msg = localized ? super.getLocalizedMessage() : super.getMessage();
        StringBuilder sb = new StringBuilder(msg == null ? "" : msg);
        
        for (Throwable exception : exceptions) {
            msg = localized ? exception.getLocalizedMessage() : exception.getMessage();
            
            if (msg != null) {
                sb.append(sb.length() == 0 ? "" : "\n\n").append(msg);
            }
        }
        
        return sb.toString();
    }
387781
public int getMessageLength() {
    // Message type, number of type specifications
    int length = 1 + 4;

    if (this.attributeSpecifications != null) {
      for (AttributeSpecification spec : this.attributeSpecifications) {
        // alias, Name length, transient byte
        length += (4 + 4 + 1);
        if (spec.getAttributeName() != null) {
          try {
            length += spec.getAttributeName().getBytes("UTF-16BE").length;
          } catch (UnsupportedEncodingException e) {
            log.error("Unable to encode UTF-16BE strings.");
          }
        }
      }
    }

    if (this.origin != null) {
      try {
        length += this.origin.getBytes("UTF-16BE").length;
      } catch (UnsupportedEncodingException e) {
        log.error("Unable to encode UTF-16 strings.");
        e.printStackTrace();
      }
    }

    return length;
  }
571777
public final int getMessageStoreType() {

        String thisMethodName = "getMessageStoreType";
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, this);
        }

        // filestore
        int msType = JsMessagingEngine.MESSAGE_STORE_TYPE_FILESTORE;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName, new Integer(msType));
        }
        return msType;
    }
210258
public String getLocalizedMessage() {
  		Formatter f = new Formatter();
		f.format(m_defaultMessage, m_arguments);
        return f.toString();
    }
894800
public String getMessage() {
        if ( this.cause == null ) {
            return super.getMessage() + " Line number: " + this.lineNumber;
        } else {
            return super.getMessage() + " Line number: " + this.lineNumber + ". Caused by: " + this.cause.getMessage();
        }
    }