Java 类org.springframework.boot.actuate.audit.AuditEventRepository 实例源码

项目:BCDS    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AuditListenerTests.java   
@Test
public void testStoredEvents() {
    AuditEventRepository repository = mock(AuditEventRepository.class);
    AuditEvent event = new AuditEvent("principal", "type",
            Collections.<String, Object>emptyMap());
    AuditListener listener = new AuditListener(repository);
    listener.onApplicationEvent(new AuditApplicationEvent(event));
    verify(repository).add(event);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AuditAutoConfigurationTests.java   
@Test
public void defaultConfiguration() throws Exception {
    registerAndRefresh(AuditAutoConfiguration.class);
    assertThat(this.context.getBean(AuditEventRepository.class)).isNotNull();
    assertThat(this.context.getBean(AuthenticationAuditListener.class)).isNotNull();
    assertThat(this.context.getBean(AuthorizationAuditListener.class)).isNotNull();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AuditAutoConfigurationTests.java   
@Test
public void ownAuditEventRepository() throws Exception {
    registerAndRefresh(CustomAuditEventRepositoryConfiguration.class,
            AuditAutoConfiguration.class);
    assertThat(this.context.getBean(AuditEventRepository.class))
            .isInstanceOf(TestAuditEventRepository.class);
}
项目:spring-boot-concourse    文件:AuditListenerTests.java   
@Test
public void testStoredEvents() {
    AuditEventRepository repository = mock(AuditEventRepository.class);
    AuditEvent event = new AuditEvent("principal", "type",
            Collections.<String, Object>emptyMap());
    AuditListener listener = new AuditListener(repository);
    listener.onApplicationEvent(new AuditApplicationEvent(event));
    verify(repository).add(event);
}
项目:spring-boot-concourse    文件:AuditAutoConfigurationTests.java   
@Test
public void defaultConfiguration() throws Exception {
    registerAndRefresh(AuditAutoConfiguration.class);
    assertThat(this.context.getBean(AuditEventRepository.class)).isNotNull();
    assertThat(this.context.getBean(AuthenticationAuditListener.class)).isNotNull();
    assertThat(this.context.getBean(AuthorizationAuditListener.class)).isNotNull();
}
项目:spring-boot-concourse    文件:AuditAutoConfigurationTests.java   
@Test
public void ownAuditEventRepository() throws Exception {
    registerAndRefresh(CustomAuditEventRepositoryConfiguration.class,
            AuditAutoConfiguration.class);
    assertThat(this.context.getBean(AuditEventRepository.class))
            .isInstanceOf(TestAuditEventRepository.class);
}
项目:jhipster-ionic    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:angularjs-springboot-bookstore    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:lobbycal    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal,DateToLocalDateTimeConverter.INSTANCE.convert(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(JSR310DateConverters.DateToLocalDateTimeConverter.INSTANCE.convert(event.getTimestamp())  );
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:contestparser    文件:AuditListenerTests.java   
@Test
public void testStoredEvents() {
    AuditEventRepository repository = mock(AuditEventRepository.class);
    AuditEvent event = new AuditEvent("principal", "type",
            Collections.<String, Object>emptyMap());
    AuditListener listener = new AuditListener(repository);
    listener.onApplicationEvent(new AuditApplicationEvent(event));
    verify(repository).add(event);
}
项目:contestparser    文件:AuditAutoConfigurationTests.java   
@Test
public void testTraceConfiguration() throws Exception {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(AuditAutoConfiguration.class);
    this.context.refresh();
    assertNotNull(this.context.getBean(AuditEventRepository.class));
    assertNotNull(this.context.getBean(AuthenticationAuditListener.class));
    assertNotNull(this.context.getBean(AuthorizationAuditListener.class));
}
项目:contestparser    文件:AuditAutoConfigurationTests.java   
@Test
public void ownAutoRepository() throws Exception {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(Config.class, AuditAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBean(AuditEventRepository.class),
            instanceOf(TestAuditEventRepository.class));
}
项目:spring-boot-angularjs-examples    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:hadoop-on-demand-rest-jhipster    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:jhipster-websocket-example    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:springBoot-JHipster-AJP-Port    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:jittrackGTS    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            final Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateGreaterThan(principal, new LocalDateTime(after));
            }

            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:OrcidHub    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:website    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:quartz-hipster-ui    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:menuber    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:activemft    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:telosys-tools-saas-back    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:TSMusicBot    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:ithings-demo    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            final Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateGreaterThan(principal, new LocalDateTime(after));
            }

            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:JQuaternion    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            final Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateGreaterThan(principal, new LocalDateTime(after));
            }

            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:lightadmin-jhipster    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            final Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateGreaterThan(principal, new LocalDateTime(after));
            }

            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:iobrew    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            final Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateGreaterThan(principal, new LocalDateTime(after));
            }

            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:alv-ch-sysinfos.api    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            final Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateGreaterThan(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));
            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:BikeMan    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, new LocalDateTime(after));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:jittrackGTS    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            final Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateGreaterThan(principal, new LocalDateTime(after));
            }

            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:parkingfriends    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            final List<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                        persistenceAuditEventRepository.findByPrincipalAndAuditEventDateGreaterThan(principal, new LocalDateTime(after));
            }

            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        public void add(AuditEvent event) {
            PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
            persistentAuditEvent.setPrincipal(event.getPrincipal());
            persistentAuditEvent.setAuditEventType(event.getType());
            persistentAuditEvent.setAuditEventDate(new LocalDateTime(event.getTimestamp()));
            persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));

            persistenceAuditEventRepository.save(persistentAuditEvent);
        }
    };
}
项目:buenojo    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";

        private static final String ANONYMOUS_USER = "anonymousUser";

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                    persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, LocalDateTime.from(after.toInstant()));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            if (!AUTHORIZATION_FAILURE.equals(event.getType()) &&
                !ANONYMOUS_USER.equals(event.getPrincipal().toString())) {

                PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
                persistentAuditEvent.setPrincipal(event.getPrincipal());
                persistentAuditEvent.setAuditEventType(event.getType());
                Instant instant = Instant.ofEpochMilli(event.getTimestamp().getTime());
                persistentAuditEvent.setAuditEventDate(LocalDateTime.ofInstant(instant, ZoneId.systemDefault()));
                persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));
                persistenceAuditEventRepository.save(persistentAuditEvent);
            }
        }
    };
}
项目:shoucang    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";

        private static final String ANONYMOUS_USER = "anonymousUser";

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                    persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, LocalDateTime.from(after.toInstant()));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            if (!AUTHORIZATION_FAILURE.equals(event.getType()) &&
                !ANONYMOUS_USER.equals(event.getPrincipal().toString())) {

                PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
                persistentAuditEvent.setPrincipal(event.getPrincipal());
                persistentAuditEvent.setAuditEventType(event.getType());
                Instant instant = Instant.ofEpochMilli(event.getTimestamp().getTime());
                persistentAuditEvent.setAuditEventDate(LocalDateTime.ofInstant(instant, ZoneId.systemDefault()));
                persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));
                persistenceAuditEventRepository.save(persistentAuditEvent);
            }
        }
    };
}
项目:blogAggr    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";

        private static final String ANONYMOUS_USER = "anonymousUser";

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                    persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, LocalDateTime.from(after.toInstant()));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            if (!AUTHORIZATION_FAILURE.equals(event.getType()) &&
                !ANONYMOUS_USER.equals(event.getPrincipal().toString())) {

                PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
                persistentAuditEvent.setPrincipal(event.getPrincipal());
                persistentAuditEvent.setAuditEventType(event.getType());
                Instant instant = Instant.ofEpochMilli(event.getTimestamp().getTime());
                persistentAuditEvent.setAuditEventDate(LocalDateTime.ofInstant(instant, ZoneId.systemDefault()));
                persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));
                persistenceAuditEventRepository.save(persistentAuditEvent);
            }
        }
    };
}
项目:gameofcode    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";

        private static final String ANONYMOUS_USER = "anonymousUser";

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                    persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, LocalDateTime.from(after.toInstant()));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            if (!AUTHORIZATION_FAILURE.equals(event.getType()) &&
                !ANONYMOUS_USER.equals(event.getPrincipal().toString())) {

                PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
                persistentAuditEvent.setPrincipal(event.getPrincipal());
                persistentAuditEvent.setAuditEventType(event.getType());
                Instant instant = Instant.ofEpochMilli(event.getTimestamp().getTime());
                persistentAuditEvent.setAuditEventDate(LocalDateTime.ofInstant(instant, ZoneId.systemDefault()));
                persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));
                persistenceAuditEventRepository.save(persistentAuditEvent);
            }
        }
    };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AuditListener.java   
public AuditListener(AuditEventRepository auditEventRepository) {
    this.auditEventRepository = auditEventRepository;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AuditAutoConfiguration.java   
public AuditAutoConfiguration(
        ObjectProvider<AuditEventRepository> auditEventRepositoryProvider) {
    this.auditEventRepository = auditEventRepositoryProvider.getIfAvailable();
}
项目:shoucang    文件:CustomAuditEventRepository.java   
@Bean
public AuditEventRepository auditEventRepository() {
    return new AuditEventRepository() {

        private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";

        private static final String ANONYMOUS_USER = "anonymousUser";

        @Inject
        private AuditEventConverter auditEventConverter;

        @Override
        public List<AuditEvent> find(String principal, Date after) {
            Iterable<PersistentAuditEvent> persistentAuditEvents;
            if (principal == null && after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findAll();
            } else if (after == null) {
                persistentAuditEvents = persistenceAuditEventRepository.findByPrincipal(principal);
            } else {
                persistentAuditEvents =
                    persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfter(principal, LocalDateTime.from(after.toInstant()));
            }
            return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
        }

        @Override
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        public void add(AuditEvent event) {
            if (!AUTHORIZATION_FAILURE.equals(event.getType()) &&
                !ANONYMOUS_USER.equals(event.getPrincipal().toString())) {

                PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
                persistentAuditEvent.setPrincipal(event.getPrincipal());
                persistentAuditEvent.setAuditEventType(event.getType());
                Instant instant = Instant.ofEpochMilli(event.getTimestamp().getTime());
                persistentAuditEvent.setAuditEventDate(LocalDateTime.ofInstant(instant, ZoneId.systemDefault()));
                persistentAuditEvent.setData(auditEventConverter.convertDataToStrings(event.getData()));
                persistenceAuditEventRepository.save(persistentAuditEvent);
            }
        }
    };
}