...
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> <description> Configuration file for the Inspektr package which handles auditing for Java applications. If enabled this should be modified to log audit and statistics information the same way your local applications do. The default is currently to log to the console which is good for debugging/testing purposes. </description> <aop:aspectj-autoproxy/> <bean id="auditTrailManagementAspect" class="com.github.inspektr.audit.AuditTrailManagementAspect"> <!-- String applicationCode --> <constructor-arg index="0" value="CAS" /> <!-- PrincipalResolver auditablePrincipalResolver --> <constructor-arg index="1" ref="auditablePrincipalResolver" /> <!-- List<AuditTrailManager> auditTrailManagers --> <constructor-arg index="2"> <list> <bean class="com.github.inspektr.audit.support.ConsoleAuditTrailManager" /> </list> <!-- </constructor-arg> Uncomment following for <!-- Map<String,AuditActionResolver> auditActionResolverMap --> writing logs to database via JDBC. <constructor-arg index="3"> See below <map>for definition of auditManager bean. <entry key="AUTHENTICATION_RESOLVER"> --> <ref local <!-- <ref local="authenticationActionResolverauditManager" /> --> </entry>list> </constructor-arg> <entry key="CREATE_TICKET_GRANTING_TICKET_RESOLVER"> <!-- Map<String,AuditActionResolver> auditActionResolverMap --> <ref local<constructor-arg index="ticketCreationActionResolver3" /> </entry><map> <entry key="DESTROY_TICKET_GRANTING_TICKET_RESOLVERAUTHENTICATION_RESOLVER"> <bean<ref classlocal="com.github.inspektr.audit.spi.support.DefaultAuditActionResolverauthenticationActionResolver" /> </entry> <entry key="GRANTCREATE_TICKET_SERVICEGRANTING_TICKET_RESOLVER"> <ref local="ticketCreationActionResolver" /> </entry> <entry key="GRANTDESTROY_PROXYTICKET_GRANTING_TICKET_RESOLVER"> <ref<bean localclass="ticketCreationActionResolvercom.github.inspektr.audit.spi.support.DefaultAuditActionResolver" /> </entry> <entry key="VALIDATEGRANT_SERVICE_TICKET_RESOLVER"> <ref local="ticketValidationActionResolverticketCreationActionResolver" /> </entry> </map> </constructor-arg><entry key="GRANT_PROXY_GRANTING_TICKET_RESOLVER"> <!-- Map<String,AuditResourceResolver> auditResourceResolverMap -- <ref local="ticketCreationActionResolver" /> <constructor-arg index="4"> <map></entry> <entry key="AUTHENTICATIONVALIDATE_SERVICE_RESOURCETICKET_RESOLVER"> <bean<ref classlocal="org.jasig.cas.audit.spi.CredentialsAsFirstParameterResourceResolver" /"ticketValidationActionResolver" /> </entry> </map> <entry key="CREATE_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER"> </constructor-arg> <ref local="returnValueResourceResolver" /<!-- Map<String,AuditResourceResolver> auditResourceResolverMap --> <constructor-arg index="4"> </entry> <map> <entry key="DESTROY_TICKET_GRANTING_TICKET_AUTHENTICATION_RESOURCE_RESOLVER"> <ref<bean localclass="ticketResourceResolverorg.jasig.cas.audit.spi.CredentialsAsFirstParameterResourceResolver" /> </entry> <entry key="GRANTCREATE_TICKET_SERVICEGRANTING_TICKET_RESOURCE_RESOLVER"> <bean<ref classlocal="org.jasig.cas.audit.spi.ServiceResourceResolverreturnValueResourceResolver" /> </entry> <entry key="GRANTDESTROY_PROXYTICKET_GRANTING_TICKET_RESOURCE_RESOLVER"> <ref local="returnValueResourceResolverticketResourceResolver" /> </entry> <entry key="VALIDATEGRANT_SERVICE_TICKET_RESOURCE_RESOLVER"> <ref<bean localclass="ticketResourceResolver"org.jasig.cas.audit.spi.ServiceResourceResolver" /> </entry> </map> <entry key="GRANT_PROXY_GRANTING_TICKET_RESOURCE_RESOLVER"> </constructor-arg> </bean> <bean<ref idlocal="auditablePrincipalResolverreturnValueResourceResolver" class="org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver">/> <constructor-arg index="0" ref="ticketRegistry" /> </entry> </bean> <bean<entry idkey="authenticationActionResolver"VALIDATE_SERVICE_TICKET_RESOURCE_RESOLVER"> class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver"> <!-- String successSuffix --<ref local="ticketResourceResolver" /> <constructor-arg index="0" value="_SUCCESS" /> </entry> <!--/map> String failureSuffix --> <constructor-arg index="1" value="_FAILED" /> </constructor-arg> </bean> <bean id="ticketCreationActionResolverauditablePrincipalResolver" class="comorg.githubjasig.inspektrcas.audit.spi.TicketOrCredentialPrincipalResolver"> <constructor-arg index="0" ref="ticketRegistry" /> </bean> <bean id="authenticationActionResolver" class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver"> <!-- String successSuffix --> <constructor-arg index="0" value="_CREATEDSUCCESS" /> <!-- String failureSuffix --> <constructor-arg index="1" value="_NOT_CREATED" /> </bean> FAILED" /> </bean> <bean id="ticketCreationActionResolver" class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver"> <!-- String successSuffix --> <constructor-arg index="0" value="_CREATED" /> <!-- String failureSuffix --> <constructor-arg index="1" value="_NOT_CREATED" /> </bean> <bean id="ticketValidationActionResolver" class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver"> <!-- String successSuffix --> <constructor-arg index="0" value="D" /> <!-- String failureSuffix --> <constructor-arg index="1" value="_FAILED" /> </bean> <bean id="returnValueResourceResolver" class="com.github.inspektr.audit.spi.support.ReturnValueAsStringResourceResolver" /> <bean id="ticketResourceResolver" class="org.jasig.cas.audit.spi.TicketAsFirstParameterResourceResolver" /> <!-- Uncomment following beans for JDBC support. Assumes there is a dataSource bean that defines a valid JDBC data source. --> <!-- <bean id="ticketValidationActionResolverinspektrTransactionManager" class="comorg.githubspringframework.inspektrjdbc.audit.spi.support.DefaultAuditActionResolver">datasource.DataSourceTransactionManager" <!-- String successSuffix --> <constructor-arg index="0" value="D"p:dataSource-ref="dataSource" /> <bean id="inspektrTransactionTemplate" class="org.springframework.transaction.support.TransactionTemplate" <!-- String failureSuffix -->p:transactionManager-ref="inspektrTransactionManager" <constructor-arg indexp:isolationLevelName="1ISOLATION_READ_COMMITTED" value p:propagationBehaviorName="PROPAGATION_FAILEDREQUIRED" /> </bean>> <bean id="returnValueResourceResolverauditManager" class="com.github.inspektr.audit.spi.support.ReturnValueAsStringResourceResolverJdbcAuditTrailManager" /> <constructor-arg index="0" ref="inspektrTransactionTemplate" /> <bean id="ticketResourceResolver" <property name="dataSource" classref="org.jasig.cas.audit.spi.TicketAsFirstParameterResourceResolver" /dataSource" /> </bean> --> </beans> |
Inspektr assumes the database pointed to by the JDBC data source contains tables with the schema described at http://code.google.com/p/inspektr/wiki/DatabaseTables. The following script will create these tables with reasonable indices in Oracle; modify as needed for your database platform.
...