it.openutils.hibernate.security.services
Interface SecurityRuleManager

All Known Implementing Classes:
SecurityRuleManagerImpl

public interface SecurityRuleManager

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

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 update(SecurityRule securityRule)
           
 

Method Detail

findAll

java.util.List<SecurityRule> findAll()
Returns:
All the defined SecurityRules.

findFiltered

java.util.List<SecurityRule> findFiltered(SecurityRule filter)
Parameters:
filter - The SecurityRule to use as search filter
Returns:
The list of matching SecurityRules.

load

SecurityRule load(java.lang.Long id)
Parameters:
id - The id of the SecurityRule to load
Returns:
The SecurityRule with the given id

loadIfAvailable

SecurityRule loadIfAvailable(java.lang.Long id)
Parameters:
id - The id of the SecurityRule to load
Returns:
The SecurityRule with the given id, or null if it is not found

delete

void delete(SecurityRule securityRule)
Parameters:
securityRule - The security rule to remove

saveOrUpdate

void saveOrUpdate(SecurityRule securityRule)
Parameters:
securityRule - The SecurityRule to save or update

save

java.lang.Long save(SecurityRule securityRule)
Parameters:
securityRule - The SecurityRule to save
Returns:
The id of the saved SecurityRule

update

void update(SecurityRule securityRule)
Parameters:
securityRule - The SecurityRule to update

getEntityFilterFromRules

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
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

getRulesForRoles

java.util.List<SecurityRule> getRulesForRoles(java.lang.String entity,
                                              java.util.List<java.lang.String> roles)
Parameters:
entity - The entity name we want rules for
roles - The list of roles
Returns:
The list of security rules matching entity - roles

getRulesForRoles

java.util.List<SecurityRule> getRulesForRoles(java.lang.Object entity,
                                              java.util.List<java.lang.String> roles)
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.