Commit Graph

107 Commits

Author SHA1 Message Date
Robert von Burg 8344c75d39 [Major] Refactored setup of StrolchAgent using StrolchBootstrapper
Now instead of instantiating StrolchAgent and calling the method
setup(), instantiate StrolchBootstrapper and call one of the setup
methods which is appropriate to your use-case.

New feature is to use a StrolchBootstrap.xml to configure the
environment, root, config and data paths. Each can be defined by
environment and overridden, etc.
2016-02-27 13:32:18 +01:00
Robert von Burg e2b3e5f7b0 [Minor] removed unnecessary else 2016-02-10 17:48:18 +01:00
Robert von Burg 3502a4adad [Minor] Removed redundant types (diamond operator) 2016-02-10 17:46:50 +01:00
Robert von Burg 0473b472b3 [Major] Added PolicyContainer interface
Resource, Order, Activity and Action now implement this interface and Command.getPolicy() now takes a PolicyContainer as a parameter.
2016-02-10 17:37:50 +01:00
Robert von Burg e6697eb9c2 [Fix] Fixing startup race condition on timeout of old sessions 2015-11-20 19:58:46 +01:00
Robert von Burg 292050a8f9 [New] Use InvalidCredentialsException 2015-10-23 18:22:05 +02:00
Robert von Burg a22a6db408 [Fix] fixed compiler error 2015-10-16 17:59:20 +02:00
Robert von Burg c37fd20efb [Major] Added persisting and reloading of sessions 2015-10-16 17:21:49 +02:00
Robert von Burg 60300ab21d [New] Added AbstractService.runPrivilege()
- This runs the given action as the system user 'privileged'
2015-10-08 22:09:45 +02:00
Robert von Burg d8a68f26fd [New] Added helper methods for running as a system user 2015-10-08 12:32:02 +02:00
Robert von Burg b9f3e5d13c [New] Added better exception messages 2015-10-08 12:30:52 +02:00
Robert von Burg 4de7dfba85 [New] TransientRealm now disallows updates, i.e. duplicates in XML model 2015-08-24 09:50:46 +02:00
Robert von Burg 4e6f7a916f [Minor] also log situations where no service state is returned 2015-08-24 09:41:24 +02:00
Robert von Burg 7414081cbc [Major] Added StrolchPolicy.undo() and Command.getPolicy() 2015-08-22 23:00:50 +02:00
Robert von Burg cde640d511 [Major] Added StrolchPolicy.undo()
- and from now on we don't use interfaces anymore. We use abstract
classes with StrolchPolicy as the super class.
- it would be lovely if Java would get rid of interfaces and abstract
classes. We only need one: abstract classes.
2015-08-22 21:16:43 +02:00
Robert von Burg 01a86ca9f7 [Major] Added StrolchPolicy as super class of all Strolch policies
- this allows to inject a StrolchTransaction and the ComponentContainer
during instantiation
2015-08-22 20:44:31 +02:00
Robert von Burg 12ca8c4f07 [Major] Refactored package for policies in model project
- added additional tests
2015-08-22 15:29:48 +02:00
Robert von Burg 5da07f5824 [Major] Refactored package for policies in model project
- added additional tests
2015-08-22 15:09:30 +02:00
Robert von Burg 0e3b3b2a1e [Minor] [New] Implemented and fixed remaining policy tests 2015-08-22 12:04:41 +02:00
Robert von Burg ac1885883a [New] Added Policies
You can now add policies to Resources, Orders and Activities:
<Policies>
	<Policy Type="PlanningPolicy" Value="key:SimplePlanningPolicy" />
	<Policy Type="ExecutionPolicy"
Value="java:li.strolch.policy.execution.TestSimulatedExecutionPolicy" />
	<Policy Type="ConfirmationPolicy" Value="key:NoConfirmation" />
</Policies>

And now there is a PolicyHandler to get the Policy:
<Component>
	<name>PolicyHandler</name>
	<api>li.strolch.policy.PolicyHandler</api>
	<impl>li.strolch.policy.DefaultPolicyHandler</impl>
	<Properties>
		<readPolicyFile>true</readPolicyFile>
		<policyConfigFile>StrolchPolicies.xml</policyConfigFile>
	</Properties>
</Component>

Which has its own configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<StrolchPolicies>

	<PolicyType Type="PlanningPolicy"
Api="li.strolch.policytest.TestPlanningPolicy">
		<Policy Key="SimplePlanningPolicy"
Class="li.strolch.policytest.TestSimplePlanningPolicy" />
	</PolicyType>

	<PolicyType Type="ConfirmationPolicy"
Api="li.strolch.policytest.TestConfirmationPolicy">
		<Policy Key="NoConfirmation"
Class="li.strolch.policytest.TestNoConfirmationPolicy" />
	</PolicyType>

</StrolchPolicies>

Some tests are still broken at this state - will fix them in the next
commit
2015-08-21 17:38:41 +02:00
Robert von Burg 69eb5ccf38 [Major] Refactored query API
- Now added ordering
- added setters for visitors on query
-
2015-08-10 22:21:45 +02:00
Robert von Burg 29a88fe6ab [New] Added StrolchComponent.getConfiguration()
- and thus removed any instance variables to it in subclasses
2015-07-10 10:48:17 +02:00
Robert von Burg 022cf4c5f3 [Minor] Added logging of which environment is loaded from root path 2015-07-09 14:48:32 +02:00
Robert von Burg cf004e5577 [Minor] Changed TimeState Type from BooleanState to Boolean, etc.
- See StrolchValueType for the types of values which Strolch knows about
2015-07-08 07:47:46 +02:00
Robert von Burg 82ce5a7261 [New][Devel] Work in progress of implementing ActivityMap
- Creating new maps for transient, transactional and cached mode
- adding to Realms; including initialization
- adding new methods to transactions e.g. getActivityBy(), etc.
- Adding new ActivityDao with InMemory implementation
- extending PersistenceHandler
- fixed compile errors in the rest of the project

Still missing is the implementation in persistence handler and fixing
the tests. Currently no tests were run, just trying to fix compile
errors
2015-06-28 20:42:42 +02:00
Robert von Burg 521bd84ce0 [Major] StrolchComponent methods can now throw Exception
- execption handling is done in the ComponentContainerStateHandler
- clients now not need to worry about exceptions which would make them
  rethrow anyhow as a runtime exception
2015-06-11 19:19:52 +02:00
Robert von Burg 503bdbe4d6 [Major] refactored SystemUserActions in privilege
Now a SystemUserAction is defined as follows:
<Privilege name="ch.eitchnet.privilege.handler.SystemUserAction" 
    policy="DefaultPrivilege">
  <Allow>li.strolch.agent.impl.StartRealms</Allow>
</Privilege>
2015-06-03 23:32:23 +02:00
Robert von Burg 473c852ea6 [New] Added ServiceResult.isNok() 2015-06-01 18:03:11 +02:00
Robert von Burg 9988c426f1 [Minor] added more JavaDoc to StrolchTransaction.findElement() 2015-05-25 22:22:48 +02:00
Robert von Burg 1b9e687d42 [Minor] added NPE check in AbstractTransaction for refPs 2015-05-15 20:14:21 +02:00
Robert von Burg f07b241ddc [New] Added feature to ignore a realm on DB init
This can be very handy to not start the connection pool for realms which
you know won't connect to the DB (but is not transient) - weird isn't
it? =))

The property is: db.ignore.realm.<realmName>

The actual use case is the following:
- You have a realm which use is used normally and is not transient so
you have a configuration for it
- you have another StrolchComponent which opens its own transactions to
the DB but you only require a subset of the realms so you then use the
ignore property to ignore the other realms.
2015-05-08 18:07:30 +02:00
Robert von Burg 1da65c1131 [Minor] added logging of pool size in PostgreSqlDbConnectionBuilder 2015-05-08 17:41:36 +02:00
Robert von Burg d3dad2a827 [New] added Integer, Float and ListParameters
- including tests, etc.
2015-05-02 13:32:30 +02:00
Robert von Burg 01535fb515 [New] added connection pool properties for PersistenceHandler
- e.g. for PostgreSQL enforce pool size:
  <db.pool.maximumPoolSize>1</db.pool.maximumPoolSize>
2015-04-30 08:46:18 +02:00
Robert von Burg a6b320268f [Minor] code formatting 2015-04-22 13:27:28 +02:00
Robert von Burg d31e9ffc6d [Project] Added missing license headers 2015-04-22 13:20:28 +02:00
Robert von Burg 64c6a01083 [Minor] Added doc to Auditing*MapFacades and impl. query auditing 2015-04-22 12:06:20 +02:00
Robert von Burg 31493f2fa1 [Major] PostgreSql now uses HikariCP for connection pooling 2015-04-21 15:04:51 +02:00
Robert von Burg 69c842034a [New] Added rest GET of Order and Resource as XML 2015-04-19 16:13:26 +02:00
Robert von Burg 91a08057c1 [Minor] fixed session timeout not being audit action timeout 2015-04-05 01:27:50 +02:00
Robert von Burg bd4291b483 [Major] Moved privilege management into separate services
- instead of just calling the methods from the REST API, now we call
services
- this allows auditing who changes which privileges
2015-04-05 01:11:54 +02:00
Robert von Burg 6bd1ed58ad [New] Added limit and sorting to Audit query incl. REST API 2015-04-04 18:29:33 +02:00
Robert von Burg aa11f8098a [New] Added elementSubType to Audit 2015-04-04 17:53:54 +02:00
Robert von Burg c307102e33 [Minor] added ComponentContainer.getRealm(Certificate)
- instead of throwing an exception if the realm property is missing on
the certificate, we first see if the default realm is available
2015-04-02 20:39:29 +02:00
Robert von Burg 30608ba99a [New] Added REST API to query Audits 2015-04-02 20:26:20 +02:00
Robert von Burg 9ca7b5f26f [New] Added audits for login and logout 2015-04-02 20:26:20 +02:00
Robert von Burg e123cbf47d [Minor] added ComponentContainer.getRealm(Certificate) 2015-04-02 20:26:20 +02:00
Robert von Burg 819ae53708 [Minor] added missing PrivilegePolicies:
<Policy name="RoleAccessPrivilege"
    class="ch.eitchnet.privilege.policy.RoleAccessPrivilege" />
<Policy name="UserAccessPrivilege" 
    class="ch.eitchnet.privilege.policy.UserAccessPrivilege" />
2015-03-12 18:05:46 +01:00
Robert von Burg 5ffc03f115 [Minor] removed reference to non existing role PrivilegAdmin in users 2015-03-12 18:01:02 +01:00
Robert von Burg fa3fe89237 [Minor] removed requirement for PrivilegeAdmin role in priv. handler 2015-03-12 17:44:46 +01:00