/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ @Override public void validateOperatingSystem ( final OperatingSystemDescriptor descriptor, final ValidationContext context ) { if ( modules != null ) { for ( final SetupModule module : this.modules ) { module.validateOperatingSystem ( descriptor, context ); } } }
@Override public void perform ( final DeploymentContext context, final OperatingSystemDescriptor operatingSystem ) throws Exception { runSetup ( context, this.module.getContainer ().getModules (), operatingSystem ); }
public static Boolean isProperty ( final OperatingSystemDescriptor operatingSystem, final String name, final Boolean defaultValue ) { OperatingSystemDescriptor os = operatingSystem; while ( os != null ) { final Boolean value = Properties.isProperty ( operatingSystem.getProperties (), name, null ); if ( value != null ) { return value; } os = os.getParent (); } return defaultValue; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public SetupModuleContainer getContainer () { if ( container != null && container.eIsProxy () ) { InternalEObject oldContainer = (InternalEObject)container; container = (SetupModuleContainer)eResolveProxy ( oldContainer ); if ( container != oldContainer ) { if ( eNotificationRequired () ) eNotify ( new ENotificationImpl ( this, Notification.RESOLVE, SetupPackage.SUB_CONTAINER_MODULE__CONTAINER, oldContainer, container ) ); } } return container; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ @Override public void validateOperatingSystem ( final OperatingSystemDescriptor descriptor, final ValidationContext ctx ) { if ( this.container == null ) { ctx.add ( "A sub container module must reference a setup container" ); } for ( final SetupModule module : this.container.getModules () ) { module.validateOperatingSystem ( descriptor, ctx ); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public OperatingSystemDescriptor getParent () { if ( parent != null && parent.eIsProxy () ) { InternalEObject oldParent = (InternalEObject)parent; parent = (OperatingSystemDescriptor)eResolveProxy ( oldParent ); if ( parent != oldParent ) { if ( eNotificationRequired () ) eNotify ( new ENotificationImpl ( this, Notification.RESOLVE, SetupPackage.OPERATING_SYSTEM_DESCRIPTOR__PARENT, oldParent, parent ) ); } } return parent; }
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 (); }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors ( Collection<Object> newChildDescriptors, Object object ) { super.collectNewChildDescriptors ( newChildDescriptors, object ); newChildDescriptors.add ( createChildParameter ( SetupPackage.Literals.SETUP_DEFINITIONS__CONTAINERS, SetupFactory.eINSTANCE.createSetupModuleContainer () ) ); newChildDescriptors.add ( createChildParameter ( SetupPackage.Literals.SETUP_DEFINITIONS__OPERATION_SYSTEM_DEFINITIONS, SetupFactory.eINSTANCE.createOperatingSystemDescriptor () ) ); }
public void validate () { final String version = Properties.get ( this.os.getProperties (), POSTGRES_VERSION_KEY, null ); if ( version == null ) { this.ctx.add ( "Operating system does not provide PostgreSQL" ); } else if ( !POSTGRES_VERSION_VALUE.equals ( version ) ) { this.ctx.add ( "Requires '{0}' = {1} but found ({2})", POSTGRES_VERSION_KEY, POSTGRES_VERSION_VALUE, version ); } final Map<String, String> props = Properties.makeAttributes ( this.os.getProperties () ); getConfigurationFile ( props ); getHostBasedAccessFile ( props ); } }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors ( Collection<Object> newChildDescriptors, Object object ) { super.collectNewChildDescriptors ( newChildDescriptors, object ); newChildDescriptors.add ( createChildParameter ( SetupPackage.Literals.SETUP_MODULE_CONTAINER__MODULES, SetupFactory.eINSTANCE.createSubContainerModule () ) ); }
public static void runSetup ( final DeploymentContext context, final Collection<? extends SetupModule> modules, final OperatingSystemDescriptor operatingSystem ) throws Exception { for ( final SetupModule module : modules ) { final SetupModuleHandler handler = AdapterHelper.adapt ( module, SetupModuleHandler.class, true ); if ( handler == null ) { throw new IllegalStateException ( String.format ( "Unable to find setup handler for module: %s", module.eClass ().getName () ) ); } handler.perform ( context, operatingSystem ); } }
public static void validate ( final SerialToNetworkSetupModule setupModule, final OperatingSystemDescriptor descriptor ) throws Exception { if ( !OperatingSystemDescriptors.isProperty ( descriptor, DPKG_DIVERT, false ) ) { throw new IllegalStateException ( String.format ( "Operating system %s does not support '%s'. Or it is not set to 'true'.", descriptor.getId (), DPKG_DIVERT ) ); } } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SetupModuleContainer getSetup () { if ( setup != null && setup.eIsProxy () ) { InternalEObject oldSetup = (InternalEObject)setup; setup = (SetupModuleContainer)eResolveProxy ( oldSetup ); if ( setup != oldSetup ) { if ( eNotificationRequired () ) eNotify ( new ENotificationImpl ( this, Notification.RESOLVE, DeploymentPackage.COMMON_DEPLOYMENT_MECHANISM__SETUP, oldSetup, setup ) ); } } return setup; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public OperatingSystemDescriptor getOperatingSystem () { if ( operatingSystem != null && operatingSystem.eIsProxy () ) { InternalEObject oldOperatingSystem = (InternalEObject)operatingSystem; operatingSystem = (OperatingSystemDescriptor)eResolveProxy ( oldOperatingSystem ); if ( operatingSystem != oldOperatingSystem ) { if ( eNotificationRequired () ) eNotify ( new ENotificationImpl ( this, Notification.RESOLVE, DeploymentPackage.COMMON_DEPLOYMENT_MECHANISM__OPERATING_SYSTEM, oldOperatingSystem, operatingSystem ) ); } } return operatingSystem; }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors ( Collection<Object> newChildDescriptors, Object object ) { super.collectNewChildDescriptors ( newChildDescriptors, object ); newChildDescriptors.add ( createChildParameter ( DeploymentPackage.Literals.COMMON_DEPLOYMENT_MECHANISM__CHANGES, DeploymentFactory.eINSTANCE.createChangeEntry () ) ); newChildDescriptors.add ( createChildParameter ( DeploymentPackage.Literals.COMMON_DEPLOYMENT_MECHANISM__ADDITIONAL_SETUP_MODULES, SetupFactory.eINSTANCE.createSubContainerModule () ) ); }
public static Boolean isProperty ( final OperatingSystemDescriptor operatingSystem, final String name, final Boolean defaultValue ) { OperatingSystemDescriptor os = operatingSystem; while ( os != null ) { final Boolean value = Properties.isProperty ( operatingSystem.getProperties (), name, null ); if ( value != null ) { return value; } os = os.getParent (); } return defaultValue; }
@Override public void perform ( final DeploymentContext context, final OperatingSystemDescriptor operatingSystem ) throws Exception { runSetup ( context, this.module.getContainer ().getModules (), operatingSystem ); }
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 (); }
public static String getProperty ( final OperatingSystemDescriptor operatingSystem, final String name, final String defaultValue ) { OperatingSystemDescriptor os = operatingSystem; while ( os != null ) { final String value = Properties.getProperty ( operatingSystem.getProperties (), name, null ); if ( value != null ) { return value; } os = os.getParent (); } return defaultValue; }
public static String getProperty ( final OperatingSystemDescriptor operatingSystem, final String name, final String defaultValue ) { OperatingSystemDescriptor os = operatingSystem; while ( os != null ) { final String value = Properties.getProperty ( operatingSystem.getProperties (), name, null ); if ( value != null ) { return value; } os = os.getParent (); } return defaultValue; }