public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });
public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });
public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });