So, this means there is no way to change or set Preferred Authority in this release and no need to set the proxy info. Thanks for clarifying this. thanks Anissa. Tom Mueller wrote: > Anissa, > Please see inline. > Anissa Lam wrote: >> Hi Tom, >> I have a question on the API's from the Image class >> >> 1. getInventory() >> I called image.getInventory(null, false) to get the list of package. Does this return the list from the preferred authority as there doesn't seem to be a way to specify the authority. > Yes. There is no multi-authority support in the Java API. So everything comes from the preferred authority. >> >> 2. setAuthority( authname, origin, uuid) >> Is this the API to use for user to set a preferred Authority ? So user needs to know both the origin URL and the uuid. How do they find out the UUID in order to set this ? > No. This just changes the attributes for an authority. It can be used to change any authority, but remember that inventory, packages, etc. only come from the preferred authority. To set a UUID with this call, one needs to "make up" a UUID. This is done by using the Java Uuid class. This is used by the bootstrap code. > > You don't need to have the URL to change the uuid. Just pass in null for the URL and it is not changed (per the javadocs). >> >> 3. getPreferredAuthorityName() >> I am getting glassfish.org from this call, so this is the authority name that is used for the setAuthority() method ? I can't find any API to get the URL of the authority, do i miss it or it is not possible today ? It will be nice to show to the user this info. > It's not possible today. >> >> 4. I just want to confirm this. I don't find anything regarding setting th proxy info, this means user will not be able to set that in Admin Console if they need to. Am i correct ? > The proxy that is used is the one for the JRE as a whole, i.e., the http.proxyHost and http.proxyPort system properties. So there is no pkg(5)-specific interface to set proxies. > > Tom >> >> thanks >> Anissa. >> -------------------------------------- >> getInventory >> public java.util.List getInventory(java.lang.String[] pkg_list, >> boolean all_known) >> >> Get the inventory of packages and their associated state. The inventory is returned in FmriState objects that consist of an Fmri and the four states for the Fmri. These states are: >> >> * upgradable A package with a newer version if available in the catalog >> * frozen TBD >> * incorporated The package is part of an incorporation >> * excludes TBD >> >> * >> >> Parameters: >> pkg_list - Limit the inventory to packages that match entries in the list of package names >> all_known - If true, return all package versions. Otherwise only return the most recent version of each package. >> Returns: >> A List of FmriState objects that identify the Fmris that are available for the image. >> >> >> getPreferredAuthorityName >> public java.lang.String getPreferredAuthorityName >> >> >> setAuthority >> public void setAuthority(java.lang.String authname, >> java.net.URL origin, >> java.lang.String uuid) >> >> Set image authority attributes. If authname names an authority that currently doesn't exist, it is added to the image. For adding an authority, the origin URL is required. For an existing authority, the origin or uuid parameters may be null and in that case the value for the attribute is not changed. >> >> 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 >> >> Parameters: >> authname - - the name of the authority to change >> origin - - the origin URL for the authority >> uuid - - the UUID for the authority >> Throws: >> java.lang.IllegalArgumentException - - if the authority is not currently in the image and origin is null. >> >> >