Commit Graph

218 Commits

Author SHA1 Message Date
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 fa3fe89237 [Minor] removed requirement for PrivilegeAdmin role in priv. handler 2015-03-12 17:44:46 +01:00
Robert von Burg a832b2dc3e [New] Refactored XML import and export model
- added allowInclude for recursive parsing of xml importing
- ModelStatistics is now JAXB capable
- added handling of absolute paths
2015-02-28 20:41:52 +01:00
Robert von Burg 69af0d75bc [New] added StrolchTransaction.setSuppressDoNothingLogging() 2015-02-13 17:15:25 +01:00
Robert von Burg 9a8f29de34 [Minor] minor exception message changes on refP 2015-02-11 23:02:30 +01:00
Robert von Burg f847ff3208 [Bugfix] fixed bug in RuntimeConfiguration
- the methods getConfigFile and getDataFile() didn't properly evaluate
if they should throw an exception if a directory or file does not exist
2015-02-08 16:48:49 +01:00
Robert von Burg 35c35b9d1c [New] Added new MigrationsHandler to migrate the model
- Add the new MigrationsHandler as a StrolchComponent
- add migrations/data/<realm>/n.n.n.xml files
- and your migration will run
2015-02-08 12:59:21 +01:00
Robert von Burg e741680959 [Devel] Implementing MigrationsHandler
- currently the parsing of the versions is handled
- missing is the actual loading of the date into the realms
- and the performing of the code migrations
- and the registering of the performed migrations
2015-02-07 23:56:59 +01:00
Robert von Burg 2375c94dd6 [Minor] removed all tx.commitOnClose() for read only TXs 2015-02-06 22:26:30 +01:00
Robert von Burg 3fc4c83a61 [Minor] removed all tx.commitOnClose() for read only TXs 2015-02-06 22:13:48 +01:00
Robert von Burg 85b82f6628 [New] Added TransactionCloseStrategy.DO_NOTHING
- added a new closing strategy which is now the default closing
strategy. This effectively makes a new transaction read only
2015-02-06 21:35:38 +01:00
Robert von Burg 1736435864 Merge branch 'feature/tx-flush' into develop
Conflicts:
	li.strolch.agent/src/main/java/li/strolch/persistence/api/StrolchTransaction.java
2015-02-06 09:20:34 +01:00
Robert von Burg 40c9ac7969 [Major] added new feature tx.flush()
- Now if you need to perform commands to carry on in your transaction,
you can simply use the tx.flush()-method.
- Should something go wrong, then even after a tx.flush() one can call
throw tx.fail("Reason") or tx.rollbackOnClose()
2015-02-06 09:18:12 +01:00
Robert von Burg 46ccb921df [Major] Refactored how a TX is closed
- So sadly just auto closing a TX using try-resource from Java7 is a bad idea.
- Doing that leads to problems when an exception is thrown, then the close is called (duh) but this leads to commit being called.
- Since the Java language does not offer a decent way to detect if the close is being called in the context of an exception i was forced to add a tx.commitOnClose() and tx.rollbackOnClose().
- The default is that when a TX is opened, then the close strategy is rollback; the API user must call tx.commitOnClose() before the TX is closed by the braces, or as late as possible, to make sure that if an exception is thrown the transaction is rolled back, and not committed.
- The API was also extended with a tx.fail(msg):StrolchTransactionException so that if the implementor detects an unrecoverable error, one can write: throw tx.fail(“my reason”);

This was sadly an unavoidable late 1.0.0 change
Conflicts:
	li.strolch.agent/src/main/java/li/strolch/persistence/api/AbstractTransaction.java
2015-02-03 23:21:28 +01:00
Robert von Burg a9f3b04b3f [Devel] fixing flushing of TX not working on rollback 2015-02-03 23:19:29 +01:00
Robert von Burg b0cf516dab [Major] Refactored how a TX is closed
- So sadly just auto closing a TX using try-resource from Java7 is a bad idea.
- Doing that leads to problems when an exception is thrown, then the close is called (duh) but this leads to commit being called.
- Since the Java language does not offer a decent way to detect if the close is being called in the context of an exception i was forced to add a tx.commitOnClose() and tx.rollbackOnClose().
- The default is that when a TX is opened, then the close strategy is rollback; the API user must call tx.commitOnClose() before the TX is closed by the braces, or as late as possible, to make sure that if an exception is thrown the transaction is rolled back, and not committed.
- The API was also extended with a tx.fail(msg):StrolchTransactionException so that if the implementor detects an unrecoverable error, one can write: throw tx.fail(“my reason”);

This was sadly an unavoidable late 1.0.0 change
2015-02-03 23:18:31 +01:00
Robert von Burg 9532c97ef1 [Major] fixed issue with CACHED not querying inmemory
- this was a big issue as the query was delegated by the TX to the
persistence handler, which meant that the current element map types
(cached, transactional, etc.) were ignored. Move the doQuery to the
element maps, and this lead to also reimplementing the way the cached
element maps work: they now use an in memory dao, instead of MapOfMaps
2015-02-01 22:28:42 +01:00
Robert von Burg a0f832c7db [Major] changed ParameterSelection implementation
- stringListSelection() uses contains, instead of equals now
- dateRangeSelection() uses a date range object now
2015-02-01 14:12:53 +01:00
Robert von Burg 2f84091f76 [Devel] adding new feature tx.flush() 2015-01-26 00:50:46 +01:00
Robert von Burg 569c745cc7 [New] added tx.getCertificate() 2015-01-23 12:08:19 +01:00
Robert von Burg be6f1d170f [New] added tx.get*()-methods with assertExists boolean
- now a user can always use that flag to guarantee the element exists
2015-01-23 12:06:15 +01:00
Robert von Burg 120ff0ace9 [New] Added tx.getTemplate*(), documented TX, added StrolchLockException 2015-01-23 11:40:17 +01:00
Robert von Burg 99887642a6 [Bugfix] fixed bug where controllers aren't properly stopped
- this occurred for controllers which had dependencies of other
dependencies
2015-01-20 20:08:58 +01:00
Robert von Burg 72abd2a175 Merge branch 'develop' of git@github.com:eitchnet/strolch.git into develop 2015-01-20 19:48:10 +01:00
Robert von Burg bacf17b1a7 [New] Added tx.auditFrom()
- this allows to quickly create a new Audit which uses the details from
the current TX. This TX can then be added to the auditTrail for
persisting
2015-01-20 19:47:49 +01:00
Robert von Burg b731be86e3 [Bugfix] fixed bug where controllers aren't properly stopped
- this occurred for controllers which had dependencies of other
dependencies
2015-01-20 19:43:51 +01:00
Robert von Burg 15ae2f9702 [Minor] don't log multiple times the exception on failed service 2015-01-18 19:17:16 +01:00
Robert von Burg 9505ab355c [New] Added new StrolchAccessDeniedException for use in ServiceHandler
Now if you add the DefaultServiceHandler property 'throwOnPrivilegeFail'
and set it to true, then the service handler will throw a
StrolchAccessDeniedException which in combination with the
StrolchRestfulExceptionMapper allows rest services to quickly determine
if the error was because the user does not have access to the requested
resource.

Same goes for performing queries in AbstractTransaction only there
instead of throwing a privilege exception, we now also throw a
StrolchAccessDeniedException
2015-01-18 18:37:04 +01:00
Robert von Burg 6eb6f8d503 [Minor] better logging in TX 2015-01-16 17:47:47 +01:00
Robert von Burg e44775f30b [Bugfix] fixed not unlocked objects after TX
When a TX is closed, all locked objects are unlocked. The but originated from multiple commands being performed for the same object, thus the object was locked multiple times i.e. the lock counter was >1. Now added a releaseLock() method which is called by the TX when the TX is closed so that the lock counter is really 0 and the lock is released.

- Added tests for this situation
- documented the LockHandler
2015-01-16 13:59:17 +01:00
Robert von Burg cfde0fa8b7 [Bugfix] fixed minor TX logging issue 2015-01-11 18:41:52 +01:00
Robert von Burg ee741b5e18 [Bugfix] fixed not setting new Impl for component, when overridden
- Now when you set a new Impl for a component, then the dependencies are
also replaced
2015-01-09 01:05:48 +01:00
Robert von Burg 4c631ad07f [Minor] removed logging of controller names, duplicated in DepAnalyzer 2015-01-09 00:28:09 +01:00
Reto Breitenmoser aee258bc9a [Bugfix] swapped input parameters for match method 2015-01-05 22:25:57 +01:00
Robert von Burg 304255fcc2 [Minor] fixed broken tests due to change in privilege handling 2014-12-31 17:00:59 +01:00
Robert von Burg b70ee2d228 [New] Added LoginResult.getRoles(), modified logs
- also log user when performing service calls
- also log user when committing TX
2014-12-31 16:41:00 +01:00
Robert von Burg a119dfad0a [New] added StrolchTransaction.get*By() with assertExists flags 2014-11-22 12:26:21 +01:00
Robert von Burg 3d66c33e7f [Minor] adding environment in logging when setting up container 2014-11-14 22:59:50 +01:00
Robert von Burg ce34dd4d5d [Minor] adding environment in logging when setting up container 2014-11-14 22:58:30 +01:00
Robert von Burg 9b61277518 [Minor] removed useless logger in ConfigurationSaxParser 2014-11-14 22:51:46 +01:00
Robert von Burg 85d1a4a145 [Major] refactored PostgreSQL DB schema validation
Now moved all generic schema generation code to ch.eitchnet.utils so it can be used by other projects
2014-11-14 00:07:53 +01:00
Robert von Burg d55371e9b7 [Minor] fixed component version descriptions 2014-10-04 14:35:01 +02:00
Robert von Burg d7c6025c59 [New] Added a new parameter: DurationParameter of type "Duration"
The parameter is implemented in all visitors and also persistence layer
postgre.
2014-10-04 13:40:52 +02:00
Robert von Burg 32c17858e1 [Major] Added Session timeout handling
SessionHandler now has a timer checking to make sure that sessions which haven’t been accessed for a time defined by ‘session.ttl.minutes’ are invalidated
2014-09-27 12:30:35 +02:00
Robert von Burg 96740a571c [Major] Added a DB initialization mechanism
Now PostgreSQL implementation can import a configured dataStore if the persistence handler configuration property ‘allowDataInitOnSchemaCreate’. For this to work, the schema must have a migration status of CREATED, or DROPPED_CREATED on startup, or using the new method PersistenceHandler.performDbInitialization()-method. Further the properties ‘allowSchemaDrop’ and ‘allowSchemaCreate’ must be enabled.
2014-09-23 23:57:11 +02:00
Robert von Burg 3cc91dfd04 moved everything to a subdirectory for repo merge 2014-09-16 08:45:30 +02:00