Index by: file name | procedure name | procedure call | annotation
createJ2cAuthId_proc.tcl (annotations | original source)

# 
# Install J2C Auth ID.
#
####################################################################
# Patrick Finnegan 23/05/2005.  V1. 
####################################################################

####################################################################
# Create Security Object for database connection.
####################################################################
proc createJ2CAuthId { alias description userId password } {

   putsLog "proc - [info level 0 ]"

# set attributes array

   set attrArray(alias)       $alias  
   set attrArray(description) $description
   set attrArray(userId)      $userId
   set attrArray(password)    $password

   #convert to list and print  

   putsLog "J2C AuthId Properties are..........."

   foreach { a b } [ array get attrArray ] { putsLog [ format "%-25s %s" "$a" "$b" ] }
   
   putsLog "[ string repeat . [ string length "J2C AuthId Properties are..........." ] ]"

   global AdminConfig 
  
   putsLog "List installed JAASAuthData authentication entries"

   set JAASentries [ $AdminConfig list JAASAuthData ] 

   foreach e $JAASentries {

      set subList [ $AdminConfig show $e ]

      foreach e $subList {
         putsLog [ format "%-5s %-30s %-20s" " " [ lindex $e 0 ] [ lindex $e 1 ] ]
      }

      putsLog "" 
   }

   putsLog "Remove Possible Duplicate Entries"

   set i 0

   while { $i < [llength $JAASentries] } {

      putsLog "index is [ lindex [ $AdminConfig show [lindex $JAASentries $i ] ] 0 ]"
      catch { lsearch [ lindex [ $AdminConfig show [lindex $JAASentries $i ] ] 0 ] $attrArray(alias) } r

      if { $r == -1 } {

	  putsLog " no match for $attrArray(alias)"

      } else { 

	    putsLog " **** Delete $attrArray(alias) **** "
            
	    catch { $AdminConfig remove [ lindex $JAASentries $i ] } r

	    putsLog $r
      }

      incr i
   }

   foreach { a b } [ array get attrArray ] { lappend attrList [ list $a $b ] }

   if { [ catch { $AdminConfig create JAASAuthData [$AdminConfig list Security] $attrList } r ] == 0 } { 

	   putsLog "Puts J2CAuthId $attrArray(alias) created successfully" 

   } else {

       return -code error $r 

   }

   putsLog "List installed JAASAuthData authentication entries - confirm change "

   foreach e [ $AdminConfig list JAASAuthData ] {

      set subList [ $AdminConfig show $e ]

      foreach e $subList {
         putsLog [ format "%-5s %-30s %-20s" " " [ lindex $e 0 ] [ lindex $e 1 ] ]
      }

      putsLog "" 
   }
}

Index by: file name | procedure name | procedure call | annotation
File generated 2007-08-07 at 13:42.