Package framework.audit

Examples of framework.audit.Audit


    public void saveAudit(List<AuditDetails> auditDetails) throws ClipsServerException {
        String s = "";
        long t1 = new Date().getTime();
        for (AuditDetails ad : auditDetails) {
            s += "AuditDetails[ id: " + ad.id + ", sign: " + Converter.hexDump(ad.sign) + "]\n";
            Audit audit = findEntity(Audit.class, ad.id);
            audit.setDsa(Converter.hexDump(ad.sign));
            List list = findEntityWhatWithResCount(null, CollaboratorCertificate.class, new Field[]{new Field("collaborator.id", ad.collaboratorID)}, " ORDER BY a.id", 1);
            if (list.size() != 1){
                throw new ClipsServerException("Документ аудита не может быть подписан, т.к. не найден сертификат открытого ключа");
            }
            audit.setCertificate((CollaboratorCertificate) list.get(0));
            manager.persist(audit);
        }
        System.out.println("Save audit\n" + s + " in " + (new Date().getTime() - t1)+ " мс");
//        throw new UnsupportedOperationException("Not supported yet.");
    }
View Full Code Here


            throw new ESecurity("В документе аудита не была произведена проверка изменений");
        }
        if (auditDoc.getResult() == null) {
            return null;
        }
        Audit audit = new Audit();
        audit.setDate(auditDoc.getDate());
        audit.setValue(auditDoc.getResult());
        audit.setCollaborator(auditDoc.collab);
        audit.setEntityClass(auditDoc.getClassName());
        audit.setEntityId(auditDoc.getId() == null ? 0 : auditDoc.getId());

//        String dsa = "";
//        for(int i=0; i<256; i++) {
//            byte b = (byte)Math.floor(Math.random()*256);
//            String tmp = Integer.toHexString(((int)b) & 0xFF).toUpperCase();
//            dsa += tmp;
//        }
//        audit.setDsa(dsa);

        manager.persist(audit);
        manager.flush();
        manager.refresh(audit);
        return audit.getDetails(this);
    }
View Full Code Here

TOP

Related Classes of framework.audit.Audit

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.