/** * Checks to see if subentries for the search and list operations should be * made visible based on the availability of the search request control * * @param opContext the invocation object to use for determining subentry visibility * @return true if subentries should be visible, false otherwise * @throws Exception if there are problems accessing request controls */ private boolean isSubentryVisible( OperationContext opContext ) throws LdapException { if ( !opContext.hasRequestControls() ) { return false; } // found the subentry request control so we return its value if ( opContext.hasRequestControl( SUBENTRY_CONTROL ) ) { SubentriesDecorator subentriesDecorator = ( SubentriesDecorator ) opContext .getRequestControl( SUBENTRY_CONTROL ); return subentriesDecorator.getDecorated().isVisible(); } return false; }