i'd do the following (don't look at the names, it's the idea that counts):
create a clean data access interface (as if you don't need to use the legacy system).
Code:
interface CleanDataInterface{
Book findBook(int id);
}
Your services would use that clean interface.
Then you create an implementation that adopts the method call to the legacy system. (adapter pattern)
Code:
public class AdapterImplementation implements CleanDataInterface{
public Book findBook(int id){
//retrieve principal from securitycontext and get factory,
//probably using a helper class
return legacyDataLayer.findBook(factory.getNeededUserInformation, id);
}
}
If ever you decide to abandon the legacy data system, you only have to write another implementation of the CleanDatainterface, your other layers aren't affected.