protected int checkAndSetSecurityPart() { if ((this.flags | MESSAGE_HAS_SECURE_PART) == this.flags) { this.securePart = new Part(); return 1; } else { this.securePart = null; return 0; } }
/** * Sets and builds the {@link Part}s that are sent in the payload of the Message */ public void setNumberOfParts(int numberOfParts) { // hitesh: need to add security header here from server // need to insure it is not chunked message // should we look message type to avoid internal message like ping this.messageModified = true; this.currentPart = 0; this.numberOfParts = numberOfParts; if (numberOfParts > this.partsList.length) { Part[] newPartsList = new Part[numberOfParts]; for (int i = 0; i < numberOfParts; i++) { if (i < this.partsList.length) { newPartsList[i] = this.partsList[i]; } else { newPartsList[i] = new Part(); } } this.partsList = newPartsList; } }
public void setSecurePart(byte[] bytes) { this.securePart = new Part(); this.securePart.setPartState(bytes, false); }
/** * Creates a new message with the given number of parts */ public Message(int numberOfParts, Version destVersion) { this.maxMessageSize = Integer.getInteger(MAX_MESSAGE_SIZE_PROPERTY, DEFAULT_MAX_MESSAGE_SIZE); this.version = destVersion; Assert.assertTrue(destVersion != null, "Attempt to create an unversioned message"); this.partsList = new Part[numberOfParts]; this.numberOfParts = numberOfParts; int partsListLength = this.partsList.length; for (int i = 0; i < partsListLength; i++) { this.partsList[i] = new Part(); } }
private void setSecurityPart() { try { this.connectionId = randomConnectionIdGen.nextLong(); this.securePart = new Part(); byte[] id = encryptId(this.connectionId); this.securePart.setPartState(id, false); } catch (Exception ex) { logger.warn("Server failed to encrypt data " + ex); throw new GemFireSecurityException("Server failed to encrypt response message."); } }
setLastChunk((lastChunk & 0x01) == 0x01); if ((lastChunk & 0x02) == 0x02) { this.securePart = new Part(); if (logger.isDebugEnabled()) { logger.debug("ChunkedMessage.readChunk() securePart present");