Class MultipleJGitEnvironmentRepository
java.lang.Object
org.springframework.cloud.config.server.support.AbstractScmAccessor
org.springframework.cloud.config.server.environment.AbstractScmEnvironmentRepository
org.springframework.cloud.config.server.environment.JGitEnvironmentRepository
org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, EnvironmentRepository, SearchPathLocator, org.springframework.context.ResourceLoaderAware, org.springframework.core.Ordered
EnvironmentRepository that based on one or more git repositories. Can be
configured just like a single JGitEnvironmentRepository, for the "default"
properties, and then additional repositories can be registered by name. The simplest
form of the registration is just a map from name to uri (plus credentials if needed),
where each app has its own git repository. As well as a name you can provide a pattern
that matches on the application name (or even a list of patterns). Each sub-repository
additionally can have its own search paths (subdirectories inside the top level of the
repository).- Author:
- Andy Chan (iceycake), Dave Syer, Gareth Clay
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class JGitEnvironmentRepository
JGitEnvironmentRepository.JGitFactoryNested classes/interfaces inherited from interface SearchPathLocator
SearchPathLocator.Locations -
Field Summary
Fields inherited from class JGitEnvironmentRepository
MESSAGEFields inherited from class AbstractScmAccessor
loggerFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionMultipleJGitEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment, MultipleJGitEnvironmentProperties properties, io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.springframework.cloud.config.environment.EnvironmentgetLocations(String application, String profile, String label) getRepos()voidsetOrder(int order) voidsetRepos(Map<String, MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository> repos) Methods inherited from class JGitEnvironmentRepository
fetch, getDefaultLabel, getGitFactory, getLastRefresh, getRefreshRate, getTimeout, getTransportConfigCallback, isCloneOnStart, isDeleteUntrackedBranches, isForcePull, isSkipSslValidation, isTryMasterBranch, onPullInvalidIndex, refresh, setCloneOnStart, setDefaultLabel, setDeleteUntrackedBranches, setForcePull, setGitCredentialsProviderFactory, setGitFactory, setLastRefresh, setRefreshRate, setSkipSslValidation, setTimeout, setTransportConfigCallback, setTryMasterBranch, shouldPull, warnMethods inherited from class AbstractScmEnvironmentRepository
findOne, getOrderMethods inherited from class AbstractScmAccessor
createBaseDir, getBasedir, getEnvironment, getPassphrase, getPassword, getSearchLocations, getSearchPaths, getUri, getUsername, getWorkingDirectory, isStrictHostKeyChecking, setBasedir, setEnvironment, setPassphrase, setPassword, setResourceLoader, setSearchPaths, setStrictHostKeyChecking, setUri, setUsernameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EnvironmentRepository
findOne
-
Constructor Details
-
MultipleJGitEnvironmentRepository
public MultipleJGitEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment, MultipleJGitEnvironmentProperties properties, io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classJGitEnvironmentRepository- Throws:
Exception
-
getRepos
public Map<String, MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository> getRepos() -
setRepos
public void setRepos(Map<String, MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository> repos) -
getLocations
- Specified by:
getLocationsin interfaceSearchPathLocator- Overrides:
getLocationsin classJGitEnvironmentRepository
-
findOne
public org.springframework.cloud.config.environment.Environment findOne(String application, String profile, String label, boolean includeOrigin) - Specified by:
findOnein interfaceEnvironmentRepository- Overrides:
findOnein classJGitEnvironmentRepository
-
setOrder
public void setOrder(int order) - Overrides:
setOrderin classAbstractScmEnvironmentRepository
-