Examples of Admin


Examples of org.apache.hadoop.hbase.client.Admin

    return getHTableDescriptors(tableNames);
  }

  HTableDescriptor[] getHTableDescriptors(List<TableName> tableNames) {
    HTableDescriptor[] htd = new HTableDescriptor[0];
    Admin admin = null;
    try {
      LOG.info("getHTableDescriptors == tableNames => " + tableNames);
      admin = new HBaseAdmin(getConf());
      htd = admin.getTableDescriptorsByTableName(tableNames);
    } catch (IOException e) {
      LOG.debug("Exception getting table descriptors", e);
    } finally {
      if (admin != null) {
        try {
          admin.close();
        } catch (IOException e) {
          LOG.debug("Exception closing HBaseAdmin", e);
        }
      }
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.inheritance.entity.Admin

    super.setUp(CLEAR_TABLES, Admin.class, RegularUser.class,
        ComputerUser.class);

    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    admin = new Admin();
    user = new RegularUser();
    user.setAdmin(admin);
    admin.addRegularUser(user);
    em.persist(admin);
    em.persist(user);
View Full Code Here

Examples of org.ejbca.core.model.log.Admin

    Certificate testcert = CertTools.getCertfromByteArray(testcertenc);
    ArrayList<Approval> approvals = new ArrayList<Approval>();
   
    Approval ap = new Approval("test");
    Date apDate = ap.getApprovalDate();
    ap.setApprovalAdmin(true, new Admin(testcert, "USERNAME", null));
    approvals.add(ap);
   
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(baos);
     
View Full Code Here

Examples of org.ejbca.core.model.log.Admin

   * @param allowNonAdmins true if we should verify that it is a real administrator, false only extracts the certificate and checks that it is not revoked.
   * @param wsContext web service context that contains the SSL information
   * @return Admin object based on the SSL client certificate
   */
  protected Admin getAdmin(boolean allowNonAdmins) throws AuthorizationDeniedException, EjbcaException {
    Admin admin = null;
    try {
      MessageContext msgContext = wsContext.getMessageContext();
      HttpServletRequest request = (HttpServletRequest) msgContext.get(MessageContext.SERVLET_REQUEST);
      X509Certificate[] certificates = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");

View Full Code Here

Examples of org.ejbca.core.model.log.Admin

      throw new EjbcaException(ErrorCode.AUTH_CERT_NOT_RECEIVED,
                "Error no client certificate recieved used for authentication.");
    }

    try{
      Admin admin = userAdminSession.getAdmin(certificates[0]);
      userAdminSession.checkIfCertificateBelongToUser(admin, CertTools.getSerialNumber(certificates[0]), CertTools.getIssuerDN(certificates[0]));
      if(!authorizationSession.isAuthorizedNoLog(admin, AccessRulesConstants.ROLE_ADMINISTRATOR)) {
          Authorizer.throwAuthorizationException(admin, AccessRulesConstants.ROLE_ADMINISTRATOR, null);
      }
      retval = true;
View Full Code Here

Examples of org.ejbca.core.model.log.Admin

            + "ifn1eHMbL8dGLd5bc2GNBZkmhFIEoDvbfn9jo7phlS8iyvF2YhC4eso8Xb+T7+BZ"
            + "QUOBOvc=").getBytes());
 
  public void testWriteExternal() throws Exception {
    Certificate testcert = CertTools.getCertfromByteArray(testcertenc);
    DummyApprovalRequest ar = new DummyApprovalRequest(new Admin(testcert, null, null),null,1,2, false);
   
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(baos);
      oos.writeObject(ar);
      oos.flush();
View Full Code Here

Examples of org.ejbca.core.model.log.Admin

   
  }

  public void testGenerateApprovalId() throws Exception {
    Certificate testcert = CertTools.getCertfromByteArray(testcertenc);
    DummyApprovalRequest ar = new DummyApprovalRequest(new Admin(testcert, null, null),null,1,2, false);
   
      int id1 = ar.generateApprovalId();
      int id2 = ar.generateApprovalId();
      assertEquals(id1, id2);
  }
View Full Code Here

Examples of org.ejbca.core.model.log.Admin

    }
   
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    @Override
  public void testRollback(final long rollbackTestTime) {
      final Admin internalAdmin = Admin.getInternalAdmin();
    log(internalAdmin, internalAdmin.getCaId(), LogConstants.MODULE_CUSTOM, new Date(rollbackTestTime), null, null,
        LogConstants.EVENT_INFO_UNKNOWN, "Test of rollback resistance of log-system.", null);
    throw new EJBException("Test of rollback resistance of log-system.");
  }
View Full Code Here

Examples of org.ejbca.core.model.log.Admin

  public void editUser(final UserDataVOWS userdata)
      throws CADoesntExistsException, AuthorizationDeniedException, UserDoesntFullfillEndEntityProfile, EjbcaException, ApprovalException, WaitingForApprovalException {
        final IPatternLogger logger = TransactionLogger.getPatternLogger();
        try {
          final EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
          final Admin admin = ejbhelper.getAdmin();
          logAdminName(admin,logger);
          final UserDataVO userdatavo = ejbhelper.convertUserDataVOWS(admin, userdata);
            if (userAdminSession.existsUser(admin, userdatavo.getUsername())) {
              if (log.isDebugEnabled()) {
                log.debug("User " + userdata.getUsername() + " exists, update the userdata. New status of user '"+userdata.getStatus()+"'." );         
View Full Code Here

Examples of org.ejbca.core.model.log.Admin

            log.debug("Find user with match '"+usermatch.getMatchvalue()+"'.");
      }
        final IPatternLogger logger = TransactionLogger.getPatternLogger();
        try {
          final EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
          final Admin admin = ejbhelper.getAdmin();
          logAdminName(admin,logger);
          final Query query = ejbhelper.convertUserMatch(admin, usermatch);           
          final Collection<UserDataVO> result = userAdminSession.query(admin, query, null,null, MAXNUMBEROFROWS); // also checks authorization
          if (result.size() > 0) {
            retval = new ArrayList<UserDataVOWS>(result.size());
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.