Package org.platformlayer

Examples of org.platformlayer.RepositoryException


      int modelId = db.mapToValue(modelClass.getItemType());
      int serviceId = db.mapToValue(modelClass.getServiceType());

      ItemEntity rs = db.queries.findItem(serviceId, modelId, projectId, itemId.getKey());
      if (rs == null) {
        throw new RepositoryException("Item not found");
      }

      byte[] secretData = rs.secret;

      CryptoKey itemSecret;

      if (secretData == null) {
        itemSecret = FathomdbCrypto.generateKey();
        secretData = itemSecrets.encodeItemSecret(itemSecret);

        db.updateSecret(itemId, secretData);
      } else {
        itemSecret = item.secret.getSecret();
      }

      byte[] data = serialize(item, itemSecret);

      db.updateItem(itemId, data, item.state);

      // Note: we can't change tags here (that needs a separate call to updateTags)

      SecretProvider secretProvider = SecretProvider.forKey(itemSecret);

      boolean fetchTags = true;
      return fetchItem(db, modelClass.getServiceType(), modelClass.getItemType(), project, itemId, itemClass,
          secretProvider, fetchTags);
    } catch (SQLException e) {
      throw new RepositoryException("Error running query", e);
    } finally {
      db.close();
    }
  }
View Full Code Here


    DbHelper db = new DbHelper(key);

    try {
      db.updateItemState(newState, key.getItemId());
    } catch (SQLException e) {
      throw new RepositoryException("Error running query", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

    try {
      int atomValue = db.getProjectCode();
      return atomValue;
    } catch (SQLException e) {
      throw new RepositoryException("Error running query", e);
    } finally {
      db.close();
    }

  }
View Full Code Here

        }
      }

      return tags;
    } catch (SQLException e) {
      throw new RepositoryException("Error running query", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

      sort(ret);

      return ret;
    } catch (SQLException e) {
      throw new RepositoryException("Error listing job executions", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

      sortJobs(ret);

      return ret;
    } catch (SQLException e) {
      throw new RepositoryException("Error listing job executions", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

        return null;
      }

      return mapFromEntity(execution, jobKey);
    } catch (SQLException e) {
      throw new RepositoryException("Error listing job executions", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

    Object o;
    try {
      Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
      o = unmarshaller.unmarshal(new StringReader(actionXml));
    } catch (JAXBException e) {
      throw new RepositoryException("Error deserializing action", e);
    }

    return Casts.checkedCast(o, Action.class);
  }
View Full Code Here

      Marshaller marshaller = jaxbContext.createMarshaller();
      StringWriter writer = new StringWriter();
      marshaller.marshal(action, writer);
      return writer.toString();
    } catch (JAXBException e) {
      throw new RepositoryException("Error serializing action", e);
    }
  }
View Full Code Here

        return null;
      }

      return mapFromEntity(execution, jobKey);
    } catch (SQLException e) {
      throw new RepositoryException("Error listing job executions", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

TOP

Related Classes of org.platformlayer.RepositoryException

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.