|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.pkg.client.Image
public class Image
An Image
is a directory tree containing the laid-down contents
of a self-consistent graph of Packages.
An Image has a root path.
Nested Class Summary | |
---|---|
static class |
Image.FmriState
An FmriState represents the current state of an Fmri within
the image. |
class |
Image.ImagePlan
An ImagePlan takes a list of requested packages, an Image (and its
policy restrictions), and returns the set of package operations needed
to transform the Image to the list of requested packages. |
Field Summary | |
---|---|
static int |
IMG_ENTIRE
|
static int |
IMG_PARTIAL
|
static int |
IMG_USER
|
Constructor Summary | |
---|---|
Image(java.io.File path)
Create an Image object for an existing user image based on a File. |
|
Image(java.lang.String path)
Create an Image object for an existing user image based on a String |
Method Summary | |
---|---|
java.lang.String[] |
getAuthorityNames()
Return the authority names defined for this image. |
java.util.List<Image.FmriState> |
getInventory(java.lang.String[] pkg_list,
boolean all_known)
Get the inventory of packages and their associated state. |
Manifest |
getManifest(Fmri fmri)
Get the manifest for a package. |
java.lang.String |
getPreferredAuthorityName()
|
java.io.File |
getRootDirectory()
Obtain the root directory for this image. |
void |
hideMetaDirectory()
Change the permissions on the Image meta data directory so that the directory will be hidden. |
void |
installPackages(java.util.List<Fmri> pkgs)
Install packages and any required dependencies. |
void |
installPackages(java.lang.String[] pkgNames)
Install packages and any required dependencies. |
Image.ImagePlan |
makeInstallPlan(java.util.List<Fmri> pkgs)
Create an plan for installing packages and any required dependencies. |
Image.ImagePlan |
makeInstallPlan(java.lang.String[] pkgNames)
Create an plan for installing packages and any required dependencies. |
void |
refreshCatalogs()
Call refresh on all of the Catalogs for this image. |
void |
saveConfig()
Save the configuration for the image. |
void |
setAuthority(java.lang.String authname,
java.net.URL origin,
java.lang.String uuid)
Set image authority attributes. |
void |
setProxy(java.net.Proxy p)
Set the proxy to be used by connenctions to repositories. |
void |
uninstallPackages(java.util.List<Fmri> pkgs)
Uninstall packages. |
void |
uninstallPackages(java.lang.String[] pkgNames)
Uninstall packages. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IMG_ENTIRE
public static final int IMG_PARTIAL
public static final int IMG_USER
Constructor Detail |
---|
public Image(java.lang.String path) throws java.lang.Exception
path
- The path for a file or directory within the image.
java.lang.Exception
public Image(java.io.File path) throws java.lang.Exception
path
- A File within the image.
java.lang.Exception
Method Detail |
---|
public java.io.File getRootDirectory()
public void hideMetaDirectory() throws java.io.IOException
java.io.IOException
public void setProxy(java.net.Proxy p)
The proxy for an Image is initialized to be the return value from SystemInfo.getProxy. This method can be used to set the proxy to some other value or to null if the desire is to use the system defaults.
p
- - the proxy to usepublic void saveConfig() throws java.io.IOException
java.io.IOException
public java.lang.String getPreferredAuthorityName()
public java.lang.String[] getAuthorityNames()
public void setAuthority(java.lang.String authname, java.net.URL origin, java.lang.String uuid)
NOTE: setting the uuid is effective only if a uuid attribute is already there
NOTE: adding an authority doesn't yet save it to disk
authname
- - the name of the authority to changeorigin
- - the origin URL for the authorityuuid
- - the UUID for the authority
java.lang.IllegalArgumentException
- - if the authority is not currently in the
image and origin is null.public void refreshCatalogs() throws java.io.IOException
java.io.IOException
public java.util.List<Image.FmriState> getInventory(java.lang.String[] pkg_list, boolean all_known)
pkg_list
- Limit the inventory to packages that match entries in the
list of package namesall_known
- If true, return all package versions. Otherwise only
return the most recent version of each package.
public Image.ImagePlan makeInstallPlan(java.lang.String[] pkgNames) throws java.io.IOException
pkgNames
- names of packages to install
java.io.IOException
public Image.ImagePlan makeInstallPlan(java.util.List<Fmri> pkgs) throws java.io.IOException
pkgs
- List of valid Fmris from the image inventory for packages to
install.
java.io.IOException
public void installPackages(java.lang.String[] pkgNames) throws java.io.IOException
The catalogs are searched for a matching package for each entry in the pkgNames array. If multiple packages match an entry, the most recent package is installed. If no matching package is found, an IllegalArgumentException is thrown.
This method is shorthand for:
makeInstallPlan(pkgNames).execute();
pkgNames
- names of packages to install
java.io.IOException
java.lang.IllegalArgumentException
- if a matching package cannot be foundpublic void installPackages(java.util.List<Fmri> pkgs) throws java.io.IOException
This method is shorthand for:
makeInstallPlan(pkgs).execute();
pkgs
- List of valid Fmris from the image inventory for packages to
install.
java.io.IOException
public void uninstallPackages(java.lang.String[] pkgNames) throws java.io.IOException
pkgNames
- names of packages to uninstall
java.io.IOException
public void uninstallPackages(java.util.List<Fmri> pkgs) throws java.io.IOException
pkgs
- List of valid Fmris to uninstall.
java.io.IOException
public Manifest getManifest(Fmri fmri) throws java.io.IOException
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |