X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=security%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsecurity%2Fauthorization%2Fhibernate%2FPersistentAuthorizationService.java;h=cad84ab0e8d3c64b6dc112e961f470089b8c71e4;hb=17775e14ecfb286e59f67117e5cee7e21e95ab1f;hp=caf69903d72802d48dd142b4c61411ceb9aba9eb;hpb=ddd261f331280640c5b53c7128230b629ebcd268;p=utils diff --git a/security/src/main/java/org/wamblee/security/authorization/hibernate/PersistentAuthorizationService.java b/security/src/main/java/org/wamblee/security/authorization/hibernate/PersistentAuthorizationService.java index caf69903..cad84ab0 100644 --- a/security/src/main/java/org/wamblee/security/authorization/hibernate/PersistentAuthorizationService.java +++ b/security/src/main/java/org/wamblee/security/authorization/hibernate/PersistentAuthorizationService.java @@ -1,18 +1,18 @@ /* - * Copyright 2005 the original author or authors. - * + * Copyright 2005-2010 the original author or authors. + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ package org.wamblee.security.authorization.hibernate; import org.springframework.orm.hibernate3.HibernateTemplate; @@ -29,12 +29,11 @@ import org.wamblee.usermgt.UserAccessor; import java.util.List; - /** * Authorization service with persistent storage. This is a wrapper for - * {@link org.wamblee.security.authorization.DefaultAuthorizationService} - * which refreshes the state of the service at certain time intervals. - * + * {@link org.wamblee.security.authorization.DefaultAuthorizationService} which + * refreshes the state of the service at certain time intervals. + * * @author Erik Brakkee */ public class PersistentAuthorizationService extends AbstractPersistent @@ -79,7 +78,7 @@ public class PersistentAuthorizationService extends AbstractPersistent */ private long lastRefreshTime; -/** + /** * Constructs the persistent service. * * @param aName @@ -95,17 +94,16 @@ public class PersistentAuthorizationService extends AbstractPersistent public PersistentAuthorizationService(String aName, HibernateTemplate aTemplate, UserAccessor aAccessor, long aRefreshInterval) { - template = aTemplate; - refreshInterval = aRefreshInterval; - lastRefreshTime = System.currentTimeMillis(); - userAccessor = aAccessor; - name = aName; + template = aTemplate; + refreshInterval = aRefreshInterval; + lastRefreshTime = System.currentTimeMillis(); + userAccessor = aAccessor; + name = aName; } /** * Initialize service if needed. - * - * @throws IllegalArgumentException DOCUMENT ME! + * */ private void initialize() { if (service == null) { @@ -114,8 +112,8 @@ public class PersistentAuthorizationService extends AbstractPersistent if (result.size() > 1) { throw new IllegalArgumentException( - "Returned more than one service for name '" + name + "' (" - + result.size() + ")"); + "Returned more than one service for name '" + name + "' (" + + result.size() + ")"); } if (result.size() == 0) { @@ -130,17 +128,10 @@ public class PersistentAuthorizationService extends AbstractPersistent /* * (non-Javadoc) - * - * @see org.wamblee.security.authorization.AuthorizationService#isAllowed(java.lang.Object, - * org.wamblee.security.authorization.Operation) - */ - /** - * DOCUMENT ME! - * - * @param aResource DOCUMENT ME! - * @param aOperation DOCUMENT ME! - * - * @return DOCUMENT ME! + * + * @see + * org.wamblee.security.authorization.AuthorizationService#isAllowed(java + * .lang.Object, org.wamblee.security.authorization.Operation) */ public boolean isAllowed(Object aResource, Operation aOperation) { initialize(); @@ -149,17 +140,11 @@ public class PersistentAuthorizationService extends AbstractPersistent return service.isAllowed(aResource, aOperation); } - /* (non-Javadoc) - * @see org.wamblee.security.authorization.AuthorizationService#check(T, org.wamblee.security.authorization.Operation) - */ - /** - * DOCUMENT ME! - * - * @param DOCUMENT ME! - * @param aResource DOCUMENT ME! - * @param aOperation DOCUMENT ME! - * - * @return DOCUMENT ME! + /* + * (non-Javadoc) + * + * @see org.wamblee.security.authorization.AuthorizationService#check(T, + * org.wamblee.security.authorization.Operation) */ public T check(T aResource, Operation aOperation) { initialize(); @@ -170,14 +155,9 @@ public class PersistentAuthorizationService extends AbstractPersistent /* * (non-Javadoc) - * + * * @see org.wamblee.security.authorization.AuthorizationService#getRules() */ - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ public AuthorizationRule[] getRules() { initialize(); refresh(); @@ -187,13 +167,10 @@ public class PersistentAuthorizationService extends AbstractPersistent /* * (non-Javadoc) - * - * @see org.wamblee.security.authorization.AuthorizationService#appendRule(org.wamblee.security.authorization.AuthorizationRule) - */ - /** - * DOCUMENT ME! - * - * @param aRule DOCUMENT ME! + * + * @see + * org.wamblee.security.authorization.AuthorizationService#appendRule(org + * .wamblee.security.authorization.AuthorizationRule) */ public void appendRule(AuthorizationRule aRule) { initialize(); @@ -204,13 +181,9 @@ public class PersistentAuthorizationService extends AbstractPersistent /* * (non-Javadoc) - * - * @see org.wamblee.security.authorization.AuthorizationService#removeRule(int) - */ - /** - * DOCUMENT ME! - * - * @param aIndex DOCUMENT ME! + * + * @see + * org.wamblee.security.authorization.AuthorizationService#removeRule(int) */ public void removeRule(int aIndex) { initialize(); @@ -221,15 +194,10 @@ public class PersistentAuthorizationService extends AbstractPersistent /* * (non-Javadoc) - * - * @see org.wamblee.security.authorization.AuthorizationService#insertRuleAfter(int, - * org.wamblee.security.authorization.AuthorizationRule) - */ - /** - * DOCUMENT ME! - * - * @param aIndex DOCUMENT ME! - * @param aRule DOCUMENT ME! + * + * @see + * org.wamblee.security.authorization.AuthorizationService#insertRuleAfter + * (int, org.wamblee.security.authorization.AuthorizationRule) */ public void insertRuleAfter(int aIndex, AuthorizationRule aRule) { initialize();