private String makeHash ( String request ) throws CacheException { RequestCtx reqCtx = null ; try { reqCtx = m_contextUtil . makeRequestCtx ( request ) ; } catch ( MelcoeXacmlException pe ) { throw new CacheException ( "Error converting request" , pe ) ; } byte [ ] hash = null ; // ensure thread safety, don't want concurrent invocations of this method all modifying digest at once // (alternative is to construct a new digest for each( synchronized ( digest ) { digest . reset ( ) ; hashSubjectList ( reqCtx . getSubjectsAsList ( ) , digest ) ; hashAttributeList ( reqCtx . getResourceAsList ( ) , digest ) ; hashAttributeList ( reqCtx . getActionAsList ( ) , digest ) ; hashAttributeList ( reqCtx . getEnvironmentAttributesAsList ( ) , digest ) ; hash = digest . digest ( ) ; } return byte2hex ( hash ) ; }
Given a request this method generates a hash .