public void addObjPart(Object o) { addObjPart(o, false); }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public GetPDXIdForTypeOpImpl(PdxType type) { super(MessageType.GET_PDX_ID_FOR_TYPE, 1); getMessage().addObjPart(type); }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public GetEventValueOpImpl(EventID event, Object callbackArg) { super(MessageType.REQUEST_EVENT_VALUE, callbackArg != null ? 2 : 1); getMessage().addObjPart(event); if (callbackArg != null) { getMessage().addObjPart(callbackArg); } }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public GetPDXIdForEnumOpImpl(EnumInfo ei) { super(MessageType.GET_PDX_ID_FOR_ENUM, 1); getMessage().addObjPart(ei); }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public PrimaryAckOpImpl(List events) { super(MessageType.PERIODIC_ACK, events.size()); for (Iterator i = events.iterator(); i.hasNext();) { getMessage().addObjPart(i.next()); } }
@Override protected void initMessagePart() { Object[] keysArray = new Object[this.keyList.size()]; this.keyList.toArray(keysArray); getMessage().addObjPart(keysArray); if (this.callback != null) { getMessage().addObjPart(this.callback); } else { // using the old GET_ALL_70 command that expects an int saying we are not register interest getMessage().addIntPart(0); } }
protected Message getGFEMessage() throws IOException { Message message = new Message(1, Version.CURRENT); message.setMessageType(MessageType.CLIENT_MARKER); message.setTransactionId(0); message.addObjPart(this.eventId); return message; }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public AddPdxEnumOpImpl(int id, EnumInfo ei) { super(MessageType.ADD_PDX_ENUM, 2); getMessage().addObjPart(ei); getMessage().addIntPart(id); }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public AddPDXTypeOpImpl(int id, PdxType type) { super(MessageType.ADD_PDX_TYPE, 2); getMessage().addObjPart(type); getMessage().addIntPart(id); }
public ExecuteFunctionNoAckOpImpl(String functionId, Object args, MemberMappedArgument memberMappedArg, byte hasResult, boolean isFnSerializationReqd, boolean isHA, boolean optimizeForWrite, String[] groups, boolean allMembers) { super(MessageType.EXECUTE_FUNCTION, MSG_PARTS); getMessage().addBytesPart(new byte[] {AbstractExecution.getFunctionState(isHA, hasResult == (byte) 1 ? true : false, optimizeForWrite)}); getMessage().addStringOrObjPart(functionId); getMessage().addObjPart(args); getMessage().addObjPart(memberMappedArg); getMessage().addObjPart(groups); getMessage().addBytesPart(ExecuteFunctionOp.getByteArrayForFlags(allMembers)); }
@Test public void oldSecurityShouldFailIfNotAuthorized() throws Exception { when(this.securityService.isClientSecurityRequired()).thenReturn(true); when(this.securityService.isIntegratedSecurity()).thenReturn(false); doThrow(new NotAuthorizedException("")).when(this.authzRequest).putAuthorize(eq(REGION_NAME), eq(KEY), eq(VALUE), eq(true), eq(CALLBACK_ARG)); this.put.cmdExecute(this.message, this.serverConnection, this.securityService, 0); verify(this.authzRequest).putAuthorize(eq(REGION_NAME), eq(KEY), eq(VALUE), eq(true), eq(CALLBACK_ARG)); ArgumentCaptor<NotAuthorizedException> argument = ArgumentCaptor.forClass(NotAuthorizedException.class); verify(this.errorResponseMessage).addObjPart(argument.capture()); assertThat(argument.getValue()).isExactlyInstanceOf(NotAuthorizedException.class); verify(this.errorResponseMessage).send(this.serverConnection); }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public QueryOpImpl(String queryPredicate, Object[] queryParams) { super(MessageType.QUERY_WITH_PARAMETERS, 2 + queryParams.length); getMessage().addStringPart(queryPredicate); getMessage().addIntPart(queryParams.length); for (Object param : queryParams) { getMessage().addObjPart(param); } }
private static void writeContainsKeyResponse(boolean containsKey, Message origMsg, ServerConnection servConn) throws IOException { Message responseMsg = servConn.getResponseMessage(); responseMsg.setMessageType(MessageType.RESPONSE); responseMsg.setNumberOfParts(1); responseMsg.setTransactionId(origMsg.getTransactionId()); responseMsg.addObjPart(containsKey ? Boolean.TRUE : Boolean.FALSE); responseMsg.send(servConn); }
private static void writeSizeResponse(Integer sizeCount, Message origMsg, ServerConnection servConn) throws IOException { Message responseMsg = servConn.getResponseMessage(); responseMsg.setMessageType(MessageType.RESPONSE); responseMsg.setNumberOfParts(1); responseMsg.setTransactionId(origMsg.getTransactionId()); responseMsg.addObjPart(sizeCount); responseMsg.send(servConn); }
private static void writeContainsKeyResponse(boolean containsKey, Message origMsg, ServerConnection servConn) throws IOException { Message responseMsg = servConn.getResponseMessage(); responseMsg.setMessageType(MessageType.RESPONSE); responseMsg.setNumberOfParts(1); responseMsg.setTransactionId(origMsg.getTransactionId()); responseMsg.addObjPart(containsKey ? Boolean.TRUE : Boolean.FALSE); responseMsg.send(servConn); }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public ClearOpImpl(String region, EventID eventId, Object callbackArg) { super(MessageType.CLEAR_REGION, callbackArg != null ? 3 : 2); getMessage().addStringPart(region); getMessage().addBytesPart(eventId.calcBytes()); if (callbackArg != null) { getMessage().addObjPart(callbackArg); } }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public DestroyRegionOpImpl(String region, EventID eventId, Object callbackArg) { super(MessageType.DESTROY_REGION, callbackArg != null ? 3 : 2); getMessage().addStringPart(region); getMessage().addBytesPart(eventId.calcBytes()); if (callbackArg != null) { getMessage().addObjPart(callbackArg); } }
protected Message getGFEMessage(Version clientVersion) { Message message = null; int dataSerializerLength = this.serializedDataSerializer.length; message = new Message(dataSerializerLength + 1, clientVersion); // one for eventID // Set message type message.setMessageType(MessageType.REGISTER_DATASERIALIZERS); for (int i = 0; i < dataSerializerLength; i = i + 2) { message.addBytesPart(this.serializedDataSerializer[i]); message.addBytesPart(this.serializedDataSerializer[i + 1]); } message.setTransactionId(0); message.addObjPart(this.getEventId()); return message; }
/** * @throws org.apache.geode.SerializationException if serialization fails */ public InvalidateOpImpl(String region, EntryEventImpl event) { super(MessageType.INVALIDATE, event.getCallbackArgument() != null ? 4 : 3); Object callbackArg = event.getCallbackArgument(); this.event = event; getMessage().addStringPart(region); getMessage().addStringOrObjPart(event.getKeyInfo().getKey()); getMessage().addBytesPart(event.getEventId().calcBytes()); if (callbackArg != null) { getMessage().addObjPart(callbackArg); } }
@Test public void numberOfPartsIsAdjusted() { int numParts = this.message.getNumberOfParts(); this.message.setNumberOfParts(2 * numParts + 1); assertEquals(2 * numParts + 1, this.message.getNumberOfParts()); this.message.addBytesPart(new byte[1]); this.message.addIntPart(2); this.message.addLongPart(3); this.message.addObjPart("4"); this.message.addStringPart("5"); assertEquals(5, this.message.getNextPartNumber()); }