public void putUnique(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { boolean ok = table.compareAndSet( // name.asBytes(), // colId.name(), // null, // key.asBytes()); if (!ok) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); }
public void remove(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { boolean ok = table.compareAndSet( name.asBytes(), colId.name(), key.asBytes(), null); if (!ok) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); } }
public void remove(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { boolean ok = table.compareAndSet( name.asBytes(), colId.name(), key.asBytes(), null); if (!ok) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); } }
public void putUnique(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { boolean ok = table.compareAndSet( // name.asBytes(), // colId.name(), // null, // key.asBytes()); if (!ok) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); }
public boolean compareAndRemove(RefKey refKey, RefData oldData) throws DhtException, TimeoutException { RepositoryKey repo = refKey.getRepositoryKey(); return table.compareAndSet( // repo.asBytes(), // colRef.append(refKey.asBytes()), // oldData != RefDataUtil.NONE ? oldData.toByteArray() : null, // null); } }
public boolean compareAndRemove(RefKey refKey, RefData oldData) throws DhtException, TimeoutException { RepositoryKey repo = refKey.getRepositoryKey(); return table.compareAndSet( // repo.asBytes(), // colRef.append(refKey.asBytes()), // oldData != RefDataUtil.NONE ? oldData.toByteArray() : null, // null); } }
public boolean compareAndPut(RefKey refKey, RefData oldData, RefData newData) throws DhtException, TimeoutException { RepositoryKey repo = refKey.getRepositoryKey(); return table.compareAndSet( // repo.asBytes(), // colRef.append(refKey.asBytes()), // oldData != RefDataUtil.NONE ? oldData.toByteArray() : null, // newData.toByteArray()); }
public boolean compareAndPut(RefKey refKey, RefData oldData, RefData newData) throws DhtException, TimeoutException { RepositoryKey repo = refKey.getRepositoryKey(); return table.compareAndSet( // repo.asBytes(), // colRef.append(refKey.asBytes()), // oldData != RefDataUtil.NONE ? oldData.toByteArray() : null, // newData.toByteArray()); }