/** * Adds a frame to the transaction. As stated in the STOMP specification, only {@code SEND, ACK and NACK} frames * can be in transactions. * * @param frame the frame to add * @return {@code true} if the frame was added to the transaction, {@code false otherwise}. Main failure reason is the number of * frames stored in the transaction that have exceed the number of allowed frames in transaction. */ public synchronized boolean addFrameToTransaction(Frame frame) { return frames.size() < connection.server().options().getMaxFrameInTransaction() && frames.add(frame); }
public static void toJson(StompServerOptions obj, java.util.Map<String, Object> json) { if (obj.getHeartbeat() != null) { json.put("heartbeat", obj.getHeartbeat()); } json.put("maxBodyLength", obj.getMaxBodyLength()); json.put("maxFrameInTransaction", obj.getMaxFrameInTransaction()); json.put("maxHeaderLength", obj.getMaxHeaderLength()); json.put("maxHeaders", obj.getMaxHeaders()); json.put("maxSubscriptionsByClient", obj.getMaxSubscriptionsByClient()); json.put("secured", obj.isSecured()); json.put("sendErrorOnNoSubscriptions", obj.isSendErrorOnNoSubscriptions()); if (obj.getSupportedVersions() != null) { JsonArray array = new JsonArray(); obj.getSupportedVersions().forEach(item -> array.add(item)); json.put("supportedVersions", array); } json.put("timeFactor", obj.getTimeFactor()); json.put("trailingLine", obj.isTrailingLine()); json.put("transactionChunkSize", obj.getTransactionChunkSize()); json.put("websocketBridge", obj.isWebsocketBridge()); if (obj.getWebsocketPath() != null) { json.put("websocketPath", obj.getWebsocketPath()); } } }