Package org.ejbca.core.model.approval

Examples of org.ejbca.core.model.approval.Approval


                                    approvalID = RevocationApprovalRequest.generateApprovalId(approvalType, username, reason, null, null);
                            }
                            Query q = new Query(Query.TYPE_APPROVALQUERY);
                            q.add(ApprovalMatch.MATCH_WITH_APPROVALID, BasicMatch.MATCH_TYPE_EQUALS, Integer.toString(approvalID));
                            ApprovalDataVO approvalData = (ApprovalDataVO) (approvalSession.query(internalAdmin, q, 0, 1, "cAId="+approvalCAID, "(endEntityProfileId="+SecConst.EMPTY_ENDENTITYPROFILE+")").get(0));
                            Approval approval = new Approval("Approved during testing.");
                            approvalExecutionSession.approve(approvingAdmin, approvalID, approval, globalConfigurationSession.getCachedGlobalConfiguration(new Admin(Admin.INTERNALCAID)));
                            approvalData = (ApprovalDataVO) approvalSession.findApprovalDataVO(internalAdmin, approvalID).iterator().next();
                            assertEquals(approvalData.getStatus(), ApprovalDataVO.STATUS_EXECUTED);
                    CertificateStatus status = certificateStoreSession.getStatus(issuerDN, serialNumber);
                            assertEquals(status.revocationReason, reason);
View Full Code Here


                                    approvalID = RevocationApprovalRequest.generateApprovalId(approvalType, username, reason, null, null);
                            }
                            Query q = new Query(Query.TYPE_APPROVALQUERY);
                            q.add(ApprovalMatch.MATCH_WITH_APPROVALID, BasicMatch.MATCH_TYPE_EQUALS, Integer.toString(approvalID));
                            ApprovalDataVO approvalData = (ApprovalDataVO) (approvalSession.query(internalAdmin, q, 0, 1, "cAId="+approvalCAID, "(endEntityProfileId="+SecConst.EMPTY_ENDENTITYPROFILE+")").get(0));
                            Approval approval = new Approval("Approved during testing.");
                            approvalExecutionSession.approve(approvingAdmin, approvalID, approval, raAdminSession.getCachedGlobalConfiguration(new Admin(Admin.INTERNALCAID)));
                            approvalData = (ApprovalDataVO) approvalSession.findApprovalDataVO(internalAdmin, approvalID).iterator().next();
                            assertEquals(approvalData.getStatus(), ApprovalDataVO.STATUS_EXECUTED);
                    CertificateStatus status = certificateStoreSession.getStatus(issuerDN, serialNumber);
                            assertEquals(status.revocationReason, reason);
View Full Code Here

            }
        }
        //Check that his admin has not approved this this request before
        Iterator<Approval> iter = data.getApprovals().iterator();
        while (iter.hasNext()) {
          Approval next = iter.next();
            if ((next.getAdmin().getUsername()!=null && username!=null && next.getAdmin().getUsername().equals(username)) || ((next.getAdmin().getUsername()==null || username==null) && admin.getAdminData().equals(next.getAdmin().getAdminData()))) {
                logSession.log(admin, adl.getCaid(), LogConstants.MODULE_APPROVAL, new Date(), null, null, LogConstants.EVENT_ERROR_APPROVALREJECTED,
                        "Error administrator have already approved or rejected current request, approveId ");
                throw new AdminAlreadyApprovedRequestException("Error administrator have already approved or rejected current request, approveId : "
                        + /*approvalId*/ adl.getApprovalid());
            }
View Full Code Here

      final ObjectOutputStream oos = new ObjectOutputStream(baos);
      final int size = approvals.size();
      oos.writeInt(size);
      final Iterator<Approval> iter = approvals.iterator();
      while(iter.hasNext()){
        final Approval next = iter.next();
        oos.writeObject(next);
      }
      oos.flush();
      approvalData.setApprovaldata(new String(Base64.encode(baos.toByteArray(),false)));
    } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.approval.Approval

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.