Writes the Properties object to the Version metadata system store

@param versionStore The system store client used to retrieve the metadata
versions
@param props The Properties object to write to the System store
974715
public static void setProperties(SystemStoreClient<String, String> versionStore,
                                     Properties props) {
        if (props == null) {
            logger.info("Ignoring set for empty properties");
            return;
        }

        try {
            String versionString = getPropertiesString(props);
            versionStore.putSysStore(SystemStoreConstants.VERSIONS_METADATA_KEY,
                                     versionString);
        } catch(Exception e) {
            logger.info("Got exception in setting properties : ", e);
        }
    }
329847
public static void removeEmptyProperties(Map<String, CmsClientProperty> props) {

        Iterator<Map.Entry<String, CmsClientProperty>> iter = props.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry<String, CmsClientProperty> entry = iter.next();
            CmsClientProperty value = entry.getValue();
            if (value.isEmpty()) {
                iter.remove();
            }
        }
    }
1129848
public void setProperties(Properties properties) throws ConfigurationException {
//		initialRequest = application.getCurrentRequest();
		autoReload = Boolean.valueOf(properties.getProperty("autoreload", "true"));

		defaultMappingName = properties.getProperty("defaultmapping", defaultMappingName);

/*		strict = section.getValue("strict", new GenericValue(strict), "abort mapping loading on errors").toBoolean().booleanValue();
        Environment.System.out.println("checking mapping strictly: " + strict);*/

		mappingFilesMap = PropertiesSupport.getSubsection(properties, "mapping");
	}
778121
public void storeToYAML(final Properties props, final OutputStream os, final String header, final String encoding)
			throws IOException {
		try {
			((PrefixedProperties) props).storeToYAML(os, header, encoding);
		} catch (final ClassCastException err) {
			throw new IOException(
					"Cannot store properties JSON file - not using PrefixedProperties: " + err.getMessage());
		}
	}
193570
public void setVersions(java.util.Collection<VersionSummary> versions) {
        if (versions == null) {
            this.versions = null;
            return;
        }

        this.versions = new java.util.ArrayList<VersionSummary>(versions);
    }
452364
protected void setProperties(Properties properties) {
        Properties oldProperties = internalProperties;
        synchronized(this) {
            internalProperties = properties;
        }
        notifyPropertiesChanged(oldProperties);
    }
391596
void update(Dictionary<String, Object> props) {
        if (deleted) {
            return;
        }

        final String instancePid = (String) props.get("service.pid");
        final String instanceId = (String) props.get("id");
        if (instanceId == null) {
            Tr.error(tc, "cls.library.id.missing");
        }
        if (libraryListenersTracker == null) {
            //set up a tracker for notification listeners for this library
            Filter listenerFilter = null;
            // To better support parent first nested config, also filter on libraryRef,
            // which will be a list of pid (or, if cardinality=0, then just a pid).
            try {
                listenerFilter = FrameworkUtil.createFilter("(&(objectClass=" + LibraryChangeListener.class.getName() +
                                                            ")(|(library=" + instanceId + ")(libraryRef=*" + instancePid + "*)))");
            } catch (InvalidSyntaxException e) {
                //auto FFDC because the syntax shouldn't be wrong!
                Tr.error(tc, "cls.library.id.invalid", instanceId, e.toString());
            }

            ServiceTracker<LibraryChangeListener, LibraryChangeListener> tracker;
            tracker = new ServiceTracker<LibraryChangeListener, LibraryChangeListener>(this.ctx, listenerFilter, null);
            tracker.open();
            libraryListenersTracker = tracker;
        }

        LibraryGeneration nextGen;
        synchronized (generationLock) {
            nextGen = nextGeneration;
            if (nextGen != null) {
                // there is already a new generation in the process of being updated.
                // since it is using stale properties we want to cancel that generation
                // and start a new one.
                nextGeneration = null;
                nextGen.cancel();
            }
            nextGeneration = nextGen = new LibraryGeneration(this, instanceId, props);
        }
        nextGen.fetchFilesets();
    }
633944
@Reference(target = "(id=unbound)")
    protected void setTaskStore(DatabaseStore svc, Map<String, Object> props) {
        persistentStore = svc;
        persistentStoreDisplayId = (String) props.get("config.displayId");
    }
52417
private void writePropertyFile()
	{
	    try
	    {
	    	java.util.Properties props = new java.util.Properties();
			
	    	MultimediaContainerManager.getContainerConfigs(props);
			props.setProperty(PROPERTY_SEARCHPATH, searchPath);
			props.setProperty(PROPERTY_EXPORTPATH, exportPath);
			props.setProperty(PROPERTY_LOOKANDFEEL, uiClassName);
			props.setProperty(PROPERTY_SYSTEMTRAY, Boolean.toString(useSystemTray));
			props.setProperty(PROPERTY_VOLUME_VALUE, Float.toString(currentVolume));
			props.setProperty(PROPERTY_BALANCE_VALUE, Float.toString(currentBalance));
			for (int i=0; i<PROPERTY_LASTLOADED_MAXENTRIES; i++)
			{
				URL element = lastLoaded.get(i);
				if (element!=null)
					props.setProperty(PROPERTY_LASTLOADED+'.'+i, element.toString());
			}
			props.setProperty(PROPERTY_EFFECTS_PASSTHROUGH, Boolean.toString(isDSPEnabled()));

			props.setProperty(PROPERTY_MAINDIALOG_POS, Helpers.getStringFromPoint(getLocation()));
			props.setProperty(PROPERTY_MAINDIALOG_SIZE, Helpers.getStringFromDimension(getSize()));
			props.setProperty(PROPERTY_SETUPDIALOG_POS, Helpers.getStringFromPoint(getPlayerSetUpDialog().getLocation()));
			props.setProperty(PROPERTY_SETUPDIALOG_SIZE, Helpers.getStringFromDimension(getPlayerSetUpDialog().getSize()));
			props.setProperty(PROPERTY_SETUPDIALOG_VISABLE, Boolean.toString(getPlayerSetUpDialog().isVisible()));
			props.setProperty(PROPERTY_PROPERTIESDIALOG_POS, Helpers.getStringFromPoint(getModInfoDialog().getLocation()));
			props.setProperty(PROPERTY_PROPERTIESDIALOG_SIZE, Helpers.getStringFromDimension(getModInfoDialog().getSize()));
			props.setProperty(PROPERTY_PROPERTIESDIALOG_VISABLE, Boolean.toString(getModInfoDialog().isVisible()));
			props.setProperty(PROPERTY_PLAYLISTDIALOG_POS, Helpers.getStringFromPoint(getPlaylistDialog().getLocation()));
			props.setProperty(PROPERTY_PLAYLISTDIALOG_SIZE, Helpers.getStringFromDimension(getPlaylistDialog().getSize()));
			props.setProperty(PROPERTY_PLAYLIST_VISABLE, Boolean.toString(getPlaylistDialog().isVisible()));
			props.setProperty(PROPERTY_EFFECTDIALOG_POS, Helpers.getStringFromPoint(getEffectDialog().getLocation()));
			props.setProperty(PROPERTY_EFFECTDIALOG_SIZE, Helpers.getStringFromDimension(getEffectDialog().getSize()));
			props.setProperty(PROPERTY_EFFECT_VISABLE, Boolean.toString(getEffectDialog().isVisible()));
			if (currentEqualizer!=null)
			{
				props.setProperty(PROPERTY_EQUALIZER_ISACTIVE, Boolean.toString(currentEqualizer.isActive()));
				props.setProperty(PROPERTY_EQUALIZER_PREAMP, Float.toString(currentEqualizer.getPreAmpDB()));
				for (int i=0; i<currentEqualizer.getBandCount(); i++)
				{
					props.setProperty(PROPERTY_EQUALIZER_BAND_PREFIX + Integer.toString(i), Float.toString(currentEqualizer.getBand(i)));
				}
			}
			if (currentPitchShift!=null)
			{
				props.setProperty(PROPERTY_PITCHSHIFT_ISACTIVE, Boolean.toString(currentPitchShift.isActive()));
				props.setProperty(PROPERTY_PITCHSHIFT_PITCH, Float.toString(currentPitchShift.getPitchScale()));
				props.setProperty(PROPERTY_PITCHSHIFT_SAMPLESCALE, Float.toString(currentPitchShift.getSampleScale()));
				props.setProperty(PROPERTY_PITCHSHIFT_FRAMESIZE, Integer.toString(currentPitchShift.getFftFrameSize()));
				props.setProperty(PROPERTY_PITCHSHIFT_OVERSAMPLING, Integer.toString(currentPitchShift.getFFTOversampling()));
			}

			File propertyFile = new File(propertyFilePath + File.separator + PROPERTYFILENAME);
	        if (propertyFile.exists())
	        {
	        	boolean ok = propertyFile.delete();
	        	if (ok) ok = propertyFile.createNewFile();
	        	if (!ok) Log.error("Could not create property file: " + propertyFile.getCanonicalPath());
	        }
	        java.io.FileOutputStream fos = null;
	        try
	        {
		    	fos = new java.io.FileOutputStream(propertyFile);
			    props.store(fos, WINDOW_TITLE);
	        }
	        finally
	        {
	        	if (fos!=null) try { fos.close(); } catch (IOException ex) { Log.error("IGNORED", ex); }
	        }
	    }
	    catch (Throwable ex)
	    {
			Log.error("MainForm]", ex);
	    }
	}
39053
public static void writeUpdateCenterProperties(JsonWriter json, Optional<UpdateCenter> updateCenter) {
    if (updateCenter.isPresent()) {
      json.propDateTime(PROPERTY_UPDATE_CENTER_REFRESH, updateCenter.get().getDate());
    }
  }
297474
synchronized boolean updateKeystoreConfig(Dictionary<String, Object> props) {
        properties = props;
        if (id != null) {
            properties.put(Constants.SSLPROP_ALIAS, id);
        }
        String location = (String) properties.get(LibertyConstants.KEY_KEYSTORE_LOCATION);
        if (location != null) {
            properties.put(Constants.SSLPROP_KEY_STORE, locSvc.getServiceWithException().resolveString(location));
        }

        try {
            // Try modifying the properties..
            // This may throw if arguments are bad
            wsKeyStore = new WSKeyStore(id, properties, this);
            KeyStoreManager.getInstance().addKeyStoreToMap(id, wsKeyStore);
            KeyStoreManager.getInstance().addKeyStoreToMap(pid, wsKeyStore);
            return true;
        } catch (Exception e) {
            wsKeyStore = null;
            return false;
        }
    }
706484
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        try {
            int intValue = Integer.parseInt(strValue);
            set(intValue);
        } catch (NumberFormatException nfe) {
        }
    }
860592
public void write(ObjectWriter out, PersistedPropertyData propData) throws IOException
   {
      // write id
      out.writeInt(SerializationConstants.PERSISTED_PROPERTY_DATA);

      out.writeString(propData.getQPath().getAsString());
      out.writeString(propData.getIdentifier());

      if (propData.getParentIdentifier() != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         out.writeString(propData.getParentIdentifier());
      }
      else
         out.writeByte(SerializationConstants.NULL_DATA);

      out.writeInt(propData.getPersistedVersion());
      // -------------------

      out.writeInt(propData.getType());
      out.writeBoolean(propData.isMultiValued());
      out.writeLong(propData.getPersistedSize());

      List<ValueData> values = propData.getValues();
      if (values != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         int listSize = values.size();
         out.writeInt(listSize);
         PersistedValueDataWriter wr = new PersistedValueDataWriter();
         for (int i = 0; i < listSize; i++)
         {
            wr.write(out, (PersistedValueData)values.get(i));
         }
      }
      else
      {
         out.writeByte(SerializationConstants.NULL_DATA);
      }

   }
206029
protected void setLayoutVersion(Properties props, StorageDirectory sd)
      throws IncorrectVersionException, InconsistentFSStateException {
    int lv = Integer.parseInt(getProperty(props, sd, LAYOUT_VERSION));
    if (lv < FSConstants.LAYOUT_VERSION) { // future version
      throw new IncorrectVersionException(lv, "storage directory "
          + sd.root.getAbsolutePath());
    }
    layoutVersion = lv;
  }
590027
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        boolean intValue = Boolean.parseBoolean(strValue);
        set(intValue);
    }
289930
public void updateMetadataVersions() {
        Properties versionProps = MetadataVersionStoreUtils.getProperties(this.systemStoreRepository.getMetadataVersionStore());
        Long newVersion = fetchNewVersion(SystemStoreConstants.CLUSTER_VERSION_KEY,
                                          null,
                                          versionProps);
        if(newVersion != null) {
            this.currentClusterVersion = newVersion;
        }
    }
820884
private void generateProperties(JsonNode node, String parentPrefix,
			Properties props) {

		Iterator<Entry<String, JsonNode>> fields = node.fields();
		while (fields.hasNext()) {
			Entry<String, JsonNode> entry = fields.next();
			String fieldName = entry.getKey();
			JsonNode jsonNode = entry.getValue();
			String nodePrefix = parentPrefix == null ? fieldName : parentPrefix
					+ FIELD_NAME_SEPARATOR + fieldName;
			if (jsonNode.isTextual() || jsonNode.isBoolean()) {
				props.put(nodePrefix, jsonNode.asText());
			} else if (jsonNode.isNumber()) {
				props.put(nodePrefix, Integer.toString(jsonNode.asInt()));
			} else if (jsonNode.isArray()) {
				String arrayValue = convertToString(jsonNode);
				props.put(nodePrefix, arrayValue);
			}
			generateProperties(jsonNode, nodePrefix, props);
		}
	}