it.openutils.hibernate.security.services.impl
Class SecurityRuleManagerImpl

java.lang.Object
  extended by it.openutils.hibernate.security.services.impl.SecurityRuleManagerImpl
All Implemented Interfaces:
SecurityRuleManager

public class SecurityRuleManagerImpl
extends java.lang.Object
implements SecurityRuleManager

Version:
$Id: SecurityRuleManagerImpl.java 705 2008-02-26 10:56:55Z fcarone $
Author:
fcarone

Constructor Summary
SecurityRuleManagerImpl()
           
 
Method Summary
 void delete(SecurityRule securityRule)
          
 java.util.List<SecurityRule> findAll()
          
 java.util.List<SecurityRule> findFiltered(SecurityRule filter)
          
 org.hibernate.Filter getEntityFilterFromRules(java.lang.String entity, java.util.List<SecurityRule> rules)
          
 java.util.List<SecurityRule> getRulesForRoles(java.lang.Object entity, java.util.List<java.lang.String> roles)
          
 java.util.List<SecurityRule> getRulesForRoles(java.lang.String entity, java.util.List<java.lang.String> roles)
          
 SecurityRule load(java.lang.Long id)
          
 SecurityRule loadIfAvailable(java.lang.Long id)
          
 java.lang.Long save(SecurityRule securityRule)
          
 void saveOrUpdate(SecurityRule securityRule)
          
 void setSecurityRuleDAO(SecurityRuleDAO securityRuleDAO)
          Sets the securityRuleDAO.
 void update(SecurityRule securityRule)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityRuleManagerImpl

public SecurityRuleManagerImpl()
Method Detail

setSecurityRuleDAO

public void setSecurityRuleDAO(SecurityRuleDAO securityRuleDAO)
Sets the securityRuleDAO.

Parameters:
securityRuleDAO - the securityRuleDAO to set

findAll

public java.util.List<SecurityRule> findAll()

Specified by:
findAll in interface SecurityRuleManager
Returns:
All the defined SecurityRules.

findFiltered

public java.util.List<SecurityRule> findFiltered(SecurityRule filter)

Specified by:
findFiltered in interface SecurityRuleManager
Parameters:
filter - The SecurityRule to use as search filter
Returns:
The list of matching SecurityRules.

getEntityFilterFromRules

public org.hibernate.Filter getEntityFilterFromRules(java.lang.String entity,
                                                     java.util.List<SecurityRule> rules)
                                              throws java.lang.SecurityException,
                                                     java.lang.ClassNotFoundException,
                                                     java.lang.InstantiationException,
                                                     java.lang.IllegalAccessException,
                                                     java.lang.NoSuchFieldException

Specified by:
getEntityFilterFromRules in interface SecurityRuleManager
Parameters:
entity - The entity to apply rules for
rules - The list of rules to apply
Returns:
The Hibernate Filter responding to the given criteria
Throws:
java.lang.SecurityException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.NoSuchFieldException

load

public SecurityRule load(java.lang.Long id)

Specified by:
load in interface SecurityRuleManager
Parameters:
id - The id of the SecurityRule to load
Returns:
The SecurityRule with the given id

loadIfAvailable

public SecurityRule loadIfAvailable(java.lang.Long id)

Specified by:
loadIfAvailable in interface SecurityRuleManager
Parameters:
id - The id of the SecurityRule to load
Returns:
The SecurityRule with the given id, or null if it is not found

delete

public void delete(SecurityRule securityRule)

Specified by:
delete in interface SecurityRuleManager
Parameters:
securityRule - The security rule to remove

save

public java.lang.Long save(SecurityRule securityRule)

Specified by:
save in interface SecurityRuleManager
Parameters:
securityRule - The SecurityRule to save
Returns:
The id of the saved SecurityRule

saveOrUpdate

public void saveOrUpdate(SecurityRule securityRule)

Specified by:
saveOrUpdate in interface SecurityRuleManager
Parameters:
securityRule - The SecurityRule to save or update

update

public void update(SecurityRule securityRule)

Specified by:
update in interface SecurityRuleManager
Parameters:
securityRule - The SecurityRule to update

getRulesForRoles

public java.util.List<SecurityRule> getRulesForRoles(java.lang.String entity,
                                                     java.util.List<java.lang.String> roles)

Specified by:
getRulesForRoles in interface SecurityRuleManager
Parameters:
entity - The entity name we want rules for
roles - The list of roles
Returns:
The list of security rules matching entity - roles

getRulesForRoles

public java.util.List<SecurityRule> getRulesForRoles(java.lang.Object entity,
                                                     java.util.List<java.lang.String> roles)

Specified by:
getRulesForRoles in interface SecurityRuleManager
Parameters:
entity - The entity we want rules for
roles - The list of roles
Returns:
The list of security rules matching entity - roles


Copyright © 2008 Openmind. All Rights Reserved.