Examples of AuditRecord


Examples of com.atlassian.jira.rest.client.api.domain.AuditRecord

            final String remoteAddress = JsonParseUtil.getOptionalString(json, "remoteAddress");
            final AuditAssociatedItem objectItem = JsonParseUtil.getOptionalJsonObject(json, "objectItem", associatedItemJsonParser);
            final OptionalIterable<AuditAssociatedItem> associatedItem = JsonParseUtil.parseOptionalJsonArray(json.optJSONArray("associatedItems"), associatedItemJsonParser);
            final OptionalIterable<AuditChangedValue> changedValues = JsonParseUtil.parseOptionalJsonArray(json.optJSONArray("changedValues"), changedValueJsonParser);

            return new AuditRecord(id, summary, remoteAddress, created, category, eventSource, authorKey, objectItem, associatedItem, changedValues);
        }
View Full Code Here

Examples of com.atlassian.jira.rest.client.api.domain.AuditRecord

        assertThat(auditRecordsData.getOffset(), is(0));
        assertThat(auditRecordsData.getLimit(), is(1000));
        assertThat(auditRecordsData.getTotal(), is(2));

        final Iterator<AuditRecord> recordsIterator = auditRecordsData.getRecords().iterator();
        final AuditRecord firstRecord = recordsIterator.next();
        assertThat(firstRecord.getSummary(), is("User added to group"));
        assertThat(firstRecord.getRemoteAddress(), is("127.0.0.1"));

        assertThat(firstRecord.getCreated().toInstant(), is(SAMPLE_DATE));
        assertThat(firstRecord.getCategory(), is("group management"));
        assertThat(firstRecord.getEventSource(), is("Connect plugin"));
        assertThat(firstRecord.getAuthorKey(), is("admin"));

        assertThat(firstRecord.getObjectItem().getId(), nullValue());
        assertThat(firstRecord.getObjectItem().getName(), is("jira-developers"));
        assertThat(firstRecord.getObjectItem().getTypeName(), is("GROUP"));
        assertThat(firstRecord.getObjectItem().getParentId(), nullValue());
        assertThat(firstRecord.getObjectItem().getParentName(), nullValue());

        final AuditAssociatedItem firstItem = firstRecord.getAssociatedItems().iterator().next();
        assertThat(firstItem.getId(), is("admin"));
        assertThat(firstItem.getName(), is("admin"));
        assertThat(firstItem.getTypeName(), is("USER"));
        assertThat(firstItem.getParentId(), is("1"));
        assertThat(firstItem.getParentName(), is("JIRA Internal Directory"));

        assertThat(firstRecord.getChangedValues(), notNullValue());

        final Iterator<AuditChangedValue> iterator = firstRecord.getChangedValues().iterator();
        final AuditChangedValue valueItem1 = iterator.next();
        assertThat(valueItem1.getFieldName(), is("Username"));
        assertThat(valueItem1.getChangedFrom(), nullValue());
        assertThat(valueItem1.getChangedTo(), is("admin"));

        final AuditChangedValue valueItem2 = iterator.next();
        assertThat(valueItem2.getFieldName(), is("Full Name"));
        assertThat(valueItem2.getChangedFrom(), is("administrator"));
        assertThat(valueItem2.getChangedTo(), is("admin"));

        final AuditChangedValue valueItem3 = iterator.next();
        assertThat(valueItem3.getFieldName(), is("Email"));
        assertThat(valueItem3.getChangedTo(), is("admin@local.com"));

        final AuditChangedValue valueItem4 = iterator.next();
        assertThat(valueItem4.getFieldName(), is("Active / Inactive"));
        assertThat(valueItem4.getChangedTo(), is("Active"));

        //check second firstRecord which does not contain optional fields
        final AuditRecord secondRecord = recordsIterator.next();
        assertThat(secondRecord.getSummary(), is("User added to group"));
        assertThat(secondRecord.getRemoteAddress(), nullValue());
        assertThat(secondRecord.getCreated().toInstant(), is(SAMPLE_DATE));
        assertThat(secondRecord.getCategory(), is("group management"));
        assertThat(secondRecord.getEventSource(), is("Other connect plugin"));
        assertThat(secondRecord.getAuthorKey(), is("admin"));

        assertThat(secondRecord.getObjectItem().getId(), nullValue());
        assertThat(secondRecord.getObjectItem().getName(), is("jira-developers"));
        assertThat(secondRecord.getObjectItem().getTypeName(), is("GROUP"));
        assertThat(secondRecord.getObjectItem().getParentId(), nullValue());
        assertThat(secondRecord.getObjectItem().getParentName(), nullValue());

        final AuditAssociatedItem secondItem = secondRecord.getAssociatedItems().iterator().next();
        assertThat(secondItem.getName(), is("admin"));
        assertThat(secondItem.getTypeName(), is("USER"));
        assertThat(secondItem.getId(),  nullValue());
        assertThat(secondItem.getParentId(), nullValue());
        assertThat(secondItem.getParentName(), nullValue());

        assertThat(secondRecord.getChangedValues().iterator().hasNext(), is(false));
    }
View Full Code Here

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

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

                    && 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

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

            }
            // 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

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

                }

                // 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

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

                                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

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

        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

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

                     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

Examples of org.internna.iwebmvc.model.core.AuditRecord

    protected DAO getDAO() {
        return dao;
    }

    protected void audit(String operation, DomainEntity entity) {
        dao.create(new AuditRecord(operation, entity, (UserImpl) userManager.getActiveUser()));
    }
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.