Class RepositoryPackages


  • public final class RepositoryPackages
    extends java.lang.Object
    Store of currently-known local and remote packages, in convenient forms.
    • Constructor Detail

      • RepositoryPackages

        public RepositoryPackages()
      • RepositoryPackages

        public RepositoryPackages​(@NonNull
                                  java.util.List<LocalPackage> localPkgs,
                                  @NonNull
                                  java.util.List<RemotePackage> remotePkgs)
    • Method Detail

      • getTimestampMs

        public long getTimestampMs()
        Returns the timestamp (in System.currentTimeMillis() time) when this object was created.
      • getUpdatedPkgs

        @NonNull
        public java.util.Set<UpdatablePackage> getUpdatedPkgs()
        Returns the set of packages that have local updates available.
        Returns:
        A non-null, possibly empty Set of update candidates.
      • getNewPkgs

        @NonNull
        public java.util.Set<RemotePackage> getNewPkgs()
        Returns the set of new remote packages that are not locally present and that the user could install.
        Returns:
        A non-null, possibly empty Set of new install candidates.
      • getConsolidatedPkgs

        @NonNull
        public java.util.Map<java.lang.String,​UpdatablePackage> getConsolidatedPkgs()
        Returns a map of package install ids to UpdatablePackages representing all known local and remote packages. Remote packages corresponding to local packages will be represented by a single item containing both the local and remote info. {@see IPkgDesc#getInstallId()}
      • getLocalPackages

        @NonNull
        public java.util.Map<java.lang.String,​LocalPackage> getLocalPackages()
        Returns a map of path (the unique ID of a package) to LocalPackage, for all packages currently installed.
      • getRemotePackages

        @NonNull
        public java.util.Map<java.lang.String,​RemotePackage> getRemotePackages()
        Returns a Map from path (the unique ID of a package) to RemotePackage.
      • getLocalPackagesForPrefix

        @NonNull
        public java.util.Collection<LocalPackage> getLocalPackagesForPrefix​(@Nullable
                                                                            java.lang.String pathPrefix)
      • getRemotePackagesForPrefix

        @NonNull
        public java.util.Collection<RemotePackage> getRemotePackagesForPrefix​(@Nullable
                                                                              java.lang.String pathPrefix)
      • setLocalPkgInfos

        public void setLocalPkgInfos​(@NonNull
                                     java.util.Collection<LocalPackage> packages)
        Sets the collection of known LocalPackages, and recomputes the list of updates and new packages, if RemotePackages have been set.
      • setRemotePkgInfos

        public void setRemotePkgInfos​(@NonNull
                                      java.util.Collection<RemotePackage> packages)
        Sets the collection of known RemotePackages, and recomputes the list of updates and new packages, if LocalPackages have been set.