@Override public void writeObject(ObjectOutput output, UUID uuid) throws IOException { MarshallUtil.marshallUUID(uuid, output, true); }
@Override public void writeTo(ObjectOutput output) throws IOException { MarshallUtil.marshallEnum(commandType, output); output.writeObject(queryDefinition); MarshallUtil.marshallUUID(queryId, output, true); output.writeInt(docIndex); }
@Override public void writeTo(ObjectOutput output) throws IOException { MarshallUtil.marshallEnum(commandType, output); output.writeObject(query); MarshallUtil.marshallUUID(lazyQueryId, output, true); output.writeInt(docIndex); }
@Test public void testUUID() throws IOException { ObjectInputOutput io = new ObjectInputOutput(); MarshallUtil.marshallUUID(null, io, true); Assert.assertNull(MarshallUtil.unmarshallUUID(io, true)); Assert.assertEquals(0, io.buffer.size()); for (int i = 0; i < NR_RANDOM; ++i) { io.reset(); UUID uuid = UUID.randomUUID(); MarshallUtil.marshallUUID(uuid, io, false); Assert.assertEquals(uuid, MarshallUtil.unmarshallUUID(io, false)); Assert.assertEquals(0, io.buffer.size()); } for (int i = 0; i < NR_RANDOM; ++i) { io.reset(); UUID uuid = UUID.randomUUID(); MarshallUtil.marshallUUID(uuid, io, true); Assert.assertEquals(uuid, MarshallUtil.unmarshallUUID(io, true)); Assert.assertEquals(0, io.buffer.size()); } }
@Override public void writeObject(ObjectOutput output, AuthenticatedClientSessionEntity session) throws IOException { MarshallUtil.marshallUUID(session.id, output, false); MarshallUtil.marshallString(session.getRealmId(), output); MarshallUtil.marshallString(session.getAuthMethod(), output); MarshallUtil.marshallString(session.getRedirectUri(), output); KeycloakMarshallUtil.marshall(session.getTimestamp(), output); MarshallUtil.marshallString(session.getAction(), output); Map<String, String> notes = session.getNotes(); KeycloakMarshallUtil.writeMap(notes, KeycloakMarshallUtil.STRING_EXT, KeycloakMarshallUtil.STRING_EXT, output); MarshallUtil.marshallString(session.getCurrentRefreshToken(), output); KeycloakMarshallUtil.marshall(session.getCurrentRefreshTokenUseCount(), output); }