Formatting
This commit is contained in:
parent
906bf90fd3
commit
d1d3b35699
@ -25,17 +25,13 @@ import uk.co.neviyn.Observations.resources.TutorResource;
|
||||
public class ObservationsApplication extends Application<ObservationsConfiguration> {
|
||||
|
||||
private final HibernateBundle<ObservationsConfiguration> hibernate = new HibernateBundle<ObservationsConfiguration>(
|
||||
Observation.class,
|
||||
Tutor.class,
|
||||
Site.class
|
||||
) {
|
||||
Observation.class, Tutor.class, Site.class) {
|
||||
@Override
|
||||
public DataSourceFactory getDataSourceFactory(ObservationsConfiguration configuration) {
|
||||
return configuration.getDataSourceFactory();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new ObservationsApplication().run(args);
|
||||
}
|
||||
@ -50,12 +46,9 @@ public class ObservationsApplication extends Application<ObservationsConfigurati
|
||||
@Override
|
||||
public void run(ObservationsConfiguration observationsConfiguration, Environment environment) {
|
||||
final JerseyEnvironment jersey = environment.jersey();
|
||||
jersey.register(new AuthDynamicFeature(
|
||||
new BasicCredentialAuthFilter.Builder<User>()
|
||||
.setAuthenticator(new SimpleAuthenticator(observationsConfiguration.getAdminPassword()))
|
||||
.setRealm("SECURITY")
|
||||
.buildAuthFilter()
|
||||
));
|
||||
jersey.register(new AuthDynamicFeature(new BasicCredentialAuthFilter.Builder<User>()
|
||||
.setAuthenticator(new SimpleAuthenticator(observationsConfiguration.getAdminPassword())).setRealm("SECURITY")
|
||||
.buildAuthFilter()));
|
||||
jersey.register(new AuthValueFactoryProvider.Binder<>(User.class));
|
||||
TutorDao tutorDao = new TutorDao(hibernate.getSessionFactory());
|
||||
SiteDao siteDao = new SiteDao(hibernate.getSessionFactory());
|
||||
|
Loading…
Reference in New Issue
Block a user