Search in sources :

Example 1 with DefaultStormtrooperDao

use of com.okta.authn.sdk.example.dao.DefaultStormtrooperDao in project okta-auth-java by okta.

the class ExampleApplication method configureJersey.

private void configureJersey(JerseyEnvironment jersey) {
    // Load any resource in the resources package
    String baseResourcePackage = getClass().getPackage().getName() + ".resources";
    jersey.packages(baseResourcePackage);
    AuthenticationClient client = AuthenticationClients.builder().build();
    // use @Inject to bind the DAOs
    jersey.register(new AbstractBinder() {

        @Override
        protected void configure() {
            bind(new DefaultStormtrooperDao()).to(StormtrooperDao.class);
            bind(new DefaultTieCraftDao()).to(TieCraftDao.class);
            bind(client).to(AuthenticationClient.class);
        }
    });
}
Also used : DefaultTieCraftDao(com.okta.authn.sdk.example.dao.DefaultTieCraftDao) DefaultStormtrooperDao(com.okta.authn.sdk.example.dao.DefaultStormtrooperDao) StormtrooperDao(com.okta.authn.sdk.example.dao.StormtrooperDao) DefaultStormtrooperDao(com.okta.authn.sdk.example.dao.DefaultStormtrooperDao) AbstractBinder(org.glassfish.hk2.utilities.binding.AbstractBinder) TieCraftDao(com.okta.authn.sdk.example.dao.TieCraftDao) DefaultTieCraftDao(com.okta.authn.sdk.example.dao.DefaultTieCraftDao) AuthenticationClient(com.okta.authn.sdk.client.AuthenticationClient)

Aggregations

AuthenticationClient (com.okta.authn.sdk.client.AuthenticationClient)1 DefaultStormtrooperDao (com.okta.authn.sdk.example.dao.DefaultStormtrooperDao)1 DefaultTieCraftDao (com.okta.authn.sdk.example.dao.DefaultTieCraftDao)1 StormtrooperDao (com.okta.authn.sdk.example.dao.StormtrooperDao)1 TieCraftDao (com.okta.authn.sdk.example.dao.TieCraftDao)1 AbstractBinder (org.glassfish.hk2.utilities.binding.AbstractBinder)1