mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
Use static method for new StoreParameters instance
This commit is contained in:
@@ -48,7 +48,8 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import sonia.scm.store.ConfigurationStore;
|
import sonia.scm.store.ConfigurationStore;
|
||||||
import sonia.scm.store.ConfigurationStoreFactory;
|
import sonia.scm.store.ConfigurationStoreFactory;
|
||||||
import sonia.scm.store.StoreParameters;
|
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,8 +75,8 @@ public abstract class AbstractRepositoryHandler<C extends RepositoryConfig>
|
|||||||
* @param storeFactory
|
* @param storeFactory
|
||||||
*/
|
*/
|
||||||
protected AbstractRepositoryHandler(ConfigurationStoreFactory storeFactory) {
|
protected AbstractRepositoryHandler(ConfigurationStoreFactory storeFactory) {
|
||||||
this.store = storeFactory.getStore(new StoreParameters()
|
this.store = storeFactory.getStore(
|
||||||
.withType(getConfigClass())
|
forType(getConfigClass())
|
||||||
.withName(getType().getName())
|
.withName(getType().getName())
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ public class StoreParameters {
|
|||||||
return repository;
|
return repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WithType withType(Class type){
|
public static WithType forType(Class type){
|
||||||
return new WithType(type);
|
return new StoreParameters().new WithType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WithType {
|
public class WithType {
|
||||||
|
|||||||
@@ -39,11 +39,12 @@ import com.google.inject.Singleton;
|
|||||||
|
|
||||||
import sonia.scm.group.Group;
|
import sonia.scm.group.Group;
|
||||||
import sonia.scm.group.GroupDAO;
|
import sonia.scm.group.GroupDAO;
|
||||||
import sonia.scm.store.StoreParameters;
|
|
||||||
import sonia.scm.xml.AbstractXmlDAO;
|
import sonia.scm.xml.AbstractXmlDAO;
|
||||||
|
|
||||||
import sonia.scm.store.ConfigurationStoreFactory;
|
import sonia.scm.store.ConfigurationStoreFactory;
|
||||||
|
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
@@ -66,8 +67,8 @@ public class XmlGroupDAO extends AbstractXmlDAO<Group, XmlGroupDatabase>
|
|||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public XmlGroupDAO(ConfigurationStoreFactory storeFactory) {
|
public XmlGroupDAO(ConfigurationStoreFactory storeFactory) {
|
||||||
super(storeFactory.getStore(new StoreParameters()
|
super(storeFactory.getStore(
|
||||||
.withType(XmlGroupDatabase.class)
|
forType(XmlGroupDatabase.class)
|
||||||
.withName(STORE_NAME)
|
.withName(STORE_NAME)
|
||||||
.build()));
|
.build()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,10 +73,10 @@ public abstract class FileBasedStoreFactory {
|
|||||||
protected File getStoreLocation(String name, Class type, Repository repository) {
|
protected File getStoreLocation(String name, Class type, Repository repository) {
|
||||||
if (storeDirectory == null) {
|
if (storeDirectory == null) {
|
||||||
if (repository != null) {
|
if (repository != null) {
|
||||||
LOG.debug("create store with type :{}, name:{} and repository {}", type, name, repository.getNamespaceAndName());
|
LOG.debug("create store with type: {}, name: {} and repository: {}", type, name, repository.getNamespaceAndName());
|
||||||
storeDirectory = this.getStoreDirectory(store, repository);
|
storeDirectory = this.getStoreDirectory(store, repository);
|
||||||
} else {
|
} else {
|
||||||
LOG.debug("create store with type :{} and name:{} ", type, name);
|
LOG.debug("create store with type: {} and name: {} ", type, name);
|
||||||
storeDirectory = this.getStoreDirectory(store);
|
storeDirectory = this.getStoreDirectory(store);
|
||||||
}
|
}
|
||||||
IOUtil.mkdirs(storeDirectory);
|
IOUtil.mkdirs(storeDirectory);
|
||||||
@@ -91,7 +91,7 @@ public abstract class FileBasedStoreFactory {
|
|||||||
* @return the store directory of a specific repository
|
* @return the store directory of a specific repository
|
||||||
*/
|
*/
|
||||||
private File getStoreDirectory(Store store, Repository repository) {
|
private File getStoreDirectory(Store store, Repository repository) {
|
||||||
return new File (repositoryLocationResolver.getPath(repository.getId()).toFile(), store.getRepositoryStoreDirectory());
|
return new File(repositoryLocationResolver.getPath(repository.getId()).toFile(), store.getRepositoryStoreDirectory());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ package sonia.scm.user.xml;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
import sonia.scm.store.ConfigurationStoreFactory;
|
||||||
import sonia.scm.store.StoreParameters;
|
|
||||||
import sonia.scm.user.User;
|
import sonia.scm.user.User;
|
||||||
import sonia.scm.user.UserDAO;
|
import sonia.scm.user.UserDAO;
|
||||||
import sonia.scm.xml.AbstractXmlDAO;
|
import sonia.scm.xml.AbstractXmlDAO;
|
||||||
import sonia.scm.store.ConfigurationStoreFactory;
|
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -66,8 +66,8 @@ public class XmlUserDAO extends AbstractXmlDAO<User, XmlUserDatabase>
|
|||||||
@Inject
|
@Inject
|
||||||
public XmlUserDAO(ConfigurationStoreFactory storeFactory)
|
public XmlUserDAO(ConfigurationStoreFactory storeFactory)
|
||||||
{
|
{
|
||||||
super(storeFactory.getStore(new StoreParameters()
|
super(storeFactory.getStore(
|
||||||
.withType(XmlUserDatabase.class)
|
forType(XmlUserDatabase.class)
|
||||||
.withName(STORE_NAME)
|
.withName(STORE_NAME)
|
||||||
.build()));
|
.build()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -65,8 +66,8 @@ public class FileBlobStoreTest extends BlobStoreTestBase
|
|||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void shouldStoreAndLoadInRepository() {
|
public void shouldStoreAndLoadInRepository() {
|
||||||
BlobStore store = createBlobStoreFactory().getStore(new StoreParameters()
|
BlobStore store = createBlobStoreFactory().getStore(
|
||||||
.withType(StoreObject.class)
|
forType(StoreObject.class)
|
||||||
.withName("test")
|
.withName("test")
|
||||||
.forRepository(new Repository("id", "git", "ns", "n"))
|
.forRepository(new Repository("id", "git", "ns", "n"))
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
@@ -132,8 +133,8 @@ public class JAXBConfigurationEntryStoreTest
|
|||||||
ConfigurationEntryStore<AssignedPermission> store = createPermissionStore(RESOURCE_FIXED, name);
|
ConfigurationEntryStore<AssignedPermission> store = createPermissionStore(RESOURCE_FIXED, name);
|
||||||
|
|
||||||
store.put("a45", new AssignedPermission("tuser4", "repository:create"));
|
store.put("a45", new AssignedPermission("tuser4", "repository:create"));
|
||||||
store = createConfigurationStoreFactory().getStore(new StoreParameters()
|
store = createConfigurationStoreFactory().getStore(
|
||||||
.withType(AssignedPermission.class)
|
forType(AssignedPermission.class)
|
||||||
.withName(name)
|
.withName(name)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
@@ -231,8 +232,8 @@ public class JAXBConfigurationEntryStoreTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
copy(resource, name);
|
copy(resource, name);
|
||||||
return createConfigurationStoreFactory().getStore(new StoreParameters()
|
return createConfigurationStoreFactory().getStore(
|
||||||
.withType(AssignedPermission.class)
|
forType(AssignedPermission.class)
|
||||||
.withName(name)
|
.withName(name)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for {@link JAXBConfigurationStore}.
|
* Unit tests for {@link JAXBConfigurationStore}.
|
||||||
@@ -58,8 +59,8 @@ public class JAXBConfigurationStoreTest extends StoreTestBase {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void shouldStoreAndLoadInRepository() throws IOException
|
public void shouldStoreAndLoadInRepository() throws IOException
|
||||||
{
|
{
|
||||||
ConfigurationStore<StoreObject> store = createStoreFactory().getStore(new StoreParameters()
|
ConfigurationStore<StoreObject> store = createStoreFactory().getStore(
|
||||||
.withType(StoreObject.class)
|
forType(StoreObject.class)
|
||||||
.withName("test")
|
.withName("test")
|
||||||
.forRepository(new Repository("id", "git", "ns", "n"))
|
.forRepository(new Repository("id", "git", "ns", "n"))
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -38,10 +38,9 @@ import org.junit.Test;
|
|||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.security.UUIDKeyGenerator;
|
import sonia.scm.security.UUIDKeyGenerator;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -63,25 +62,21 @@ public class JAXBDataStoreTest extends DataStoreTestBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DataStore getDataStore(Class type, Repository repository) {
|
protected DataStore getDataStore(Class type, Repository repository) {
|
||||||
StoreParameters params = new StoreParameters()
|
return createDataStoreFactory().getStore(forType(type)
|
||||||
.withType(type)
|
|
||||||
.withName("test")
|
.withName("test")
|
||||||
.forRepository(repository)
|
.forRepository(repository)
|
||||||
.build();
|
.build());
|
||||||
return createDataStoreFactory().getStore(params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DataStore getDataStore(Class type) {
|
protected DataStore getDataStore(Class type) {
|
||||||
StoreParameters params = new StoreParameters()
|
return createDataStoreFactory().getStore(forType(type)
|
||||||
.withType(type)
|
|
||||||
.withName("test")
|
.withName("test")
|
||||||
.build();
|
.build());
|
||||||
return createDataStoreFactory().getStore(params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldStoreAndLoadInRepository() throws IOException
|
public void shouldStoreAndLoadInRepository()
|
||||||
{
|
{
|
||||||
repoStore.put("abc", new StoreObject("abc_value"));
|
repoStore.put("abc", new StoreObject("abc_value"));
|
||||||
StoreObject storeObject = repoStore.get("abc");
|
StoreObject storeObject = repoStore.get("abc");
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ package sonia.scm.web.lfs;
|
|||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.store.Blob;
|
|
||||||
import sonia.scm.store.BlobStore;
|
import sonia.scm.store.BlobStore;
|
||||||
import sonia.scm.store.BlobStoreFactory;
|
import sonia.scm.store.BlobStoreFactory;
|
||||||
import sonia.scm.store.StoreParameters;
|
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates {@link BlobStore} objects to store lfs objects.
|
* Creates {@link BlobStore} objects to store lfs objects.
|
||||||
@@ -78,8 +78,8 @@ public class LfsBlobStoreFactory {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public BlobStore getLfsBlobStore(Repository repository) {
|
public BlobStore getLfsBlobStore(Repository repository) {
|
||||||
return blobStoreFactory.getStore(new StoreParameters()
|
return blobStoreFactory.getStore(
|
||||||
.withType(Blob.class)
|
forType(String.class)
|
||||||
.withName(repository.getId() + GIT_LFS_REPOSITORY_POSTFIX)
|
.withName(repository.getId() + GIT_LFS_REPOSITORY_POSTFIX)
|
||||||
.forRepository(repository)
|
.forRepository(repository)
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import static org.junit.Assert.assertFalse;
|
|||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
@@ -69,8 +70,8 @@ public abstract class BlobStoreTestBase extends AbstractTestBase
|
|||||||
@Before
|
@Before
|
||||||
public void createBlobStore()
|
public void createBlobStore()
|
||||||
{
|
{
|
||||||
store = createBlobStoreFactory().getStore(new StoreParameters()
|
store = createBlobStoreFactory().getStore(
|
||||||
.withType(Blob.class)
|
forType(Blob.class)
|
||||||
.withName("test")
|
.withName("test")
|
||||||
.forRepository(RepositoryTestData.createHeartOfGold())
|
.forRepository(RepositoryTestData.createHeartOfGold())
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ package sonia.scm.store;
|
|||||||
|
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
|
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
@@ -51,8 +53,7 @@ public abstract class ConfigurationEntryStoreTestBase extends KeyValueStoreTestB
|
|||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
protected ConfigurationEntryStore getDataStore(Class type) {
|
protected ConfigurationEntryStore getDataStore(Class type) {
|
||||||
StoreParameters params = new StoreParameters()
|
StoreParameters params = forType(type)
|
||||||
.withType(type)
|
|
||||||
.withName(storeName)
|
.withName(storeName)
|
||||||
.build();
|
.build();
|
||||||
return this.createConfigurationStoreFactory().getStore(params);
|
return this.createConfigurationStoreFactory().getStore(params);
|
||||||
@@ -60,8 +61,7 @@ public abstract class ConfigurationEntryStoreTestBase extends KeyValueStoreTestB
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ConfigurationEntryStore getDataStore(Class type, Repository repository) {
|
protected ConfigurationEntryStore getDataStore(Class type, Repository repository) {
|
||||||
StoreParameters params = new StoreParameters()
|
StoreParameters params = forType(type)
|
||||||
.withType(type)
|
|
||||||
.withName(repoStoreName)
|
.withName(repoStoreName)
|
||||||
.forRepository(repository)
|
.forRepository(repository)
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import sonia.scm.repository.RepositoryTestData;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -57,8 +58,7 @@ public abstract class DataStoreTestBase extends KeyValueStoreTestBase
|
|||||||
|
|
||||||
|
|
||||||
protected StoreParameters getStoreParametersWithRepository(Repository repository) {
|
protected StoreParameters getStoreParametersWithRepository(Repository repository) {
|
||||||
return new StoreParameters()
|
return forType(StoreObject.class)
|
||||||
.withType(StoreObject.class)
|
|
||||||
.withName("test")
|
.withName("test")
|
||||||
.forRepository(repository)
|
.forRepository(repository)
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ package sonia.scm.store;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import sonia.scm.AbstractTestBase;
|
import sonia.scm.AbstractTestBase;
|
||||||
import sonia.scm.repository.Repository;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
@@ -60,13 +60,6 @@ public abstract class StoreTestBase extends AbstractTestBase
|
|||||||
*/
|
*/
|
||||||
protected abstract ConfigurationStoreFactory createStoreFactory();
|
protected abstract ConfigurationStoreFactory createStoreFactory();
|
||||||
|
|
||||||
protected StoreParameters getStoreParameters() {
|
|
||||||
return new StoreParameters()
|
|
||||||
.withType(StoreObject.class)
|
|
||||||
.withName("test")
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
@@ -74,7 +67,7 @@ public abstract class StoreTestBase extends AbstractTestBase
|
|||||||
@Test
|
@Test
|
||||||
public void testGet()
|
public void testGet()
|
||||||
{
|
{
|
||||||
ConfigurationStore<StoreObject> store = createStoreFactory().getStore(getStoreParameters());
|
ConfigurationStore<StoreObject> store = createStoreFactory().getStore(forType(StoreObject.class).withName("test").build());
|
||||||
|
|
||||||
assertNotNull(store);
|
assertNotNull(store);
|
||||||
|
|
||||||
@@ -90,7 +83,7 @@ public abstract class StoreTestBase extends AbstractTestBase
|
|||||||
@Test
|
@Test
|
||||||
public void testSet()
|
public void testSet()
|
||||||
{
|
{
|
||||||
ConfigurationStore<StoreObject> store = createStoreFactory().getStore(getStoreParameters());
|
ConfigurationStore<StoreObject> store = createStoreFactory().getStore(forType(StoreObject.class).withName("test").build());
|
||||||
|
|
||||||
assertNotNull(store);
|
assertNotNull(store);
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO add events
|
* TODO add events
|
||||||
*
|
*
|
||||||
@@ -112,8 +114,8 @@ public class DefaultSecuritySystem implements SecuritySystem
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public DefaultSecuritySystem(ConfigurationEntryStoreFactory storeFactory)
|
public DefaultSecuritySystem(ConfigurationEntryStoreFactory storeFactory)
|
||||||
{
|
{
|
||||||
store = storeFactory.getStore(new StoreParameters()
|
store = storeFactory.getStore(
|
||||||
.withType(AssignedPermission.class)
|
forType(AssignedPermission.class)
|
||||||
.withName(NAME)
|
.withName(NAME)
|
||||||
.build());
|
.build());
|
||||||
readAvailablePermissions();
|
readAvailablePermissions();
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import sonia.scm.store.ConfigurationEntryStore;
|
import sonia.scm.store.ConfigurationEntryStore;
|
||||||
import sonia.scm.store.ConfigurationEntryStoreFactory;
|
import sonia.scm.store.ConfigurationEntryStoreFactory;
|
||||||
import sonia.scm.store.StoreParameters;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.*;
|
import static com.google.common.base.Preconditions.*;
|
||||||
|
import static sonia.scm.store.StoreParameters.forType;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
@@ -91,8 +91,8 @@ public class SecureKeyResolver extends SigningKeyResolverAdapter
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public SecureKeyResolver(ConfigurationEntryStoreFactory storeFactory)
|
public SecureKeyResolver(ConfigurationEntryStoreFactory storeFactory)
|
||||||
{
|
{
|
||||||
store = storeFactory.getStore(new StoreParameters()
|
store = storeFactory.getStore(
|
||||||
.withType(SecureKey.class)
|
forType(SecureKey.class)
|
||||||
.withName(STORE_NAME)
|
.withName(STORE_NAME)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user