Package org.fcrepo.server.storage.types

Examples of org.fcrepo.server.storage.types.AuditRecord


            XMLEvent event = reader.nextEvent();
            if (event.isStartElement()) {
                StartElement element = (StartElement) event;
                inElement = element.getName().getLocalPart();
                if (inElement.equals(AUDIT.RECORD.localName)) {
                    AuditRecord record = new AuditRecord();
                    java.util.Iterator<?> it = element.getAttributes();
                    while (it.hasNext()) {
                        Attribute attr = (Attribute) it.next();
                        if (attr.getName().getLocalPart()
                                .equals(AUDIT.ID.localName)) {
                            record.id = attr.getValue();
                        }
                    }
                    records.add(record);
                } else if (inElement.equals(AUDIT.PROCESS.localName)) {
                    java.util.Iterator<?> it = element.getAttributes();
                    while (it.hasNext()) {
                        Attribute attr = (Attribute) it.next();
                        if (attr.getName().getLocalPart()
                                .equals(AUDIT.TYPE.localName)) {
                            records.get(records.size() - 1).processType =
                                    attr.getValue();
                        }
                    }
                }
            }
            if (event.isEndElement()) {
                inElement = "";
            }
            if (event.isCharacters()) {
                Characters characters = (Characters) event;
                if (!records.isEmpty()) {
                    AuditRecord record = records.get(records.size() - 1);
                    if (inElement.equals(AUDIT.ACTION.localName)) {
                        record.action = characters.getData();
                    } else if (inElement.equals(AUDIT.COMPONENT_ID.localName)) {
                        record.componentID = characters.getData();
                    } else if (inElement.equals(AUDIT.DATE.localName)) {
View Full Code Here


                    && m_xmlDataLevel == 0) {
                // finished all xml metadata for this datastream
                if (m_dsId.equals("FEDORA-AUDITTRAIL")
                        || m_dsId.equals("AUDIT")) {
                    // we've been looking at an audit trail... set audit record
                    AuditRecord a = new AuditRecord();
                    // In METS each audit record is in its own <digiprovMD>
                    // element within an <amdSec>.  So, pick up the XML ID
                    // of the <digiprovMD> element for the audit record id.
                    // This amdSec is treated like a datastream, and each
                    // digiprovMD is a version, so id was parsed into dsVersId.
View Full Code Here

            }
            // Now, put component ids on audit records.  Pre-Fedora 2.0
            // datastream versions pointed to their audit records.
            Iterator<AuditRecord> iter = m_obj.getAuditRecords().iterator();
            while (iter.hasNext()) {
                AuditRecord au = iter.next();
                if (au.componentID == null || au.componentID.equals("")) {
                    // Before Fedora 2.0 audit records were associated with
                    // datastream version ids.  From now on, the datastream id
                    // will be posted as the component id in the audit record,
                    // and associations to particular datastream versions can
View Full Code Here

                }

                // if AUDIT datastream, initialize new audit record object
                if (m_gotAudit) {
                    if (localName.equals("record")) {
                        m_auditRec = new AuditRecord();
                        m_auditRec.id = grab(a, uri, "ID");
                    } else if (localName.equals("process")) {
                        m_auditProcessType = grab(a, uri, "type");
                    }
                }
View Full Code Here

                                DOWriter w,
                                String action,
                                String componentID,
                                String justification,
                                Date nowUTC) throws ServerException {
        AuditRecord audit = new AuditRecord();
        audit.id = w.newAuditRecordID();
        audit.processType = "Fedora API-M";
        audit.action = action;
        audit.componentID = componentID;
        audit.responsibility =
View Full Code Here

        m_ds1_1.DSVersionID = "DS1";
        m_ds2_0 = new Datastream();
        m_ds2_0.DatastreamID = "DS2.0";
        m_ds2_0.DSVersionID = "DS2";
        // ... and some audit records
        m_audit1 = new AuditRecord();
        m_audit1.id = "AUDIT1";
        m_audit1.action = "Object Created";
        m_audit2 = new AuditRecord();
        m_audit2.id = "AUDIT2";
        m_audit2.action = "Datastream 1 Added";
        m_audit3 = new AuditRecord();
        m_audit3.id = "AUDIT3";
        m_audit3.action = "Datastream 1 Versioned";
        m_audit4 = new AuditRecord();
        m_audit4.id = "AUDIT4";
        m_audit4.action = "Datastream 2 Added";
        m_audit5 = new AuditRecord();
        m_audit5.id = "AUDIT5";
        m_audit5.action = "Disseminator 1 Added";
        m_audit6 = new AuditRecord();
        m_audit6.id = "AUDIT6";
        m_audit6.action = "Disseminator 1 Versioned";
        m_audit7 = new AuditRecord();
        m_audit7.id = "AUDIT7";
        m_audit7.action = "Disseminator 2 Added";
        // init sdef
        m_sdef = new BasicDigitalObject();
        m_sdef.setCreateDate(m_startTime);
View Full Code Here

                     ds1copyOfCopy.xmlContent.length);
    }

    @Test
    public void testAuditDatastream() throws Exception {
        AuditRecord record = new AuditRecord();
        record.action = "modifyDatastreamByReference";
        record.componentID = "DRAWING-ICON";
        record.date = new Date(0L);
        record.id = "AUDREC1";
        record.justification = "malice";
View Full Code Here

TOP

Related Classes of org.fcrepo.server.storage.types.AuditRecord

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.