Added APi to get the audit trail.

Fixes for persistence and simple test.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3668 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2006-09-04 09:59:22 +00:00
parent 0fa1d85631
commit 7b3ce70218
8 changed files with 133 additions and 42 deletions

View File

@@ -109,9 +109,9 @@
<!-- The app_source_idx index is used to find the app source -->
<!-- The look up is always the tripple, the service and method or just the method may be null -->
<property name="application" column="application" type="string" length="255" not-null="true" index="app_source_idx"/>
<property name="service" column="service" type="string" length="255" not-null="false" index="app_source_idx"/>
<property name="method" column="method" type="string" length="255" not-null="false" index="app_source_idx"/>
<property name="application" column="application" type="string" length="255" not-null="true" index="app_source_app_idx"/>
<property name="service" column="service" type="string" length="255" not-null="false" index="app_source_ser_idx"/>
<property name="method" column="method" type="string" length="255" not-null="false" index="app_source_met_idx"/>
</class>

View File

@@ -28,7 +28,7 @@ import java.util.HashMap;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.audit.AuditConfiguration;
import org.alfresco.repo.audit.AuditDAO;
import org.alfresco.repo.audit.AuditInfo;
import org.alfresco.repo.audit.AuditState;
import org.alfresco.repo.content.AbstractContentStore;
import org.alfresco.repo.content.ContentStore;
import org.alfresco.repo.content.MimetypeMap;
@@ -92,7 +92,7 @@ public class HibernateAuditDAO extends HibernateDaoSupport implements AuditDAO,
this.contentStore = contentStore;
}
public void audit(AuditInfo auditInfo)
public void audit(AuditState auditInfo)
{
// Find/Build the configuraton entry
AuditConfigImpl auditConfig = getAuditConfig(auditInfo);
@@ -170,7 +170,7 @@ public class HibernateAuditDAO extends HibernateDaoSupport implements AuditDAO,
}
}
private AuditSourceImpl getAuditSource(AuditInfo auditInfo)
private AuditSourceImpl getAuditSource(AuditState auditInfo)
{
AuditSourceImpl auditSourceImpl;
@@ -218,7 +218,7 @@ public class HibernateAuditDAO extends HibernateDaoSupport implements AuditDAO,
return auditSourceImpl;
}
private AuditDateImpl getAuditDate(AuditInfo auditInfo)
private AuditDateImpl getAuditDate(AuditState auditInfo)
{
Calendar cal = GregorianCalendar.getInstance();
cal.setTime(auditInfo.getDate());
@@ -265,7 +265,7 @@ public class HibernateAuditDAO extends HibernateDaoSupport implements AuditDAO,
return auditDate;
}
private AuditConfigImpl getAuditConfig(AuditInfo auditInfo)
private AuditConfigImpl getAuditConfig(AuditState auditInfo)
{
AuditConfigImpl auditConfig;
if ((auditConfiguration.get() == null) || (auditConfiguration.get() != auditInfo.getAuditConfiguration()))
@@ -323,7 +323,7 @@ public class HibernateAuditDAO extends HibernateDaoSupport implements AuditDAO,
return auditConfig;
}
private AuditConfigImpl createNewAuditConfigImpl(AuditInfo auditInfo)
private AuditConfigImpl createNewAuditConfigImpl(AuditState auditInfo)
{
AuditConfigImpl auditConfig = new AuditConfigImpl();
InputStream is = new BufferedInputStream(auditInfo.getAuditConfiguration().getInputStream());