public void setEventSyncResponse(EventServerSync response) { this.response.setEventSync(response); }
private void processSeqNumber(EventClientSync request, SyncContext responseHolder) { if (request.isSeqNumberRequest()) { EventServerSync response = responseHolder.getResponse().getEventSync(); if (response == null) { response = new EventServerSync(); responseHolder.getResponse().setEventSync(response); } response.setEventSequenceNumberResponse(new EventSequenceNumberResponse( Math.max(state.getEventSeqNumber(), 0))); } }
/** * Clean <code>ServerSync</code>, which mean that all fields are null. * * @param syncResponse is instance for cleaning */ public static void cleanup(ServerSync syncResponse) { if (syncResponse == null) { return; } syncResponse.setUserSync(null); syncResponse.setRedirectSync(null); syncResponse.setProfileSync(null); syncResponse.setNotificationSync(null); syncResponse.setLogSync(null); syncResponse.setEventSync(null); syncResponse.setConfigurationSync(null); }
private void addEventsAndReply(ActorContext context, ChannelMetaData channel, EndpointEventReceiveMessage message) { SyncRequestMessage pendingRequest = channel.getRequestMessage(); SyncContext pendingResponse = channel.getResponseHolder(); EventServerSync eventResponse = pendingResponse.getResponse().getEventSync(); if (eventResponse == null) { eventResponse = new EventServerSync(); pendingResponse.getResponse().setEventSync(eventResponse); } eventResponse.setEvents(message.getEvents()); sendReply(context, pendingRequest, pendingResponse.getResponse()); if (!channel.getType().isAsync()) { state.removeChannel(channel); } }
/** * make deep copy of <code>ServerSync</code> instance. * * @param source is source for copping * @return deep copy of <code>ServerSync</code> instance */ public static ServerSync deepCopy(ServerSync source) { if (source == null) { return null; } ServerSync copy = new ServerSync(); copy.setRequestId(source.getRequestId()); copy.setStatus(source.getStatus()); copy.setUserSync(deepCopy(source.getUserSync())); copy.setRedirectSync(deepCopy(source.getRedirectSync())); copy.setProfileSync(deepCopy(source.getProfileSync())); copy.setNotificationSync(deepCopy(source.getNotificationSync())); copy.setLogSync(deepCopy(source.getLogSync())); copy.setEventSync(deepCopy(source.getEventSync())); copy.setConfigurationSync(deepCopy(source.getConfigurationSync())); return copy; }