/**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public ServiceSetting getImplServiceSetting() {
   if (implServiceSetting != null && implServiceSetting.eIsProxy()) {
     InternalEObject oldImplServiceSetting = (InternalEObject) implServiceSetting;
     implServiceSetting = (ServiceSetting) eResolveProxy(oldImplServiceSetting);
     if (implServiceSetting != oldImplServiceSetting) {
       if (eNotificationRequired())
         eNotify(
             new ENotificationImpl(
                 this,
                 Notification.RESOLVE,
                 ResourcesPackage.RESOURCE_SETTING__IMPL_SERVICE_SETTING,
                 oldImplServiceSetting,
                 implServiceSetting));
     }
   }
   return implServiceSetting;
 }
  public void CreateSetting(
      String setttingName,
      String defaultValue,
      String settingDescription,
      boolean newServiceCreated,
      OfferedService offService,
      OfferedResource offeredResource,
      boolean readable,
      boolean writable,
      boolean isOptional) {

    // http://repos.pii.tssg.org:8080/repository/rest/configParamAtomic/586

    // NodeList ParamAtomicNode = xmlutl.getNodeListFromObject (
    // configParamAtomicDocument , "//configParamAtomic[@id="+setId+"]");
    log("setttingName = " + setttingName);
    log("setDescription = " + settingDescription);

    ServiceSetting servSetting = null;
    if (!newServiceCreated) {
      log("try to find  servSetting : " + setttingName + " for service : " + offService);
      servSetting = FindServiceSettingOfOfferedService(offService, setttingName);
    }

    if (newServiceCreated || (servSetting == null)) {
      servSetting = ServicesFactory.eINSTANCE.createServiceSetting();
      servSetting.setName(setttingName);
      servSetting.setDescription(settingDescription);
      servSetting.setId(offService.getServiceSettings().size() + 1);
      servSetting.setUniqueID(offService.getUniqueID() + "_set_" + servSetting.getId());
      servSetting.setCanBePublished(false);
      servSetting.setUserEditable(writable);
      servSetting.setUserExposed(true);
      servSetting.setReadable(readable);
      servSetting.setWritable(writable);

      // The following constraint means that the parameter is available
      // after the CREATE operation!
      // SettingConstraint setconstraint =
      // ServicesFactory.eINSTANCE.createSettingConstraint();
      // setconstraint.setForOperation(ServiceResourceOperation.OP_CREATE);
      // setconstraint.setAvailableAfterOperation(true);
      // servSetting.getSettingConstraints().add(setconstraint);

      offService.getServiceSettings().add(servSetting);
      log("servSettings = OK!");
    }
    // service settings now to resource settings

    if (offeredResource != null) {
      ResourceSetting resourceSetting = ResourcesFactory.eINSTANCE.createResourceSetting();
      resourceSetting.setName(setttingName);

      brTypeString sType = brokermodel.services.ServicesFactory.eINSTANCE.createbrTypeString();
      sType.setDefaultValue(defaultValue);
      resourceSetting.setSettingType(sType);

      resourceSetting.setDescription(settingDescription);
      resourceSetting.setId(servSetting.getId());
      resourceSetting.setUniqueID(offeredResource.getUniqueID() + "_set_" + servSetting.getId());
      resourceSetting.setCanBePublished(false);
      resourceSetting.setUserEditable(writable);
      resourceSetting.setUserExposed(true);
      resourceSetting.setReadable(readable);
      resourceSetting.setWritable(writable);
      resourceSetting.setOptional(isOptional);
      resourceSetting.setImplServiceSetting(servSetting);
      offeredResource.getResourceSettings().add(resourceSetting);

      log("ResourceSettings = OK!");
    }
  }