Package org.appng.core.model
Class RepositoryCacheFilesystem
- java.lang.Object
-
- org.appng.core.model.RepositoryCacheFilesystem
-
- All Implemented Interfaces:
RepositoryCache
public class RepositoryCacheFilesystem extends Object
Implementation ofRepositoryCache
that retrieves the packages from the local filesystem.- Author:
- Matthias Herlitzius
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,PackageWrapper>
applicationWrapperMap
protected byte[]
cert
protected byte[]
privateKey
protected Repository
repository
protected SignatureWrapper
signatureWrapper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(PackageArchive archive)
Adds a singlePackageArchive
void
deletePackageVersion(String packageName, String packageVersion, String packageTimestamp)
Deletes the specified application version from the repository.List<PackageWrapper>
getApplications()
Returns all packages found in the repository.List<PackageWrapper>
getApplications(String packageName)
Returns all packages that match the given name in the repository.Certification
getCertification()
Returns theCertification
for the cached repository, if anyPackageArchive
getPackageArchive(String packageName, String packageVersion, String packageTimestamp)
Returns aPackageArchive
for the specified package.PackageWrapper
getPackageWrapper(String name)
Returns thePackageWrapper
for the a package.protected Repository
getRepository()
List<PackageInfo>
getVersions(String name)
Returns all available versions of a package.void
initializeWrapper(String packageName)
void
reload()
Reloads the repository contents by clearing and updating the cache.
-
-
-
Field Detail
-
privateKey
protected byte[] privateKey
-
applicationWrapperMap
protected final Map<String,PackageWrapper> applicationWrapperMap
-
repository
protected final Repository repository
-
cert
protected byte[] cert
-
signatureWrapper
protected SignatureWrapper signatureWrapper
-
-
Method Detail
-
getCertification
public Certification getCertification()
Description copied from interface:RepositoryCache
Returns theCertification
for the cached repository, if any- Returns:
- the
Certification
-
add
public boolean add(PackageArchive archive)
Description copied from interface:RepositoryCache
Adds a singlePackageArchive
- Parameters:
archive
- the archive to add
-
initializeWrapper
public void initializeWrapper(String packageName)
-
deletePackageVersion
public void deletePackageVersion(String packageName, String packageVersion, String packageTimestamp) throws BusinessException
Description copied from interface:RepositoryCache
Deletes the specified application version from the repository.- Parameters:
packageName
- The package name.packageVersion
- The package version.packageTimestamp
- The package timestamp.- Throws:
BusinessException
- if such a package does not exist
-
getPackageArchive
public PackageArchive getPackageArchive(String packageName, String packageVersion, String packageTimestamp) throws BusinessException
Description copied from interface:RepositoryCache
Returns aPackageArchive
for the specified package.- Parameters:
packageName
- The package name.packageVersion
- The package version.packageTimestamp
- The package timestamp.- Returns:
- The
PackageArchive
. - Throws:
BusinessException
- if the archive was not found or is invalid
-
reload
public void reload() throws BusinessException
Description copied from interface:RepositoryCache
Reloads the repository contents by clearing and updating the cache.- Specified by:
reload
in interfaceRepositoryCache
- Throws:
BusinessException
-
getApplications
public List<PackageWrapper> getApplications() throws BusinessException
Description copied from interface:RepositoryCache
Returns all packages found in the repository.- Specified by:
getApplications
in interfaceRepositoryCache
- Returns:
- The package list.
- Throws:
BusinessException
-
getApplications
public List<PackageWrapper> getApplications(String packageName) throws BusinessException
Description copied from interface:RepositoryCache
Returns all packages that match the given name in the repository.- Specified by:
getApplications
in interfaceRepositoryCache
- Parameters:
packageName
- an optional search-string for the package's name, supporting*
as a placeholder- Returns:
- The package list.
- Throws:
BusinessException
-
getVersions
public List<PackageInfo> getVersions(String name) throws BusinessException
Description copied from interface:RepositoryCache
Returns all available versions of a package.- Specified by:
getVersions
in interfaceRepositoryCache
- Parameters:
name
- The name of the application.- Returns:
- The
PackageInfo
s. - Throws:
BusinessException
- if such a package does not exist
-
getPackageWrapper
public PackageWrapper getPackageWrapper(String name)
Description copied from interface:RepositoryCache
Returns thePackageWrapper
for the a package.- Specified by:
getPackageWrapper
in interfaceRepositoryCache
- Parameters:
name
- The name of the package.- Returns:
- the
PackageWrapper
-
getRepository
protected Repository getRepository()
-
-