Commit Graph

424 Commits

Author SHA1 Message Date
Robert von Burg a53c9a0e46 [Major] simplified API for fluent API in StrolchSearch 2018-03-26 14:48:12 +02:00
Robert von Burg 277a57dda3 [Minor] Cache PrivilegeContext in StrolchTransaction 2018-03-23 17:11:35 +01:00
Robert von Burg 2907df815a [Project] Added privilege StrolchSearch 2018-03-20 07:46:50 +01:00
Robert von Burg 86b65f8697 [Major] Removed petitparser, using StrolchSearch in REST API 2018-03-20 07:46:28 +01:00
Robert von Burg fee696a5ef [Fix] Fixed compile errors 2018-03-14 10:10:01 +01:00
Robert von Burg 73744d0931 [Fix] Fixed compile errors 2018-03-14 09:33:50 +01:00
Robert von Burg 4689af6ee0 [Major] Implemented GenericSearch for internal use 2018-03-14 09:08:33 +01:00
Robert von Burg 50fbafde45 [Major] Implemented GenericSearch for internal use 2018-03-14 09:04:07 +01:00
Robert von Burg 9bd0d43f50 [Major] Better generics support in Search API, includin ExpressionBuilder 2018-03-14 08:09:29 +01:00
Robert von Burg 131b4bdf83 [Fix] Fixed broken test 2018-03-13 22:09:30 +01:00
Robert von Burg 75d79544af [Major] Implemented new search API using Streams 2018-03-13 17:51:24 +01:00
Robert von Burg d3b5fa5128 [Major] Moved query classes to li.strolch.agent 2018-03-12 18:13:46 +01:00
Robert von Burg 44bb21a43f [Fix] DefaultLockHandler uses ConcurrentHashMap 2018-03-10 15:17:30 +01:00
Robert von Burg 7e30e0c78d [Minor] Use tx ind InMemoryElementListener instead of ElementMaps 2018-03-09 12:45:23 +01:00
Robert von Burg 42c500d677 [Minor] clear cache when flushing 2018-03-09 10:49:00 +01:00
Robert von Burg 5fcf08e4eb [New] Added tx.clearCache() 2018-03-09 10:27:28 +01:00
Robert von Burg 742e436a93 [Major] Implemented caching of data in AbstractTransaction 2018-03-08 18:07:11 +01:00
Robert von Burg caeed3d670 [Minor] Fix in TransientElementMap.java 2018-03-08 18:07:11 +01:00
Robert von Burg 676bb9c11e [Fix] Fixed broken tests 2018-02-28 09:04:49 +01:00
Robert von Burg c66f7c2805 [Major] Implement StrolchElement.isReadOnly() and .setReadOnly()
Modifying a read only element causes an exception. Retrieving elements from the TX, or directly from the ElementMap returns a clone, so nothing changes there. But elements returned by a query will have their readOnly flag set, thus if these are modified, then they need to be cloned first.
2018-02-27 14:46:23 +01:00
Robert von Burg 315879ebe1 [Major] (Re-)Implemented XML Persistence 2018-02-27 09:00:26 +01:00
Robert von Burg 8e4a1c7ac3 [Fix] Set initial version when updating in TransientElementMap 2018-02-20 12:04:11 +01:00
Robert von Burg a2a0645f3b [Minor] Log exceptions of StrolchSystemAction 2018-02-20 09:47:35 +01:00
Robert von Burg aac4ad2fd9 [Fix] Swapped enableDelayedObserverUpdates 2018-02-13 17:59:01 +01:00
Robert von Burg f3ea159052 [Major] RIP transactional mode 2018-02-09 22:16:34 +01:00
Robert von Burg 0d42defd2a [Major] Reworked visitors: StrolchElement.accept(StrolchElementVisitor) 2018-02-09 11:32:50 +01:00
Robert von Burg a5f9d655b8 [Fix] Remove version of parsed files in inspector 2018-02-02 11:56:41 +01:00
Robert von Burg ba115b70c4 [Fix] Remove version of parsed files in inspector 2018-02-02 11:50:00 +01:00
Robert von Burg a7a33e4e0c [Minor] logger change in TransientRealm 2018-01-10 18:27:05 +01:00
Robert von Burg 50c379d06d [Major] Using executor pools with names in StrolchAgent 2017-12-19 14:54:57 +01:00
Robert von Burg 6328827f9e [Minor] Fixed logging in CachedElementMap 2017-12-07 11:01:12 +01:00
Robert von Burg 04f4fed0ba [New] Added toJson() to ServiceResult, ModelStatistics 2017-11-29 16:56:36 +01:00
Robert von Burg 2d60a352b4 [Fix] Fix not allow to re-add removed element with versioning enabled 2017-11-01 10:15:21 +01:00
Robert von Burg 49d5e41fe5 [Minor] Also log for which parameter the element was not found 2017-10-27 09:20:04 +02:00
Robert von Burg d44da5b587 [New] Added StrolchEnum.keySet() 2017-10-25 09:41:07 +02:00
Reto Breitenmoser b89aa885d4 [Minor] set new creation date for template orders 2017-10-21 21:04:19 +02:00
Robert von Burg c0bf2ae428 [Major] Refactored GenericReport into Policies for extension 2017-10-18 13:11:39 +02:00
Robert von Burg 394c3735e3 [New] Added StrolchTransaction.getResourceFor(Action) 2017-10-12 16:12:39 +02:00
Robert von Burg 5c5a3afbbc [Fix] re-run add model change commands in TX, as commands create new 2017-10-10 12:06:37 +02:00
Reto Breitenmoser 4adac09ab5 [Minor] set username from certificate 2017-10-09 21:44:49 +02:00
Reto Breitenmoser 283a78bdfa [Minor] added authenticateSingleSignOn method 2017-10-08 21:19:30 +02:00
Robert von Burg adf53dd49f [Major] Implemented SingleSignOn facility for Privilege 2017-10-06 16:59:22 +02:00
Robert von Burg 4087608e1a [Fix] Throw Exception on programmer mistake if no commitOnClose with + 2017-10-05 09:54:42 +02:00
Robert von Burg 45a385920d [Fix] Fixed NPE in AbstractTransaction.needsCommit() 2017-10-04 14:27:13 +02:00
Robert von Burg dad2f35b16 [Major] Multiple changes to StrolchTransaction:
New:
- needsCommit() -> return true if objects or commands are registered
- hasResource()
- hasOrder()
- hasActivity()

Changes:
- When tx.add(), update() or remove() is called, then get*Template(),  or get*By() check the internal cache and thus e.g. a new resource is immediately available.
- the has*()-methods also check the internal cache, thus the need to get the underlying maps should now no longe be required in normal TX use.
2017-10-04 13:10:20 +02:00
Robert von Burg 2c5dddd893 [Major] rename add/update/remove methods in StrolchTransaction 2017-10-03 11:41:30 +02:00
Robert von Burg 90a81b6725 [Major] Rename DO_NOTHING as READ_ONLY in StrolchTransaction 2017-10-03 11:37:01 +02:00
Robert von Burg 84d3ca4666 [Minor] Some code cleanup for JDK 9 2017-09-29 16:21:21 +02:00
Robert von Burg 2cb799dfb4 [Major] Removed the need for javax.xml.bind.* imports. Using gson 2017-09-29 15:57:21 +02:00
Robert von Burg 4bcddc4e3b [Major] Removed MainStarter.java as never used 2017-09-28 13:32:57 +02:00
Robert von Burg 592fce0e88 [Minor] tx.add*() -> remove check for existing. Need deeper fix 2017-09-27 20:52:10 +02:00
Robert von Burg 3310bb8766 [Minor] Fix compile warnings 2017-09-26 15:01:02 +02:00
Robert von Burg fd4d428000 [New] It is now possible to override a logging
Just add a logback.xml file with the appropriate configuration in the
config folder and it will be loaded automatically.
2017-09-20 17:41:24 +02:00
Robert von Burg 060692a5c1 [Fix] Fixed RuntimeConfiguration.getConfigFile() 2017-09-20 17:40:34 +02:00
Robert von Burg d0aa763f6a [New] Added StrolchJob for recurring jobs 2017-09-15 10:35:37 +02:00
Robert von Burg 4153c9bb14 [Minor] Throw exception if forget to commit 2017-09-08 18:51:23 +02:00
Robert von Burg 97a0c076a4 [Minor] Throw exception if forget to commit 2017-09-08 18:48:53 +02:00
Robert von Burg d2f19dca5d [Minor] Small memory consumption improvement 2017-08-30 16:31:44 +02:00
Robert von Burg 5461d04f4e [New] StrolchAgent now instantiates executor services for async work 2017-08-30 14:34:19 +02:00
Robert von Burg 9e47eb4070 [Fix] Fixed error due to objectFilter noch flushed 2017-08-24 16:44:09 +02:00
Robert von Burg f2cdea3b7d [Major] Changes in LogMessage, not using ID for equals 2017-08-16 11:23:44 +02:00
Robert von Burg 27b6beff03 [Fix] Use certificate username, if firstname and lastname null
- but only for agent users
2017-08-08 14:58:01 +02:00
Robert von Burg c79f1d6ae6 [Fix] Returning 401 if session is invalid, 403 for privilege 2017-07-26 15:15:20 +02:00
Robert von Burg e71b7b018b [Major] Now exposing StrolchTransaction.assertHasPrivilege()
Enforcing privilege checking was a bad idea
2017-07-25 14:12:51 +02:00
Robert von Burg 1183000520 [Major] Implemented privilege checking for DAO
Now the PrivilegeConfig.xml must include:

	<Policies>
		<Policy name="ModelPrivilege"
class="li.strolch.runtime.privilege.ModelPrivilege" />
	</Policies>

And PrivilegeRoles.xml must include:

	<Role>
		<Privilege name="GetResource" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="GetOrder" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="GetActivity" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="AddResource" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="AddOrder" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="AddActivity" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="UpdateResource" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="UpdateOrder" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="UpdateActivity" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="RemoveResource" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="RemoveOrder" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
		<Privilege name="RemoveActivity" policy="ModelPrivilege">
			<AllAllowed>true</AllAllowed>
		</Privilege>
	</Role>
2017-07-24 20:07:10 +02:00
Robert von Burg c0cc6f57cb [Major] Added add, update and remove methods to TX for elements
Moved add, update and remove commands to agent package
2017-07-24 13:51:17 +02:00
Robert von Burg e459b561b8 [Major] LogMessage now has an ID which is used in OperationsLog 2017-06-15 13:33:14 +02:00
Robert von Burg 9b92d2fdbc [Major] Refactored LogMessage to use ResourceBundle, instead of bundleId 2017-06-14 17:58:13 +02:00
Robert von Burg 08631498dc [Major] Creating LogMessages for exceptions in Migrations, TX, Execution 2017-06-14 15:54:58 +02:00
Robert von Burg 0badb0fc01 [Minor] Log duration of state changes in components 2017-06-07 15:53:10 +02:00
Robert von Burg 4c9e66876a [Major] Privilege passwords are now salted! 2017-05-22 14:37:48 +02:00
Robert von Burg f87c42f399 [Project] switched tests to use logback-classic 2017-05-22 09:50:48 +02:00
Robert von Burg d5514e772c [Minor] Fixed deprecation in MainStarter 2017-05-18 15:02:58 +02:00
Robert von Burg 3622339896 [Major] Total refactoring of StrolchElementVisitor hierarchy 2017-05-17 09:20:27 +02:00
Robert von Burg 42c623cea6 [Major] Added Service.getArgumentInstance() 2017-05-16 15:18:38 +02:00
Robert von Burg 3f7c959865 [New] Added new EventCollectingObserverHandler
This observer handler is enabled with the additional boolean
configuration <enableDelayedObserverUpdates> and allows for less updates
to observers as they are cached
2017-05-16 14:29:59 +02:00
Robert von Burg f1216f8825 [Major] Now throwing exception if TX is not committed but has commands 2017-05-16 14:28:32 +02:00
Robert von Burg b68b74aade [Fix] Fixed InMemoryTransaction marked committed on flush 2017-05-09 12:30:53 +02:00
Robert von Burg b302c3f19e [Fix] Fixed wrong exception message when asserting *-Ref parameters 2017-05-08 19:07:51 +02:00
Robert von Burg 96ed97132b [New] StrolchTransaction.findElement() override for allowing null 2017-05-03 15:31:26 +02:00
Robert von Burg 22538dc7fa [Major] New implementation of ObserverHandler for async updates 2017-05-02 16:07:55 +02:00
Robert von Burg d1a392f025 [Major] Changed the behaviour of the EventBasedExecutionHandler
Now execution is always performed asynchronously for each Action and an
Activity should be added to the ExecutionHandler by calling
.addForExecution(), so that it is executed later even if an action
couldn't be executed to it being reserved (for instance).
2017-04-22 19:25:27 +02:00
Robert von Burg c835ef2735 [Minor] Cleaned up use of new FileInputStream 2017-04-11 11:04:46 +02:00
Robert von Burg 6afba02c59 [Major] Implemented querying Activities by state and resolves #3 2017-04-06 10:02:04 +02:00
Robert von Burg fbb2bc85db [Minor] Small logging changes 2017-04-06 08:42:05 +02:00
Robert von Burg 801f792771 [Minor] Added StrolchComponent.openTx() methods 2017-03-29 14:14:25 +02:00
Robert von Burg fa7309cb19 [New] Added StrolchElementQuery.internal() 2017-03-01 01:37:55 +01:00
Robert von Burg 89739717f2 [Major] Refactored LockHandler to use Locator
This is required because in certain instances it is important to lock
the object before retrieving it, otherwise if, for instance in
execution, we would need to fetch, lock and re-fetch to be sure we have
the latest object.

In moste of the Update*Commands this is not important as we perform a
list commit wins, where the client wants their version to be persisted.
Later a optimistic locking can be performed in that the given version
must be the latest, otherwise an exception would be thrown
2017-02-22 12:14:23 +01:00
Robert von Burg 5c8ccabd7f [New] Added new ReservationExection to reserve resources 2017-02-20 17:32:44 +01:00
Robert von Burg f086143e82 [Minor] JavaDoc updates for StrolchRealm 2017-02-17 17:37:41 +01:00
Robert von Burg 743709f103 [Fix] Added missing activity observer calls in AbstractTransaction
- also updated JavaDoc of ObserverHandler
- and only perform observer updates if element list are not empty
2017-02-17 17:26:37 +01:00
Robert von Burg 834fab7601 [New] Added StrolchConfiguration.getComponentConfiguration(Class) 2017-02-17 13:38:21 +01:00
Robert von Burg 3770e7b65c [Minor] Give component name, when state change invalid 2017-02-17 13:37:35 +01:00
Robert von Burg 98532d2f88 [Major] locator for a timed state must have TimedState separator 2017-02-02 12:56:21 +01:00
Robert von Burg 5cdffcc450 [New] Implemented StrolchTransaction.setSuppressAuditsForAudits() 2017-01-31 11:24:27 +01:00
Robert von Burg 6bf3ee1509 [New] Added methods on StrolchTransaction and StrolchComponent 2017-01-23 16:42:08 +01:00
Robert von Burg edcef3e755 Merged branch release/1.4.0 into develop 2016-11-03 11:51:11 +01:00
Robert von Burg 8fd4a5e311 [Fix] Fixed InMemoryElementListener because of versioning 2016-10-24 11:08:41 +02:00
Robert von Burg f5fc938124 [Minor] Always log original exception if TX fails 2016-10-24 10:45:06 +02:00
Robert von Burg ba476b2f68 [Minor] Added TODO about .getBy() which returns clone, and querying 2016-10-07 09:38:39 +02:00
Robert von Burg b775c00f4d [Major] Implemented ExecutionDuration and fixed deep execution
Using the DurationExecution:

<Activity Id="produceBicycle" Name="Activity" Type="ToStock" 
        TimeOrdering="Series">
  <ParameterBag Name="objectives" Id="Objectives" Type="Objectives">
    <Parameter Name="Duration" Id="duration" Value="PT0.01S" 
          Type="Duration" />
  </ParameterBag>
  <Action Id="produce" Name="Produce" ResourceId="bicycle" 
          ResourceType="Product" Type="Produce" />
</Activity>

IActivityElement now has a new method .findParameter() to search up the
activity hierarchy to find the element
2016-10-06 20:38:06 +02:00
Robert von Burg 48caa84903 [Major] Refactored SystemAction in privileges
Simplified the API, removed the privileged user - now always use the
agent system user for running system actions. One method has no return
value and one has a return value. Now it is easy to perform a system
action using:

    runAsAgent(ctx -> {
      // do work			
    });

    String result = runAsAgentWithResult(ctx -> {
      // do work
      return "done";
    });

    // execute a SystemAction
    runAsAgent(action);

    // execute a SystemActionWithResult
    String result = runAsAgentWithResult(actionWithResult);
2016-09-29 15:54:30 +02:00
Robert von Burg dd227c65d0 [Major] Refactored SystemAction in privileges
Simplified the API, removed the privileged user - now always use the
agent system user for running system actions. One method has no return
value and one has a return value. Now it is easy to perform a system
action using:

    runAsAgent(ctx -> {
      // do work			
    });

    String result = runAsAgentWithResult(ctx -> {
      // do work
      return "done";
    });

    // execute a SystemAction
    runAsAgent(action);

    // execute a SystemActionWithResult
    String result = runAsAgentWithResult(actionWithResult);
2016-09-29 12:26:27 +02:00
Robert von Burg d86e23b58f [Fix] Fixed locator finding for Activity and Action 2016-09-23 13:29:02 +02:00
Robert von Burg d413794213 [Major] Added Activity.TimeOrdering and updated Model XSD 2016-09-23 10:53:37 +02:00
Robert von Burg 5cbbfebf06 [Major] Services now consider Arg realm or user realm 2016-09-22 21:52:36 +02:00
Robert von Burg e3ea9fa159 [New] When retrieving new templates, then the type and ID is set auto 2016-09-21 15:47:18 +02:00
Robert von Burg f8165208b1 [New] Added CRUD Services and Commands for Activities 2016-09-21 12:40:23 +02:00
Robert von Burg 657c47aacd [New] Added get activity template methods on StrolchTransaction 2016-09-21 10:00:51 +02:00
Robert von Burg 55fb3a53c8 [Project] Extended documentation for:
- components
- queries
- realms
- services and commands
2016-09-15 18:37:15 +02:00
Robert von Burg 3f2c749659 [Minor] Added AbstractionConfiguration.getAsProperties() 2016-09-08 11:20:06 +02:00
Robert von Burg bcc0bf4a10 [Major] Now users can reset their own passwords
- built in User Challenge feature (currently only console)
- extended REST API to allow user to initiate a challenge and then use
the challenge to authenticate for a one time change password session
2016-09-07 14:41:16 +02:00
Robert von Burg 41f5f22574 [Minor] Allow to override privilegeValue in StrolchElementQuery
use this together with the value "internal" to define queries as
internal, so you can make them executable without having to allow all
queries
2016-08-31 12:29:29 +02:00
Robert von Burg acf3c12313 [Fix] Fixed errors due to new feature versioning
* When initializing the version was not set
* template copies had a version set
2016-08-20 18:24:21 +02:00
Robert von Burg 3474d9c890 [Minor] Updated JavaDoc of StrolchTransaction 2016-08-20 13:36:49 +02:00
Robert von Burg b30b791460 [Minor] Added further methods for setting up a Strolch Agent 2016-08-11 10:51:58 +02:00
Robert von Burg fa136c966c [Minor] Privilege sessions should be stored in the temp path, not data 2016-08-11 10:51:30 +02:00
Robert von Burg 07daf34f86 [Major] Implemented opt-in versioning
- fixing remaining PostgreSQL DAO tests
2016-08-08 09:30:56 +02:00
Robert von Burg 8c4c8e539e [Major] Implemented opt-in versioning
- Implemented marshalling of Version
- Added further tests for marshalled version
- added version in deep equals
- fixing further tests
2016-08-07 17:47:52 +02:00
Robert von Burg 26961b33cc [Major] Implemented opt-in versioning
- adding versioning tests
- fixing broken tests
- implemented missing PostgreSQL DAO methods
2016-08-07 11:49:36 +02:00
Robert von Burg 9dc09515e9 [Major] Implemented opt-in versioning
Now all root elements have a version, and if the realm has versioning
enabled, then actions through the ElementMap lead to new versions being
created. There are also methods to revert/undo changes to an object.

Some tests are still failing, this will be fixed later
2016-08-05 20:24:23 +02:00
Robert von Burg 0703103d3b [Major] Refactored object hierarchy and added version to objects
- New ParameterBagContainer interface for GroupedParameterizedElement
- StrolchRootElement extends ParameterBagContainer
- StrolchRootElement is now required in Queries, not StrolchElement
- New Version object on StrolchRootElement
2016-07-31 14:56:57 +02:00
Robert von Burg 11ba7eb1de [Major] Moved ch.eitchnet to li.strolch 2016-06-26 11:38:41 +02:00
Robert von Burg c404c56b8a [Major] Refactored startup so a Version must always be set
This implies having an appVersion.properties in each project which is an
actual Strolch app.
2016-04-06 21:25:59 +02:00
Robert von Burg a74508ba12 [WIP] Added Resource table loading to planning web 2016-04-01 18:24:35 +02:00
Robert von Burg 0cadf66f3f [Major] Refactored Privilege to use separate mode files
So now users and roles are in their own files. This makes it far easier
to add new privileges without needing to take care if the user changed
their data.
2016-02-28 19:54:17 +01:00
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
Robert von Burg 5675027f6c [Minor] removed the PrivilegeAdmin role from all PrivilegeModel.xml 2015-03-12 17:43:42 +01:00
Robert von Burg 5602f56c15 [Major] allow user to change their own locale incl. auto persist 2015-03-08 21:44:35 +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 8593ab4a15 [Minor] fixed broken test due to change in value time format 2014-10-09 13:23:06 +02: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 956d61f32e [Minor] fixed test to really check getting order by locator 2014-09-28 23:39:16 +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