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 static ConfigurationSyncResponse convert(ConfigurationServerSync source) { if (source == null) { return null; } ConfigurationSyncResponse sync = new ConfigurationSyncResponse(); sync.setConfDeltaBody(source.getConfDeltaBody()); sync.setConfSchemaBody(source.getConfSchemaBody()); sync.setResponseStatus(convert(source.getResponseStatus())); return sync; }
ConfigurationServerSync response = new ConfigurationServerSync(); if (deltaResponse.getDelta() != null) { try { response.setConfDeltaBody(ByteBuffer.wrap(deltaResponse.getDelta().getData())); } catch (IOException ex) { LOG.error("conf delta invalid: {}", ex); response.setConfSchemaBody( ByteBuffer.wrap(deltaResponse.getConfSchema().getBytes("UTF-8"))); } catch (UnsupportedEncodingException ex) { response.setResponseStatus(SyncResponseStatus.RESYNC); break; case DELTA: response.setResponseStatus(SyncResponseStatus.DELTA); break; default: response.setResponseStatus(SyncResponseStatus.NO_DELTA); break;
private void encode(GrowingByteBuffer buf, ConfigurationServerSync configurationSync) { int option = 0; ByteBuffer confSchemaBody = configurationSync.getConfSchemaBody(); ByteBuffer confDeltaBody = configurationSync.getConfDeltaBody(); boolean confSchemaPresent = confSchemaBody != null && confSchemaBody.hasArray()
&& response.getConfigurationSync().getResponseStatus() != SyncResponseStatus.NO_DELTA) { return true;
? !configurationSync.equals(that.configurationSync) : that.configurationSync != null) { return false;
@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; }