Here i found a conceptual problem where the *byId() methods didn't
properly resolve ObjectRefs and add them to the TX because, we added the
ObjectRefs to the filter, which made the TX resolve PersistenContexts by
the wrong type.
Now we always add the same type of object to the ObjectFilter; the
PersistentContext. This means that when we call ObjectDao.add(T), etc.
we must already create such the context. This helps resolve another
issue at the back of my mind: We don't want to partially commit a TX if
such a basic information as the object's CTX is not available.
Locking is not yet implemented, but is now prepared. This is once again
a major rewrite but this has lead to easier use and less if/else
constructs but far more object oriented delegation and double
dispatching where possible
it is still not really nice how one has to use the persistence layer,
thus in the test folder i am currently implementing a completely new API
where simple use is central - but not forgetting SAX and DOM being used
transparently.
Changing to the visitor pattern will make it easier to implement a SAX
reader and writer
This is a commit so that i don't loose my work. The code currently does
not compile
Moved the property helper methods from SystemHelper to a new class
PropertiesHelper and added methods where one can pass in the actual
properties thus not being restricted to the system properties
Now the objects put into the cache no longer need to implement an
interface, this makes it easier to adopt the filter in different
scenarios.
Tests written to validate that the filter works as expected. Still some
outstanding tests which currently fail
The problem was due to a naming problem with the PrivilegeMessages class
and property bundle having the same name and being in the same package.
Moved the properties file now to the resources directory
Now the PrivilegeContext object is central and once the user logged in,
this object is bound to a ThreadLocal. From then there is no further
need to interact with the PrivilegeHandler - this allows for
authenticated users to get a remote copy of the PrivilegeContext so that
on a remote client, the user can check for permissions, without having
to do the round trip to the server.
A code review of this change would be good, but preliminary tests show
that it works. A test should now be implemented to check if getting a
remote copy also allows for authorization.