@@ -0,0 +1,1980 @@
+package uk.ac.ox.oucs.oauth.dao;%0A%0Aimport uk.ac.ox.oucs.oauth.domain.Accessor;%0Aimport uk.ac.ox.oucs.oauth.domain.Consumer;%0A%0Aimport java.util.Collection;%0A%0A/**%0A * Delegate method to access the OAuthDAO.%0A * %3Cp%3E%0A * As the DAO might work with Hibernate, and everything Hibernate related has to be in Shared, the DAO interface is in the API.%0A * Even so, the DAO shouldn't be used (except in here), so the interface is package-visible, and the only way to access to it%0A * is by creating a delegate class to do every call.%0A * %3C/p%3E%0A * %3Cp%3E%0A * This shouldn't be used anywhere else for obvious security reasons!%0A * %3C/p%3E%0A *%0A * @author Colin Hebert%0A */%0Apublic class OAuthProvider %7B%0A    private AccessorDao accessorDao;%0A    private ConsumerDao consumerDao;%0A%0A    public void setAccessorDao(AccessorDao accessorDao) %7B%0A        this.accessorDao = accessorDao;%0A    %7D%0A%0A    public void setConsumerDao(ConsumerDao consumerDao) %7B%0A        this.consumerDao = consumerDao;%0A    %7D%0A%0A    public void createAccessor(Accessor accessor) %7B%0A        accessorDao.create(accessor);%0A    %7D%0A%0A    public Accessor getAccessor(String accessorId) %7B%0A        return accessorDao.get(accessorId);%0A    %7D%0A%0A    public Collection%3CAccessor%3E getAccessorsByUser(String userId) %7B%0A        return accessorDao.getByUser(userId);%0A    %7D%0A%0A    public Accessor updateAccessor(Accessor accessor) %7B%0A        return accessorDao.update(accessor);%0A    %7D%0A%0A    public void removeAccessor(Accessor accessor) %7B%0A        accessorDao.remove(accessor);%0A    %7D%0A%0A    public void markExpiredAccessors() %7B%0A        accessorDao.markExpiredAccessors();%0A    %7D%0A%0A    public void createConsumer(Consumer consumer) %7B%0A        consumerDao.create(consumer);%0A    %7D%0A%0A    public Consumer getConsumer(String consumerId) %7B%0A        return consumerDao.get(consumerId);%0A    %7D%0A%0A    public Consumer updateConsumer(Consumer consumer) %7B%0A        return consumerDao.update(consumer);%0A    %7D%0A%0A    public void removeConsumer(String consumerId) %7B%0A        consumerDao.remove(consumerId);%0A    %7D%0A%7D%0A

Create a delegate class to access DAO from within the impl