org.appng.core.model

## Class RepositoryCacheFactory

- java.lang.Object
- - org.appng.core.model.RepositoryCacheFactory

-     public class RepositoryCacheFactory
      extends Object

  Returns instances of `RepositoryCache`.
  Author:
    Matthias Herlitzius, Matthias Müller

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RepositoryCache` | `getCache(Repository repository)` Returns a `RepositoryCache` for the given `Repository`
    `static RepositoryCacheFactory` | `init(Properties platformConfig)` Initializes the factory with properties from the platform's configuration
    `static RepositoryCacheFactory` | `init(String cert, String privateKey, byte[] trustStore, String storePass, boolean validateCertChain)` Initializes the factory.
    `static RepositoryCacheFactory` | `instance()`
    `void` | `setConnectTimeout(int connectTimeout)`
    `void` | `setReadTimeout(int readTimeout)`
    `static void` | `validateRepositoryURI(Repository repository)` Checks whether the `Repository` has a valid `URI`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 a `KeyStore` from)
        `storePass` - the truststore's password
        `validateCertChain` - 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 a `RepositoryCache` for the given `Repository`
      Parameters:
        `repository` - the `Repository`
      Returns:
        the `RepositoryCache`
      Throws:
        `BusinessException` - if an error occurred while retrieving the `RepositoryCache`

    - #### validateRepositoryURI

          public static void validateRepositoryURI(Repository repository)
                                            throws BusinessException

      Checks whether the `Repository` has a valid `URI`.
      Parameters:
        `repository` - the `Repository` to check
      Throws:
        `BusinessException` - if the `URI` defined by the `Repository` is not valid
      See Also:
        `RepositoryScheme`, `Repository.getUri()`

    - #### setConnectTimeout

          public void setConnectTimeout(int connectTimeout)

    - #### setReadTimeout

          public void setReadTimeout(int readTimeout)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.