Commit Graph

150 Commits

Author SHA1 Message Date
Robert von Burg 99f34ec1b2 [Minor] Added a log info about system after startup 2014-08-04 17:47:16 +02:00
Robert von Burg 027ee8020f [Bugfix] fixed not closed TX when undoCommands() fails 2014-08-04 15:36:02 +02:00
Robert von Burg c564c2b847 [New] Implemented NameSelector.contains() and caseInsensitive() 2014-08-04 15:10:30 +02:00
Robert von Burg 7b8defc56f [New] added StrolchQuery.getSelection() and cleaned up some constants 2014-08-04 14:50:56 +02:00
Robert von Burg bf4c23e241 [New] Implemented StrolchDao.hasElement() 2014-08-04 11:47:44 +02:00
Robert von Burg 62265da046 [Minor] fixed typo 2014-07-31 22:59:27 +02:00
Robert von Burg 68a69f6319 [Bugfix] never ever return your own set!
Fixed issue where querying the keyset returned the actual set, thus
modifying the set caused modifications in the ElementMap
2014-07-31 22:22:46 +02:00
Robert von Burg 57607ae23c [Bugfix] fixed concurrent modification of list when removing elements 2014-07-31 16:35:29 +02:00
Robert von Burg ddf7c95bb5 [Major] added new methods ElementMap.removeAll() 2014-07-31 16:11:46 +02:00
Robert von Burg 281ce4e826 [New] Added a DataRange parameter selection 2014-07-31 09:42:41 +02:00
Robert von Burg a80c24a82b [Minor] enums has abstract methods... 2014-07-15 18:51:34 +02:00
Robert von Burg 87ee16e33b [New] Added AbstractConfiguration.getDataDir()
This is a convenience method to get a certain directory in the data path
of a strolch runtime.
2014-06-28 01:06:21 +02:00
Robert von Burg 76274b81c8 [New] Added a ElementMap.getTemplate()-method
This really simplifies the working with templates in Strolch. Just know
the type of template, retrieve it, clone it and then set your values.
2014-06-28 01:05:13 +02:00
Robert von Burg a087f4a624 [Minor] fixed compiler warning 2014-06-13 17:33:53 +02:00
Robert von Burg 028d198f79 [Minor] fixed test which breaks on Java8 2014-06-13 17:23:56 +02:00
Robert von Burg 791e8b7416 [Major] No more static persistence of a Privilege Certificate
Now the certificate is passed into the Service before execution.

This is better than having a static reference which can always lead to
weird behaviour, especially when multiple ClassLoaders come into play.
2014-04-15 19:20:13 +02:00
Robert von Burg f714da28f2 [New] Added ElementMap.getBy(String, Parameter)
This allows to query elements by using a StringParameter which is a
reference to another element.
2014-03-31 21:36:12 +02:00
Robert von Burg 86105eaba2 [Minor] Added exception when adding a resource which already exists 2014-03-29 02:07:05 +01:00
Robert von Burg 54375f1b8d Merge branch 'master' of git@github.com:eitch/li.strolch.agent.git 2014-03-19 20:28:16 +01:00
Robert von Burg 8f382caac6 [Bugfix] fixed problem stopping component that throws exception
Now we are sure that if a component fails to stop or destroy, we catch
the situation and carry on stopping the others. This handling is not
done when starting, as there we don't want to finish starting the agent
if something goes wrong.
2014-03-19 20:24:06 +01:00
Robert von Burg 62b0d407b0 [Minor] Accessing the realms through the container 2014-03-14 14:38:08 +01:00
Robert von Burg 2894b5b157 [Bugfix] Fixed two bugs in CachedElementMap
First bug was a situation where the update() method returned a list of
null elements due to removing and then trying to "replace" the existing
element.

Then fixed a bug where when an element was removed its ID was not
removed the key set.
2014-03-10 22:33:22 +01:00
Robert von Burg c7cb42724e [Major] Multiple issues
- Documented ComponentContainer.getComponent()
- StrolchRealm try lock timeout is configurable
- added DataStoreMode.isTransient()
- documented Command
- fixed lower case name attributes in Enums.xml
2014-03-03 23:30:35 +01:00
Robert von Burg 66e70fce75 [New] Implemented StrolchTransaction.addCommand(), Command.undo()
Commands are now supposed to be added to the StrolchTransaction so that
when a TX is committed, the commands are first verified and then
Command.doCommand() is called.

But most important of all, in case of an exception, Command.undo() is
called so that each Command can properly undo its changes so that also
in memory changes are rolled back.
2014-02-26 20:43:26 +01:00
Robert von Burg b8981cc592 [New] Implemented Command.undo() for all commands
This lead to the ElementMaps returning replaced elements when calling
update() or updateAll().

Further now the StrolchTransaction has methods to check the state easier
than comparing with the TransactionState enum
2014-02-25 21:21:42 +01:00
Robert von Burg 9f3cbf06f1 [New] Implemented locking for Strolch elements
Also cleaned up hierarchy of StrolchTransaction by moving up everything
into AbstractTransaction as made sense and added special delegation
methods for the actual commit() and rollback() ind the concrete
implementations.
2014-02-24 21:47:45 +01:00
Robert von Burg d6ebf330c7 [New] Implemented separate DataStoreMode for each StrolchRealm
added new component state mode SETUP which is before initialize which is
where configurations can be loaded, but no other components may be used
2014-02-19 00:09:25 +01:00
Robert von Burg 14de9b29df [New] Implemented separate DataStoreMode for each StrolchRealm 2014-02-17 22:07:54 +01:00
Robert von Burg c1a84fc480 [Bugfix] fixed NPE when CLI argument is missing 2014-02-17 21:46:23 +01:00
Robert von Burg a7e4faa5c1 [Minor] added protected logger field to Command 2014-02-14 21:45:09 +01:00
Robert von Burg e4d5f9623f [Bugfix] fixed bug where InMemory realms were not separated
InMemoryPersistenceHandler did not keep separate DAOs for each realm, so
that the realms were not separated in memory
2014-02-13 22:20:56 +01:00
Robert von Burg 8767f8c953 [Minor] added DBC check for empty realm name 2014-02-07 16:46:54 +01:00
Robert von Burg a90b8abf20 [Major] refactoring use of BooleanSelection in StrolchQuery 2014-02-03 08:03:15 +01:00
Robert von Burg 13db5f5cc8 [Minor] using Deque instead of Stack 2014-02-01 13:47:31 +01:00
Robert von Burg 9620d374ed [New] Added NotSelector and implemented InMemory*QueryVisitor 2014-02-01 13:13:31 +01:00
Robert von Burg f857c0b5c0 [Minor] switched to StringHelper.isNotEmpty() 2014-01-31 19:03:07 +01:00
Robert von Burg e72481eddd [New] modified the Selection to have a builder pattern
Further modified the StringParameterSelection to allow for contains and
case insensitive querying

Removed remaining nls warnings
2014-01-31 15:55:45 +01:00
Robert von Burg 9c9087250f [New] Implemented Export and Import model services and commands 2014-01-30 00:21:03 +01:00
Robert von Burg 4f9a8ae0d4 [New] Implemented an EnumHandler 2014-01-28 22:07:17 +01:00
Robert von Burg 6db47346da [Minor] catch AccessDeniedException and throw StrolchException
we don't want to propagate why a user can't log in if credentials are
not correct
2014-01-27 20:30:49 +01:00
Robert von Burg 6d6ed977b4 [Major] changed constructor of StrolchComponent
Should have interface ComponentContainer in constructor
2014-01-25 22:14:08 +01:00
Robert von Burg 0f8b7fd3a7 [New] added version info metadata to agent 2014-01-23 22:00:22 +01:00
Robert von Burg bee3c353ab [Bugfix] fixed a bug where components were started multiple times
This occurs when multiple upstream dependencies are shared by components
. When starting the container the root upstream dependencies are started
and then all those direct downstream dependencies, leading to components
being started multiple times.
2014-01-22 08:03:05 +01:00
Robert von Burg 11fbf61cb3 [New] Added ComponentContainer.getRealmNames()
Now it is possible to iterate over the configured realms. This is used
in the li.strolch.rest project to build an inspector of the agent
2014-01-17 12:32:22 +01:00
Robert von Burg 06c3c816da [New] added querySize() methods to ElementMap 2014-01-15 22:09:19 +01:00
Robert von Burg ae9a65393f [Minor] added additional constructor to pass state and error msg 2014-01-14 23:25:59 +01:00
Robert von Burg a82cb7ae39 [Minor] added ServiceResult.error(String) 2014-01-13 22:29:39 +01:00
Robert von Burg fa72314fcf [Bugfix] fixed broken synchronisation in CachedElementMap
It is still not completely clear if this is correct - tests will follow
- but this is certainly better than before...
2014-01-13 20:13:27 +01:00
Robert von Burg 4c71dcfa3f [New] Implemented StrolchTransaction.findElement(Locator)
Now using a locator, it is possible to query a StrolchElement. It is
possible to query top level i.e. Resource/Order or ParameterBag, or
Parameter.
2014-01-13 19:10:14 +01:00
Robert von Burg a446a25a2e [Major] Implemented CACHED mode
This lead to refactoring of other code:
 - removed get*Dao() from StrolchTransaction
 - added StrolchTransaction.getPersistenceHandler()
 - removed unused variables in TransactionalElementMap
   - this lead to removal of constructors in subclasses
 - added ComponentContainer.getDataStoreMode()
 - added ElementMap.addAll(), removeAll() and updateAll() methods
   - implemented in all ElementMap implementations
2014-01-11 17:39:14 +01:00
Robert von Burg 62affa815c [Major] moved the package li.strolch.runtime.agent to li.strolch.agent 2014-01-10 23:22:45 +01:00
Robert von Burg ffc18e06d7 [Major] refactored how transactions are opened
Now the ElementMapHandler is the central object and clients do not use
access DAOs or the PersistenceHandler anymore. This is now transparent.
2014-01-10 19:10:29 +01:00
Robert von Burg 8e4128c8a4 [Major] removed project li.strolch.persistence.api
Moved all classes to li.strolch.runtime
2014-01-10 16:50:57 +01:00
Robert von Burg 70d393dcc1 [New] Extended InMemoryElementListener to configure if add or update 2014-01-01 02:18:31 +01:00
Robert von Burg f93d361c4e [Bugfix] fixed a bug where a system action failed in PostInitializer 2013-12-28 12:59:42 +01:00
Robert von Burg 8f056afbb6 [New] added a semi unique id generation to StrolchAgent 2013-12-28 12:58:57 +01:00
Robert von Burg a355452a36 [Minor] removed getResourceMap() and getOrderMap() from StrolchAgent
The clients will be using the container and should not be using the
agent directly
2013-12-27 11:32:14 +01:00
Robert von Burg a514ceec99 [New] Added doQuery() methods to DAOs and hooked up InMemory querying 2013-12-26 01:12:51 +01:00
Robert von Burg 986492854b [Major] TXs are opened from ElementMap and all methods need a TX now 2013-12-26 00:05:06 +01:00
Robert von Burg 4e6322a6f7 [New] EMPTY and TRANSIENT modes now use InMemoryPersistenceHandler
This is to start prepare for using aa TX in every ElementMap method
2013-12-25 23:24:13 +01:00
Robert von Burg ebc9b59dd1 [Minor] reorganized classes for Agent into api and impl packages 2013-12-25 22:30:59 +01:00
Robert von Burg 51fac6a0cf [New] Implemented a mock persistence to test CACHED and TRANSACTIONAL 2013-12-25 22:15:09 +01:00
Robert von Burg 4ce8c9b643 [Major] RuntimeMock now also copies data 2013-12-25 19:04:55 +01:00
Robert von Burg cc0794bf30 [New] Implemented the TRANSACTIONAL mode
Each method on the ElementMap opens and closes its own transactions.
This is not exactly perfect, but still thinking of a better way, than
just using a singleton...
2013-12-25 18:42:23 +01:00
Robert von Burg 169ce6fee7 [Project] separated tests from model 2013-12-25 15:48:36 +01:00
Robert von Burg 1851f63d34 [Bugfix] fixed a situation where the webapp can't init PrivilegeHandler
the situation was that the XmlPersistenceHandler uses the base path 
from the user and not the webapps root
2013-12-25 14:43:20 +01:00
Robert von Burg 8a52a8142c [Minor] fixed issue where eclipse couldn't validate log4j.xml 2013-12-25 11:56:16 +01:00
Robert von Burg 6aaf7a5364 [Minor] better error handling when the agent does not start
Should the agent not be able to start due to configuration problems, 
then the agent must still be stopped, thus state changes in this context
should not lead to exceptions when shutting down.
2013-12-24 16:51:31 +01:00
Robert von Burg 5df4e64e10 [Major] moved OrderDao and ResourceDao factory methods to transaction
It makes using transaction feel easier.
2013-12-24 00:36:33 +01:00
Robert von Burg 435b11c5ef [New] Implemented CACHED mode for Strolch 2013-12-24 00:18:06 +01:00
Robert von Burg 2686e3d7bf [Major] Strolch agent is now fully realm capable
ResourceMap and OrderMap are kept in a StrolchRealm object for each
realm which is configured. This is transparent for the user. When no
realms are defined then the 'defaultRealm' is configured where all
methods without a realm parameter use this realm.

Once a realm is configured, the defaultRealm must be configured if it 
is still to be used at runtime.

Tests make sure realms work, for both transient, and empty situations.
Cached agent mode is next to be implemented
2013-12-23 20:28:49 +01:00
Robert von Burg 0254a74d16 [Major] refactored Element maps for better handling
Now they are not components, now there is an ElementMapHandler which
is the component and the OrderMap and ResourceMap can be retrieved from
the ElementMapHandler
2013-12-23 18:42:50 +01:00
Robert von Burg 8a084d0144 [New] XmlModelFileHandler has been extended with a
XmlModelDefaultHandler
2013-12-23 01:54:58 +01:00
Robert von Burg 663131f821 [Project] Changed all licence references to Apache License 2.0 2013-12-15 13:10:24 +01:00
Robert von Burg 0dfc7e9f4b [New] implemented in memory querying 2013-12-11 23:50:49 +01:00
Robert von Burg 9bea101c9d [Devel] Query engine transparent to the underlying implementation
Currently querying in memory works, now we need the visitor pattern to
abstract away the details of the in memory querying mechanism and allow
other querying mechanisms
2013-11-30 13:13:30 +01:00
Robert von Burg 925a25657a [New] implemented Parameter selection with test.
The ParameterizedElementSelector was still missing.
2013-11-29 08:42:44 +01:00
Robert von Burg a141744068 [New] added missing ModelBuilder class to generate teste data 2013-11-28 21:59:55 +01:00
Robert von Burg 643f846f32 [New] added many querying methods to the ElementMap interface
Implemented it in the InMemoryMap abstraction
2013-11-28 21:58:47 +01:00
Robert von Burg 66e076ea49 [New] added tests for in-memory query 2013-11-28 21:56:58 +01:00
Robert von Burg 4f428afcd1 [New] added missing abstract class StrolchTypeNavigator 2013-11-28 21:56:22 +01:00
Robert von Burg c0cebd533a [New] added OrderTypeNavigator 2013-11-28 21:53:27 +01:00
Robert von Burg aa3f39661a [New] implemented simple in-memory query 2013-11-28 21:52:32 +01:00
Robert von Burg 044fc81a18 [New] Added a MainStarter application to start Strolch from main classes 2013-11-25 23:25:45 +01:00
Robert von Burg 323b6cfd7b [New] Implemented EMPTY and TRANSIENT dataStoreModes.
Refactored Agent to be responsible for starting the container. And it
requires the runtime configuration.
2013-11-25 18:53:41 +01:00
Robert von Burg 3a2f4495dd [Devel] implementing InMemory maps for EMPTY and TRANSIENT modes 2013-11-21 18:20:06 +01:00
Robert von Burg 567ec02814 [Minor] changed exception message to be better understood 2013-11-20 07:52:27 +01:00
Robert von Burg fc3fc3e203 [Devel] Starting to implement element maps 2013-11-19 23:14:36 +01:00
Robert von Burg 548a34b9f3 [Minor] throw exception if declared dependency is missing
Instead of running into a NPE, now an exception is thrown so the user
knows which component is missing which dependency.
2013-11-16 01:09:44 +01:00
Robert von Burg 81960291e7 [New] Implemented ObserverHandler model
An ObserverHandler component can be registered and used to update
listeners.
2013-11-14 21:32:24 +01:00
Robert von Burg defba45d02 [New] added state to the container - checked by PrivilegeHandler
The container how sets its own state once it has changed the state of
the components. Now the DefaultStrolchPrivilegeHandler checks that the
container has started before allowing any methods to be called. 

This might still be too restrictive in that when the container is
stopped, that then an admin can not log in and perform any actions, but
this can then be changed when needed.
2013-11-13 19:52:49 +01:00
Robert von Burg ff1b629c9d [New] Implemented a component directed acyclic dependency tree
This is needed to start/stop in the right order
2013-11-12 19:34:48 +01:00
Robert von Burg 8702caa5c3 Implemented tests for dependency analyzing. 2013-11-08 18:24:32 +01:00
Robert von Burg 3a44a1407e [Devel] busy implementing a component directed acyclic dependency tree
This is needed to start/stop in the right order
2013-11-06 22:34:00 +01:00
Robert von Burg af34d81df8 [Devel] busy implementing a component directed acyclic dependency tree
This is needed to start/stop in the right order
2013-11-05 20:41:24 +01:00
Robert von Burg 85011270d2 [Major] basic implementation of Strolch Runtime complete
- We now have a container which can be configured with components, can
be setup, started, stopped and destroye.

- Missing is still the implementation of the dependencies.
2013-10-31 00:43:14 +01:00
Robert von Burg efd30b82a9 [New] implementing base configuration model and privilege handler 2013-10-28 22:07:54 +01:00
Robert von Burg 3a0f37faad [New] Added StrolchComponent for state of Strolch components 2013-10-27 03:26:43 +01:00
Robert von Burg f5dbc076d4 [New] added basic configuration model 2013-10-24 21:47:16 +02:00
Robert von Burg 8a6b212248 [New] added basic configuration modl 2013-10-23 23:15:26 +02:00