org.appng.core.domain

## Class RepositoryImpl

- java.lang.Object
- - org.appng.core.domain.RepositoryImpl

- All Implemented Interfaces:
    Serializable, Identifiable<Integer>, Nameable, Named<Integer>, Versionable<Date>, Auditable<Integer>, Repository

      @Entity
      public class RepositoryImpl
      extends Object
      implements Repository, Auditable<Integer>

  `Repository` implementation.
  Author:
    Matthias Herlitzius
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RepositoryImpl()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deletePackageVersion(String applicationName, String applicationVersion, String applicationTimestamp)`
    `byte[]` | `getAcceptedCerts()`
    `static ApplicationImpl` | `getApplication(ApplicationImpl application, ApplicationInfo applicationInfo)`
    `static ApplicationImpl` | `getApplication(ApplicationInfo applicationInfo)`
    `Certification` | `getCertification()` Returns the `Certification`
    `@Size(max=8192,message="{validation.string.max}") String` | `getDescription()` Returns the description.
    `String` | `getDigest()` The digest for this repository, used for local published repositories to grant remote accesss
    `Integer` | `getId()` Returns the id.
    `List<InstallablePackage>` | `getInstallablePackages(List<Identifier> provisionedPackages)` Returns a list of `InstallablePackage`s for the given list of package `Identifier`s
    `@NotNull(message="{validation.notNull}") @Size(max=64,message="{validation.string.max}") String` | `getName()` Returns the name.
    `PackageArchive` | `getPackageArchive(String applicationName, String applicationVersion, String applicationTimestamp)` Returns the `PackageArchive` with the given name, version and timestamp
    `Packages` | `getPackages()` Returns the `Packages` offered by this repository, containing a list of all available `Package`s
    `Packages` | `getPackages(String packageName)` Returns the `Packages` offered by this repository, containing a list of all available `Package`s
    `List<PackageVersion>` | `getPackageVersions(List<Identifier> provisionedPackagesList, String name)`
    `PackageVersions` | `getPackageVersions(String name)` Returns the `PackageVersions` for the package with the given name, containing a list of `PackageInfo` rmations
    `Collection<X509Certificate>` | `getRemoteCerts()` Returns the certificate chain, if this is a signed remote repository.
    `@Size(max=64,message="{validation.string.max}") String` | `getRemoteRepositoryName()` In case the type for this repository is `RepositoryType.REMOTE`, returns the name of the referred remote repository.
    `RepositoryMode` | `getRepositoryMode()` The mode for this repository,
    `RepositoryType` | `getRepositoryType()` The type for this repository.
    `Collection<X509Certificate>` | `getTrustedCertChain()` Returns the certificate chain, if this is a remote repository and a certificate chain to be trusted has been defined
    `URI` | `getUri()` The URI for this `Repository`, may refer to to local filesystem or a remote address
    `Date` | `getVersion()` Returns the version.
    `boolean` | `isActive()` Whether or not `PackageArchive`s can be retrieved from this repository
    `boolean` | `isPublished()` Whether or not this repository is being published via the SOAP interface, so other repositories can refer to it as an remote repository
    `boolean` | `isStrict()` Whether or not this repository uses strict filename validation when scanning for `PackageArchive`s, i.e.
    `void` | `reload()` Reloads the application repository.
    `void` | `setAcceptedCerts(byte[] acceptedCerts)`
    `void` | `setActive(boolean isActive)`
    `void` | `setDescription(String description)`
    `void` | `setDigest(String digest)`
    `void` | `setId(Integer id)`
    `void` | `setName(String name)`
    `void` | `setPublished(boolean isPublished)`
    `void` | `setRemoteRepositoryName(String remoteRepositoryName)`
    `void` | `setRepositoryMode(RepositoryMode repositoryMode)`
    `void` | `setRepositoryType(RepositoryType repositoryType)`
    `void` | `setStrict(boolean isStrict)`
    `void` | `setTrustedCertChain(Collection<X509Certificate> trustedCerts)` Sets the certificate chain to trust for this repository
    `void` | `setUri(URI uri)`
    `void` | `setVersion(Date version)`
    `String` | `toString()`

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

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

    - ### Methods inherited from interface org.appng.core.domain.Auditable

      `getAuditName`

- - ### Constructor Detail

    - #### RepositoryImpl

          public RepositoryImpl()

  - ### Method Detail

    - #### getId

          public Integer getId()

      Description copied from interface: `Identifiable`
      Returns the id.
      Specified by:
        `getId` in interface `Identifiable<Integer>`
      Returns:
        the id

    - #### setId

          public void setId(Integer id)

    - #### getName

          @NotNull(message="{validation.notNull}")
           @Size(max=64,
                message="{validation.string.max}")
          public @NotNull(message="{validation.notNull}") @Size(max=64,message="{validation.string.max}") String getName()

      Description copied from interface: `Nameable`
      Returns the name.
      Specified by:
        `getName` in interface `Nameable`
      Returns:
        the name

    - #### setName

          public void setName(String name)

    - #### getDescription

          @Size(max=8192,
                message="{validation.string.max}")
          public @Size(max=8192,message="{validation.string.max}") String getDescription()

      Description copied from interface: `Nameable`
      Returns the description.
      Specified by:
        `getDescription` in interface `Nameable`
      Returns:
        the description

    - #### setDescription

          public void setDescription(String description)

    - #### getVersion

          public Date getVersion()

      Description copied from interface: `Versionable`
      Returns the version.
      Specified by:
        `getVersion` in interface `Versionable<Date>`
      Returns:
        the version

    - #### setVersion

          public void setVersion(Date version)

    - #### getRepositoryType

          public RepositoryType getRepositoryType()

      Description copied from interface: `Repository`
      The type for this repository.
      Specified by:
        `getRepositoryType` in interface `Repository`
      Returns:
        the `RepositoryType`

    - #### setRepositoryType

          public void setRepositoryType(RepositoryType repositoryType)

    - #### getUri

          public URI getUri()

      Description copied from interface: `Repository`
      The URI for this `Repository`, may refer to to local filesystem or a remote address
      Specified by:
        `getUri` in interface `Repository`
      Returns:
        the URI

    - #### setUri

          public void setUri(URI uri)

    - #### isActive

          public boolean isActive()

      Description copied from interface: `Repository`
      Whether or not `PackageArchive`s can be retrieved from this repository
      Specified by:
        `isActive` in interface `Repository`
      Returns:
        `true` if this repository is active, `false` otherwise

    - #### setActive

          public void setActive(boolean isActive)

    - #### isPublished

          public boolean isPublished()

      Description copied from interface: `Repository`
      Whether or not this repository is being published via the SOAP interface, so other repositories can refer to it as an remote repository
      Specified by:
        `isPublished` in interface `Repository`
      Returns:
        `true` if this repository is published, `false` otherwise
      See Also:
        `Repository.getRepositoryType()`

    - #### setPublished

          public void setPublished(boolean isPublished)

    - #### isStrict

          public boolean isStrict()

      Description copied from interface: `Repository`
      Whether or not this repository uses strict filename validation when scanning for `PackageArchive`s, i.e. the naming pattern must be `<name>-<version>-<timestamp>.zip`. If this method returns `false`, the more lax naming pattern `<name>-<version>.zip` is used, omitting the `<timestamp>` part.
      Specified by:
        `isStrict` in interface `Repository`
      Returns:
        if this repository uses strict filename validation

    - #### setStrict

          public void setStrict(boolean isStrict)

    - #### getRepositoryMode

          public RepositoryMode getRepositoryMode()

      Description copied from interface: `Repository`
      The mode for this repository,
      Specified by:
        `getRepositoryMode` in interface `Repository`
      Returns:
        the `RepositoryMode`

    - #### setRepositoryMode

          public void setRepositoryMode(RepositoryMode repositoryMode)

    - #### getRemoteRepositoryName

          @Size(max=64,
                message="{validation.string.max}")
          public @Size(max=64,message="{validation.string.max}") String getRemoteRepositoryName()

      Description copied from interface: `Repository`
      In case the type for this repository is `RepositoryType.REMOTE`, returns the name of the referred remote repository.
      Specified by:
        `getRemoteRepositoryName` in interface `Repository`
      Returns:
        the name of the referred remote repository

    - #### setRemoteRepositoryName

          public void setRemoteRepositoryName(String remoteRepositoryName)

    - #### getDigest

          public String getDigest()

      Description copied from interface: `Repository`
      The digest for this repository, used for local published repositories to grant remote accesss
      Specified by:
        `getDigest` in interface `Repository`
      Returns:
        the digest
      See Also:
        `Repository.isPublished()`

    - #### setDigest

          public void setDigest(String digest)

    - #### getInstallablePackages

          public List<InstallablePackage> getInstallablePackages(List<Identifier> provisionedPackages)
                                                          throws BusinessException

      Description copied from interface: `Repository`
      Returns a list of `InstallablePackage`s for the given list of package `Identifier`s
      Specified by:
        `getInstallablePackages` in interface `Repository`
      Parameters:
        `provisionedPackages` - the list of package identifiers
      Returns:
        a list of `InstallablePackage`s for the given package identifiers
      Throws:
        `BusinessException` - if an error occurs while retrieving the packages

    - #### getPackageVersions

          public List<PackageVersion> getPackageVersions(List<Identifier> provisionedPackagesList,
                                                         String name)
                                                  throws BusinessException

      Throws:
        `BusinessException`

    - #### getPackages

          public Packages getPackages()
                               throws BusinessException

      Description copied from interface: `Repository`
      Returns the `Packages` offered by this repository, containing a list of all available `Package`s
      Specified by:
        `getPackages` in interface `Repository`
      Returns:
        the `Packages` offered by this repository
      Throws:
        `BusinessException` - if an error occurs while reading the package informations

    - #### getPackages

          public Packages getPackages(String packageName)
                               throws BusinessException

      Description copied from interface: `Repository`
      Returns the `Packages` offered by this repository, containing a list of all available `Package`s
      Specified by:
        `getPackages` in interface `Repository`
      Parameters:
        `packageName` - an optional search-string for the package's name, supporting `*` as a placeholder
      Returns:
        the `Packages` offered by this repository
      Throws:
        `BusinessException` - if an error occurs while reading the package informations

    - #### getCertification

          public Certification getCertification()
                                         throws BusinessException

      Description copied from interface: `Repository`
      Returns the `Certification`
      Specified by:
        `getCertification` in interface `Repository`
      Returns:
      Throws:
        `BusinessException`

    - #### getPackageVersions

          public PackageVersions getPackageVersions(String name)
                                             throws BusinessException

      Description copied from interface: `Repository`
      Returns the `PackageVersions` for the package with the given name, containing a list of `PackageInfo` rmations
      Specified by:
        `getPackageVersions` in interface `Repository`
      Parameters:
        `name` - the name of the package to get the versions for
      Returns:
        the `PackageVersions`
      Throws:
        `BusinessException` - if an error occurs while retrieving the `PackageVersions`

    - #### getPackageArchive

          public PackageArchive getPackageArchive(String applicationName,
                                                  String applicationVersion,
                                                  String applicationTimestamp)
                                           throws BusinessException

      Description copied from interface: `Repository`
      Returns the `PackageArchive` with the given name, version and timestamp
      Specified by:
        `getPackageArchive` in interface `Repository`
      Parameters:
        `applicationName` - the name of the archive
        `applicationVersion` - the version of the archive
        `applicationTimestamp` - the timestamp of the archive, only used if `Repository.isStrict()` returns `true`.
      Returns:
        the `PackageArchive`
      Throws:
        `BusinessException` - if no such `PackageArchive` exists or if this repository is not active
      See Also:
        `Repository.isStrict()`, `Repository.isActive()`

    - #### deletePackageVersion

          public void deletePackageVersion(String applicationName,
                                           String applicationVersion,
                                           String applicationTimestamp)
                                    throws Exception

      Throws:
        `Exception`

    - #### getApplication

          public static ApplicationImpl getApplication(ApplicationInfo applicationInfo)

    - #### getApplication

          public static ApplicationImpl getApplication(ApplicationImpl application,
                                                       ApplicationInfo applicationInfo)

    - #### reload

          public void reload()
                      throws BusinessException

      Reloads the application repository.
      Throws:
        `BusinessException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getAcceptedCerts

          public byte[] getAcceptedCerts()

    - #### setAcceptedCerts

          public void setAcceptedCerts(byte[] acceptedCerts)

    - #### getRemoteCerts

          public Collection<X509Certificate> getRemoteCerts()
                                                     throws SigningException,
                                                            BusinessException

      Returns the certificate chain, if this is a signed remote repository.
      Returns:
        the immutable certificate chain
      Throws:
        `SigningException` - if an error occurs while retrieving the certificate chain
        `BusinessException` - if an the remote repository could not be reached

    - #### setTrustedCertChain

          public void setTrustedCertChain(Collection<X509Certificate> trustedCerts)
                                   throws SigningException

      Sets the certificate chain to trust for this repository
      Parameters:
        `trustedCerts` - the certificate chain
      Throws:
        `SigningException` - if an error occurs while encoding the certificates to their binary form
      See Also:
        `getTrustedCertChain()`

    - #### getTrustedCertChain

          public Collection<X509Certificate> getTrustedCertChain()
                                                          throws SigningException

      Description copied from interface: `Repository`
      Returns the certificate chain, if this is a remote repository and a certificate chain to be trusted has been defined
      Specified by:
        `getTrustedCertChain` in interface `Repository`
      Returns:
        the immutable certificate chain, or `null`
      Throws:
        `SigningException` - if an error occurs while reading the certificate chain

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