/** * Set the reader options. * * @param opt * new reader options object. * @return {@code this} */ public B setReaderOptions(DhtReaderOptions opt) { readerOptions = opt; return self(); }
/** * Set the name of the repository to open. * * @param name * the name. * @return {@code this}. */ public B setRepositoryName(String name) { this.name = name; return self(); }
/** * Set the cluster used to store the repositories. * * @param database * the database supplier. * @return {@code this} */ public B setDatabase(D database) { this.database = database; return self(); }
/** * Set the reader options. * * @param opt * new reader options object. * @return {@code this} */ public B setReaderOptions(DhtReaderOptions opt) { readerOptions = opt; return self(); }
/** * Set the inserter options. * * @param opt * new inserter options object. * @return {@code this} */ public B setInserterOptions(DhtInserterOptions opt) { inserterOptions = opt; return self(); }
/** * @param key * @return {@code this} */ public B setRepositoryKey(RepositoryKey key) { this.key = key; return self(); }
/** * @param key * @return {@code this} */ public B setRepositoryKey(RepositoryKey key) { this.key = key; return self(); }
/** * Set the cluster used to store the repositories. * * @param database * the database supplier. * @return {@code this} */ public B setDatabase(D database) { this.database = database; return self(); }
/** * Set the inserter options. * * @param opt * new inserter options object. * @return {@code this} */ public B setInserterOptions(DhtInserterOptions opt) { inserterOptions = opt; return self(); }
/** * Set the name of the repository to open. * * @param name * the name. * @return {@code this}. */ public B setRepositoryName(String name) { this.name = name; return self(); }
@Override public B setWorkTree(File workTree) { if (workTree != null) throw new IllegalArgumentException(); return self(); }
@Override public B setGitDir(File gitDir) { if (gitDir != null) throw new IllegalArgumentException(); return self(); }
@Override public B setWorkTree(File workTree) { if (workTree != null) throw new IllegalArgumentException(); return self(); }
@Override public B setGitDir(File gitDir) { if (gitDir != null) throw new IllegalArgumentException(); return self(); }
@Override public B setObjectDirectory(File objectDirectory) { if (objectDirectory != null) throw new IllegalArgumentException(); return self(); }
@Override public B setIndexFile(File indexFile) { if (indexFile != null) throw new IllegalArgumentException(); return self(); } }
@Override public B setIndexFile(File indexFile) { if (indexFile != null) throw new IllegalArgumentException(); return self(); } }
@Override public B setObjectDirectory(File objectDirectory) { if (objectDirectory != null) throw new IllegalArgumentException(); return self(); }
@Override public B setup() throws IllegalArgumentException, DhtException, RepositoryNotFoundException { if (getDatabase() == null) throw new IllegalArgumentException(DhtText.get().databaseRequired); if (getReaderOptions() == null) setReaderOptions(new DhtReaderOptions()); if (getInserterOptions() == null) setInserterOptions(new DhtInserterOptions()); if (getRepositoryKey() == null) { if (getRepositoryName() == null) throw new IllegalArgumentException(DhtText.get().nameRequired); RepositoryKey r; try { r = getDatabase().repositoryIndex().get( RepositoryName.create(name)); } catch (TimeoutException e) { throw new DhtTimeoutException(MessageFormat.format( DhtText.get().timeoutLocatingRepository, name), e); } if (isMustExist() && r == null) throw new RepositoryNotFoundException(getRepositoryName()); if (r != null) setRepositoryKey(r); } return self(); }
@Override public B setup() throws IllegalArgumentException, DhtException, RepositoryNotFoundException { if (getDatabase() == null) throw new IllegalArgumentException(DhtText.get().databaseRequired); if (getReaderOptions() == null) setReaderOptions(new DhtReaderOptions()); if (getInserterOptions() == null) setInserterOptions(new DhtInserterOptions()); if (getRepositoryKey() == null) { if (getRepositoryName() == null) throw new IllegalArgumentException(DhtText.get().nameRequired); RepositoryKey r; try { r = getDatabase().repositoryIndex().get( RepositoryName.create(name)); } catch (TimeoutException e) { throw new DhtTimeoutException(MessageFormat.format( DhtText.get().timeoutLocatingRepository, name), e); } if (isMustExist() && r == null) throw new RepositoryNotFoundException(getRepositoryName()); if (r != null) setRepositoryKey(r); } return self(); }