This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component(service=UkelonnDatabase.class, immediate=true) | |
public class PGUkelonnDatabaseProvider implements UkelonnDatabase { | |
@Activate | |
public void activate(Map<String, Object> config) { | |
createDatasource(config); | |
try(Connection connect = getConnection()) { | |
... (create schema and insert initial data) | |
} catch (Exception e) { | |
logError("Failed to create ukelonn database schema in the PostgreSQL ukelonn database", e); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component(service=UkelonnService.class, immediate=true) | |
public class UkelonnServiceProvider extends UkelonnServiceBase { | |
private UkelonnDatabase database; | |
@Activate | |
public void activate() { | |
// Nothing to do here | |
} | |
@Reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component(service=UkelonnService.class, immediate=true) | |
public class UkelonnServiceProvider extends UkelonnServiceBase { | |
... | |
@Override | |
public Account getAccount(String username) { | |
try(Connection connection = database.getConnection()) { | |
try(PreparedStatement statement = connection.prepareStatement("select * from accounts_view where username=?")) { | |
statement.setString(1, username); | |
try(ResultSet resultset = statement.executeQuery()) { | |
if (resultset.next()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<feature name="authservice-with-dbrealm-and-session"> | |
<feature>authservice-web-security-dbrealm</feature> | |
<feature>authservice-web-security-memorysession</feature> | |
<feature>authservice-users</feature> | |
<feature>authservice-web-security</feature> | |
</feature> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<feature name="authservice-user-admin"> | |
<feature>authservice-with-dbrealm-and-session</feature> | |
<feature>authservice-user-management-frontend</feature> | |
</feature> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<feature name="authservice-with-derby-dbrealm-and-session"> | |
<feature>authservice-db-derby-test</feature> | |
<feature>authservice-with-dbrealm-and-session</feature> | |
</feature> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<feature name="authservice-with-postgresql-dbrealm-and-session"> | |
<feature>authservice-db-postgresql</feature> | |
<feature>authservice-with-dbrealm-and-session</feature> | |
</feature> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
karaf@root()> feature:repo-add mvn:no.priv.bang.authservice/authservice/LATEST/xml/features | |
Adding feature url mvn:no.priv.bang.authservice/authservice/LATEST/xml/features | |
karaf@root()> feature:install authservice-with-derby-dbrealm-and-session | |
karaf@root()> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
karaf@root()> feature:repo-add mvn:no.priv.bang.authservice/authservice/LATEST/xml/features | |
Adding feature url mvn:no.priv.bang.authservice/authservice/LATEST/xml/features | |
karaf@root()> feature:install authservice-with-postgresql-dbrealm-and-session | |
karaf@root()> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
karaf@root()> config:edit no.priv.bang.ukelonn.db.postgresql.PGUkelonnDatabaseProvider | |
karaf@root()> config:property-set ukelonn.db.jdbc.url "jdbc:postgresql:///ukelonn" | |
karaf@root()> config:property-set ukelonn.db.jdbc.user "karaf" | |
karaf@root()> config:property-set ukelonn.db.jdbc.password "karaf" | |
karaf@root()> config:update | |
karaf@root()> |