2788N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2788N/A<!DOCTYPE stax SYSTEM "/stax.dtd">
2788N/A<!--
2788N/A ! CDDL HEADER START
2788N/A !
2788N/A ! The contents of this file are subject to the terms of the
2788N/A ! Common Development and Distribution License, Version 1.0 only
2788N/A ! (the "License"). You may not use this file except in compliance
2788N/A ! with the License.
2788N/A !
6982N/A ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
6982N/A ! or http://forgerock.org/license/CDDLv1.0.html.
2788N/A ! See the License for the specific language governing permissions
2788N/A ! and limitations under the License.
2788N/A !
2788N/A ! When distributing Covered Code, include this CDDL HEADER in each
6982N/A ! file and include the License file at legal-notices/CDDLv1_0.txt.
6982N/A ! If applicable, add the following below this CDDL HEADER, with the
6982N/A ! fields enclosed by brackets "[]" replaced with your own identifying
6982N/A ! information:
2788N/A ! Portions Copyright [yyyy] [name of copyright owner]
2788N/A !
2788N/A ! CDDL HEADER END
2788N/A !
4716N/A ! Copyright 2007-2009 Sun Microsystems, Inc.
2788N/A ! -->
2788N/A<stax>
2788N/A <function name="GetDirectoryServerVars">
2788N/A <function-prolog>
2788N/A This function gets variables associated with the Directory Server
2788N/A </function-prolog>
2788N/A <function-map-args>
2788N/A <function-arg-def name="location" type="optional" default="STAXServiceMachine">
2788N/A <function-arg-description>
2788N/A Location of target host
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="hostname"/>
2788N/A </function-arg-def>
4153N/A <function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
2788N/A <function-arg-description>
2788N/A Pathname to installation root
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="hostname"/>
2788N/A </function-arg-def>
2788N/A </function-map-args>
2788N/A
2788N/A <sequence>
2788N/A <script>
2788N/A mylocation=location
2788N/A mypath=dsPath
2788N/A DSInfo=directory_server_information()
2788N/A </script>
2788N/A
2788N/A <message>'Get Information about server %s %s' % (mylocation,dsPath)</message>
2788N/A
2788N/A <!-- Obtain the variables for the system from start-ds -->
2788N/A <call function="'StartDsWithScript'">
2788N/A { 'location' : mylocation,
2788N/A 'dsPath' : mypath,
2788N/A 'dsSystemInfo' : 'true'
2788N/A }
2788N/A </call>
2788N/A
2788N/A <if expr="RC != 0">
2788N/A <message>
2788N/A 'Unable to obtain system information variables for %s %s.' % (mylocation,mypath)
2788N/A </message>
2788N/A <else>
2788N/A <sequence>
2788N/A <message>
2788N/A 'Processing [%s]' % STAXResult
2788N/A </message>
2788N/A <script>
2788N/A DSInfo.SystemList=STAXResult[0][1].split('\n')
2788N/A DSInfo.ServerDict['server version']= \
4716N/A DSInfo.getServerVersion(DSInfo.SystemList[0],PRODUCTNAME)
2788N/A
2788N/A for DSInfo.line in DSInfo.SystemList:
2788N/A DSInfo.key=DSInfo.line[0:DSInfo.line.find(':')].strip()
2788N/A DSInfo.value= \
2788N/A DSInfo.line[DSInfo.line.find(':')+1:len(DSInfo.line)].strip()
2788N/A DSInfo.SystemDict[DSInfo.key]=DSInfo.value
2788N/A
2788N/A DSInfo.ServerDict['server buildid']= \
2788N/A DSInfo.getServerValueFromKey('Build ID',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['java version']= \
3063N/A DSInfo.getServerValueFromKey('JAVA Version',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['java vendor']= \
3063N/A DSInfo.getServerValueFromKey('JAVA Vendor',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['jvm version']= \
2788N/A DSInfo.getServerValueFromKey('JVM Version',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['jvm vendor']= \
2788N/A DSInfo.getServerValueFromKey('JVM Vendor',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['jvm architecture']= \
2788N/A DSInfo.getServerValueFromKey('JVM Architecture',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['system os']= \
2788N/A DSInfo.getServerValueFromKey('Operating System',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['system name']= \
2788N/A DSInfo.getServerValueFromKey('System Name',DSInfo.SystemDict)
2788N/A
2788N/A DSInfoServersDict[mypath]=DSInfo.ServerDict
2788N/A </script>
2788N/A </sequence>
2788N/A </else>
2788N/A </if>
2788N/A
2788N/A <!-- Obtain the secret variables for the system from start-ds -->
2788N/A <call function="'StartDsWithScript'">
2788N/A { 'location' : mylocation,
2788N/A 'dsPath' : mypath,
2788N/A 'dsBuildInfo' : 'true'
2788N/A }
2788N/A </call>
2788N/A
2788N/A <if expr="RC != 0">
2788N/A <message>
2788N/A 'Unable to obtain build information variables for %s %s.' % (mylocation,mypath)
2788N/A </message>
2788N/A <else>
2788N/A <script>
2788N/A DSInfo.SystemList=STAXResult[0][1].split('\n')
2788N/A
2788N/A for DSInfo.line in DSInfo.SystemList:
2788N/A DSInfo.key=DSInfo.line[0:DSInfo.line.find(':')].strip()
2788N/A DSInfo.value= \
2788N/A DSInfo.line[DSInfo.line.find(':')+1:len(DSInfo.line)].strip()
2788N/A DSInfo.SystemDict[DSInfo.key]=DSInfo.value
2788N/A
2788N/A DSInfo.ServerDict['svn revision']= \
2788N/A DSInfo.getServerValueFromKey('Revision Number',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['major version']= \
2788N/A DSInfo.getServerValueFromKey('Major Version',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['minor version']= \
2788N/A DSInfo.getServerValueFromKey('Minor Version',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['point version']= \
2788N/A DSInfo.getServerValueFromKey('Point Version',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['version qualifier']= \
2788N/A DSInfo.getServerValueFromKey('Version Qualifier',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['fix ids']= \
2788N/A DSInfo.getServerValueFromKey('Fix IDs',DSInfo.SystemDict)
2788N/A DSInfo.ServerDict['debug build']= \
2788N/A DSInfo.getServerValueFromKey('Debug Build',DSInfo.SystemDict)
2788N/A </script>
2788N/A </else>
2788N/A </if>
2788N/A </sequence>
2788N/A </function>
2788N/A</stax>