private void convertEnvParams(Map envParams) throws PolicyException {
  if ((envParams == null) || (envParams.isEmpty())) {
    return;
  }
  Set reqIPSet=(Set)envParams.get(REQUEST_IP);
  String reqIP=null;
  if (reqIPSet != null) {
    if (!reqIPSet.isEmpty()) {
      Iterator items=reqIPSet.iterator();
      reqIP=(String)items.next();
      envParams.put(REQUEST_IP,reqIP);
    }
 else {
      envParams.put(REQUEST_IP,null);
    }
  }
  if (debug.messageEnabled()) {
    debug.message("PolicyRequestHandler.convertEnvParams(): " + REQUEST_IP + " is "+ reqIP);
  }
  Set reqTimeSet=(Set)envParams.get(REQUEST_TIME);
  Long reqTime=null;
  if (reqTimeSet != null) {
    if (!reqTimeSet.isEmpty()) {
      Iterator items=reqTimeSet.iterator();
      String reqTimeStr=(String)items.next();
      reqTime=new Long(reqTimeStr);
      envParams.put(REQUEST_TIME,reqTime);
    }
 else {
      envParams.put(REQUEST_TIME,null);
    }
  }
  if (debug.messageEnabled()) {
    debug.message("PolicyRequestHandler.convertEnvParams(): " + REQUEST_TIME + " is "+ reqTime);
  }
  try {
    Set reqTimeZoneSet=(Set)envParams.get(REQUEST_TIME_ZONE);
    TimeZone reqTimeZone=null;
    if (reqTimeZoneSet != null) {
      if (!reqTimeZoneSet.isEmpty()) {
        Iterator items=reqTimeZoneSet.iterator();
        String reqTimeZoneStr=(String)items.next();
        reqTimeZone=TimeZone.getTimeZone(reqTimeZoneStr);
        envParams.put(REQUEST_TIME_ZONE,reqTimeZone);
      }
 else {
        envParams.put(REQUEST_TIME_ZONE,null);
      }
    }
    if (debug.messageEnabled()) {
      debug.message("PolicyRequestHandler.convertEnvParams(): " + REQUEST_TIME_ZONE + " is "+ reqTimeZone);
    }
  }
 catch (  Exception e) {
    throw new PolicyException(ResBundleUtils.rbName,"invalid_request_time_zone_in_request",null,e);
  }
}

private void convertEnvParams ( Map envParams ) throws PolicyException { if ( ( envParams == null ) || ( envParams . isEmpty ( ) ) ) { return ; } Set reqIPSet = ( Set ) envParams . get ( REQUEST_IP ) ; String reqIP = null ; if ( reqIPSet != null ) { if ( ! reqIPSet . isEmpty ( ) ) { Iterator items = reqIPSet . iterator ( ) ; reqIP = ( String ) items . next ( ) ; envParams . put ( REQUEST_IP , reqIP ) ; } else { envParams . put ( REQUEST_IP , null ) ; } } if ( debug . messageEnabled ( ) ) { debug . message ( "PolicyRequestHandler.convertEnvParams(): " + REQUEST_IP + " is " + reqIP ) ; } Set reqTimeSet = ( Set ) envParams . get ( REQUEST_TIME ) ; Long reqTime = null ; if ( reqTimeSet != null ) { if ( ! reqTimeSet . isEmpty ( ) ) { Iterator items = reqTimeSet . iterator ( ) ; String reqTimeStr = ( String ) items . next ( ) ; reqTime = new Long ( reqTimeStr ) ; envParams . put ( REQUEST_TIME , reqTime ) ; } else { envParams . put ( REQUEST_TIME , null ) ; } } if ( debug . messageEnabled ( ) ) { debug . message ( "PolicyRequestHandler.convertEnvParams(): " + REQUEST_TIME + " is " + reqTime ) ; } try { Set reqTimeZoneSet = ( Set ) envParams . get ( REQUEST_TIME_ZONE ) ; TimeZone reqTimeZone = null ; if ( reqTimeZoneSet != null ) { if ( ! reqTimeZoneSet . isEmpty ( ) ) { Iterator items = reqTimeZoneSet . iterator ( ) ; String reqTimeZoneStr = ( String ) items . next ( ) ; reqTimeZone = TimeZone . getTimeZone ( reqTimeZoneStr ) ; envParams . put ( REQUEST_TIME_ZONE , reqTimeZone ) ; } else { envParams . put ( REQUEST_TIME_ZONE , null ) ; } } if ( debug . messageEnabled ( ) ) { debug . message ( "PolicyRequestHandler.convertEnvParams(): " + REQUEST_TIME_ZONE + " is " + reqTimeZone ) ; } } catch ( Exception e ) { throw new PolicyException ( ResBundleUtils . rbName , "invalid_request_time_zone_in_request" , null , e ) ; } }
convert the environment parameters from sets to their proper data types and put back into the map
