Package org.eclipse.ecf.storage

Examples of org.eclipse.ecf.storage.IDStoreException


  }

  public void putAssociate(String key, IIDEntry entry, boolean encrypt)
      throws IDStoreException {
    if (key == null)
      throw new IDStoreException("key cannot be null"); //$NON-NLS-1$
    if (entry == null)
      throw new IDStoreException("entry cannot be null"); //$NON-NLS-1$
    ISecurePreferences associateNode = prefs.node(key);
    ISecurePreferences prefs = entry.getPreferences();
    // This is where associates are created with form:
    // <index>:<namespace>:<idname>
    String entryAssociate = String
View Full Code Here


    try {
      // Get index of first :
      int index = name.indexOf(DELIMITER);
      // If not found then the name is not well-formed
      if (index == -1)
        throw new IDStoreException("Associate ID not well-formed"); //$NON-NLS-1$
      // Get the index string
      String indexStr = name.substring(0, index);
      Integer resultIndex = null;
      // Create resultIndex from indexStr
      try {
        resultIndex = Integer.valueOf(indexStr);
      } catch (NumberFormatException e) {
        throw new IDStoreException("Associate ID not well-formed", e); //$NON-NLS-1$
      }
      // get remainder string
      name = name.substring(index + 1);
      // Get index of second :
      index = name.indexOf(DELIMITER);
      if (index == -1)
        throw new IDStoreException("Associate ID not well-formed"); //$NON-NLS-1$
      // Get namespace name before index
      String namespaceName = name.substring(0, index);
      ISecurePreferences namespacePrefs = getPreferences(
          getNamespaceRoot(), namespaceName);
      if (namespacePrefs == null)
        throw new IDStoreException(
            "Cannot find Namespace=" + namespaceName); //$NON-NLS-1$
      // Get ID name after index
      String idName = name.substring(index + 1);
      ISecurePreferences idPrefs = getPreferences(namespacePrefs, idName);
      if (idPrefs == null)
        throw new IDStoreException(
            "ID="  + idName + " not found in Namespace=" + namespaceName); //$NON-NLS-1$ //$NON-NLS-2$
      // Put new IDEntry in sorted collection ordered by resultIndex
      results.put(resultIndex, new IDEntry(idPrefs));
    } catch (IDStoreException e) {
      Activator.getDefault().log(
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.storage.IDStoreException

Copyright © 2018 www.massapicom. 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.