/** * Get the startup mechanism to use * * @param defaultStartupMechanism * the default if none is set * @return the startup mechanism, or the default */ private StartupMechanism getStartupMechanism ( final StartupMechanism defaultStartupMechanism ) { if ( this.deploy.getStartupMechanism () == null || this.deploy.getStartupMechanism () == StartupMechanism.DEFAULT ) { final String type = OperatingSystemDescriptors.getProperty ( this.deploy.getOperatingSystem (), "startup", defaultStartupMechanism.name () ); return StartupMechanism.valueOf ( type ); } else { return this.deploy.getStartupMechanism (); } }
protected void runSetup ( final CommonDeploymentMechanism deploy, final DeploymentContext context, final IProgressMonitor monitor ) throws Exception { if ( deploy.getSetup () != null ) { SubModuleHandler.runSetup ( context, deploy.getSetup ().getModules (), this.deploy.getOperatingSystem () ); } SubModuleHandler.runSetup ( context, deploy.getAdditionalSetupModules (), deploy.getOperatingSystem () ); monitor.done (); }
protected String makeCreate ( final CommonDeploymentMechanism deploy ) { final StringBuilder sb = new StringBuilder (); if ( deploy.isAutomaticCreate () ) { String flags; if ( deploy.getRecreateBackups () == null ) { flags = "-i"; } else if ( deploy.getRecreateBackups () > 0 ) { flags = "-b " + deploy.getRecreateBackups (); } else { flags = "-d"; } for ( final String app : makeEquinoxList () ) { sb.append ( String.format ( "echo -n Creating application \\'%s\\' ...\n", app ) ); sb.append ( String.format ( "scada.create.%s %s > /dev/null\n", app, flags ) ); sb.append ( String.format ( "echo \" done!\"\n", app ) ); } } return sb.toString (); }
/** * This returns the label styled text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getStyledText ( Object object ) { StartupMechanism labelValue = ( (CommonDeploymentMechanism)object ).getStartupMechanism (); String label = labelValue == null ? null : labelValue.toString (); StyledString styledLabel = new StyledString (); if ( label == null || label.length () == 0 ) { styledLabel.append ( getString ( "_UI_CommonDeploymentMechanism_type" ), StyledString.Style.QUALIFIER_STYLER ); //$NON-NLS-1$ } else { styledLabel.append ( getString ( "_UI_CommonDeploymentMechanism_type" ), StyledString.Style.QUALIFIER_STYLER ).append ( " " + label ); //$NON-NLS-1$ //$NON-NLS-2$ } return styledLabel; }
protected void stopApplications ( final StringBuilder sb ) { final ScriptMaker sm = new ScriptMaker ( getStartupHandler () ); for ( final String driver : makeDriverList () ) { sm.appendStopDriver ( sb, driver ); } if ( this.deploy.isAutomaticCreate () ) { for ( final String app : makeEquinoxList () ) { sm.appendStopApp ( sb, app ); } } }
private StartupHandler createStartupHandler ( final StartupMechanism defaultStartupMechanism ) { final StartupMechanism sm = getStartupMechanism ( defaultStartupMechanism ); if ( sm == null ) { return null; } switch ( sm ) { case REDHAT_SYSV: return new RedhatSystemVHandler (); case UPSTART: return new UpstartHandler ( this.deploy.getOperatingSystem () ); case LSB_SYSV: return new LSBSystemVHandler (); case SYSTEMD: return new SystemdHandler (); case DEFAULT: return null; // we ran of options here } throw new IllegalStateException ( String.format ( "Startup method %s is unsupported", sm ) ); }
protected void startApplications ( final StringBuilder sb ) { final ScriptMaker sm = new ScriptMaker ( getStartupHandler () ); for ( final String driver : makeDriverList () ) { sm.appendStartDriver ( sb, driver ); } if ( this.deploy.isAutomaticCreate () ) { for ( final String app : makeEquinoxList () ) { sm.appendStartApp ( sb, app ); } } }
private StartupHandler createStartupHandler ( final StartupMechanism defaultStartupMechanism ) { final StartupMechanism sm = getStartupMechanism ( defaultStartupMechanism ); if ( sm == null ) { return null; } switch ( sm ) { case REDHAT_SYSV: return new RedhatSystemVHandler (); case UPSTART: return new UpstartHandler ( this.deploy.getOperatingSystem () ); case LSB_SYSV: return new LSBSystemVHandler (); case SYSTEMD: return new SystemdHandler (); case DEFAULT: return null; // we ran of options here } throw new IllegalStateException ( String.format ( "Startup method %s is unsupported", sm ) ); }
protected void runSetup ( final CommonDeploymentMechanism deploy, final DeploymentContext context, final IProgressMonitor monitor ) throws Exception { if ( deploy.getSetup () != null ) { SubModuleHandler.runSetup ( context, deploy.getSetup ().getModules (), this.deploy.getOperatingSystem () ); } SubModuleHandler.runSetup ( context, deploy.getAdditionalSetupModules (), deploy.getOperatingSystem () ); monitor.done (); }
/** * Get the startup mechanism to use * * @param defaultStartupMechanism * the default if none is set * @return the startup mechanism, or the default */ private StartupMechanism getStartupMechanism ( final StartupMechanism defaultStartupMechanism ) { if ( this.deploy.getStartupMechanism () == null || this.deploy.getStartupMechanism () == StartupMechanism.DEFAULT ) { final String type = OperatingSystemDescriptors.getProperty ( this.deploy.getOperatingSystem (), "startup", defaultStartupMechanism.name () ); return StartupMechanism.valueOf ( type ); } else { return this.deploy.getStartupMechanism (); } }
protected String makeCreate ( final CommonDeploymentMechanism deploy ) { final StringBuilder sb = new StringBuilder (); if ( deploy.isAutomaticCreate () ) { String flags; if ( deploy.getRecreateBackups () == null ) { flags = "-i"; } else if ( deploy.getRecreateBackups () > 0 ) { flags = "-b " + deploy.getRecreateBackups (); } else { flags = "-d"; } for ( final String app : makeEquinoxList () ) { sb.append ( String.format ( "echo -n Creating application \\'%s\\' ...\n", app ) ); sb.append ( String.format ( "scada.create.%s %s > /dev/null\n", app, flags ) ); sb.append ( String.format ( "echo \" done!\"\n", app ) ); } } return sb.toString (); }
protected void stopApplications ( final StringBuilder sb ) { final ScriptMaker sm = new ScriptMaker ( getStartupHandler () ); for ( final String driver : makeDriverList () ) { sm.appendStopDriver ( sb, driver ); } if ( this.deploy.isAutomaticCreate () ) { for ( final String app : makeEquinoxList () ) { sm.appendStopApp ( sb, app ); } } }
protected void startApplications ( final StringBuilder sb ) { final ScriptMaker sm = new ScriptMaker ( getStartupHandler () ); for ( final String driver : makeDriverList () ) { sm.appendStartDriver ( sb, driver ); } if ( this.deploy.isAutomaticCreate () ) { for ( final String app : makeEquinoxList () ) { sm.appendStartApp ( sb, app ); } } }