Hi,

with ResourceAccessSecurity there's the first service depending on the
ServiceResolver and loaded by the ServiceTracker. For further services we
should use a generic way to handle this.

Another goal is that we can implement operations in this way for different
ServiceResolver in a generic way. For example default operations like
'move' 'copy' 'checkout' 'checkin' can then be implemented for different
Resources (jcr, mongodb).

On next step it can be used by the post servlet to access it via REST.

I implemented a try like this

public interface ServiceMap {


 /**

 * Return the instance of the Service for the requested interface

 *

 * @param requestedInterface The Service or null if not found

 * @return

 */

<T> T getService(Class<T> requestedInterface);

 }

public interface ResourceResolver {

…

    /**

     * Return the service map for this resolver.

     *

     * @return

     */

    ServiceMap getServiceMap();

}

To use a service use

ResourceAccessSecurity  service =
resource.getResourceResolver().getServiceMap().getService(ResourceAccessSecurity.class);

or maybe

MoveOperation  service =
resource.getResourceResolver().getServiceMap().getService(MoveOperation.class);
service.move(resource,targetPath);

Ok, what's the goal?

1. We do not need to change resource providers if we initiate a new service
for resources
2. A generic way to access operations if the service implement an
Operation-Interface via REST / Post-Servlet

What do you think?

Mike

Reply via email to