@ Override public IPermission [ ] select ( String owner , String principal , String activity , String target , String type ) throws AuthorizationException { Connection conn = null ; PreparedStatement stmt = null ; ResultSet rs = null ; List < IPermission > perms = new ArrayList < IPermission > ( ) ; String query = getSelectQuery ( owner , principal , activity , target , type ) ; try { conn = RDBMServices . getConnection ( ) ; stmt = conn . prepareStatement ( query ) ; prepareSelectQuery ( stmt , owner , principal , activity , target , type ) ; try { rs = stmt . executeQuery ( ) ; try { while ( rs . next ( ) ) { perms . add ( instanceFromResultSet ( rs ) ) ; } } finally { rs . close ( ) ; } } finally { stmt . close ( ) ; } } catch ( SQLException sqle ) { log . error ( "Problem retrieving permissions" , sqle ) ; throw new AuthorizationException ( "Problem retrieving Permissions [" + sqle . getMessage ( ) + "] for query=[" + query + "] for owner=[" + owner + "] and principal=[" + principal + "] and activity=[" + activity + "] and target=[" + target + "] and type=[" + type + "]" , sqle ) ; } finally { RDBMServices . releaseConnection ( conn ) ; } if ( log . isTraceEnabled ( ) ) { log . trace ( "RDBMPermissionImpl.select(): [" + query + "] for owner=[" + owner + "] and principal=[" + principal + "] and activity=[" + activity + "] and target=[" + target + "] and type=[" + type + "] returned permissions [" + perms + "]" ) ; } return ( ( IPermission [ ] ) perms . toArray ( new IPermission [ perms . size ( ) ] ) ) ; }
Select the Permissions from the store .