###
### set_serialization.jacl
###
###
###
###
###

proc set_serialization {snames} {


###
### set up globals
###

global AdminConfig
global AdminControl
global AdminApp


set cells [$AdminConfig list Cell]

foreach cell $cells {
     set cname [$AdminConfig showAttribute $cell name]
     set nodes [$AdminConfig list Node $cell]

     puts " "
     puts "Cell: $cname         "

     foreach node $nodes {

        set nname [$AdminConfig showAttribute $node name]
        puts " "
        puts "Node: $nname            "


        foreach sname $snames {


            puts " "
            puts "Server: $sname"

            set serverid [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/]

            if {[llength $serverid] == 0} {
               puts "Serverid null - returning "
               continue 
            }

            set SessionManager [$AdminConfig list SessionManager $serverid]


$AdminConfig modify $SessionManager {{accessSessionOnTimeout true} {allowSerializedSessionAccess false} {defaultCookieSettings {{domain {}} {maximumAge -1} {name JSESSIONID} {path /} {secure false}}} {enable true} {enableCookies true} {enableProtocolSwitchRewriting false} {enableSSLTracking false} {enableSecurityIntegration false} {enableUrlRewriting false} {maxWaitTime 5} {properties {}} {sessionDatabasePersistence {{datasourceJNDIName jdbc/Sessions} {db2RowSize ROW_SIZE_4KB} {password *****} {tableSpaceName {}} {userId db2admin}}} {sessionPersistenceMode NONE} {tuningParams {{allowOverflow true} {invalidationSchedule {{firstHour 14} {secondHour 2}}} {invalidationTimeout 30} {maxInMemorySessionCount 1000} {scheduleInvalidation false} {usingMultiRowSchema false} {writeContents ONLY_UPDATED_ATTRIBUTES} {writeFrequency TIME_BASED_WRITE} {writeInterval 10}}}} 


        }
    }
}

$AdminConfig save

}



###
### Main
###
### Test servers: nap_1_1 nap_2_1 
###


if { !($argc == 1) } {
   puts ""
   puts "Usage: , "
   puts " "
   puts "wsadmin.sh -username system -password password -f set_serialization.jacl \"server1 server2 ...\""
} else { 
   set xservers      [lindex $argv 0]  
   set_serialization $xservers 
}