Package org.appng.core.model
Class RepositoryCacheFactory
- java.lang.Object
-
- org.appng.core.model.RepositoryCacheFactory
-
public class RepositoryCacheFactory extends Object
Returns instances ofRepositoryCache
.- Author:
- Matthias Herlitzius, Matthias Müller
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RepositoryCache
getCache(Repository repository)
Returns aRepositoryCache
for the givenRepository
static RepositoryCacheFactory
init(String cert, String privateKey, byte[] trustStore, String storePass, boolean validateCertChain)
Initializes the factory.static RepositoryCacheFactory
init(Properties platformConfig)
Initializes the factory with properties from the platform's configurationstatic RepositoryCacheFactory
instance()
void
setConnectTimeout(int connectTimeout)
void
setReadTimeout(int readTimeout)
static void
validateRepositoryURI(Repository repository)
Checks whether theRepository
has a validURI
.
-
-
-
Method Detail
-
init
public static RepositoryCacheFactory init(String cert, String privateKey, byte[] trustStore, String storePass, boolean validateCertChain)
Initializes the factory.- Parameters:
cert
- the certificate to use when verifying a signed remote repository (PEM format)privateKey
- the private key to use when signing a local published repository (PEM format)trustStore
- the truststore used when verifying a signed remote repository (to build aKeyStore
from)storePass
- the truststore's passwordvalidateCertChain
- whether or not signed remote repositories are validated against the configured truststore- Returns:
- the singleton instance of
RepositoryCacheFactory
-
init
public static RepositoryCacheFactory init(Properties platformConfig)
Initializes the factory with properties from the platform's configuration- Parameters:
platformConfig
- the platform's configuration- Returns:
- the singleton instance of
RepositoryCacheFactory
- See Also:
init(java.lang.String, java.lang.String, byte[], java.lang.String, boolean)
,Platform.Property.REPOSITORY_CERT
,Platform.Property.REPOSITORY_SIGNATURE
,Platform.Property.REPOSITORY_TRUSTSTORE
,Platform.Property.REPOSITORY_TRUST_STORE_PASSWORD
,Platform.Property.REPOSITORY_VERIFY_SIGNATURE
-
instance
public static RepositoryCacheFactory instance()
-
getCache
public RepositoryCache getCache(Repository repository) throws BusinessException
Returns aRepositoryCache
for the givenRepository
- Parameters:
repository
- theRepository
- Returns:
- the
RepositoryCache
- Throws:
BusinessException
- if an error occurred while retrieving theRepositoryCache
-
validateRepositoryURI
public static void validateRepositoryURI(Repository repository) throws BusinessException
Checks whether theRepository
has a validURI
.- Parameters:
repository
- theRepository
to check- Throws:
BusinessException
- if theURI
defined by theRepository
is not valid- See Also:
RepositoryScheme
,Repository.getUri()
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
-
setReadTimeout
public void setReadTimeout(int readTimeout)
-
-