Example usage for org.apache.shiro.realm.jdbc JdbcRealm setName

List of usage examples for org.apache.shiro.realm.jdbc JdbcRealm setName

Introduction

In this page you can find the example usage for org.apache.shiro.realm.jdbc JdbcRealm setName.

Prototype

public void setName(String name) 

Source Link

Usage

From source file:io.bootique.shiro.jdbc.realm.JdbcRealmFactory.java

License:Apache License

@Override
public Realm createRealm(Injector injector) {

    DataSource ds = findDataSource(injector.getInstance(DataSourceFactory.class));

    JdbcRealm realm = new JdbcRealm();

    if (name != null) {
        realm.setName(name);
    }//from  w  w w.ja  v a 2  s .  co  m

    realm.setDataSource(ds);
    realm.setPermissionsLookupEnabled(lookupPermissions);

    if (authenticationQuery != null) {
        realm.setAuthenticationQuery(authenticationQuery);
    }

    if (permissionsQuery != null) {
        realm.setPermissionsQuery(permissionsQuery);
    }

    if (saltStyle != null) {
        realm.setSaltStyle(saltStyle);
    }

    if (userRolesQuery != null) {
        realm.setUserRolesQuery(userRolesQuery);
    }

    return realm;
}