@Override public Void forPath(String path) throws Exception { OperationAndData<String> operationAndData = new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext(), null); client.processBackgroundOperation(operationAndData, null); return null; } }
private void pathInBackground(final String path) { OperationAndData.ErrorCallback<String> errorCallback = null; //Only need an error callback if we're in guaranteed mode if(guaranteed) { errorCallback = new OperationAndData.ErrorCallback<String>() { @Override public void retriesExhausted(OperationAndData<String> operationAndData) { client.getFailedRemoveWatcherManager().addFailedOperation(new FailedRemoveWatchManager.FailedRemoveWatchDetails(path, watcher)); } }; } client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), errorCallback, backgrounding.getContext(), !local), null); }
public byte[] forEnsemble() throws Exception { if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<>(this, null, backgrounding.getCallback(), null, backgrounding.getContext(), null), null); return new byte[0]; } else { return ensembleInForeground(); } }
@Override public byte[] forEnsemble() throws Exception { if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<Void>(this, null, backgrounding.getCallback(), null, backgrounding.getContext(), watching), null); return null; } else { return configInForeground(); } }
@Override public List<ACL> forPath(String path) throws Exception { path = client.fixForNamespace(path); List<ACL> result = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext(), null), null); } else { result = pathInForeground(path); } return result; }
private void pathInBackground(final String path, final byte[] data, final String givenPath) OperationAndData<PathAndBytes> operationAndData = new OperationAndData<PathAndBytes>(this, new PathAndBytes(path, data), backgrounding.getCallback(), new OperationAndData.ErrorCallback<PathAndBytes>()
@Override public Stat forPath(String path) throws Exception { String fixedPath = client.fixForNamespace(path); List<ACL> aclList = acling.getAclList(fixedPath); client.getSchemaSet().getSchema(path).validateGeneral(path, null, aclList); Stat resultStat = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<String>(this, fixedPath, backgrounding.getCallback(), null, backgrounding.getContext(), null), null); } else { resultStat = pathInForeground(fixedPath, aclList); } return resultStat; }
@Override public byte[] forPath(String path) throws Exception { client.getSchemaSet().getSchema(path).validateWatch(path, watching.isWatched() || watching.hasWatcher()); path = client.fixForNamespace(path); byte[] responseData = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext(), watching), null); } else { responseData = pathInForeground(path); } return responseData; }
@Override public List<String> forPath(String path) throws Exception { client.getSchemaSet().getSchema(path).validateWatch(path, watching.isWatched() || watching.hasWatcher()); path = client.fixForNamespace(path); List<String> children = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext(), watching), null); } else { children = pathInForeground(path); } return children; }
@Override public Void forPath(String path) throws Exception { client.getSchemaSet().getSchema(path).validateDelete(path); final String unfixedPath = path; path = client.fixForNamespace(path); if ( backgrounding.inBackground() ) { OperationAndData.ErrorCallback<String> errorCallback = null; if ( guaranteed ) { errorCallback = new OperationAndData.ErrorCallback<String>() { @Override public void retriesExhausted(OperationAndData<String> operationAndData) { client.getFailedDeleteManager().addFailedOperation(unfixedPath); } }; } client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), errorCallback, backgrounding.getContext(), null), null); } else { pathInForeground(path, unfixedPath); } return null; }
@Override public Stat forPath(String path, byte[] data) throws Exception { client.getSchemaSet().getSchema(path).validateGeneral(path, data, null); if ( compress ) { data = client.getCompressionProvider().compress(path, data); } path = client.fixForNamespace(path); Stat resultStat = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<>(this, new PathAndBytes(path, data), backgrounding.getCallback(), null, backgrounding.getContext(), null), null); } else { resultStat = pathInForeground(path, data); } return resultStat; }
@Override public Stat forPath(String path) throws Exception { path = client.fixForNamespace(path); client.getSchemaSet().getSchema(path).validateWatch(path, watching.isWatched() || watching.hasWatcher()); Stat returnStat = null; if ( backgrounding.inBackground() ) { OperationAndData<String> operationAndData = new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext(), watching); if ( createParentContainersIfNeeded || createParentsIfNeeded ) { CreateBuilderImpl.backgroundCreateParentsThenNode(client, operationAndData, operationAndData.getData(), backgrounding, acling.getACLProviderForParents(), createParentContainersIfNeeded); } else { client.processBackgroundOperation(operationAndData, null); } } else { returnStat = pathInForeground(path); } return returnStat; }
@Override public Void forPath(String path) throws Exception { OperationAndData<String> operationAndData = new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext()); client.processBackgroundOperation(operationAndData, null); return null; } }
client.processBackgroundOperation(new OperationAndData<>(this, record, backgrounding.getCallback(), null, backgrounding.getContext(), null), null); return null;
@Override public Stat forPath(String path) throws Exception { path = client.fixForNamespace(path); Stat resultStat = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext()), null); } else { resultStat = pathInForeground(path); } return resultStat; }
@Override public byte[] forPath(String path) throws Exception { path = client.fixForNamespace(path); byte[] responseData = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext()), null); } else { responseData = pathInForeground(path); } return responseData; }
@Override public List<ACL> forPath(String path) throws Exception { path = client.fixForNamespace(path); List<ACL> result = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext()), null); } else { result = pathInForeground(path); } return result; }
@Override public List<String> forPath(String path) throws Exception { path = client.fixForNamespace(path); List<String> children = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), null, backgrounding.getContext()), null); } else { children = pathInForeground(path); } return children; }
@Override public Void forPath(String path) throws Exception { final String unfixedPath = path; path = client.fixForNamespace(path); if ( backgrounding.inBackground() ) { OperationAndData.ErrorCallback<String> errorCallback = null; if ( guaranteed ) { errorCallback = new OperationAndData.ErrorCallback<String>() { @Override public void retriesExhausted(OperationAndData<String> operationAndData) { client.getFailedDeleteManager().addFailedDelete(unfixedPath); } }; } client.processBackgroundOperation(new OperationAndData<String>(this, path, backgrounding.getCallback(), errorCallback, backgrounding.getContext()), null); } else { pathInForeground(path, unfixedPath); } return null; }
@Override public Stat forPath(String path, byte[] data) throws Exception { if ( compress ) { data = client.getCompressionProvider().compress(path, data); } path = client.fixForNamespace(path); Stat resultStat = null; if ( backgrounding.inBackground() ) { client.processBackgroundOperation(new OperationAndData<PathAndBytes>(this, new PathAndBytes(path, data), backgrounding.getCallback(), null, backgrounding.getContext()), null); } else { resultStat = pathInForeground(path, data); } return resultStat; }