Package org.osgi.service.prefs

Examples of org.osgi.service.prefs.Preferences.childrenNames()


    private void createRepositoryPrefs(String pid, String customer, String name) throws ConfigurationException {
        Preferences systemPrefs = m_prefsService.getSystemPreferences();

        String[] nodes;
        try {
            nodes = systemPrefs.childrenNames();
        }
        catch (BackingStoreException e) {
            throw new ConfigurationException(null, "Internal error while validating configuration.");
        }
        for (String nodeName : nodes) {
View Full Code Here


    void loadPreferences() {
        Preferences workingNode = m_prefs.node(PREFS_LOCAL_WORKING_STATE);
        Map<String, WorkingState> entries = new HashMap<String, WorkingState>();
        // First, get all nodes and their workingstate.
        try {
            for (String node : workingNode.childrenNames()) {
                String state = workingNode.node(node).get(PREFS_LOCAL_WORKING_STATE_VALUE, WorkingState.Unchanged.toString());
                entries.put(node, WorkingState.valueOf(state));
            }
        }
        catch (BackingStoreException e) {
View Full Code Here

  public void flush() {
    try {
      Preferences node = getConfigurationNode();
      if (id == null) {
        int i = node.childrenNames().length;
        while (true) {
          id = getIdPrefix() + (++i);
          if (!node.nodeExists(id)) {
            break;
          }
View Full Code Here

  }

  protected static void load(Collection<FabricDetails> cloudDetailList) {
    Preferences node = exemplar.getConfigurationNode();
    try {
      String[] childrenNames = node.childrenNames();
      for (String name : childrenNames) {
        cloudDetailList.add(new FabricDetails(name, node.node(name)));
      }
    } catch (BackingStoreException e) {
      FabricPlugin.showUserError("Failed to load fabric details", e.getMessage(), e);
View Full Code Here


    protected static void load(Collection<CloudDetails> cloudDetailList) {
        Preferences node = exemplar.getConfigurationNode();
        try {
            String[] childrenNames = node.childrenNames();
            for (String name : childrenNames) {
                cloudDetailList.add(new CloudDetails(name, node.node(name)));
            }
        } catch (BackingStoreException e) {
            FabricPlugin.showUserError("Failed to load cloud providers", e.getMessage(), e);
View Full Code Here

    {
        try
        {
            Preferences prefs = new ConfigurationScope().getNode( Application.PLUGIN_ID );
            Preferences saved_workspace = prefs.node( SAVED_WORKSPACE );
            String[] schemaNames = saved_workspace.childrenNames();
            for ( String name : schemaNames )
            {
                Preferences node = saved_workspace.node( name );
                try
                {
View Full Code Here

  public List<PuppetDBConnectionPreferences> getPuppetDBs() throws BackingStoreException {
    if(!hasPuppetDBNode())
      return Collections.emptyList();

    Preferences puppetDBNode = getPuppetDBNode();
    String[] childrenNames = puppetDBNode.childrenNames();
    if(childrenNames.length == 0)
      return Collections.emptyList();

    ArrayList<PuppetDBConnectionPreferences> result = new ArrayList<PuppetDBConnectionPreferences>(childrenNames.length);
    for(String prefName : puppetDBNode.childrenNames()) {
View Full Code Here

    String[] childrenNames = puppetDBNode.childrenNames();
    if(childrenNames.length == 0)
      return Collections.emptyList();

    ArrayList<PuppetDBConnectionPreferences> result = new ArrayList<PuppetDBConnectionPreferences>(childrenNames.length);
    for(String prefName : puppetDBNode.childrenNames()) {
      int sep = prefName.lastIndexOf(':');
      result.add(new PuppetDBConnectionPreferencesImpl(prefName.substring(0, sep), Integer.parseInt(prefName.substring(sep + 1))));
    }
    return result;
  }
View Full Code Here

  public void removeConnectionDetails(ConnectionDetails cd) {
    try {
      Preferences preferences = new InstanceScope()
          .getNode(ClientPlugin.PLUGIN_ID);
      Preferences connections = preferences.node(SAVED);
      String[] targets = connections.childrenNames();
      for (int i = 0; i < targets.length; i++) {
        String target = targets[i];
        Preferences node = connections.node(target);
        String cdTarget = normalizeURI(cd.getTargetURI());
        if (node != null && target != null && target.equals(cdTarget)) {
View Full Code Here

  public void loadConnectionDetailsFromPreferenceStore() {
    try {
      Preferences preferences = new InstanceScope()
          .getNode(ClientPlugin.PLUGIN_ID);
      Preferences connections = preferences.node(SAVED);
      String[] targets = connections.childrenNames();
      for (int i = 0; i < targets.length; i++) {
        String target = targets[i];
        Preferences node = connections.node(target);
        if (node != null) {
          addConnectionDetails(new ConnectionDetails(node.get(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.