Package com.sun.pkg.client

Examples of com.sun.pkg.client.Image


    public static void setProxyInfo(HandlerContext handlerCtx) {
        String connection = (String)handlerCtx.getInputValue("connection");
        String host = (String)handlerCtx.getInputValue("host");
        String port = (String)handlerCtx.getInputValue("port");
        try{
            Image image = getUpdateCenterImage();
            if (connection.equals("useProxy")){
                int portNo = Integer.parseInt(port);
                SocketAddress address = new InetSocketAddress(host, portNo);
                image.setProxy(new Proxy(Proxy.Type.HTTP, address));
                String url="http://"+host+":"+portNo;
                Properties prop = new Properties();
                prop.setProperty("proxy.URL", url);
                SystemInfo.initUpdateToolProps(prop);
            }else{
                image.setProxy(null);
                Properties prop = new Properties();
                prop.setProperty("proxy.URL", "");
                SystemInfo.initUpdateToolProps(prop);
            }
        }catch (Exception ex){
View Full Code Here


    @Handler(id="updateCenterProcess",
      input={
        @HandlerInput(name="action", type=String.class, required=true ),
        @HandlerInput(name="selectedRows", type=java.util.List.class, required=true )})
    public static void updateCenterProcess(HandlerContext handlerCtx) {
        Image image = getUpdateCenterImage();
        boolean install = false;
        String action= (String)handlerCtx.getInputValue("action");
        if (action.equals("install")) {
            install=true;
        }
        List obj = (List) handlerCtx.getInputValue("selectedRows");
        if (obj == null){
            //no row selected
            return;
        }
        List<Map> selectedRows = (List) obj;
        //do not use Fmri list to pass to installPackages, use String array to avoid UPDATECENTER2-2187
        String[] fmris = new String[selectedRows.size()];
        int i=0;
        try {
            for (Map oneRow : selectedRows) {
                fmris[i++]=((Fmri)oneRow.get("fmri")).toString();
            }
            if (install){
                image.installPackages(fmris);
                //updateCountInSession(image);   No need to update the update count since the count will not change.  Only installing new component is allowed.
            }else{
                image.uninstallPackages(fmris);
            }
            GuiUtil.setSessionValue("restartRequired", Boolean.TRUE);
        }catch(Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
            ex.printStackTrace();
View Full Code Here

        @HandlerOutput(name="license", type=String.class),
        @HandlerOutput(name="hasLicense", type=Boolean.class)})
    public static void getLicenseText(HandlerContext handlerCtx) {
        
        List obj = (List) handlerCtx.getInputValue("selectedRows");
        Image image = getUpdateCenterImage();
        List<Map> selectedRows = (List) obj;
        try {
            StringBuffer allLicense = new StringBuffer();
            for (Map oneRow : selectedRows) {
                Fmri fmri = (Fmri)oneRow.get("fmri");
View Full Code Here

         return getUpdateCenterImage((String)GuiUtil.getSessionValue("topDir"), false);
        }
    }

    public static Image getUpdateCenterImage(String ucDir, boolean force){
        Image image = null;
        try{
            image = new Image (new File (ucDir));
            if (force || (GuiUtil.getSessionValue(CATALOG_REFRESHED) == null)){
                if (image != null){
        image.refreshCatalogs();
        GuiUtil.setSessionValue(CATALOG_REFRESHED, "TRUE");
    }
            }
        }catch(Exception ex){
            if(force && (image == null)){
View Full Code Here

TOP

Related Classes of com.sun.pkg.client.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.