Package org.appng.core.model
Class RepositoryCacheSoap
- java.lang.Object
-
- org.appng.core.model.RepositoryCacheSoap
-
- All Implemented Interfaces:
RepositoryCache
public class RepositoryCacheSoap extends Object
Implementation ofRepositoryCache
that retrieves the packages from a remote repository.- Author:
- Matthias Herlitzius
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,PackageWrapper>
applicationWrapperMap
protected byte[]
cert
protected Repository
repository
protected SignatureWrapper
signatureWrapper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(PackageArchive packagearchive)
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 packageName)
Returns all available versions of a package.void
reload()
Reloads the repository contents by clearing and updating the cache.
-
-
-
Field Detail
-
applicationWrapperMap
protected final Map<String,PackageWrapper> applicationWrapperMap
-
repository
protected final Repository repository
-
cert
protected byte[] cert
-
signatureWrapper
protected SignatureWrapper signatureWrapper
-
-
Method Detail
-
getVersions
public List<PackageInfo> getVersions(String packageName) throws BusinessException
Description copied from interface:RepositoryCache
Returns all available versions of a package.- Specified by:
getVersions
in interfaceRepositoryCache
- Parameters:
packageName
- The name of the application.- Returns:
- The
PackageInfo
s. - Throws:
BusinessException
- if such a package does not exist
-
getCertification
public Certification getCertification() throws BusinessException
Description copied from interface:RepositoryCache
Returns theCertification
for the cached repository, if any- Returns:
- the
Certification
- Throws:
BusinessException
- if an error occurred while building the certification
-
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
-
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
-
add
public boolean add(PackageArchive packagearchive) throws BusinessException
Description copied from interface:RepositoryCache
Adds a singlePackageArchive
- Parameters:
packagearchive
- the archive to add- Throws:
BusinessException
-
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
-
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()
-
-