Package org.platformlayer

Examples of org.platformlayer.RepositoryException


    try {
      UserEntity user = db.findUserById(userId);

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


      }

      UserEntity user = db.findUserById(userCert.userId);
      return user;
    } catch (SQLException e) {
      throw new RepositoryException("Error reading user", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

    DbHelper db = new DbHelper();
    try {
      return db.listUsers(match);
    } catch (SQLException e) {
      throw new RepositoryException("Error listing users", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

    DbHelper db = new DbHelper();
    try {
      return db.listProjects(match);
    } catch (SQLException e) {
      throw new RepositoryException("Error listing projects", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

        ret.add(serviceAccount);
      }

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

    DbHelper db = new DbHelper();
    try {
      return db.findUserByKey(username);
    } catch (SQLException e) {
      throw new RepositoryException("Error reading user", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

    try {
      ProjectEntity project = db.findProjectByKey(key);

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

        KeyPair projectRsaKeyPair = RsaUtils.generateRsaKeyPair(RsaUtils.SMALL_KEYSIZE);
        project.setPublicKey(projectRsaKeyPair.getPublic());
        project.setPrivateKey(projectRsaKeyPair.getPrivate());
      } catch (IOException e) {
        throw new RepositoryException("Error encrypting secrets", e);
      }

      int rows = db.createProject(key, secretData, metadata, project.publicKeyData, project.privateKeyData);
      if (rows != 1) {
        throw new RepositoryException("Unexpected number of rows inserted");
      }

      ProjectEntity created = findProjectByKey(db, key);

      if (created == null) {
        throw new RepositoryException("Created project not found");
      }

      UserProjectEntity userProjectEntity = new UserProjectEntity();
      userProjectEntity.userId = owner.id;
      userProjectEntity.projectId = created.id;
      userProjectEntity.addRole(RoleId.OWNER);

      db.insertUserProject(userProjectEntity);

      return created;
    } catch (SQLException e) {
      throw new RepositoryException("Error creating project", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

      CertificateAndKey certificateAndKey = new SimpleCertificateAndKey(certificateChain,
          project.getPkiPrivateKey());

      return certificateAndKey;
    } catch (SQLException e) {
      throw new RepositoryException("Error retrieving PKI info", e);
    } finally {
      db.close();
    }
  }
View Full Code Here

    DbHelper db = new DbHelper();
    try {
      return db.queries.findServiceAccount(subject, publicKey);
    } catch (SQLException e) {
      throw new RepositoryException("Error reading system account", 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.