/** * {@inheritDoc} */ @Override public String toString() { StringBuilder str = new StringBuilder(); str.append(getClass().getSimpleName()).append("(") .append("TrackId:").append(getTrackingId()).append(",") .append("Tag:").append(getTag()).append(",") .append("Encoding:").append(getEncoding()).append(",") .append("MimeType:").append(getMimeType()).append(",") .append("Size:").append(getSize()).append(")"); return str.toString(); }
/** * Sets binary data for the message. Binary message will be base64 encoded and message encoding set to "base64". * * @param bytes * binary message content * @param args * list of arguments associated with this message */ public void setMessage(byte[] bytes, Object... args) { strData = new String(Base64.encodeBase64(bytes)); setEncoding(ENCODING_BASE64); setMimeType(MIME_TYPE_BINARY); if (strData != null) { setSize(strData.length()); } else { setSize(0); } argList = args; }
/** * Creates a message object with the specified properties. * * @param signature * unique signature identifying message * @param msg * actual string message associated with this instance * @param args * argument list passed along the message * @throws NullPointerException * if any arguments are {@code null} * @throws IllegalArgumentException * if signature is empty or too long */ public Message(String signature, String msg, Object... args) { setTrackingId(signature); setMessage(msg, args); }
curMsg = new Message(TNT4JSimulator.newUUID()); messageIds.put(id, curMsg); totalBytesRead += bytesRead; curMsg.setMessage(binData); msgData.append(text, 0, numRead); curMsg.setMessage(msgData.toString()); } catch (Exception e) { throw new SAXParseException("Failed loading message data from " + fileName, saxLocator, e); curMsg.setMimeType(mimeType); curMsg.setEncoding(encoding); curMsg.setCharset(charset);
curEvent.setTrackingId(eventMsg.getTrackingId()); curEvent.setMessage(expandEnvVars(eventMsg.getMessage())); } else if (msgtext != null) { curEvent.setMessage(expandEnvVars(msgtext));
/** * Creates a message object with the specified properties. * * @param signature * unique signature identifying message * @throws NullPointerException * if any arguments are {@code null} * @throws IllegalArgumentException * if signature is empty or too long */ public Message(String signature) { setTrackingId(signature); }
@Override public String sign(Message obj) throws NoSuchAlgorithmException { return sign(obj.getMessage()); }
private void recordMsgData() throws SAXException { if (curMsg == null) { return; } String msgData = curElmtValue.toString(); if (TNT4JSimulator.isGenerateValues()) { msgData = generateValues(msgData); } curMsg.setMessage(msgData); }
return super.getFieldValue(fieldName);
/** * {@inheritDoc} */ @Override public void startDocument() throws SAXException { activeActivities.clear(); activeElements.clear(); genValues.clear(); curMsg = null; curActivity = null; curActivityStart = null; curElement = null; setDocumentLocator(saxLocator); if (TNT4JSimulator.useUniqueTags()) { tagSuffix = "@" + String.valueOf(Utils.currentTimeUsec()) + "@" + TNT4JSimulator.getIteration(); } if (TNT4JSimulator.useUniqueIds()) { for (Message m : messageIds.values()) { m.setTrackingId(TNT4JSimulator.newUUID()); } } if (TNT4JSimulator.useUniqueCorrs()) { corSuffix = "@" + String.valueOf(Utils.currentTimeUsec()) + "@" + TNT4JSimulator.getIteration(); } simCurrTime = new UsecTimestamp(); }
return getMessage();
/** * Creates a message object with the specified properties. * * @param signature * unique signature identifying message * @param msg * actual byte message associated with this instance * @param args * argument list passed along the message * @throws NullPointerException * if any arguments are {@code null} * @throws IllegalArgumentException * if signature is empty or too long */ public Message(String signature, byte[] msg, Object... args) { setTrackingId(signature); setMessage(msg, args); }