
com.distelli.persistence.PersistenceConfig Maven / Gradle / Ivy
package com.distelli.persistence;
import com.distelli.cred.CredProvider;
import com.distelli.crypto.KeyProvider;
import java.io.File;
import java.net.URI;
public interface PersistenceConfig {
public static PersistenceConfig IN_MEMORY = new PersistenceConfig() {
public Double getCapacityScaleFactor() {
return 1d;
}
public String getTableNameFormat() {
return "%s";
}
public URI getEndpoint() {
return URI.create("local://localhost");
}
public URI getProxy() {
return null;
}
public CredProvider getCredProvider() {
return null;
}
public File getFile() {
return null;
}
public KeyProvider getKeyProvider() {
return null;
}
};
public interface Factory {
/**
* @param file is the file to read for the PersistenceConfig.
*
* @return the config read from the file.
*/
public PersistenceConfig create(File file);
/**
* @param file is the file to read for the PersistenceConfig.
*
* @param defaultConfig is used if any field is null.
*
* @return the config read from the file.
*/
public PersistenceConfig create(File file, PersistenceConfig defaultConfig);
}
/**
* @return the scale factor capacity to use when creating new tables.
*/
public Double getCapacityScaleFactor();
/**
* @return the tableNameFormat or null.
*/
public String getTableNameFormat();
/**
* @return the endpoint specified or null.
*/
public URI getEndpoint();
/**
* @return the proxy URI if specified or null.
*/
public URI getProxy();
/**
* @return the CredProvider for this PersistenceConfig.
*/
public CredProvider getCredProvider();
/**
* @return null if the config did not originate from a file, otherwise
* return the file in which the config originates from.
*/
public File getFile();
/**
* @return the default KeyProvider.
*/
public KeyProvider getKeyProvider();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy