@Override public int hashCode() { int result = requestId; result = 31 * result + (status != null ? status.hashCode() : 0); result = 31 * result + (bootstrapSync != null ? bootstrapSync.hashCode() : 0); result = 31 * result + (profileSync != null ? profileSync.hashCode() : 0); result = 31 * result + (configurationSync != null ? configurationSync.hashCode() : 0); result = 31 * result + (notificationSync != null ? notificationSync.hashCode() : 0); result = 31 * result + (userSync != null ? userSync.hashCode() : 0); result = 31 * result + (eventSync != null ? eventSync.hashCode() : 0); result = 31 * result + (redirectSync != null ? redirectSync.hashCode() : 0); result = 31 * result + (logSync != null ? logSync.hashCode() : 0); return result; }
private static RedirectServerSync deepCopy(RedirectServerSync source) { if (source == null) { return null; } return new RedirectServerSync(source.getAccessPointId()); }
private static ConfigurationServerSync deepCopy(ConfigurationServerSync source) { if (source == null) { return null; } ConfigurationServerSync copy = new ConfigurationServerSync(); copy.setResponseStatus(source.getResponseStatus()); copy.setConfDeltaBody(source.getConfDeltaBody()); copy.setConfSchemaBody(source.getConfSchemaBody()); return copy; }
private ServerSync buildRedirectionResponse(RedirectionRule redirection, ClientSync request) { RedirectServerSync redirectSyncResponse = new RedirectServerSync( redirection.getAccessPointId()); ServerSync response = new ServerSync(); response.setRequestId(request.getRequestId()); response.setStatus(SyncStatus.REDIRECT); response.setRedirectSync(redirectSyncResponse); return 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))); } }
@Override public int hashCode() { int result = requestId; result = 31 * result + (clientSyncMetaData != null ? clientSyncMetaData.hashCode() : 0); result = 31 * result + (bootstrapSync != null ? bootstrapSync.hashCode() : 0); result = 31 * result + (profileSync != null ? profileSync.hashCode() : 0); result = 31 * result + (forceConfigurationSync ? 1 : 0); result = 31 * result + (configurationSync != null ? configurationSync.hashCode() : 0); result = 31 * result + (forceNotificationSync ? 1 : 0); result = 31 * result + (notificationSync != null ? notificationSync.hashCode() : 0); result = 31 * result + (userSync != null ? userSync.hashCode() : 0); result = 31 * result + (eventSync != null ? eventSync.hashCode() : 0); result = 31 * result + (logSync != null ? logSync.hashCode() : 0); result = 31 * result + (useConfigurationRawSchema ? 1 : 0); return result; }
/** * Return true if client sync information is valid or false if not. * * @return true if valid, false if not */ public boolean isValid() { ClientSyncMetaData md = this.getClientSyncMetaData(); // TODO: validate if public key hash matches hash of public key during // profile registration command. if (md.getProfileHash() == null) { ProfileClientSync profileRequest = this.getProfileSync(); if (profileRequest == null || profileRequest.getEndpointPublicKey() == null) { return false; } } return true; }
private void updateResponseWithUserAttachResults(ServerSync response, UserVerificationResponseMessage message) { if (response.getUserSync() == null) { response.setUserSync(new UserServerSync()); } response.getUserSync().setUserAttachResponse(EntityConvertUtils.convert(message)); }
private void parseConfigurationClientSync(ClientSync sync, ByteBuffer buf, int options, int payloadLength) { ConfigurationClientSync confSync = new ConfigurationClientSync(); if (hasOption(options, CONFIGURATION_HASH_OPTION)) { confSync.setConfigurationHash(getNewByteBuffer(buf, CONFIGURATION_HASH_SIZE)); } if (hasOption(options, CONFIGURATION_RESYNC_OPTION)) { confSync.setResyncOnly(true); } sync.setConfigurationSync(confSync); }
private static ProfileServerSync deepCopy(ProfileServerSync source) { if (source == null) { return null; } return new ProfileServerSync(source.getResponseStatus()); }
private String getSdkToken(ClientSync request) { return request.getClientSyncMetaData().getSdkToken(); }
@Override public int hashCode() { int result = userAttachResponse != null ? userAttachResponse.hashCode() : 0; result = 31 * result + (userAttachNotification != null ? userAttachNotification.hashCode() : 0); result = 31 * result + (userDetachNotification != null ? userDetachNotification.hashCode() : 0); result = 31 * result + (endpointAttachResponses != null ? endpointAttachResponses.hashCode() : 0); result = 31 * result + (endpointDetachResponses != null ? endpointDetachResponses.hashCode() : 0); return result; }
public String getTarget() { return event.getTarget(); }
public void setEventSyncResponse(EventServerSync response) { this.response.setEventSync(response); }
public void setStatus(SyncStatus status) { this.response.setStatus(status); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + requestId; result = prime * result + ((this.result == null) ? 0 : this.result.hashCode()); return result; }
@Override public int hashCode() { return responseStatus != null ? responseStatus.hashCode() : 0; }
public String getAppToken() { return metaData.getApplicationToken(); }