diff --git a/.gitignore b/.gitignore index f40ce70..a01ee28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1 @@ -condor-7.2.4-159529-RH.tar.gz -condor-7.4.3-261829-RH.tar.gz -/condor-7.4.4-279383-RH.tar.gz -/condor-7.5.5-308936-RH.tar.gz -/condor-7.6.0-327697-RH.tar.gz .*.swp diff --git a/7.7.0-catch-up.patch b/7.7.0-catch-up.patch deleted file mode 100644 index bcfe493..0000000 --- a/7.7.0-catch-up.patch +++ /dev/null @@ -1,122246 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e6435f5..b1d1601 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,7 +29,7 @@ set(PACKAGE "condor") - # Condor and other systems parse this number. Keep it simple: - # Number.Number.Number. Do nothing else. If you need to add - # more information, PRE_RELEASE is usually the right location. --set(VERSION "7.6.0") -+set(VERSION "7.7.0") - - # Set PRE_RELEASE to either a string (i.e. "PRE-RELEASE-UWCS") or OFF - # This shuld be "PRE-RELEASE-UWCS most of the time, and OFF when -@@ -37,8 +37,8 @@ set(VERSION "7.6.0") - # perhaps because you are working on a feature branch and need to - # ship test binaries to a user, change this to identify your work. - # Avoid whitespace. --#set(PRE_RELEASE "PRE-RELEASE-UWCS") --set(PRE_RELEASE OFF) -+set(PRE_RELEASE "PRE-RELEASE-UWCS") -+#set(PRE_RELEASE OFF) - - # If set via the cmake command line, FORCE_PRE_RELEASE allows for - # PRE_RELEASE to be forced into a build. -@@ -90,15 +90,18 @@ include (CondorStaticLib) - include (CondorPlugin) - include (CheckCXXCompilerFlag) - include (CheckCXXSourceCompiles) --include (CondorConfigure) # will initiate the configure - include (AddSubdirectories) - include (CondorPLTest) - include (CondorExeTest) - include (CondorStdExeTest) - include (SrcTargetRef) - include (DumpLocalFlags) -+include (CondorPreExternal) -+include (CondorPostExternal) -+include (CondorConfigure) # will initiate the configure - include (TarGz) # Must be after include(CondorPackageConfig) - -+ - if ( WINDOWS ) - set_property(GLOBAL PROPERTY USE_FOLDERS ON) - endif ( WINDOWS ) -diff --git a/build/cmake/CondorConfigure.cmake b/build/cmake/CondorConfigure.cmake -index ad69e0c..6cd9feb 100644 ---- a/build/cmake/CondorConfigure.cmake -+++ b/build/cmake/CondorConfigure.cmake -@@ -128,7 +128,15 @@ if( NOT WINDOWS) - - set(HAVE_PTHREAD_H ${CMAKE_HAVE_PTHREAD_H}) - -- find_library(HAVE_DMTCP dmtcpaware HINTS /usr/local/lib/dmtcp ) -+ find_library( HAVE_DMTCP dmtcpaware HINTS /usr/local/lib/dmtcp ) -+ find_library( LIBRESOLV_PATH resolv ) -+ if( NOT "${LIBRESOLV_PATH}" MATCHES "-NOTFOUND" ) -+ set(HAVE_LIBRESOLV ON) -+ endif() -+ find_library( LIBDL_PATH resolv ) -+ if( NOT "${LIBDL_PATH}" MATCHES "-NOTFOUND" ) -+ set(HAVE_LIBDL ON) -+ endif() - check_library_exists(dl dlopen "" HAVE_DLOPEN) - check_symbol_exists(res_init "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_DECL_RES_INIT) - -@@ -140,7 +148,6 @@ if( NOT WINDOWS) - check_function_exists("_fstati64" HAVE__FSTATI64) - check_function_exists("getdtablesize" HAVE_GETDTABLESIZE) - check_function_exists("getpagesize" HAVE_GETPAGESIZE) -- check_function_exists("getwd" HAVE_GETWD) - check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY) - check_function_exists("inet_ntoa" HAS_INET_NTOA) - check_function_exists("lchown" HAVE_LCHOWN) -@@ -198,7 +205,11 @@ if( NOT WINDOWS) - - check_struct_has_member("struct statfs" f_fstyp "sys/statfs.h" HAVE_STRUCT_STATFS_F_FSTYP) - if (NOT ${OS_NAME} STREQUAL "DARWIN") -- check_struct_has_member("struct statfs" f_fstypename "sys/statfs.h" HAVE_STRUCT_STATFS_F_FSTYPENAME) -+ if( HAVE_SYS_STATFS_H ) -+ check_struct_has_member("struct statfs" f_fstypename "sys/statfs.h" HAVE_STRUCT_STATFS_F_FSTYPENAME ) -+ else() -+ check_struct_has_member("struct statfs" f_fstypename "sys/mount.h" HAVE_STRUCT_STATFS_F_FSTYPENAME ) -+ endif() - endif() - check_struct_has_member("struct statfs" f_type "sys/statfs.h" HAVE_STRUCT_STATFS_F_TYPE) - check_struct_has_member("struct statvfs" f_basetype "sys/types.h;sys/statvfs.h" HAVE_STRUCT_STATVFS_F_BASETYPE) -@@ -307,6 +318,12 @@ elseif(${OS_NAME} STREQUAL "LINUX") - set(HAS_PTHREADS ${CMAKE_USE_PTHREADS_INIT}) - set(HAVE_PTHREADS ${CMAKE_USE_PTHREADS_INIT}) - -+ # Even if the flavor of linux we are compiling on doesn't -+ # have Pss in /proc/pid/smaps, the binaries we generate -+ # may run on some other version of linux that does, so -+ # be optimistic here. -+ set(HAVE_PSS ON) -+ - #The following checks are for std:u only. - glibc_detect( GLIBC_VERSION ) - -@@ -322,6 +339,10 @@ elseif(${OS_NAME} STREQUAL "HPUX") - set(HPUX ON) - set(DOES_SAVE_SIGSTATE ON) - set(NEEDS_64BIT_STRUCTS ON) -+elseif(${OS_NAME} STREQUAL "HPUX") -+ set(HPUX ON) -+ set(DOES_SAVE_SIGSTATE ON) -+ set(NEEDS_64BIT_STRUCTS ON) - endif() - - ################################################## -@@ -338,6 +359,7 @@ option(BUILD_TESTS "Will build internal test applications" ON) - option(WANT_CONTRIB "Enable quill functionality" OFF) - option(WANT_FULL_DEPLOYMENT "Install condors deployment scripts, libs, and includes" ON) - option(WANT_GLEXEC "Build and install condor glexec functionality" ON) -+option(ENABLE_JAVA_TESTS "Enable java tests" ON) - - if (UW_BUILD OR WINDOWS) - option(PROPER "Try to build using native env" OFF) -@@ -397,47 +419,52 @@ if (PROPER) - find_path(HAVE_OPENSSL_SSL_H "openssl/ssl.h") - find_path(HAVE_PCRE_H "pcre.h") - find_path(HAVE_PCRE_PCRE_H "pcre/pcre.h" ) --else(PROPER) -+ option(CACHED_EXTERNALS "enable/disable cached externals" OFF) -+else() - message(STATUS "********* Configuring externals using [uw-externals] a.k.a NONPROPER *********") -- # temporarily disable cacheing externals on windows, primarily b/c of nmi. -- option(SCRATCH_EXTERNALS "Will put the externals into scratch location" OFF) -- -+ option(CACHED_EXTERNALS "enable/disable cached externals" ON) - endif(PROPER) - --## this primarily exists for nmi cached building.. yuk! --if (SCRATCH_EXTERNALS AND EXISTS "/scratch/externals/cmake") -- if (WINDOWS) -- set (EXTERNAL_STAGE C:/temp/${PACKAGE_NAME}) -- set (EXTERNAL_DL C:/temp/${PACKAGE_NAME}/download) -- else(WINDOWS) -- set (EXTERNAL_STAGE /scratch/externals/cmake/${PACKAGE_NAME}_${PACKAGE_VERSION}/stage/root) -- set (EXTERNAL_DL /scratch/externals/cmake/${PACKAGE_NAME}_${PACKAGE_VERSION}/externals/stage/download) -- -- set (EXTERNAL_MOD_DEP /scratch/externals/cmake/${PACKAGE_NAME}_${PACKAGE_VERSION}/mod.txt) -- add_custom_command( -- OUTPUT ${EXTERNAL_MOD_DEP} -- COMMAND chmod -- ARGS -f -R a+rwX /scratch/externals/cmake && touch ${EXTERNAL_MOD_DEP} -- COMMENT "changing ownership on externals cache because so on multiple user machines they can take advantage" ) -- endif(WINDOWS) -+if (WINDOWS) -+ -+ if (NOT EXTERNAL_STAGE) -+ # the environment variable CONDOR_BLD_EXTERNAL_STAGE will be set to the -+ # path for externals if the invoker wants shared externals. otherwise -+ # just build externals in a sub-directory of the project directory -+ # -+ set (EXTERNAL_STAGE $ENV{CONDOR_BLD_EXTERNAL_STAGE}) -+ if (EXTERNAL_STAGE) -+ # cmake doesn't like windows paths, so make sure that this path separators are unix style -+ string (REPLACE "\\" "/" EXTERNAL_STAGE "${EXTERNAL_STAGE}") -+ else() -+ set (EXTERNAL_STAGE ${CMAKE_CURRENT_BINARY_DIR}/bld_external) -+ endif() -+ -+ endif() -+ - else() -- set (EXTERNAL_STAGE ${CMAKE_CURRENT_BINARY_DIR}/externals/stage/root/${PACKAGE_NAME}_${PACKAGE_VERSION}) -- set (EXTERNAL_DL ${CMAKE_CURRENT_BINARY_DIR}/externals/stage/download/${PACKAGE_NAME}_${PACKAGE_VERSION}) --endif() -+ -+ if (NOT EXTERNAL_STAGE) -+ # temporarily disable AFS cache. -+ #if ( EXISTS /p/condor/workspaces/externals ) -+ # set (EXTERNAL_STAGE /p/condor/workspaces/externals/cmake/${OS_NAME}/${SYS_ARCH}) -+ #else() -+ # in case someone tries something funky insert OS & ARCH in path -+ set (EXTERNAL_STAGE /scratch/condor_externals) #${OS_NAME}/${SYS_ARCH}) -+ #endif() -+ endif() - --dprint("EXTERNAL_STAGE=${EXTERNAL_STAGE}") --set (EXTERNAL_BUILD_PREFIX ${EXTERNAL_STAGE}/opt) -+endif(WINDOWS) - --# let cmake carve out the paths for the externals --file (MAKE_DIRECTORY ${EXTERNAL_DL} -- ${EXTERNAL_STAGE}/include -- ${EXTERNAL_STAGE}/lib -- ${EXTERNAL_STAGE}/lib64 -- ${EXTERNAL_STAGE}/opt -- ${EXTERNAL_STAGE}/src ) -+# instead of clausing above over-ride if not defined. -+if (NOT CACHED_EXTERNALS) -+ set (EXTERNAL_STAGE ${CMAKE_CURRENT_BINARY_DIR}/bld_external) -+endif() - --include_directories( ${EXTERNAL_STAGE}/include ) --link_directories( ${EXTERNAL_STAGE}/lib64 ${EXTERNAL_STAGE}/lib ) -+dprint("EXTERNAL_STAGE=${EXTERNAL_STAGE}") -+if (NOT EXISTS ${EXTERNAL_STAGE}) -+ file ( MAKE_DIRECTORY ${EXTERNAL_STAGE} ) -+endif() - - ########################################### - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/boost/1.39.0) -@@ -454,18 +481,20 @@ add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/postgresql/8.2.3-p1) - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/drmaa/1.6) - - if (NOT WINDOWS) -- add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/coredumper/0.2) -+ add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/coredumper/2011.05.24-r31) - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/unicoregahp/1.2.0) - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/expat/2.0.1) - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libxml2/2.7.3) - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libvirt/0.6.2) -- add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libdeltacloud/0.7) -+ add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libdeltacloud/0.8) -+ add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libcgroup/0.37) - - # globus is an odd *beast* which requires a bit more config. - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/globus/5.0.1-p1) - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/blahp/1.16.1) - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/voms/1.9.10_4) - add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/cream/1.12.1_14) -+ add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/wso2/2.1.0) - - # the following logic if for standard universe *only* - if (LINUX AND NOT CLIPPED AND GLIBC_VERSION AND NOT PROPER) -@@ -528,8 +557,8 @@ add_definitions(-DHAVE_CONFIG_H) - - ########################################### - # include and link locations --include_directories(${EXTERNAL_STAGE}/include ${EXTERNAL_INCLUDES} ) --link_directories(${EXTERNAL_STAGE}/lib) -+include_directories( ${CONDOR_EXTERNAL_INCLUDE_DIRS} ) -+link_directories( ${CONDOR_EXTERNAL_LINK_DIRS} ) - - if ( $ENV{JAVA_HOME} ) - include_directories($ENV{JAVA_HOME}/include) -@@ -669,7 +698,7 @@ else(MSVC) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--warn-once -Wl,--warn-common") - endif(LINUX) - -- if(HAVE_DLOPEN AND NOT DARWIN) -+ if( HAVE_LIBDL AND NOT BSD_UNIX ) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ldl") - endif() - -@@ -678,7 +707,7 @@ else(MSVC) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-berok -Wl,-bstatic -lstdc++ -Wl,-bdynamic -lcfg -lodm -static-libgcc") - endif(AIX) - -- if (NOT PROPER AND NOT AIX) -+ if ( NOT PROPER AND HAVE_LIBRESOLV ) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lresolv") - if (NOT DARWIN) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lcrypt") -@@ -818,9 +847,15 @@ dprint ( "CONDOR_PACKAGE_NAME: ${CONDOR_PACKAGE_NAME}" ) - # is TRUE on all UNIX-like OS's, including Apple OS X and CygWin - dprint ( "UNIX: ${UNIX}" ) - -+# is TRUE on all BSD-derived UNIXen -+dprint ( "BSD_UNIX: ${BSD_UNIX}" ) -+ - # is TRUE on all UNIX-like OS's, including Apple OS X and CygWin - dprint ( "Linux: ${LINUX_NAME}" ) - -+# Print FreeBSD info -+dprint ( "FreeBSD: ${FREEBSD_MAJOR}.${FREEBSD_MINOR}" ) -+ - # is TRUE on Windows, including CygWin - dprint ( "WIN32: ${WIN32}" ) - -diff --git a/build/cmake/CondorPackageConfig.cmake b/build/cmake/CondorPackageConfig.cmake -index 57b2700..b42e414 100644 ---- a/build/cmake/CondorPackageConfig.cmake -+++ b/build/cmake/CondorPackageConfig.cmake -@@ -119,6 +119,7 @@ set( C_INCLUDE include) - set( C_MAN man) - set( C_SRC src) - set( C_SQL sql) -+set( C_SERVICES services) - - set( C_INIT etc/init.d ) - set( C_ETC etc/examples ) -@@ -152,6 +153,7 @@ elseif ( ${OS_NAME} MATCHES "WIN" ) - set( C_SBIN bin ) - set( C_ETC etc ) - -+ set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) - set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CONDOR_PACKAGE_NAME}") - set (CPACK_PACKAGE_FILE_NAME "${CONDOR_PACKAGE_NAME}") - set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CONDOR_VERSION}") -diff --git a/build/cmake/macros/CondorPostExternal.cmake b/build/cmake/macros/CondorPostExternal.cmake -new file mode 100644 -index 0000000..20208db ---- /dev/null -+++ b/build/cmake/macros/CondorPostExternal.cmake -@@ -0,0 +1,54 @@ -+ ############################################################### -+ # -+ # Copyright 2011 Red Hat, Inc. -+ # -+ # Licensed under the Apache License, Version 2.0 (the "License"); you -+ # may not use this file except in compliance with the License. You may -+ # obtain a copy of the License at -+ # -+ # http://www.apache.org/licenses/LICENSE-2.0 -+ # -+ # Unless required by applicable law or agreed to in writing, software -+ # distributed under the License is distributed on an "AS IS" BASIS, -+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ # See the License for the specific language governing permissions and -+ # limitations under the License. -+ # -+ ############################################################### -+ -+MACRO (CONDOR_POST_EXTERNAL _TARGET _INC_DIR _LIB_DIR) -+ -+ string( TOUPPER "${_TARGET}" _UP_TARGET ) -+ -+ if (WINDOWS) -+ set_property( TARGET ${_TARGET} PROPERTY FOLDER "externals" ) -+ endif() -+ -+ # if a local built copy exists disable from all build -+ if ( ${_UP_TARGET}_PREBUILT ) -+ set_target_properties( ${_TARGET} PROPERTIES EXCLUDE_FROM_ALL TRUE) -+ message (STATUS "--> (${_TARGET}): excluded from all target, cached version exists") -+ else() -+ append_var(CONDOR_EXTERNALS ${_TARGET}) -+ append_var(${_UP_TARGET}_REF ${_TARGET}) -+ endif() -+ -+ set( ${_UP_TARGET}_FOUND ${${_UP_TARGET}_FOUND} PARENT_SCOPE ) -+ set( HAVE_EXT_${_UP_TARGET} ON PARENT_SCOPE ) -+ -+ # used by --with packages -+ set( ${_UP_TARGET}_INSTALL_LOC ${${_UP_TARGET}_INSTALL_LOC} PARENT_SCOPE) -+ -+ set(${_TARGET}INCLUDE ${_INC_DIR}) -+ if(${_TARGET}INCLUDE) -+ append_var(CONDOR_EXTERNAL_INCLUDE_DIRS ${${_UP_TARGET}_INSTALL_LOC}/${_INC_DIR}) -+ append_var(${_UP_TARGET}_INCLUDE ${${_UP_TARGET}_INSTALL_LOC}/${_INC_DIR}) -+ endif() -+ -+ set(${_TARGET}LINK ${_LIB_DIR}) -+ if(${_TARGET}LINK) -+ append_var(CONDOR_EXTERNAL_LINK_DIRS ${${_UP_TARGET}_INSTALL_LOC}/${_LIB_DIR}) -+ append_var(${_UP_TARGET}_LD ${${_UP_TARGET}_INSTALL_LOC}/${_LIB_DIR}) -+ endif() -+ -+ENDMACRO(CONDOR_POST_EXTERNAL) -diff --git a/build/cmake/macros/CondorPreExternal.cmake b/build/cmake/macros/CondorPreExternal.cmake -new file mode 100644 -index 0000000..c4c790c ---- /dev/null -+++ b/build/cmake/macros/CondorPreExternal.cmake -@@ -0,0 +1,53 @@ -+ ############################################################### -+ # -+ # Copyright 2011 Red Hat, Inc. -+ # -+ # Licensed under the Apache License, Version 2.0 (the "License"); you -+ # may not use this file except in compliance with the License. You may -+ # obtain a copy of the License at -+ # -+ # http://www.apache.org/licenses/LICENSE-2.0 -+ # -+ # Unless required by applicable law or agreed to in writing, software -+ # distributed under the License is distributed on an "AS IS" BASIS, -+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ # See the License for the specific language governing permissions and -+ # limitations under the License. -+ # -+ ############################################################### -+ -+ -+################################################################ -+# -+# -+# -+# The macro defines the following variables: -+# ${_TARGET_VER} - equal to input ${_VER} -+# ${_TARGET}_STAGE - base location where files will be placed -+# ${_TARGET}_INSTALL_LOC - install location which will be used as reference -+# ${_TARGET}_PREBUILT - indicates if it is prebuilt used by condor_post_external -+# Example usage: -+# condor_pre_external(DRMAA drmaa-1.6 "include;lib" "include/drmaa.h") -+ -+MACRO (CONDOR_PRE_EXTERNAL _TARGET _VER _INSTALL_DIRS _EXISTANCE_CHECK ) -+ -+ # set variables which will be used throughout -+ set ( ${_TARGET}_VER ${_VER} ) -+ set ( ${_TARGET}_STAGE ${EXTERNAL_STAGE}/${${_TARGET}_VER} ) -+ set ( ${_TARGET}_INSTALL_LOC ${${_TARGET}_STAGE}/install ) -+ -+ file ( MAKE_DIRECTORY ${${_TARGET}_INSTALL_LOC} ) -+ foreach ( dir ${_INSTALL_DIRS} ) -+ if (NOT EXISTS ${${_TARGET}_INSTALL_LOC}/${dir}) -+ file ( MAKE_DIRECTORY ${${_TARGET}_INSTALL_LOC}/${dir} ) -+ endif() -+ endforeach(dir) -+ -+ # Check for existance of -+ #message (STATUS "Checking ${${_TARGET}_INSTALL_LOC}/${_EXISTANCE_CHECK}") -+ if ( EXISTS ${${_TARGET}_INSTALL_LOC}/${_EXISTANCE_CHECK} ) -+ #message (STATUS "FOUND!") -+ set (${_TARGET}_PREBUILT ON ) -+ endif() -+ -+ENDMACRO (CONDOR_PRE_EXTERNAL) -diff --git a/build/cmake/macros/SystemSpecificInformations.cmake b/build/cmake/macros/SystemSpecificInformations.cmake -index 125de4b..a694153 100644 ---- a/build/cmake/macros/SystemSpecificInformations.cmake -+++ b/build/cmake/macros/SystemSpecificInformations.cmake -@@ -227,9 +227,41 @@ if(UNIX) - else() - set(LINUX_NAME "NOT-FOUND") - endif(LINUX_NAME) -+ endif(EXISTS "/etc/issue") -+ -+ elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") -+ string(REGEX MATCH "(([0-9]+)\\.([0-9]+))-RELEASE" FREEBSD "${CMAKE_SYSTEM_VERSION}") -+ set( FREEBSD_RELEASE "${CMAKE_MATCH_1}" ) -+ set( FREEBSD_MAJOR "${CMAKE_MATCH_2}" ) -+ set( FREEBSD_MINOR "${CMAKE_MATCH_3}" ) -+ set( FREEBSD_VERSION "${CMAKE_SYSTEM_VERSION}" ) -+ set( SYSTEM_NAME "freebsd_${FREEBSD_RELEASE}" ) -+ set( CONDOR_FREEBSD ON ) -+ set( BSD_UNIX ON ) -+ if(FREEBSD_MAJOR MATCHES "4" ) -+ set( CONDOR_FREEBSD4 ON ) -+ elseif(FREEBSD_MAJOR MATCHES "5" ) -+ set( CONDOR_FREEBSD5 ON ) -+ elseif(FREEBSD_MAJOR MATCHES "6" ) -+ set( CONDOR_FREEBSD6 ON ) -+ elseif(FREEBSD_MAJOR MATCHES "7" ) -+ set( CONDOR_FREEBSD7 ON ) -+ elseif(FREEBSD_MAJOR MATCHES "8" ) -+ set( CONDOR_FREEBSD8 ON ) -+ endif() -+ if( CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" ) -+ set( SYS_ARCH "x86_64") -+ elseif( CMAKE_SYSTEM_PROCESSOR MATCHES "i386" ) -+ set( SYS_ARCH "x86") -+ endif( ) -+ set( PLATFORM "${SYS_ARCH}_freebsd_${FREEBSD_RELEASE}") -+ -+ elseif(OS_NAME MATCHES "DARWIN") -+ set( BSD_UNIX ON ) - -- endif(EXISTS "/etc/issue") - endif(CMAKE_SYSTEM_NAME MATCHES "Linux") -+ - set(SPECIFIC_SYSTEM_VERSION_NAME "${SPECIFIC_SYSTEM_VERSION_NAME}-${CMAKE_SYSTEM_PROCESSOR}") - set(SPECIFIC_COMPILER_NAME "") -+ - endif(UNIX) -diff --git a/build/cmake/macros/gSOAPGen.cmake b/build/cmake/macros/gSOAPGen.cmake -index 08515f8..734a5eb 100644 ---- a/build/cmake/macros/gSOAPGen.cmake -+++ b/build/cmake/macros/gSOAPGen.cmake -@@ -50,8 +50,8 @@ if ( HAVE_EXT_GSOAP ) - ALL - DEPENDS ${${_DAEMON}_SOAP_SRCS} ) - -- if (NOT PROPER) -- add_dependencies( gen_${_DAEMON}_soapfiles gsoap ) -+ if (NOT PROPER AND GSOAP_REF) -+ add_dependencies( gen_${_DAEMON}_soapfiles ${GSOAP_REF} ) - endif() - - if (WINDOWS) -diff --git a/build/cmake/modules/ExternalProjectPatched.cmake b/build/cmake/modules/ExternalProjectPatched.cmake -index 0fc4633..816b7f2 100644 ---- a/build/cmake/modules/ExternalProjectPatched.cmake -+++ b/build/cmake/modules/ExternalProjectPatched.cmake -@@ -264,6 +264,10 @@ function(_ep_write_extractfile_script script_filename filename tmp directory) - set(args xfz) - endif() - -+ if(filename MATCHES ".bz2$") -+ set(args xfj) -+ endif() -+ - if(filename MATCHES ".tar.gz$") - set(args xfz) - endif() -@@ -403,7 +407,9 @@ function(_ep_set_directories name) - foreach(var ${places}) - string(TOUPPER "${var}" VAR) - get_property(dir TARGET ${name} PROPERTY _EP_${VAR}_DIR) -- file(MAKE_DIRECTORY "${dir}") -+ if(NOT EXISTS "${dir}") -+ file(MAKE_DIRECTORY "${dir}") -+ endif() - if(NOT EXISTS "${dir}") - message(FATAL_ERROR "dir '${dir}' does not exist after file(MAKE_DIRECTORY)") - endif() -@@ -648,7 +654,7 @@ function(_ep_add_download_command name) - set(work_dir ${download_dir}) - - string(REGEX MATCH "[^/]*$" fname "${url}") -- if(NOT "${fname}" MATCHES "\\.(tar|tgz|zip|tar\\.gz)$") -+ if(NOT "${fname}" MATCHES "\\.(tar|tgz|zip|tar\\.gz|bz2)$") - message(FATAL_ERROR "Could not extract tarball filename from url:\n ${url}") - endif() - -diff --git a/externals/bundles/blahp/1.16.1/CMakeLists.txt b/externals/bundles/blahp/1.16.1/CMakeLists.txt -index 2e23ac6..3ba9b82 100644 ---- a/externals/bundles/blahp/1.16.1/CMakeLists.txt -+++ b/externals/bundles/blahp/1.16.1/CMakeLists.txt -@@ -28,32 +28,33 @@ if ( WITH_BLAHP ) - if ( NOT PROPER ) - message(STATUS "TODO:TSTCLAIR BLAHP eval if linking correct popt w/o mundging Makefile.am") - -- set(POPT_VER popt-1.14) -- set(BLAHP_VER blahp-1.16.1) -+ ######################################## -+ condor_pre_external( POPT popt-1.14 "lib;include" "lib/libpopt.a") - - ExternalProject_Add(popt -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${POPT_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${POPT_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${POPT_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${POPT_VER}.tar.gz - #--Configure step ---------- -- CONFIGURE_COMMAND cd ${POPT_VER} && ./configure --prefix=${EXTERNAL_STAGE} -+ CONFIGURE_COMMAND cd ${POPT_VER} && ./configure --prefix=${POPT_INSTALL_LOC} - #--Build Step ---------- - BUILD_COMMAND cd ${POPT_VER} && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${POPT_INSTALL_LOC} - INSTALL_COMMAND cd ${POPT_VER} && make install ) - -- #dprint("we ingore the return param from bootstrap.. there are errors!") -+ condor_post_external( popt OFF OFF ) - -+ ######################################## -+ condor_pre_external( BLAHP blahp-1.16.1 "lib;include" "done") -+ - ExternalProject_Add(blahp -- DEPENDS openssl globus popt -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${BLAHP_VER} -+ DEPENDS ${OPENSSL_REF} ${GLOBUS_REF} ${POPT_REF} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${BLAHP_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${BLAHP_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${BLAHP_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND patch -i ${CMAKE_CURRENT_SOURCE_DIR}/classad.patch -p0 && -@@ -67,27 +68,27 @@ if ( WITH_BLAHP ) - mv org.glite.ce.blahp/config/blah.config.template org.glite.ce.blahp/config/batch_gahp.config.template - #--Configure step ---------- - CONFIGURE_COMMAND cd org.glite.ce.blahp && -- ./bootstrap || ./configure --with-classads-prefix=${EXTERNAL_STAGE} -- --with-openssl-prefix=${EXTERNAL_STAGE} -- --with-globus-prefix=${EXTERNAL_STAGE} -+ ./bootstrap || ./configure --with-classads-prefix=${CLASSADS_INSTALL_LOC} -+ --with-openssl-prefix=${OPENSSL_INSTALL_LOC} -+ --with-globus-prefix=${GLOBUS_INSTALL_LOC} - --with-globus-nothr-flavor=gcc${BIT_MODE}dbg -- --prefix=${EXTERNAL_STAGE}/opt/glite -+ --prefix=${BLAHP_INSTALL_LOC}/opt/glite - #--Build Step ---------- - BUILD_COMMAND cd org.glite.ce.blahp && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd org.glite.ce.blahp && make install ) -+ INSTALL_DIR ${BLAHP_INSTALL_LOC} -+ INSTALL_COMMAND cd org.glite.ce.blahp && make install && touch ${BLAHP_INSTALL_LOC}/done ) -+ -+ add_dependencies(blahp ${CLASSADS_FOUND}) - - ### set the install -- install ( DIRECTORY ${EXTERNAL_STAGE}/opt/glite DESTINATION ${C_LIBEXEC} USE_SOURCE_PERMISSIONS ) -+ install ( DIRECTORY ${BLAHP_INSTALL_LOC}/opt/glite DESTINATION ${C_LIBEXEC} USE_SOURCE_PERMISSIONS ) - -- add_dependencies(blahp classads) -+ condor_post_external( blahp OFF OFF ) - - set(BLAHP_FOUND ON) - -- append_var (CONDOR_EXTERNALS blahp) -- - else ( NOT PROPER ) - - find_program( BLAHP_FOUND BLClient HINTS /usr/bin ) -@@ -99,7 +100,6 @@ if ( WITH_BLAHP ) - endif( WITH_BLAHP ) - - if ( BLAHP_FOUND ) -- - message( STATUS "external configured (blahp) BLAHP_FOUND=${BLAHP_FOUND}" ) - set( BLAHP_FOUND ${BLAHP_FOUND} PARENT_SCOPE ) - set( HAVE_EXT_BLAHP ON PARENT_SCOPE ) -diff --git a/externals/bundles/blahp/1.16.1/classads.m4 b/externals/bundles/blahp/1.16.1/classads.m4 -index 424536f..33608eb 100644 ---- a/externals/bundles/blahp/1.16.1/classads.m4 -+++ b/externals/bundles/blahp/1.16.1/classads.m4 -@@ -16,7 +16,7 @@ AC_DEFUN(AC_CLASSADS, - AC_MSG_CHECKING([for CLASSAD installation]) - - CLASSAD_CFLAGS="" -- CLASSAD_LIBS="-lclassad_ns -lpcre" -+ CLASSAD_LIBS="-lclassad -lpcre" - CLASSAD_DL_LIBS="-lclassad_dl" - if test -n "$with_classads_prefix" -a "$with_classads_prefix" != "/usr" ; then - AC_MSG_RESULT([prefix: $with_classads_prefix]) -@@ -24,7 +24,7 @@ AC_DEFUN(AC_CLASSADS, - ac_classads_prefix=$with_classads_prefix - - CLASSAD_CFLAGS="-I$with_classads_prefix/include" -- CLASSAD_LIBS="$with_classads_prefix/lib/libclassad_ns.a $with_classads_prefix/lib/libpcre.a" -+ CLASSAD_LIBS="$with_classads_prefix/lib/libclassad.a $with_classads_prefix/lib/libpcre.a" - CLASSAD_DL_LIBS="-L$with_classads_prefix/lib $CLASSAD_DL_LIBS" - fi - -diff --git a/externals/bundles/boost/1.39.0/CMakeLists.txt b/externals/bundles/boost/1.39.0/CMakeLists.txt -index 3d58fcf..10c2d77 100644 ---- a/externals/bundles/boost/1.39.0/CMakeLists.txt -+++ b/externals/bundles/boost/1.39.0/CMakeLists.txt -@@ -28,6 +28,8 @@ if (WITH_BOOST ) - - if (NOT PROPER) - -+ condor_pre_external( BOOST boost_1_39_0 "lib;include" "include/boost") -+ - if (WINDOWS) - # need to expand the configure and - set(TOOLSET msvc) -@@ -51,7 +53,7 @@ if (WITH_BOOST ) - set(BOOST_INSTALL ${EXEC}bjam -a --with-thread - --with-program_options --with-system --with-regex - --with-filesystem --with-date_time --build-type=complete -- --prefix=${EXTERNAL_STAGE} --libdir=${EXTERNAL_STAGE}/lib -+ --prefix=${BOOST_INSTALL_LOC} --libdir=${BOOST_INSTALL_LOC}/lib - define=BOOST_HAS_THREADS link=shared variant=release toolset=${TOOLSET} - install) - else() -@@ -60,42 +62,37 @@ if (WITH_BOOST ) - - - # so the idea of privately staging boost is silly. -- set (BOOST_VER 1_39_0) - ExternalProject_Add(boost -- PREFIX ${EXTERNAL_BUILD_PREFIX}/boost_${BOOST_VER} - #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/boost_${BOOST_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/boost_${BOOST_VER}.tar.gz -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${BOOST_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${BOOST_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${BOOST_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND ${BOOST_PATCH} - #--Configure step ---------- -- CONFIGURE_COMMAND cd boost_${BOOST_VER} ${CMD_TERM} -- ./bootstrap.${JAM_EXT} --prefix=${EXTERNAL_STAGE} -+ CONFIGURE_COMMAND cd ${BOOST_VER} ${CMD_TERM} -+ ./bootstrap.${JAM_EXT} --prefix=${BOOST_INSTALL_LOC} - #--Build Step ---------- -- BUILD_COMMAND cd boost_${BOOST_VER} && -- ${EXEC}bjam --with-thread --layout=system --prefix=${EXTERNAL_STAGE} --libdir=${EXTERNAL_STAGE}/lib define=BOOST_HAS_THREADS link=static variant=release toolset=${TOOLSET} install -+ BUILD_COMMAND cd ${BOOST_VER} && -+ ${EXEC}bjam --with-thread --layout=system --prefix=${BOOST_INSTALL_LOC} --libdir=${BOOST_INSTALL_LOC}/lib define=BOOST_HAS_THREADS link=static variant=release toolset=${TOOLSET} install - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd boost_${BOOST_VER} && ${BOOST_INSTALL} ) -- -- -- append_var(CONDOR_EXTERNALS boost) -+ INSTALL_DIR ${BOOST_INSTALL_LOC} -+ INSTALL_COMMAND cd ${BOOST_VER} && ${BOOST_INSTALL} ) -+ - - if (WINDOWS) -- set_property( TARGET boost PROPERTY FOLDER "externals" ) -- set(BOOST_ROOT ${EXTERNAL_STAGE} PARENT_SCOPE) -+ set(BOOST_ROOT ${BOOST_INSTALL_LOC} PARENT_SCOPE) - - if (WANT_CONTRIB) - - # binding dep to VS-2008 :-( there is no easy solution to this -- install ( FILES ${EXTERNAL_STAGE}/lib/boost_date_time-vc90-mt-1_39.dll -- ${EXTERNAL_STAGE}/lib/boost_filesystem-vc90-mt-1_39.dll -- ${EXTERNAL_STAGE}/lib/boost_program_options-vc90-mt-1_39.dll -- ${EXTERNAL_STAGE}/lib/boost_regex-vc90-mt-1_39.dll -- ${EXTERNAL_STAGE}/lib/boost_system-vc90-mt-1_39.dll -- ${EXTERNAL_STAGE}/lib/boost_thread-vc90-mt-1_39.dll -+ install ( FILES ${BOOST_INSTALL_LOC}/lib/boost_date_time-vc90-mt-1_39.dll -+ ${BOOST_INSTALL_LOC}/lib/boost_filesystem-vc90-mt-1_39.dll -+ ${BOOST_INSTALL_LOC}/lib/boost_program_options-vc90-mt-1_39.dll -+ ${BOOST_INSTALL_LOC}/lib/boost_regex-vc90-mt-1_39.dll -+ ${BOOST_INSTALL_LOC}/lib/boost_system-vc90-mt-1_39.dll -+ ${BOOST_INSTALL_LOC}/lib/boost_thread-vc90-mt-1_39.dll - DESTINATION ${C_LIB} ) - - endif() -@@ -104,13 +101,15 @@ if (WITH_BOOST ) - dprint ("TBD: NON-PROPER INSTALL for CONTRIB") - endif() - -+ condor_post_external( boost "include" OFF ) -+ - else() - - # For proper builds use the .so/.dll's . - set(Boost_USE_MULTITHREADED ON) - find_package( Boost 1.33.1 COMPONENTS thread program_options system regex filesystem) - if(Boost_FOUND) -- append_var (EXTERNAL_INCLUDES ${Boost_INCLUDE_DIRS}) -+ append_var (CONDOR_EXTERNAL_INCLUDE_DIRS ${Boost_INCLUDE_DIRS}) - set (BOOST_VER ${Boost_VERSION}) - endif(Boost_FOUND) - -diff --git a/externals/bundles/coredumper/0.2/CMakeLists.txt b/externals/bundles/coredumper/0.2/CMakeLists.txt -index eb9217c..8d925ae 100644 ---- a/externals/bundles/coredumper/0.2/CMakeLists.txt -+++ b/externals/bundles/coredumper/0.2/CMakeLists.txt -@@ -25,26 +25,26 @@ if (WITH_COREDUMPER) - - if ( NOT PROPER ) - -- set (CRDPR_VER coredumper-0.2) -+ condor_pre_external( COREDUMPER coredumper-0.2 "lib;include" "done") - - ExternalProject_Add(coredumper -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${CRDPR_VER} - #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${CRDPR_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${CRDPR_VER}.tar.gz -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${COREDUMPER_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${COREDUMPER_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${COREDUMPER_VER}.tar.gz - #--Configure step ---------- -- CONFIGURE_COMMAND cd ${CRDPR_VER} && ./configure --prefix=${EXTERNAL_STAGE} -+ CONFIGURE_COMMAND cd ${COREDUMPER_VER} && ./configure --prefix=${COREDUMPER_INSTALL_LOC} - #--Build Step ---------- -- BUILD_COMMAND cd ${CRDPR_VER} && make -+ BUILD_COMMAND cd ${COREDUMPER_VER} && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd ${CRDPR_VER} && make install ) -+ INSTALL_DIR ${COREDUMPER_INSTALL_LOC} -+ INSTALL_COMMAND cd ${COREDUMPER_VER} && make install && touch ${COREDUMPER_INSTALL_LOC}/done) - - # Set the target dependencies which the rest of condor depends on. -- set(COREDUMPER_FOUND "${EXTERNAL_STAGE}/lib/libcoredumper.a") -- append_var (CONDOR_EXTERNALS coredumper) -+ set(COREDUMPER_FOUND "${COREDUMPER_INSTALL_LOC}/lib/libcoredumper.a") -+ -+ condor_post_external( coredumper include OFF ) - - else( NOT PROPER ) - -diff --git a/externals/bundles/coredumper/2011.05.24-r31/CMakeLists.txt b/externals/bundles/coredumper/2011.05.24-r31/CMakeLists.txt -new file mode 100644 -index 0000000..bf50c72 ---- /dev/null -+++ b/externals/bundles/coredumper/2011.05.24-r31/CMakeLists.txt -@@ -0,0 +1,71 @@ -+ ############################################################### -+ # -+ # Copyright 2011 Red Hat, Inc. -+ # -+ # Licensed under the Apache License, Version 2.0 (the "License"); you -+ # may not use this file except in compliance with the License. You may -+ # obtain a copy of the License at -+ # -+ # http://www.apache.org/licenses/LICENSE-2.0 -+ # -+ # Unless required by applicable law or agreed to in writing, software -+ # distributed under the License is distributed on an "AS IS" BASIS, -+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ # See the License for the specific language governing permissions and -+ # limitations under the License. -+ # -+ ############################################################### -+ -+# Q: Why are we using a checkout of the coredumper head from 05/24/2001 at r31? -+# -+# A: The latest release at the time of this check in, 1.2.1, doesn't have -+# support for building on RHEL 6. This version of the coredumper has the -+# fixes necessary for compilation on RHEL 6 and it exists before the next -+# official release of Coredumper. -+ -+if (LINUX AND ${SYS_ARCH} MATCHES "I386|X86_64") -+ option(WITH_COREDUMPER "Compiling with support for COREDUMPER" ON) -+endif() -+ -+if (WITH_COREDUMPER) -+ -+ if ( NOT PROPER ) -+ -+ condor_pre_external( COREDUMPER coredumper-2011.05.24-r31 "lib;include" "done") -+ -+ ExternalProject_Add(coredumper -+ #-- Download Step ---------- -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${COREDUMPER_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${COREDUMPER_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${COREDUMPER_VER}.tar.gz -+ #--Configure step ---------- -+ CONFIGURE_COMMAND cd ${COREDUMPER_VER} && ./configure --prefix=${COREDUMPER_INSTALL_LOC} -+ #--Build Step ---------- -+ BUILD_COMMAND cd ${COREDUMPER_VER} && make -+ BUILD_IN_SOURCE 1 -+ #--install Step ---------- -+ INSTALL_DIR ${COREDUMPER_INSTALL_LOC} -+ INSTALL_COMMAND cd ${COREDUMPER_VER} && make install && touch ${COREDUMPER_INSTALL_LOC}/done) -+ -+ # Set the target dependencies which the rest of condor depends on. -+ set(COREDUMPER_FOUND "${COREDUMPER_INSTALL_LOC}/lib/libcoredumper.a") -+ -+ condor_post_external( coredumper include OFF ) -+ -+ else( NOT PROPER ) -+ -+ find_multiple( "coredumper" COREDUMPER_FOUND ) -+ -+ endif( NOT PROPER ) -+ -+ if (COREDUMPER_FOUND) -+ message (STATUS "external configured (COREDUMPER_FOUND=${COREDUMPER_FOUND})") -+ set( COREDUMPER_FOUND ${COREDUMPER_FOUND} PARENT_SCOPE ) -+ set( HAVE_EXT_COREDUMPER ON PARENT_SCOPE ) -+ endif(COREDUMPER_FOUND) -+ -+else(WITH_COREDUMPER) -+ -+ message (STATUS "external skipped (coredumper)") -+ -+endif(WITH_COREDUMPER) -diff --git a/externals/bundles/cream/1.12.1_14/CMakeLists.txt b/externals/bundles/cream/1.12.1_14/CMakeLists.txt -index 9cc7224..d576ecf 100644 ---- a/externals/bundles/cream/1.12.1_14/CMakeLists.txt -+++ b/externals/bundles/cream/1.12.1_14/CMakeLists.txt -@@ -22,121 +22,141 @@ endif() - - if ( WITH_CREAM ) - -- # cream is sandboxed as not to pollute the local staging directory -- # this is primarily for gsoap collision and to keep other elements -- # out of condor proper. -- set (CREAM_STAGE ${EXTERNAL_STAGE}/opt/cream) -- file (MAKE_DIRECTORY ${CREAM_STAGE} -- ${CREAM_STAGE}/lib -- ${CREAM_STAGE}/include -- ${CREAM_STAGE}/include/glite/security) -- --#################### Generic localized packages -- set (GSOAP_VER gsoap_2.7.6b) -- ExternalProject_Add(cream_soap -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GSOAP_VER} -+ # we define cream 1st because other externals will place bits there. -+ condor_pre_external( CREAM org.glite.ce.cream-client-api-c-1.12.1-14 "lib;include;include/glite/security;opt" "done") -+ -+######################################### -+ condor_pre_external( CREAMSOAP gsoap_2.7.6b "lib;include" "done") -+ ExternalProject_Add(creamsoap - #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${GSOAP_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${GSOAP_VER}.tar.gz -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${CREAMSOAP_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${CREAMSOAP_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${CREAMSOAP_VER}.tar.gz -+ #--Patch step ---------- -+ PATCH_COMMAND patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/gsoap_cast.patch - #--Configure step ---------- -- CONFIGURE_COMMAND cd gsoap-2.7 && ./configure --prefix=${CREAM_STAGE} -+ CONFIGURE_COMMAND cd gsoap-2.7 && ./configure --prefix=${CREAM_INSTALL_LOC} - #--Build Step ---------- - BUILD_COMMAND cd gsoap-2.7 && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${CREAM_STAGE} -- INSTALL_COMMAND cd gsoap-2.7 && make install && cp soapcpp2/wsdl/stlvector.h ${CREAM_STAGE}/include ) -+ INSTALL_DIR ${CREAM_INSTALL_LOC} -+ INSTALL_COMMAND cd gsoap-2.7 && make -+ install && cp -f soapcpp2/wsdl/stlvector.h -+ ${CREAM_INSTALL_LOC}/include && touch -+ ${CREAMSOAP_INSTALL_LOC}/done ) -+ -+ condor_post_external( creamsoap OFF OFF ) - -- set (CARES_VER c-ares-1.3.0) -- ExternalProject_Add(c-ares -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${CARES_VER} -+######################################### -+ -+ condor_pre_external( CARES c-ares-1.3.0 "lib;include" "done") -+ ExternalProject_Add(cares - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${CARES_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${CARES_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${CARES_VER}.tar.gz - #--Configure step ---------- -- CONFIGURE_COMMAND cd ${CARES_VER} && ./configure --prefix=${CREAM_STAGE} -+ CONFIGURE_COMMAND cd ${CARES_VER} && ./configure --prefix=${CREAM_INSTALL_LOC} - #--Build Step ---------- - BUILD_COMMAND cd ${CARES_VER} && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${CREAM_STAGE} -- INSTALL_COMMAND cd ${CARES_VER} && make install ) -- -- set (LOG4CPP_VER log4cpp-1.0-3) -+ INSTALL_DIR ${CREAM_INSTALL_LOC} -+ INSTALL_COMMAND cd ${CARES_VER} && make -+ install && touch ${CARES_INSTALL_LOC}/done ) -+ condor_post_external( cares OFF OFF ) -+ -+######################################### -+ -+ condor_pre_external( LOG4CPP log4cpp-1.0-3 "lib;include" "lib/liblog4cpp.a") - ExternalProject_Add(log4cpp -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${LOG4CPP_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${LOG4CPP_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${LOG4CPP_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${LOG4CPP_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/log4errors.patch && - patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/log4configure.patch - #--Configure step ---------- -- CONFIGURE_COMMAND cd log4cpp-1.0 && ./configure --prefix=${CREAM_STAGE} -+ CONFIGURE_COMMAND cd log4cpp-1.0 && ./configure --prefix=${LOG4CPP_INSTALL_LOC} - #--Build Step ---------- - BUILD_COMMAND cd log4cpp-1.0 && make && make check - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${CREAM_STAGE} -+ INSTALL_DIR ${LOG4CPP_INSTALL_LOC} - INSTALL_COMMAND cd log4cpp-1.0 && make install ) -- --#################### cream/gss packages. -- -- # build gridsite -- set (GRIDSITE_VER gridsite-1.6.0) -+ condor_post_external( log4cpp include OFF ) -+ -+######################################### cream/gss packages. -+ -+ condor_pre_external( GRIDSITE gridsite-1.6.0 "lib;include" "done") -+ if ( BUILDING_LIBXML2 ) -+ set (GRIDSITE_DEPENDS ${LIBXML2_REF}) -+ set (GRIDSITE_INCLUDE -I${LIBXML2_INSTALL_LOC}/include/libxml2) -+ else () -+ set (GRIDSITE_DEPENDS "") -+ set (GRIDSITE_INCLUDE "") -+ endif () - ExternalProject_Add(gridsite -- DEPENDS libxml2 -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GRIDSITE_VER} -+ DEPENDS ${GRIDSITE_DEPENDS} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${GRIDSITE_VER}.src.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${GRIDSITE_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${GRIDSITE_VER}.src.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND echo "no config" - #--Build Step ---------- -- BUILD_COMMAND export MYCFLAGS='-I. -I../interface -I${EXTERNAL_STAGE}/include/libxml2' && -+ BUILD_COMMAND export MYCFLAGS='-I. -I../interface ${GRIDSITE_INCLUDE}' && - export MYCFLAGS && - cd org.gridsite.core/src && - make libgridsite.a - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${CREAM_STAGE} -- INSTALL_COMMAND cd org.gridsite.core/src && cp libgridsite.a ${CREAM_STAGE}/lib && cp ../interface/*.h ${CREAM_STAGE}/include ) -- -- -- set (GLITE_SECURITY_VER org.glite.security.gss-2.0.1-1) -- ExternalProject_Add(glite_gss -- DEPENDS globus gridsite c-ares -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GLITE_SECURITY_VER} -+ INSTALL_DIR ${CREAM_INSTALL_LOC} -+ INSTALL_COMMAND cd org.gridsite.core/src && -+ cp -f libgridsite.a ${CREAM_INSTALL_LOC}/lib && -+ cp -f ../interface/*.h ${CREAM_INSTALL_LOC}/include && -+ touch ${GRIDSITE_INSTALL_LOC}/done ) -+ condor_post_external( gridsite OFF OFF ) -+ -+######################################### -+ -+ condor_pre_external( GLITE_SECURITY org.glite.security.gss-2.0.1-1 "lib;include" "done") -+ ExternalProject_Add(glite_security -+ DEPENDS ${GLOBUS_REF} ${GRIDSITE_REF} ${CARES_REF} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${GLITE_SECURITY_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${GLITE_SECURITY_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${GLITE_SECURITY_VER}.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND echo "no config" - #--Build Step ---------- - BUILD_COMMAND cd org.glite.security.gss/src && -- gcc -g -O0 -W -Wall -Wno-unused-parameter -I../interface -I${EXTERNAL_STAGE}/include -I${EXTERNAL_STAGE}/include/${GLOBUS_FLAVOR}pthr -I${CREAM_STAGE}/include -o glite_gss.thr.o -c glite_gss.c && -+ gcc -g -O0 -W -Wall -+ -Wno-unused-parameter -I../interface -+ -I${CREAM_INSTALL_LOC}/include -I${KRB5_INSTALL_LOC}/include -I${GLOBUS_INSTALL_LOC}/include/${GLOBUS_FLAVOR}pthr -o glite_gss.thr.o -c glite_gss.c && - ar crv libglite_security_gss_${GLOBUS_FLAVOR}pthr.a glite_gss.thr.o && - ranlib libglite_security_gss_${GLOBUS_FLAVOR}pthr.a - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${CREAM_STAGE} -+ INSTALL_DIR ${CREAM_INSTALL_LOC} - INSTALL_COMMAND cd org.glite.security.gss/src && -- cp ../interface/* ${CREAM_STAGE}/include/glite/security && -- cp libglite_security_gss_${GLOBUS_FLAVOR}pthr.a ${CREAM_STAGE}/lib) -+ cp ../interface/* ${CREAM_INSTALL_LOC}/include/glite/security && -+ cp libglite_security_gss_${GLOBUS_FLAVOR}pthr.a ${CREAM_INSTALL_LOC}/lib && -+ touch ${GLITE_SECURITY_INSTALL_LOC}/done ) -+ condor_post_external( glite_security OFF OFF ) -+ -+######################################### - - # build gsoap plugin. -- set (CSP_CC_FLAGS -g -O0 -W -Wall -Wno-unused-parameter -I. -I../interface -DWITH_NONAMESPACES -I${CREAM_STAGE}/include -D_GNU_SOURCE) -+ set (CSP_CC_FLAGS -g -O0 -W -Wall -Wno-unused-parameter -I. -I../interface -DWITH_NONAMESPACES -I${CREAM_INSTALL_LOC}/include -D_GNU_SOURCE) -+ condor_pre_external( CREAM_SOAP_PLUGIN org.glite.security.gsoap-plugin-2.0.1-3 "lib;include" "done") - ExternalProject_Add(cream_soap_plugin -- DEPENDS cream_soap glite_gss -- PREFIX ${EXTERNAL_BUILD_PREFIX}/cream_soap_plugin -+ DEPENDS ${CREAMSOAP_REF} ${GLITE_SECURITY_REF} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/org.glite.security.gsoap-plugin-2.0.1-3.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${CREAM_SOAP_PLUGIN_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/org.glite.security.gsoap-plugin-2.0.1-3.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND cd org.glite.security.gsoap-plugin/src && -@@ -149,40 +169,41 @@ if ( WITH_CREAM ) - ranlib libglite_security_gsoap_plugin_${GLOBUS_FLAVOR}pthr.a - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${CREAM_STAGE}/lib -+ INSTALL_DIR ${CREAM_INSTALL_LOC}/lib - INSTALL_COMMAND cd org.glite.security.gsoap-plugin/src && -- cp libglite_security_gsoap_plugin_${GLOBUS_FLAVOR}pthr.a ${CREAM_STAGE}/lib && -- cp ../interface/*.h ${CREAM_STAGE}/include/glite/security -- ) -- -+ cp libglite_security_gsoap_plugin_${GLOBUS_FLAVOR}pthr.a ${CREAM_INSTALL_LOC}/lib && -+ cp ../interface/*.h ${CREAM_INSTALL_LOC}/include/glite/security && -+ touch ${CREAM_SOAP_PLUGIN_INSTALL_LOC}/done ) -+ condor_post_external( cream_soap_plugin OFF OFF ) - -+ condor_pre_external( CREAM_WSDL org.glite.ce.wsdl-1.12.1-14 "lib;include" "done") - ExternalProject_Add(cream_wsdl -- PREFIX ${EXTERNAL_BUILD_PREFIX}/cream_wsdl - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/org.glite.ce.wsdl-1.12.1-14.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${CREAM_WSDL_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/org.glite.ce.wsdl-1.12.1-14.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND echo "nothing to do" - #--Build Step ---------- - BUILD_COMMAND cd org.glite.ce.wsdl && -- project/install.sh ${CREAM_STAGE} ${CREAM_STAGE} 1.12.1 2.0.0 -+ project/install.sh ${CREAM_INSTALL_LOC} ${CREAM_INSTALL_LOC} 1.12.1 2.0.0 - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${CREAM_STAGE} -- INSTALL_COMMAND cd org.glite.ce.wsdl && ln -s share/wsdl ${CREAM_STAGE}/interface ) -+ INSTALL_DIR ${CREAM_INSTALL_LOC} -+ INSTALL_COMMAND cd org.glite.ce.wsdl && ln -fs share/wsdl ${CREAM_INSTALL_LOC}/interface && touch ${CREAM_WSDL_INSTALL_LOC}/done ) -+ condor_post_external( cream_wsdl OFF OFF ) - - set (CREAM_PATCH patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/cream.patch) - if (DARWIN) - set (CREAM_PATCH ${CREAM_PATCH} && patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/bsd.patch && patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/macos.patch ) - endif(DARWIN) - -+ - ExternalProject_Add(cream -- DEPENDS voms cream_soap boost log4cpp gridsite c-ares cream_soap_plugin cream_wsdl -- PREFIX ${EXTERNAL_BUILD_PREFIX}/cream -- #-- Download Step ---------- -+ DEPENDS ${VOMS_REF} ${CREAMSOAP_REF} ${BOOST_REF} ${LOG4CPP_REF} ${GRIDSITE_REF} ${CARES_REF} ${CREAM_SOAP_PLUGIN_REF} ${CREAM_WSDL_REF} -+ #-- Download Step ------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/org.glite.ce.cream-client-api-c-1.12.1-14.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${CREAM_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/org.glite.ce.cream-client-api-c-1.12.1-14.tar.gz - #--Patch step ---------- - PATCH_COMMAND ${CREAM_PATCH} -@@ -190,33 +211,25 @@ if ( WITH_CREAM ) - CONFIGURE_COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/*.m4 org.glite.ce.cream-client-api-c/project && - cd org.glite.ce.cream-client-api-c && - ./bootstrap && -- ./configure --prefix=${CREAM_STAGE} --with-globus-prefix=${EXTERNAL_STAGE} --with-globus-thr-flavor=${GLOBUS_FLAVOR}pthr --with-globus-nothr-flavor=${GLOBUS_FLAVOR} --with-openssl-prefix=${EXTERNAL_STAGE} --with-voms-prefix=${EXTERNAL_STAGE} --with-boost-prefix=${EXTERNAL_STAGE} --with-classads-prefix=${EXTERNAL_STAGE} --with-log4cpp-prefix=${CREAM_STAGE} --with-gsoap-location=${CREAM_STAGE} --with-glite-location=${CREAM_STAGE} --with-ce-wsdl-version=1.12.1 --with-delegation-wsdl-version=2.0.0 -+ ./configure --prefix=${CREAM_INSTALL_LOC} --with-globus-prefix=${GLOBUS_INSTALL_LOC} --with-globus-thr-flavor=${GLOBUS_FLAVOR}pthr --with-globus-nothr-flavor=${GLOBUS_FLAVOR} --with-openssl-prefix=${OPENSSL_INSTALL_LOC} --with-voms-prefix=${VOMS_INSTALL_LOC} --with-boost-prefix=${BOOST_INSTALL_LOC} --with-classads-prefix=${CLASSADS_INSTALL_LOC} --with-log4cpp-prefix=${LOG4CPP_INSTALL_LOC} --with-gsoap-location=${CREAM_INSTALL_LOC} --with-glite-location=${CREAM_INSTALL_LOC} --with-ce-wsdl-version=1.12.1 --with-delegation-wsdl-version=2.0.0 - #--Build Step ---------- - BUILD_COMMAND cd org.glite.ce.cream-client-api-c && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${CREAM_INSTALL_LOC} - INSTALL_COMMAND cd org.glite.ce.cream-client-api-c && -- make install -+ make install && touch ${CREAM_INSTALL_LOC}/done - ) - -- add_dependencies(cream classads) -- -- # Set the target dependencies which the rest of condor depends on. -- if(DARWIN) -- set (BOOST_LIB ${EXTERNAL_STAGE}/lib/libboost_thread.a) -- else() -- set (BOOST_LIB ${EXTERNAL_STAGE}/lib/libboost_thread.a) -- endif() -+ -+ add_dependencies(cream ${CLASSADS_FOUND}) - -- set(CREAM_FOUND "${CREAM_STAGE}/lib/libglite_ce_cream_client_soap.a;${CREAM_STAGE}/lib/libglite_ce_cream_client_util.a;${CREAM_STAGE}/lib/libglite_security_gsoap_plugin_${GLOBUS_FLAVOR}pthr.a;${CREAM_STAGE}/lib/libglite_security_gss_${GLOBUS_FLAVOR}pthr.a;${CREAM_STAGE}/lib/liblog4cpp.a;${CREAM_STAGE}/lib/libgridsite.a;${BOOST_LIB};${CREAM_STAGE}/lib/libcares.a") -+ set (BOOST_LIB ${BOOST_INSTALL_LOC}/lib/libboost_thread.a) -+ set(CREAM_FOUND "${CREAM_INSTALL_LOC}/lib/libglite_ce_cream_client_soap.a;${CREAM_INSTALL_LOC}/lib/libglite_ce_cream_client_util.a;${CREAM_INSTALL_LOC}/lib/libglite_security_gsoap_plugin_${GLOBUS_FLAVOR}pthr.a;${CREAM_INSTALL_LOC}/lib/libglite_security_gss_${GLOBUS_FLAVOR}pthr.a;${LOG4CPP_INSTALL_LOC}/lib/liblog4cpp.a;${CREAM_INSTALL_LOC}/lib/libgridsite.a;${BOOST_LIB};${CREAM_INSTALL_LOC}/lib/libcares.a") - -- append_var(CONDOR_EXTERNALS cream) -+ condor_post_external( cream include OFF ) - -- message (STATUS "external configured (CREAM_FOUND=${CREAM_FOUND})") -- set( CREAM_FOUND ${CREAM_FOUND} PARENT_SCOPE ) -- set( HAVE_EXT_CREAM ON PARENT_SCOPE ) -- set( CREAM_STAGE ${CREAM_STAGE} PARENT_SCOPE ) -+ message (STATUS "external configured (CREAM_FOUND=${CREAM_FOUND})") - - else() - message (STATUS "external skipped (cream)") -diff --git a/externals/bundles/cream/1.12.1_14/classads.m4 b/externals/bundles/cream/1.12.1_14/classads.m4 -index 424536f..33608eb 100644 ---- a/externals/bundles/cream/1.12.1_14/classads.m4 -+++ b/externals/bundles/cream/1.12.1_14/classads.m4 -@@ -16,7 +16,7 @@ AC_DEFUN(AC_CLASSADS, - AC_MSG_CHECKING([for CLASSAD installation]) - - CLASSAD_CFLAGS="" -- CLASSAD_LIBS="-lclassad_ns -lpcre" -+ CLASSAD_LIBS="-lclassad -lpcre" - CLASSAD_DL_LIBS="-lclassad_dl" - if test -n "$with_classads_prefix" -a "$with_classads_prefix" != "/usr" ; then - AC_MSG_RESULT([prefix: $with_classads_prefix]) -@@ -24,7 +24,7 @@ AC_DEFUN(AC_CLASSADS, - ac_classads_prefix=$with_classads_prefix - - CLASSAD_CFLAGS="-I$with_classads_prefix/include" -- CLASSAD_LIBS="$with_classads_prefix/lib/libclassad_ns.a $with_classads_prefix/lib/libpcre.a" -+ CLASSAD_LIBS="$with_classads_prefix/lib/libclassad.a $with_classads_prefix/lib/libpcre.a" - CLASSAD_DL_LIBS="-L$with_classads_prefix/lib $CLASSAD_DL_LIBS" - fi - -diff --git a/externals/bundles/cream/1.12.1_14/gsoap_cast.patch b/externals/bundles/cream/1.12.1_14/gsoap_cast.patch -new file mode 100644 -index 0000000..584d8d6 ---- /dev/null -+++ b/externals/bundles/cream/1.12.1_14/gsoap_cast.patch -@@ -0,0 +1,12 @@ -+diff -u -r gsoap-2.7/soapcpp2/stdsoap2.cpp gsoap-2.7-patched/soapcpp2/stdsoap2.cpp -+--- gsoap-2.7/soapcpp2/stdsoap2.cpp 2005-09-01 20:21:51.000000000 -0500 -++++ gsoap-2.7-patched/soapcpp2/stdsoap2.cpp 2011-05-26 13:21:58.945680030 -0500 -+@@ -9178,7 +9178,7 @@ -+ { -+ #ifndef WITH_LEAN -+ if (s && (soap->mode & SOAP_XML_CANONICAL)) -+- { t = strchr(s, ':'); -++ { t = strchr((char*)s, ':'); -+ if (t) -+ soap_utilize_ns(soap, s, t - s); -+ } -diff --git a/externals/bundles/curl/7.19.6-p1/CMakeLists.txt b/externals/bundles/curl/7.19.6-p1/CMakeLists.txt -index 572fe3d..36081e7 100644 ---- a/externals/bundles/curl/7.19.6-p1/CMakeLists.txt -+++ b/externals/bundles/curl/7.19.6-p1/CMakeLists.txt -@@ -23,6 +23,8 @@ option(WITH_CURL "Compiling with support for CURL" ON) - if (WITH_CURL) - - if ( NOT PROPER ) -+ -+ condor_pre_external( CURL curl-7.19.6 "lib;include" "include/curl/curl.h") - - if (WINDOWS) - set (CURL_PATCH pushd "lib" ${CMD_TERM} -@@ -30,26 +32,23 @@ if (WITH_CURL) - popd) - set (CURL_CONFIGURE echo "Nothing to configure") - set (CURL_MAKE pushd "lib" ${CMD_TERM} -- nmake -f Makefile.vc9 CFG=release-ssl WINDOWS_SDK_PATH="${WIN_SDK_PATH}" OPENSSL_PATH="${EXTERNAL_STAGE}" ${CMD_TERM} -+ nmake -f Makefile.vc9 CFG=release-ssl WINDOWS_SDK_PATH="${WIN_SDK_PATH}" OPENSSL_PATH="${OPENSSL_INSTALL_LOC}" ${CMD_TERM} - popd ${CMD_TERM}) -- set (CURL_DEPENDS openssl) -- set (CURL_INSTALL cp -f lib/lib*.lib ${EXTERNAL_STAGE}/lib && cp -rf include/curl ${EXTERNAL_STAGE}/include ) -+ set (CURL_DEPENDS ${OPENSSL_REF}) -+ set (CURL_INSTALL cp -f lib/lib*.lib ${CURL_INSTALL_LOC}/lib && cp -rf include/curl ${CURL_INSTALL_LOC}/include ) - else() - set (CURL_PATCH echo "Nothing to patch on Unix") -- set (CURL_CONFIGURE PKG_CONFIG_PATH=${EXTERNAL_STAGE} LIBS=-ldl ./configure --prefix=${EXTERNAL_STAGE} --with-ssl=${EXTERNAL_STAGE} --disable-shared --disable-ipv6 ) -+ set (CURL_CONFIGURE PKG_CONFIG_PATH=${CURL_INSTALL_LOC} LIBS=-ldl ./configure --prefix=${CURL_INSTALL_LOC} --with-ssl=${OPENSSL_INSTALL_LOC} --disable-shared --disable-ipv6 --disable-ldap --disable-ldaps ) - set (CURL_MAKE make) - set (CURL_INSTALL make install) -- set (CURL_DEPENDS openssl zlib) -+ set (CURL_DEPENDS ${OPENSSL_REF} ${ZLIB_REF}) - endif() - -- set (CURL_VER curl-7.19.6) -- - ExternalProject_Add(curl - DEPENDS ${CURL_DEPENDS} -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${CURL_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${CURL_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${CURL_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${CURL_VER}.tar.gz - #--Patch Step ---------- - PATCH_COMMAND cd ${CURL_VER} ${CMD_TERM} ${CURL_PATCH} -@@ -59,22 +58,20 @@ if (WITH_CURL) - BUILD_COMMAND cd ${CURL_VER} && ${CURL_MAKE} - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${CURL_INSTALL_LOC} - INSTALL_COMMAND cd ${CURL_VER} && ${CURL_INSTALL} ) - - # Set the target dependencies which the rest of condor depends on. - if (WINDOWS) -- set(CURL_FOUND "${EXTERNAL_STAGE}/lib/libcurl.lib") -- set_property( TARGET curl PROPERTY FOLDER "externals" ) -+ set(CURL_FOUND "${CURL_INSTALL_LOC}/lib/libcurl.lib") - else() - # libcurl is dependent on these libraries on some - # platforms. - find_multiple( "rt;idn" CURL_FOUND ) -- set(CURL_FOUND "${EXTERNAL_STAGE}/lib/libcurl.a;${CURL_FOUND}") -+ set(CURL_FOUND "${CURL_INSTALL_LOC}/lib/libcurl.a;${CURL_FOUND}") - endif() -- -- append_var (CONDOR_EXTERNALS curl) -- -+ -+ condor_post_external( curl include OFF ) - - else( NOT PROPER ) - -diff --git a/externals/bundles/drmaa/1.6/CMakeLists.txt b/externals/bundles/drmaa/1.6/CMakeLists.txt -index ce958d2..28b8ea4 100644 ---- a/externals/bundles/drmaa/1.6/CMakeLists.txt -+++ b/externals/bundles/drmaa/1.6/CMakeLists.txt -@@ -22,38 +22,37 @@ endif() - - if ( WITH_DRMAA ) - -- set (DRMAA_VER drmaa-1.6) -- -+ condor_pre_external( DRMAA drmaa-1.6 "lib;include" "include/drmaa.h") -+ - if (NOT WINDOWS) -- set (DRMAA_CONFIGURE ./configure --prefix=${EXTERNAL_STAGE}) -+ set (DRMAA_CONFIGURE ./configure --prefix=${DRMAA_INSTALL_LOC}) - set (DRMAA_MAKE make) -- set (DRMAA_INSTALL cp drmaa.h README ${EXTERNAL_STAGE}/include/ && -- cp libcondordrmaa.a ${EXTERNAL_STAGE}/lib ) -+ set (DRMAA_INSTALL cp libcondordrmaa.a ${DRMAA_INSTALL_LOC}/lib && -+ cp drmaa.h README ${DRMAA_INSTALL_LOC}/include/ ) - - if(DARWIN) -- set (DRMAA_INSTALL cp libdrmaa.dylib ${EXTERNAL_STAGE}/lib/ && ${DRMAA_INSTALL}) -- set( DRMAA_FOUND "${EXTERNAL_STAGE}/lib/libdrmaa.dylib;${EXTERNAL_STAGE}/lib/libcondordrmaa.a" ) -+ set (DRMAA_INSTALL cp libdrmaa.dylib ${DRMAA_INSTALL_LOC}/lib/ && ${DRMAA_INSTALL}) -+ set( DRMAA_FOUND "${DRMAA_INSTALL_LOC}/lib/libdrmaa.dylib;${DRMAA_INSTALL_LOC}/lib/libcondordrmaa.a" ) - else() -- set (DRMAA_INSTALL cp libdrmaa.so ${EXTERNAL_STAGE}/lib/ && ${DRMAA_INSTALL}) -- set( DRMAA_FOUND "${EXTERNAL_STAGE}/lib/libdrmaa.so;${EXTERNAL_STAGE}/lib/libcondordrmaa.a" ) -+ set (DRMAA_INSTALL cp libdrmaa.so ${DRMAA_INSTALL_LOC}/lib/ && ${DRMAA_INSTALL}) -+ set( DRMAA_FOUND "${DRMAA_INSTALL_LOC}/lib/libdrmaa.so;${DRMAA_INSTALL_LOC}/lib/libcondordrmaa.a" ) - endif() - - else() - set (DRMAA_CONFIGURE echo "Nothing to configure for Windows") - set (DRMAA_MAKE nmake /f libdrmaa.mak CFG="libdrmaa - Win32 Release") -- set (DRMAA_INSTALL cp Release/* ${EXTERNAL_STAGE}/lib \r\n -- cp drmaa.h README ${EXTERNAL_STAGE}/include) -+ set (DRMAA_INSTALL cp Release/* ${DRMAA_INSTALL_LOC}/lib \r\n -+ cp drmaa.h README ${DRMAA_INSTALL_LOC}/include) - -- set( DRMAA_FOUND "${EXTERNAL_STAGE}/lib/libdrmaa.lib" ) -+ set( DRMAA_FOUND "${DRMAA_INSTALL_LOC}/lib/libdrmaa.lib" ) - -- install ( FILES ${EXTERNAL_STAGE}/lib/libdrmaa.dll DESTINATION ${C_BIN} ) -+ install ( FILES ${DRMAA_INSTALL_LOC}/lib/libdrmaa.dll DESTINATION ${C_BIN} ) - endif() - - ExternalProject_Add(drmaa -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${DRMAA_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${DRMAA_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${DRMAA_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${DRMAA_VER}.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND ${DRMAA_CONFIGURE} -@@ -61,22 +60,17 @@ if ( WITH_DRMAA ) - BUILD_COMMAND ${DRMAA_MAKE} - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${DRMAA_INSTALL_LOC} - INSTALL_COMMAND ${DRMAA_INSTALL}) - -- if (WINDOWS) -- set_property( TARGET drmaa PROPERTY FOLDER "externals" ) -- endif() -- -+ # set standard globals include and link loc -+ condor_post_external( drmaa include OFF ) - message (STATUS "external configured (DRMAA_FOUND=${DRMAA_FOUND})") -- set( DRMAA_FOUND ${DRMAA_FOUND} PARENT_SCOPE ) -- set( HAVE_EXT_DRMAA ON PARENT_SCOPE ) -- append_var (CONDOR_EXTERNALS drmaa) -- -+ - # i've tar bundled drmaa, does anyone actually use this? if so I can explode. -- install ( FILES ${EXTERNAL_DL}/${DRMAA_VER}.tar.gz DESTINATION ${C_SRC}/drmaa ) -- install ( FILES ${EXTERNAL_STAGE}/include/drmaa.h -- ${EXTERNAL_STAGE}/include/README -+ install ( FILES ${DRMAA_STAGE}/dl/${DRMAA_VER}.tar.gz DESTINATION ${C_SRC}/drmaa ) -+ install ( FILES ${DRMAA_INSTALL_LOC}/include/drmaa.h -+ ${DRMAA_INSTALL_LOC}/include/README - DESTINATION ${C_INCLUDE} ) - - install ( FILES ${DRMAA_FOUND} DESTINATION ${C_LIB} ) -diff --git a/externals/bundles/expat/2.0.1/CMakeLists.txt b/externals/bundles/expat/2.0.1/CMakeLists.txt -index a7b3435..3d998b7 100644 ---- a/externals/bundles/expat/2.0.1/CMakeLists.txt -+++ b/externals/bundles/expat/2.0.1/CMakeLists.txt -@@ -24,26 +24,26 @@ if ( WITH_EXPAT ) - - if( NOT PROPER ) - -- set ( EXPAT_VER expat-2.0.1 ) -+ condor_pre_external( EXPAT expat-2.0.1 "lib;include" "lib/libexpat.a") - - ExternalProject_Add(expat -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${EXPAT_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${EXPAT_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${EXPAT_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${EXPAT_VER}.tar.gz - #--Configure step ---------- -- CONFIGURE_COMMAND cd ${EXPAT_VER} && ./configure --prefix=${EXTERNAL_STAGE} -+ CONFIGURE_COMMAND cd ${EXPAT_VER} && ./configure --prefix=${EXPAT_INSTALL_LOC} - #--Build Step ---------- - BUILD_COMMAND cd ${EXPAT_VER} && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${EXPAT_INSTALL_LOC} - INSTALL_COMMAND cd ${EXPAT_VER} && make install ) - - # Set the target dependencies which the rest of condor depends on. -- set(EXPAT_FOUND "${EXTERNAL_STAGE}/lib/libexpat.a") -- append_var (CONDOR_EXTERNALS expat) -+ set(EXPAT_FOUND "${EXPAT_INSTALL_LOC}/lib/libexpat.a") -+ -+ condor_post_external( expat include OFF ) - - else( NOT PROPER ) - -diff --git a/externals/bundles/gcb/1.5.6/CMakeLists.txt b/externals/bundles/gcb/1.5.6/CMakeLists.txt -deleted file mode 100644 -index a64471a..0000000 ---- a/externals/bundles/gcb/1.5.6/CMakeLists.txt -+++ /dev/null -@@ -1,59 +0,0 @@ -- ############################################################### -- # -- # Copyright 2011 Red Hat, Inc. -- # -- # Licensed under the Apache License, Version 2.0 (the "License"); you -- # may not use this file except in compliance with the License. You may -- # obtain a copy of the License at -- # -- # http://www.apache.org/licenses/LICENSE-2.0 -- # -- # Unless required by applicable law or agreed to in writing, software -- # distributed under the License is distributed on an "AS IS" BASIS, -- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- # See the License for the specific language governing permissions and -- # limitations under the License. -- # -- ############################################################### -- --if (NOT PROPER AND LINUX) -- option(WITH_GCB "Compiling with support for GCB" ON) --endif() -- --if (WITH_GCB) -- -- set (GCB_VER gcb-1.5.6) -- -- ExternalProject_Add(gcb -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GCB_VER} -- #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${GCB_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${GCB_VER}.tar.gz -- #--Configure step ---------- -- CONFIGURE_COMMAND cd ${GCB_VER} && ./configure --prefix=${EXTERNAL_STAGE} -- #--Build Step ---------- -- BUILD_COMMAND cd ${GCB_VER} && make -- BUILD_IN_SOURCE 1 -- #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd ${GCB_VER} && make install ) -- -- # Set the target dependencies which the rest of condor depends on. -- set(GCB_FOUND "${EXTERNAL_STAGE}/lib/libGCB.a") -- message (STATUS "external configured (GCB_FOUND=${GCB_FOUND})") -- set( GCB_FOUND ${GCB_FOUND} PARENT_SCOPE ) -- set( HAVE_EXT_GCB ON PARENT_SCOPE ) -- append_var ( CONDOR_EXTERNALS gcb ) -- -- # setup the install target -- install (FILES ${EXTERNAL_STAGE}/bin/gcb_broker_query DESTINATION ${C_SBIN}) -- install (FILES ${EXTERNAL_STAGE}/bin/gcb_broker -- ${EXTERNAL_STAGE}/bin/gcb_relay_server -- DESTINATION ${C_LIBEXEC} ) -- --else() -- -- message (STATUS "external skipped (gcb)") -- --endif() -diff --git a/externals/bundles/glibc/CMakeLists.txt b/externals/bundles/glibc/CMakeLists.txt -index 86c6817..6a555dc 100644 ---- a/externals/bundles/glibc/CMakeLists.txt -+++ b/externals/bundles/glibc/CMakeLists.txt -@@ -31,8 +31,8 @@ if (NOT CLIPPED) - # check only the major and minor bits of gcc version. - string(SUBSTRING ${CMAKE_C_COMPILER_VERSION} 0 2 GCC_VER_CHECK) - # corner off glibc b/c it effect -- set(GLIBC_PREFIX ${EXTERNAL_STAGE}/opt/glibc/) - set(GLIBC_DETECTED ON) -+ set(GLIBC_BUILD_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/glibc-prefix/src/glibc) - - if (${GLIBC_VERSION} STREQUAL "23") - set (VER 2.3.2.27.9.7) -@@ -45,7 +45,7 @@ if (NOT CLIPPED) - set (GLIBC_PATCH ${GLIBC_PATCH} && patch --binary -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/${VER}/gcc-4-fixes.patch ) - endif() - -- set (GLIBC_CONFIGURE ./configure --enable-static-nss --enable-add-ons=linuxthreads,c_stubs,glibc-compat --disable-shared --prefix=${GLIBC_PREFIX} --without-cvs) -+ set (GLIBC_CONFIGURE ./configure --enable-static-nss --enable-add-ons=linuxthreads,c_stubs,glibc-compat --disable-shared --without-cvs) - - set (GLIBC_MAKE make ) - -@@ -55,14 +55,14 @@ if (NOT CLIPPED) - - set (VER 2.5-20061008T1257-x86_64-p0) - -- set (GLIBC_CONFIGURE ./configure --prefix=${GLIBC_PREFIX} --enable-add-ons=nptl,rtkaio,c_stubs,libidn --without-cvs --enable-kernel=2.6.9 --with-headers=$HOME/junk/glibc-2.5-20061008T1257/override_headers:/usr/include --enable-bind-now --with-tls --with-__thread --build x86_64-redhat-linux --host x86_64-redhat-linux --disable-profile --enable-static-nss) -+ set (GLIBC_CONFIGURE ./configure --enable-add-ons=nptl,rtkaio,c_stubs,libidn --without-cvs --enable-kernel=2.6.9 --with-headers=$HOME/junk/glibc-2.5-20061008T1257/override_headers:/usr/include --enable-bind-now --with-tls --with-__thread --build x86_64-redhat-linux --host x86_64-redhat-linux --disable-profile --enable-static-nss) - - set (GLIBC_MAKE make -j2 -r 'CFLAGS=-mtune=generic -DNDEBUG=1 -g -O3 ' PARALLELMFLAGS=-s) - - else() - set (VER 2.5-20061008T1257-p0) - -- set (GLIBC_CONFIGURE ./configure --prefix=${GLIBC_PREFIX} --enable-add-ons=nptl,rtkaio,c_stubs,libidn --without-cvs --enable-kernel=2.6.9 --with-headers=$HOME/junk/glibc-2.5-20061008T1257/override_headers:/usr/include --enable-bind-now --with-tls --with-__thread --build i486-redhat-linux --host i486-redhat-linux --disable-profile --enable-static-nss) -+ set (GLIBC_CONFIGURE ./configure --enable-add-ons=nptl,rtkaio,c_stubs,libidn --without-cvs --enable-kernel=2.6.9 --with-headers=$HOME/junk/glibc-2.5-20061008T1257/override_headers:/usr/include --enable-bind-now --with-tls --with-__thread --build i486-redhat-linux --host i486-redhat-linux --disable-profile --enable-static-nss) - - set (GLIBC_MAKE make -j2 -r 'CFLAGS=-march=i386 -mtune=generic -mno-tls-direct-seg-refs -DNDEBUG=1 -g -O3 ' PARALLELMFLAGS=-s ) - endif() -@@ -76,7 +76,7 @@ if (NOT CLIPPED) - - set (GLIBC_FLAGS CC=gcc-4.3 CXX=g++-4.3 AUTOCONF=false MAKEINFO=: CFLAGS='-pipe -O2 -fstrict-aliasing -g ') - -- set (GLIBC_CONFIGURE ./configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --prefix=${GLIBC_PREFIX} --without-cvs --enable-add-ons=libidn,nptl --without-selinux --enable-kernel=2.6.8 --disable-profile --with-headers=${EXTERNAL_BUILD_PREFIX}/glibc-${VER}/src/glibc/glibc-${VER}/debian/include --enable-bind-now --with-tls --with-__thread --enable-static-nss) -+ set (GLIBC_CONFIGURE ./configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --without-cvs --enable-add-ons=libidn,nptl --without-selinux --enable-kernel=2.6.8 --disable-profile --with-headers=${GLIBC_BUILD_PREFIX}/glibc-${VER}/debian/include --enable-bind-now --with-tls --with-__thread --enable-static-nss) - - set (GLIBC_MAKE make -j2 -r) - else() -@@ -84,7 +84,7 @@ if (NOT CLIPPED) - - set (GLIBC_FLAGS CC=gcc-4.3 CXX=g++-4.3 AUTOCONF=false MAKEINFO=: CFLAGS='-pipe -O2 -fstrict-aliasing -g -march=i686 -mtune=i686 -O3 ') - -- set (GLIBC_CONFIGURE ./configure --host=i686-linux --build=i486-linux-gnu --prefix=${GLIBC_PREFIX} --without-cvs --enable-add-ons=libidn,nptl --without-selinux --enable-kernel=2.6.8 --disable-profile --with-headers=${EXTERNAL_BUILD_PREFIX}/glibc-${VER}/src/glibc/glibc-${VER}/debian/include --enable-bind-now --with-tls --with-__thread --enable-static-nss) -+ set (GLIBC_CONFIGURE ./configure --host=i686-linux --build=i486-linux-gnu --without-cvs --enable-add-ons=libidn,nptl --without-selinux --enable-kernel=2.6.8 --disable-profile --with-headers=${GLIBC_BUILD_PREFIX}/glibc-${VER}/debian/include --enable-bind-now --with-tls --with-__thread --enable-static-nss) - - set (GLIBC_MAKE make -j2 -r 'CFLAGS=-pipe -O2 -fstrict-aliasing -g -march=i686 -mtune=i686 -O3 ' PARALLELMFLAGS=-s) - endif() -@@ -98,36 +98,37 @@ if (NOT CLIPPED) - endif() - - if (GLIBC_DETECTED) -- set (GLIBC_VER glibc-${VER}) -+ -+ condor_pre_external( GLIBC glibc-${VER} "lib;include" "lib/libc.a") - set (GLIBC_INSTALL make install ) - - ExternalProject_Add(glibc -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GLIBC_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N - http://parrot.cs.wisc.edu/externals/${GLIBC_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${GLIBC_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${GLIBC_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND cd ${GLIBC_VER} && ${GLIBC_PATCH} - #--Configure step ---------- -- CONFIGURE_COMMAND ${GLIBC_FLAGS} ${GLIBC_VER}/${GLIBC_CONFIGURE} -+ CONFIGURE_COMMAND ${GLIBC_FLAGS} ${GLIBC_VER}/${GLIBC_CONFIGURE} --prefix=${GLIBC_INSTALL_LOC} - #--Build Step ---------- - BUILD_COMMAND ${GLIBC_MAKE} - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${GLIBC_INSTALL_LOC} - INSTALL_COMMAND ${GLIBC_INSTALL} ) - -- set( EXT_GLIBC_FOUND "${GLIBC_PREFIX}/lib/libc.a" ) -+ set( EXT_GLIBC_FOUND "${GLIBC_INSTALL_LOC}/lib/libc.a" ) - message ( STATUS "external configured (EXT_GLIBC_FOUND=${EXT_GLIBC_FOUND})" ) - set( EXT_GLIBC_FOUND ${EXT_GLIBC_FOUND} PARENT_SCOPE ) -- append_var(CONDOR_EXTERNALS glibc) -+ -+ condor_post_external( glibc OFF OFF ) - -- install ( FILES ${GLIBC_PREFIX}/lib/libc.a DESTINATION ${C_LIB} RENAME libcondor_c.a) -- install ( FILES ${GLIBC_PREFIX}/lib/libnss_files.a DESTINATION ${C_LIB} RENAME libcondor_nss_files.a) -- install ( FILES ${GLIBC_PREFIX}/lib/libnss_dns.a DESTINATION ${C_LIB} RENAME libcondor_nss_dns.a) -- install ( FILES ${GLIBC_PREFIX}/lib/libresolv.a DESTINATION ${C_LIB} RENAME libcondor_resolv.a) -+ install ( FILES ${GLIBC_INSTALL_LOC}/lib/libc.a DESTINATION ${C_LIB} RENAME libcondor_c.a) -+ install ( FILES ${GLIBC_INSTALL_LOC}/lib/libnss_files.a DESTINATION ${C_LIB} RENAME libcondor_nss_files.a) -+ install ( FILES ${GLIBC_INSTALL_LOC}/lib/libnss_dns.a DESTINATION ${C_LIB} RENAME libcondor_nss_dns.a) -+ install ( FILES ${GLIBC_INSTALL_LOC}/lib/libresolv.a DESTINATION ${C_LIB} RENAME libcondor_resolv.a) - endif(GLIBC_DETECTED) - - endif(NOT CLIPPED) -diff --git a/externals/bundles/globus/5.0.1-p1/CMakeLists.txt b/externals/bundles/globus/5.0.1-p1/CMakeLists.txt -index 9d7d775..7062d61 100644 ---- a/externals/bundles/globus/5.0.1-p1/CMakeLists.txt -+++ b/externals/bundles/globus/5.0.1-p1/CMakeLists.txt -@@ -16,20 +16,20 @@ - # - ############################################################### - --option(WITH_GLOBUS "Compiling with support for GLOBUS" ON) -+if (LINUX OR DARWIN) -+ option(WITH_GLOBUS "Compiling with support for GLOBUS" ON) -+endif() - - if (WITH_GLOBUS) - - if (NOT PROPER) -- set (GT4_VER globus-4.0.8 ) -- set (GT42_VER globus-4.2.1 ) -- set (GLOBUS_VER globus-5.0.1) - -+ ################################################### -+ condor_pre_external( GT4 globus-4.0.8 "lib;include" "lib/gt4/gt4-java") - ExternalProject_Add(gt4 -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GT4_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${GT4_VER}-java.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${GT4_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${GT4_VER}-java.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND echo "Nothing to do" -@@ -37,14 +37,18 @@ if (WITH_GLOBUS) - BUILD_COMMAND echo "Nothing to do" - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE}/lib -- INSTALL_COMMAND cp -r gt4-java ${EXTERNAL_STAGE}/lib/gt4 ) -+ INSTALL_DIR ${GT4_INSTALL_LOC}/lib -+ INSTALL_COMMAND cp -r gt4-java ${GT4_INSTALL_LOC}/lib/gt4 ) -+ -+ install ( DIRECTORY ${GT4_INSTALL_LOC}/lib/gt4 DESTINATION ${C_LIB} ) -+ condor_post_external( gt4 OFF OFF ) -+ ################################################### -+ condor_pre_external( GT42 globus-4.2.1 "lib;include" "lib/gt42/gt42-java") - - ExternalProject_Add(gt42 -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GT42_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${GT42_VER}-java.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${GT42_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${GT42_VER}-java.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND echo "Nothing to do" -@@ -52,8 +56,22 @@ if (WITH_GLOBUS) - BUILD_COMMAND echo "Nothing to do" - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE}/lib -- INSTALL_COMMAND cp -r gt42-java ${EXTERNAL_STAGE}/lib/gt42 ) -+ INSTALL_DIR ${GT42_INSTALL_LOC}/lib -+ INSTALL_COMMAND cp -r gt42-java ${GT42_INSTALL_LOC}/lib/gt42 ) -+ -+ install ( DIRECTORY ${GT42_INSTALL_LOC}/lib/gt42 DESTINATION ${C_LIB} ) -+ condor_post_external( gt42 OFF OFF ) -+ ################################################### -+ -+ if(${SYS_ARCH} MATCHES "IA64|X86_64") -+ set( GLOBUS_FLAVOR gcc64dbg ) -+ elseif(AIX) -+ set( GLOBUS_FLAVOR vendorcc32dbg ) -+ else () -+ set( GLOBUS_FLAVOR gcc32dbg ) -+ endif() -+ -+ condor_pre_external( GLOBUS globus-5.0.1 "lib;include" "done") - - set (GLOBUS_PATCH patch -i ${CMAKE_CURRENT_SOURCE_DIR}/xio-plugins.patch -p0 && - patch -i ${CMAKE_CURRENT_SOURCE_DIR}/rfc_proxy.patch -p0 && -@@ -82,73 +100,58 @@ if (WITH_GLOBUS) - ln -f -s ../../../../../source-trees/xio/src/builtins/popen/globus_xio_popen_driver.c . && - ln -f -s ../../../../../source-trees/xio/src/builtins/popen/globus_xio_popen_driver.h . ) - -- if(SOLARIS) -- set ( GLOBUS_PATCH patch -i ${CMAKE_CURRENT_SOURCE_DIR}/putenv.patch -p0 && ${GLOBUS_PATCH} ) -- elseif(DARWIN) -+ if(DARWIN) - set ( GLOBUS_PATCH ${GLOBUS_PATCH} && cd ../../../../../../ && patch -i ${CMAKE_CURRENT_SOURCE_DIR}/xio-plugins-2.patch -p0 ) - endif() - -- set (GLOBUS_FLAGS CFLAGS=-I${EXTERNAL_STAGE}/include && export CFLAGS && -- LDFLAGS=-L${EXTERNAL_STAGE}/lib && export LDFLAGS && -- OPENSSL_CFLAGS=-I${EXTERNAL_STAGE}/include && export OPENSSL_CFLAGS && -- OPENSSL_LDFLAGS=-L${EXTERNAL_STAGE}/lib && export OPENSSL_LDFLAGS ) -+ #CFLAGS=-I${}/include && export CFLAGS && -+ #LDFLAGS=-L${GLOBUS_INSTALL_LOC}/lib && export LDFLAGS && -+ set (GLOBUS_FLAGS CFLAGS=-I${OPENSSL_INSTALL_LOC}/include && export CFLAGS && -+ LDFLAGS=-L${OPENSSL_INSTALL_LOC}/lib && export LDFLAGS && -+ OPENSSL_CFLAGS=-I${OPENSSL_INSTALL_LOC}/include && export OPENSSL_CFLAGS && -+ OPENSSL_LDFLAGS=-L${OPENSSL_INSTALL_LOC}/lib && export OPENSSL_LDFLAGS ) - -- if( SOLARIS OR LINUX) -+ if(LINUX) - set (GLOBUS_FLAGS ${GLOBUS_FLAGS} && OPENSSL_LIBS='-lssl -lcrypto -ldl' && export OPENSSL_LIBS) - elseif(DARWIN) - set (GLOBUS_FLAGS ${GLOBUS_FLAGS} && - OPENSSL_LIBS='-lssl -lcrypto' && export OPENSSL_LIBS && -- OPENSSL_LDFLAGS='-L${EXTERNAL_STAGE}/lib -Wl,-search_paths_first' && export OPENSSL_LDFLAGS && -+ OPENSSL_LDFLAGS='-L${OPENSSL_INSTALL_LOC}/lib -Wl,-search_paths_first' && export OPENSSL_LDFLAGS && - LT_MULTI_MODULE=1 && export LT_MULTI_MODULE) - endif() - -- set (GLOBUS_DEPENDS openssl gt4 gt42) -- if (KRB5_FOUND) -- set (GLOBUS_DEPENDS ${GLOBUS_DEPENDS} krb5) -- endif(KRB5_FOUND) -- -- if(${SYS_ARCH} MATCHES "IA64|X86_64") -- set( GLOBUS_FLAVOR gcc64dbg ) -- elseif(AIX) -- set( GLOBUS_FLAVOR vendorcc32dbg ) -- else () -- set( GLOBUS_FLAVOR gcc32dbg ) -- endif() -+ set (GLOBUS_DEPENDS ${OPENSSL_REF} ${GT4_REF} ${GT42_REF}) - - # honestly the build of globus is one of the strangest things I have ever seen and it makes no sense to me. - ExternalProject_Add(globus - DEPENDS ${GLOBUS_DEPENDS} -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GLOBUS_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${GLOBUS_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${GLOBUS_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${GLOBUS_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND ${GLOBUS_PATCH} - #--Configure step ---------- - CONFIGURE_COMMAND cd gt5.0.1-all-source-installer && - ${GLOBUS_FLAGS} && -- ./configure --prefix=${EXTERNAL_STAGE} --with-flavor=${GLOBUS_FLAVOR}pthr && -+ ./configure --prefix=${GLOBUS_INSTALL_LOC} --with-flavor=${GLOBUS_FLAVOR}pthr && - make gpt gssapi_error globus-resource-management-sdk - #--Build Step ---------- - BUILD_COMMAND cd gt5.0.1-all-source-installer && - ${GLOBUS_FLAGS} && -- ./configure --prefix=${EXTERNAL_STAGE} --with-flavor=${GLOBUS_FLAVOR} && -+ ./configure --prefix=${GLOBUS_INSTALL_LOC} --with-flavor=${GLOBUS_FLAVOR} && - make gpt gssapi_error globus-resource-management-sdk && -- GLOBUS_LOCATION=${EXTERNAL_STAGE} && export GLOBUS_LOCATION && -+ GLOBUS_LOCATION=${GLOBUS_INSTALL_LOC} && export GLOBUS_LOCATION && - make globus_gridftp_server && -- ${EXTERNAL_STAGE}/sbin/gpt-build -force -static -srcdir=source-trees/gridftp/server/src ${GLOBUS_FLAVOR} && -- mv ${EXTERNAL_STAGE}/sbin/globus-gridftp-server ${EXTERNAL_STAGE}/sbin/globus-gridftp-server.dynamic -+ ${GLOBUS_INSTALL_LOC}/sbin/gpt-build -force -static -srcdir=source-trees/gridftp/server/src ${GLOBUS_FLAVOR} && -+ mv ${GLOBUS_INSTALL_LOC}/sbin/globus-gridftp-server ${GLOBUS_INSTALL_LOC}/sbin/globus-gridftp-server.dynamic - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND echo "done with the craziness that is globus" ) -+ INSTALL_DIR ${GLOBUS_INSTALL_LOC} -+ INSTALL_COMMAND touch ${GLOBUS_INSTALL_LOC}/done) - - ## Set all the config information -- set (GLOBUS_FOUND "${EXTERNAL_STAGE}/lib/libglobus_gss_assist_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_gssapi_gsi_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_gsi_proxy_core_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_gsi_credential_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_gsi_callback_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_gsi_sysconfig_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_oldgaa_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_gsi_cert_utils_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_openssl_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_openssl_error_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_proxy_ssl_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_callout_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_common_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libltdl_${GLOBUS_FLAVOR}.a") -- if ( AIX ) -- set (GLOBUS_FOUND "-Wl,-bstatic;${GLOBUS_FOUND};-Wl,-bdynamic") -- endif() -+ set (GLOBUS_FOUND "${GLOBUS_INSTALL_LOC}/lib/libglobus_gss_assist_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_gssapi_gsi_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_gsi_proxy_core_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_gsi_credential_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_gsi_callback_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_gsi_sysconfig_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_oldgaa_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_gsi_cert_utils_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_openssl_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_openssl_error_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_proxy_ssl_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_callout_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_common_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libltdl_${GLOBUS_FLAVOR}.a") - - # primarily used by cream - foreach (_glob_lib ${GLOBUS_FOUND}) -@@ -157,27 +160,20 @@ if (WITH_GLOBUS) - endforeach(_glob_lib) - - set (GLOBUS_GRID_UNIVERSE_COMMON -- "${EXTERNAL_STAGE}/lib/libglobus_gssapi_error_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_xio_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_io_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_rsl_${GLOBUS_FLAVOR}.a") -- if ( AIX ) -- set (GLOBUS_GRID_UNIVERSE_COMMON "-Wl,-bstatic;${GLOBUS_GRID_UNIVERSE_COMMON};-Wl,-bdynamic") -- endif() -+ "${GLOBUS_INSTALL_LOC}/lib/libglobus_gssapi_error_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_xio_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_io_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_rsl_${GLOBUS_FLAVOR}.a") - - set (GLOBUS_GRID_UNIVERSE_GT2 -- "${EXTERNAL_STAGE}/lib/libglobus_gass_transfer_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_gram_client_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_gram_protocol_${GLOBUS_FLAVOR}.a") -- if ( AIX ) -- set (GLOBUS_GRID_UNIVERSE_GT2 "-Wl,-bstatic;${GLOBUS_GRID_UNIVERSE_GT2};-Wl,-bdynamic") -- endif() -+ "${GLOBUS_INSTALL_LOC}/lib/libglobus_gass_transfer_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_gram_client_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_gram_protocol_${GLOBUS_FLAVOR}.a") -+ - set (GLOBUS_GRID_UNIVERSE_NORDUGRID -- "${EXTERNAL_STAGE}/lib/libglobus_ftp_client_${GLOBUS_FLAVOR}.a;${EXTERNAL_STAGE}/lib/libglobus_ftp_control_${GLOBUS_FLAVOR}.a") -+ "${GLOBUS_INSTALL_LOC}/lib/libglobus_ftp_client_${GLOBUS_FLAVOR}.a;${GLOBUS_INSTALL_LOC}/lib/libglobus_ftp_control_${GLOBUS_FLAVOR}.a") - if ( AIX ) - set (GLOBUS_GRID_UNIVERSE_NORDUGRID "-Wl,-bstatic;${GLOBUS_GRID_UNIVERSE_NORDUGRID};-Wl,-bdynamic") - endif() -- append_var (CONDOR_EXTERNALS globus) -- append_var (EXTERNAL_INCLUDES ${EXTERNAL_STAGE}/include/${GLOBUS_FLAVOR}) - -- install ( DIRECTORY ${EXTERNAL_STAGE}/lib/gt4 DESTINATION ${C_LIB} ) -- install ( DIRECTORY ${EXTERNAL_STAGE}/lib/gt42 DESTINATION ${C_LIB} ) -- install ( PROGRAMS ${EXTERNAL_STAGE}/sbin/globus-gridftp-server.dynamic DESTINATION ${C_LIBEXEC} RENAME globus-gridftp-server ) -+ condor_post_external( globus "include/${GLOBUS_FLAVOR}" OFF ) -+ -+ install ( PROGRAMS "${GLOBUS_INSTALL_LOC}/sbin/globus-gridftp-server.dynamic" DESTINATION ${C_LIBEXEC} RENAME globus-gridftp-server ) - - else( NOT PROPER ) - -@@ -186,7 +182,7 @@ if (WITH_GLOBUS) - find_multiple( "globus_gass_transfer;globus_gram_client;globus_gram_protocol" GLOBUS_GRID_UNIVERSE_GT2 ) - find_multiple( "globus_ftp_client;globus_ftp_control" GLOBUS_GRID_UNIVERSE_NORDUGRID) - if (GLOBUS_FOUND) -- append_var (EXTERNAL_INCLUDES "/usr/include/globus;/usr/lib64/globus/include;/usr/lib/globus/include") -+ append_var (CONDOR_EXTERNAL_INCLUDE_DIRS "/usr/include/globus;/usr/lib64/globus/include;/usr/lib/globus/include") - endif(GLOBUS_FOUND) - - endif(NOT PROPER) -diff --git a/externals/bundles/gsoap/2.7.10-p5/CMakeLists.txt b/externals/bundles/gsoap/2.7.10-p5/CMakeLists.txt -index b8445cb..a9c4fb4 100644 ---- a/externals/bundles/gsoap/2.7.10-p5/CMakeLists.txt -+++ b/externals/bundles/gsoap/2.7.10-p5/CMakeLists.txt -@@ -20,9 +20,10 @@ option(WITH_GSOAP "Compiling with support for GSOAP" ON) - - if (WITH_GSOAP) - -- if ( NOT PROPER ) -+ # this is only done in proper mode to cache local mods which are done to gsoap -+ condor_pre_external( GSOAP gsoap-2.7.10 "src;include" "done") - -- set (GSOAP_VER gsoap-2.7.10) -+ if ( NOT PROPER ) - - if (WINDOWS) - set (GSOAP_PATCH cp ${CMAKE_CURRENT_SOURCE_DIR}/config.WINDOWS.h gsoap/src/config.h) -@@ -32,23 +33,24 @@ if (WITH_GSOAP) - set (GSOAP_MAKE set BISON_SIMPLE=${BISON_SIMPLE}\r\n - gmake -f Makefile.win32 -C gsoap/src ) - -- set (GSOAP_INSTALL set PACKAGE_INSTALL_DIR=${EXTERNAL_STAGE}\r\n -+ set (GSOAP_INSTALL set PACKAGE_INSTALL_DIR=${GSOAP_INSTALL_LOC}\r\n - gmake -f Makefile.win32 install -C gsoap/src ) - else(WINDOWS) - set (GSOAP_PATCH patch --binary -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/install_soapcpp2_wsdl2h_aux-2.7.10-Makefile.in.patch && - patch --binary -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/fix_xlocale_insanity.patch && - patch --binary -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/nmi_prereq_hack.patch) -- set (GSOAP_CONFIGURE ./configure --prefix=${EXTERNAL_STAGE} --disable-dependency-tracking CPPFLAGS=-I${EXTERNAL_STAGE}/include/) -+ set (GSOAP_CONFIGURE ./configure --prefix=${GSOAP_INSTALL_LOC} --disable-dependency-tracking CPPFLAGS=-I${OPENSSL_INSTALL_LOC}/include/) - set (GSOAP_MAKE make ) - set (GSOAP_INSTALL make install ) - endif(WINDOWS) - -+ message (STATUS "OPENSSL_INSTALL_LOC = ${OPENSSL_INSTALL_LOC}") -+ - ExternalProject_Add( gsoap -- DEPENDS openssl -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${GSOAP_VER} -+ DEPENDS ${OPENSSL_REF} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${GSOAP_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${GSOAP_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${GSOAP_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND cd ${GSOAP_VER} ${CMD_TERM} ${GSOAP_PATCH} -@@ -58,22 +60,25 @@ if (WITH_GSOAP) - BUILD_COMMAND cd ${GSOAP_VER} ${CMD_TERM} ${GSOAP_MAKE} - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd ${GSOAP_VER} ${CMD_TERM} ${GSOAP_INSTALL} ) -+ INSTALL_DIR ${GSOAP_INSTALL_LOC} -+ INSTALL_COMMAND cd ${GSOAP_VER} -+ ${CMD_TERM} ${GSOAP_INSTALL} ${CMD_TERM} -+ touch ${GSOAP_INSTALL_LOC}/done ) - - # Set the target dependencies which the rest of condor depends on. - if (NOT WINDOWS) -- set(GSOAP_FOUND "${EXTERNAL_STAGE}/lib/libgsoapssl++.a") -- set(SOAPCPP2 "${EXTERNAL_STAGE}/bin/soapcpp2") -+ set(GSOAP_FOUND "${GSOAP_INSTALL_LOC}/lib/libgsoapssl++.a") -+ set(SOAPCPP2 "${GSOAP_INSTALL_LOC}/bin/soapcpp2") -+ condor_post_external( gsoap include OFF ) - else(NOT WINDOWS) -+ condor_post_external( gsoap include OFF ) -+ # gsoap is handled differently on windows - set(GSOAP_FOUND ON) -- set(GSOAP_SRC "${EXTERNAL_STAGE}/src/stdsoap2.cpp" PARENT_SCOPE ) -- set(SOAPCPP2 "${EXTERNAL_STAGE}/soapcpp2.exe") -- set_property( TARGET gsoap PROPERTY FOLDER "externals" ) -- endif(NOT WINDOWS) -- -- set ( GSOAP_SHARE "${EXTERNAL_BUILD_PREFIX}/${GSOAP_VER}/src/gsoap/${GSOAP_VER}/gsoap" ) -- append_var (CONDOR_EXTERNALS gsoap) -+ set(GSOAP_SRC "${GSOAP_INSTALL_LOC}/src/stdsoap2.cpp" PARENT_SCOPE ) -+ set(SOAPCPP2 "${GSOAP_INSTALL_LOC}/soapcpp2.exe") -+ endif(NOT WINDOWS) -+ -+ set ( GSOAP_SHARE "${GSOAP_INSTALL_LOC}/share/gsoap" ) - set(WSSEAPI "WSSEAPI-NOTFOUND") - - else( NOT PROPER ) -@@ -95,12 +100,12 @@ if (WITH_GSOAP) - find_file(WSSEAPI wsseapi.cpp HINTS ${GSOAP_SHARE}/plugin/ ) - - exec_program ( cp -- ARGS ${GSOAP_SHARE}/plugin/wsseapi.c ${EXTERNAL_STAGE}/src/wsseapi.cpp && patch -p3 ${EXTERNAL_STAGE}/src/wsseapi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/wsseapi.patch -+ ARGS ${GSOAP_SHARE}/plugin/wsseapi.c ${GSOAP_INSTALL_LOC}/src/wsseapi.cpp && patch -p3 ${GSOAP_INSTALL_LOC}/src/wsseapi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/wsseapi.patch - RETURN_VALUE WSSEAPI_PATCH ) - - dprint("WSSEAPI_PATCH = ${WSSEAPI_PATCH}") - if (WSSEAPI_PATCH EQUAL 0) -- set(WSSEAPI ${EXTERNAL_STAGE}/src/wsseapi.cpp) -+ set(WSSEAPI ${GSOAP_INSTALL_LOC}/src/wsseapi.cpp) - set(PRE_WSEAPPI_CPP ON PARENT_SCOPE) - endif() - -@@ -113,15 +118,15 @@ if (WITH_GSOAP) - set( GSOAP_FOUND ${GSOAP_FOUND} PARENT_SCOPE ) - - # removing dependencies from condor-proper. -- command_target( cp_smdevp cp "${GSOAP_SHARE}/plugin/smdevp.c;${EXTERNAL_STAGE}/src/smdevp.cpp" "${EXTERNAL_STAGE}/src/smdevp.cpp" ) -+ command_target( cp_smdevp cp "${GSOAP_SHARE}/plugin/smdevp.c;${GSOAP_INSTALL_LOC}/src/smdevp.cpp" "${GSOAP_INSTALL_LOC}/src/smdevp.cpp" ) - append_var (CONDOR_EXTERNALS cp_smdevp) - add_dependencies(cp_smdevp gsoap) - - if (${WSSEAPI} STREQUAL "WSSEAPI-NOTFOUND" ) - -- command_target(cp_wsseapi cp "${GSOAP_SHARE}/plugin/wsseapi.c;${EXTERNAL_STAGE}/src/wsseapi.cpp;&&;patch;-p3;${EXTERNAL_STAGE}/src/wsseapi.cpp;${CMAKE_CURRENT_SOURCE_DIR}/wsseapi.patch" "${EXTERNAL_STAGE}/src/wsseapi.cpp") -+ command_target(cp_wsseapi cp "${GSOAP_SHARE}/plugin/wsseapi.c;${GSOAP_INSTALL_LOC}/src/wsseapi.cpp;&&;patch;-p3;${GSOAP_INSTALL_LOC}/src/wsseapi.cpp;${CMAKE_CURRENT_SOURCE_DIR}/wsseapi.patch" "${GSOAP_INSTALL_LOC}/src/wsseapi.cpp") - -- set(WSSEAPI ${EXTERNAL_STAGE}/src/wsseapi.cpp) -+ set(WSSEAPI ${GSOAP_INSTALL_LOC}/src/wsseapi.cpp) - set(PRE_WSEAPPI_CPP ON PARENT_SCOPE) - add_dependencies(cp_wsseapi gsoap) - append_var (CONDOR_EXTERNALS cp_wsseapi) -@@ -129,7 +134,7 @@ if (WITH_GSOAP) - endif() - - set( WSSEAPI ${WSSEAPI} PARENT_SCOPE ) -- set( SMDEVP ${EXTERNAL_STAGE}/src/smdevp.cpp PARENT_SCOPE ) -+ set( SMDEVP ${GSOAP_INSTALL_LOC}/src/smdevp.cpp PARENT_SCOPE ) - - endif(NOT WINDOWS) - -diff --git a/externals/bundles/hadoop/0.21.0/CMakeLists.txt b/externals/bundles/hadoop/0.21.0/CMakeLists.txt -index 8dc10b1..40222b3 100644 ---- a/externals/bundles/hadoop/0.21.0/CMakeLists.txt -+++ b/externals/bundles/hadoop/0.21.0/CMakeLists.txt -@@ -22,51 +22,51 @@ if ( NOT PROPER ) - option( WITH_HADOOP "Compiling with support for HADOOP" ON ) - - if (WITH_HADOOP) -- -- set (HADOOP_VER hadoop-0.21.0) -+ -+ condor_pre_external( HADOOP hadoop-0.21.0 "hdfs" "hdfs/conf/hdfs-default.xml") -+ - if ( WINDOWS ) -- set ( HADOOP_INSTALL md \"${EXTERNAL_STAGE}/hdfs/conf\" ${CMD_TERM} -- cp -r lib ${EXTERNAL_STAGE}/hdfs ${CMD_TERM} -- rm -rf ${EXTERNAL_STAGE}/hdfs/lib/native ${CMD_TERM} -- cp -r webapps ${EXTERNAL_STAGE}/hdfs ${CMD_TERM} -- cp hadoop-common-0.21.0.jar ${EXTERNAL_STAGE}/hdfs ${CMD_TERM} -- cp hadoop-hdfs-0.21.0.jar ${EXTERNAL_STAGE}/hdfs ${CMD_TERM} -- cp hdfs/src/java/hdfs-default.xml ${EXTERNAL_STAGE}/hdfs/conf ${CMD_TERM} ) -+ set ( HADOOP_INSTALL md \"${HADOOP_INSTALL_LOC}/hdfs/conf\" ${CMD_TERM} -+ cp -r lib ${HADOOP_INSTALL_LOC}/hdfs ${CMD_TERM} -+ rm -rf ${HADOOP_INSTALL_LOC}/hdfs/lib/native ${CMD_TERM} -+ cp -r webapps ${HADOOP_INSTALL_LOC}/hdfs ${CMD_TERM} -+ cp hadoop-common-0.21.0.jar ${HADOOP_INSTALL_LOC}/hdfs ${CMD_TERM} -+ cp hadoop-hdfs-0.21.0.jar ${HADOOP_INSTALL_LOC}/hdfs ${CMD_TERM} -+ cp hdfs/src/java/hdfs-default.xml ${HADOOP_INSTALL_LOC}/hdfs/conf ${CMD_TERM} ) - else() -- set ( HADOOP_INSTALL mkdir -p ${EXTERNAL_STAGE}/hdfs/conf ${CMD_TERM} -- cp -r lib ${EXTERNAL_STAGE}/hdfs ${CMD_TERM} -- cp -r webapps ${EXTERNAL_STAGE}/hdfs ${CMD_TERM} -- cp hadoop-common-0.21.0.jar ${EXTERNAL_STAGE}/hdfs ${CMD_TERM} -- cp hadoop-hdfs-0.21.0.jar ${EXTERNAL_STAGE}/hdfs ${CMD_TERM} -- cp hdfs/src/java/hdfs-default.xml ${EXTERNAL_STAGE}/hdfs/conf ) -+ set ( HADOOP_INSTALL mkdir -p ${HADOOP_INSTALL_LOC}/hdfs/conf ${CMD_TERM} -+ cp -r lib ${HADOOP_INSTALL_LOC}/hdfs ${CMD_TERM} -+ cp -r webapps ${HADOOP_INSTALL_LOC}/hdfs ${CMD_TERM} -+ cp hadoop-common-0.21.0.jar ${HADOOP_INSTALL_LOC}/hdfs ${CMD_TERM} -+ cp hadoop-hdfs-0.21.0.jar ${HADOOP_INSTALL_LOC}/hdfs ${CMD_TERM} -+ cp hdfs/src/java/hdfs-default.xml ${HADOOP_INSTALL_LOC}/hdfs/conf ) - endif() - # a couple of odd things, this macro requires a configure and build command. - ExternalProject_Add(hadoop -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${HADOOP_VER} -- #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${HADOOP_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${HADOOP_VER}.tar.gz -- # PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/hadoop-0.20.0-patch -- CONFIGURE_COMMAND echo "nothing to configure" -- BUILD_COMMAND echo "nothing to build" -- BUILD_IN_SOURCE 1 -- #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd ${HADOOP_VER} ${CMD_TERM} ${HADOOP_INSTALL} ) -+ #-- Download Step ---------- -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${HADOOP_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${HADOOP_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${HADOOP_VER}.tar.gz -+ # PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/hadoop-0.20.0-patch -+ CONFIGURE_COMMAND echo "nothing to configure" -+ BUILD_COMMAND echo "nothing to build" -+ BUILD_IN_SOURCE 1 -+ #--install Step ---------- -+ INSTALL_DIR ${HADOOP_INSTALL_LOC} -+ INSTALL_COMMAND cd ${HADOOP_VER} ${CMD_TERM} ${HADOOP_INSTALL} ) - - ## Set all the config information - set( HADOOP_TARGET ${HADOOP_TARGET} PARENT_SCOPE ) - set( HAVE_EXT_HADOOP ON PARENT_SCOPE ) -- append_var(CONDOR_EXTERNALS hadoop) -- message (STATUS "external configured (HADOOP_FOUND=${EXTERNAL_STAGE}/hdfs)") -+ message (STATUS "external configured (HADOOP_FOUND=${HADOOP_INSTALL_LOC}/hdfs)") - - if (WINDOWS) -- set_property( TARGET hadoop PROPERTY FOLDER "externals" ) -- install ( DIRECTORY ${EXTERNAL_STAGE}/hdfs/ DESTINATION ./hdfs ) -+ install ( DIRECTORY ${HADOOP_INSTALL_LOC}/hdfs/ DESTINATION ./hdfs ) - else() -- install ( DIRECTORY ${EXTERNAL_STAGE}/hdfs DESTINATION ${C_LIBEXEC} ) -+ install ( DIRECTORY ${HADOOP_INSTALL_LOC}/hdfs DESTINATION ${C_LIBEXEC} ) - endif() -+ -+ condor_post_external( hadoop OFF OFF ) - - else() - message (STATUS "external skipped (hadoop)") -diff --git a/externals/bundles/krb5/1.4.3-p0/CMakeLists.txt b/externals/bundles/krb5/1.4.3-p0/CMakeLists.txt -index 97e6d6e..10a38f4 100644 ---- a/externals/bundles/krb5/1.4.3-p0/CMakeLists.txt -+++ b/externals/bundles/krb5/1.4.3-p0/CMakeLists.txt -@@ -25,7 +25,7 @@ if (WITH_KRB5) - - if ( NOT PROPER ) - -- set (KRB5_VER krb5-1.4.3-p0) -+ condor_pre_external( KRB5 krb5-1.4.3-p0 "lib;include" "include/krb5.h") - - if (WINDOWS) - # Just so it is noted this is a complete and total hack build of an arcane -@@ -57,25 +57,28 @@ if (WITH_KRB5) - nmake NODEBUG=1 "DEFS=-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_NON_CONFORMING_SWPRINTFS -wd4002 -wd4005 -wd4013 -wd4018 -wd4028 -wd4047 -wd4090 -wd4091 -wd4101 -wd4102 -wd4133 -wd4146 -wd4244 -wd4700 -wd4996") - - # Something is wrong with the default install (make install suck-o) -- set (KRB5_INSTALL cp ${CMAKE_CURRENT_SOURCE_DIR}/win-mac.post.h ${EXTERNAL_STAGE}/include/win-mac.h \r\n -- cp -r src/lib/obj/i386/rel/* ${EXTERNAL_STAGE}/lib \r\n -- cp -r src/include/* ${EXTERNAL_STAGE}/include \r\n -+ set (KRB5_INSTALL cp ${CMAKE_CURRENT_SOURCE_DIR}/win-mac.post.h ${KRB5_INSTALL_LOC}/include/win-mac.h \r\n -+ cp -r src/lib/obj/i386/rel/* ${KRB5_INSTALL_LOC}/lib \r\n -+ cp -r src/include/* ${KRB5_INSTALL_LOC}/include \r\n - cd \"\\\" \r\n -- cd /D "${EXTERNAL_STAGE}/lib" \r\n -+ cd /D "${KRB5_INSTALL_LOC}/lib" \r\n - ${CMAKE_CURRENT_SOURCE_DIR}/manifest.bat ) - - else() -- set (KRB5_PATCH cp ${CMAKE_CURRENT_SOURCE_DIR}/src.appl.telnet.configure src/appl/telnet/configure ) -- set (KRB5_CONFIGURE src/configure --prefix=${EXTERNAL_STAGE} --without-tcl --enable-static --sysconfdir=/etc --disable-thread-support ) -+ set (KRB5_PATCH -+ cp ${CMAKE_CURRENT_SOURCE_DIR}/src.appl.telnet.configure src/appl/telnet/configure ${CMD_TERM} -+ patch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/eai_nodata.patch ${CMD_TERM} -+ patch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/getline.patch ) -+ -+ set (KRB5_CONFIGURE src/configure --prefix=${KRB5_INSTALL_LOC} --without-tcl --enable-static --sysconfdir=/etc --disable-thread-support ) - set (KRB5_MAKE make ) - set (KRB5_INSTALL make install ) - endif() - - ExternalProject_Add(krb5 -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${KRB5_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${KRB5_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${KRB5_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${KRB5_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND cd ${KRB5_VER} ${CMD_TERM} ${KRB5_PATCH} -@@ -85,31 +88,28 @@ if (WITH_KRB5) - BUILD_COMMAND cd ${KRB5_VER} ${CMD_TERM} ${KRB5_MAKE} - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${KRB5_INSTALL_LOC} - INSTALL_COMMAND cd ${KRB5_VER} ${CMD_TERM} ${KRB5_INSTALL} ) - - # Set the target dependencies which the rest of condor depends on. - if (WINDOWS) -- set(KRB5_FOUND "${EXTERNAL_STAGE}/lib/comerr32.lib;${EXTERNAL_STAGE}/lib/gssapi32.lib;${EXTERNAL_STAGE}/lib/k5sprt32.lib;${EXTERNAL_STAGE}/lib/krb5_32.lib;${EXTERNAL_STAGE}/lib/xpprof32.lib") -+ set(KRB5_FOUND "${KRB5_INSTALL_LOC}/lib/comerr32.lib;${KRB5_INSTALL_LOC}/lib/gssapi32.lib;${KRB5_INSTALL_LOC}/lib/k5sprt32.lib;${KRB5_INSTALL_LOC}/lib/krb5_32.lib;${KRB5_INSTALL_LOC}/lib/xpprof32.lib") - - #this may become the common case. -- install ( FILES ${EXTERNAL_STAGE}/lib/comerr32.dll -- ${EXTERNAL_STAGE}/lib/gssapi32.dll -- ${EXTERNAL_STAGE}/lib/k5sprt32.dll -- ${EXTERNAL_STAGE}/lib/krb5_32.dll -- ${EXTERNAL_STAGE}/lib/xpprof32.dll -+ install ( FILES ${KRB5_INSTALL_LOC}/lib/comerr32.dll -+ ${KRB5_INSTALL_LOC}/lib/gssapi32.dll -+ ${KRB5_INSTALL_LOC}/lib/k5sprt32.dll -+ ${KRB5_INSTALL_LOC}/lib/krb5_32.dll -+ ${KRB5_INSTALL_LOC}/lib/xpprof32.dll - DESTINATION ${C_LIB} ) -- -- set_property( TARGET krb5 PROPERTY FOLDER "externals" ) -- - else() -- set(KRB5_FOUND "${EXTERNAL_STAGE}/lib/libkrb5.a;${EXTERNAL_STAGE}/lib/libk5crypto.a;${EXTERNAL_STAGE}/lib/libcom_err.a;${EXTERNAL_STAGE}/lib/libkrb5support.a") -+ set(KRB5_FOUND "${KRB5_INSTALL_LOC}/lib/libkrb5.a;${KRB5_INSTALL_LOC}/lib/libk5crypto.a;${KRB5_INSTALL_LOC}/lib/libcom_err.a;${KRB5_INSTALL_LOC}/lib/libkrb5support.a") - if ( AIX ) - set (KRB5_FOUND "-Wl,-bstatic;${KRB5_FOUND};-Wl,-bdynamic") - endif() - endif() - -- append_var(CONDOR_EXTERNALS krb5) -+ condor_post_external( krb5 include OFF ) - - else( NOT PROPER ) - -diff --git a/externals/bundles/krb5/1.4.3-p0/eai_nodata.patch b/externals/bundles/krb5/1.4.3-p0/eai_nodata.patch -new file mode 100644 -index 0000000..9e3a21f ---- /dev/null -+++ b/externals/bundles/krb5/1.4.3-p0/eai_nodata.patch -@@ -0,0 +1,21 @@ -+diff -r -u krb5-1.4.3-p0.orig/src/include/fake-addrinfo.h krb5-1.4.3-p0.patched/src/include/fake-addrinfo.h -+--- krb5-1.4.3-p0.orig/src/include/fake-addrinfo.h 2005-06-01 14:24:32.000000000 -0500 -++++ krb5-1.4.3-p0.patched/src/include/fake-addrinfo.h 2011-05-26 14:34:27.635844891 -0500 -+@@ -164,6 +164,17 @@ -+ #define HAVE_GETNAMEINFO 1 -+ #endif -+ -++/* Modern machines have changed how getaddrinfo is defined from RFC2553 to -++ * RFC 3943, but often didn't provide any backwards compatibility. -++ * So, given the knowledge from this post: -++ * http://osdir.com/ml/encryption.kerberos.devel/2005-02/msg00025.html -++ * I'm going to use that code. -psilord 05/26/2011 -++ * -++ * See git track #1998 for the ticket which generated this patch. -++*/ -++#if defined(EAI_NONAME) && !defined(EAI_NODATA) -++#define EAI_NODATA EAI_NONAME -++#endif -+ -+ /* Do we actually have *any* systems we care about that don't provide -+ either getaddrinfo or one of these two flavors of -diff --git a/externals/bundles/krb5/1.4.3-p0/getline.patch b/externals/bundles/krb5/1.4.3-p0/getline.patch -new file mode 100644 -index 0000000..160aa51 ---- /dev/null -+++ b/externals/bundles/krb5/1.4.3-p0/getline.patch -@@ -0,0 +1,65 @@ -+diff -r -u krb5-1.4.3-p0.orig/src/appl/gssftp/ftpd/ftpcmd.y krb5-1.4.3-p0.patched/src/appl/gssftp/ftpd/ftpcmd.y -+--- krb5-1.4.3-p0.orig/src/appl/gssftp/ftpd/ftpcmd.y 2004-12-03 19:39:07.000000000 -0600 -++++ krb5-1.4.3-p0.patched/src/appl/gssftp/ftpd/ftpcmd.y 2011-05-26 16:01:01.536685466 -0500 -+@@ -968,10 +968,10 @@ -+ #include -+ -+ /* -+- * getline - a hacked up version of fgets to ignore TELNET escape codes. -++ * xgetline - a hacked up version of fgets to ignore TELNET escape codes. -+ */ -+ char * -+-getline(s, n, iop) -++xgetline(s, n, iop) -+ char *s; -+ int n; -+ register FILE *iop; -+@@ -1213,13 +1213,13 @@ -+ case CMD: -+ (void) signal(SIGALRM, toolong); -+ (void) alarm((unsigned) timeout); -+- if (getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) { -++ if (xgetline(cbuf, sizeof(cbuf)-1, stdin) == NULL) { -+ reply(221, "You could at least say goodbye."); -+ dologout(0); -+ } -+ (void) alarm(0); -+ -+- /* If getline() finds an error, the string is null */ -++ /* If xgetline() finds an error, the string is null */ -+ if (*cbuf == '\0') -+ continue; -+ -+diff -r -u krb5-1.4.3-p0.orig/src/appl/gssftp/ftpd/ftpd.c krb5-1.4.3-p0.patched/src/appl/gssftp/ftpd/ftpd.c -+--- krb5-1.4.3-p0.orig/src/appl/gssftp/ftpd/ftpd.c 2005-01-21 16:46:47.000000000 -0600 -++++ krb5-1.4.3-p0.patched/src/appl/gssftp/ftpd/ftpd.c 2011-05-26 16:00:28.959690454 -0500 -+@@ -176,7 +176,7 @@ -+ extern char *home; /* pointer to home directory for glob */ -+ extern FILE *ftpd_popen(), *fopen(), *freopen(); -+ extern int ftpd_pclose(), fclose(); -+-extern char *getline(); -++extern char *xgetline(); -+ extern char cbuf[]; -+ extern off_t restart_point; -+ -+@@ -2139,7 +2139,7 @@ -+ if (!transflag) -+ return; -+ cp = tmpline; -+- if (getline(cp, sizeof(tmpline), stdin) == NULL) { -++ if (xgetline(cp, sizeof(tmpline), stdin) == NULL) { -+ reply(221, "You could at least say goodbye."); -+ dologout(0); -+ } -+diff -r -u krb5-1.4.3-p0.orig/src/appl/gssftp/ftpd/ftpd_var.h krb5-1.4.3-p0.patched/src/appl/gssftp/ftpd/ftpd_var.h -+--- krb5-1.4.3-p0.orig/src/appl/gssftp/ftpd/ftpd_var.h 2001-10-09 22:18:22.000000000 -0500 -++++ krb5-1.4.3-p0.patched/src/appl/gssftp/ftpd/ftpd_var.h 2011-05-26 16:00:15.344695477 -0500 -+@@ -89,7 +89,7 @@ -+ -+ /* ftpcmd.y */ -+ void upper(char *); -+-char *getline(char *, int, FILE *); -++char *xgetline(char *, int, FILE *); -+ #endif /* FTPD_VAR_H__ */ -+ -+ /* popen.c */ -diff --git a/externals/bundles/libcgroup/0.37/CMakeLists.txt b/externals/bundles/libcgroup/0.37/CMakeLists.txt -new file mode 100644 -index 0000000..0b3a072 ---- /dev/null -+++ b/externals/bundles/libcgroup/0.37/CMakeLists.txt -@@ -0,0 +1,64 @@ -+ ############################################################### -+ # -+ # Copyright (C) 1990-2010, Redhat. -+ # -+ # Licensed under the Apache License, Version 2.0 (the "License"); you -+ # may not use this file except in compliance with the License. You may -+ # obtain a copy of the License at -+ # -+ # http://www.apache.org/licenses/LICENSE-2.0 -+ # -+ # Unless required by applicable law or agreed to in writing, software -+ # distributed under the License is distributed on an "AS IS" BASIS, -+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ # See the License for the specific language governing permissions and -+ # limitations under the License. -+ # -+ ############################################################### -+ -+if (LINUX) -+ option(WITH_LIBCGROUP "Compiling with support for libcgroup" ON) -+endif() -+ -+if (WITH_LIBCGROUP) -+ -+ if ( NOT PROPER ) -+ -+ condor_pre_external( LIBCGROUP libcgroup-0.37 "lib;include" "lib/libcgroup.a") -+ -+ ExternalProject_Add( libcgroup -+ #-- Download Step ---------- -+ DOWNLOAD_COMMAND wget -N http://cdnetworks-us-1.dl.sourceforge.net/project/libcg/libcgroup/v0.37/${LIBCGROUP_VER}.tar.bz2 ${CMD_TERM} -+ DOWNLOAD_DIR ${LIBCGROUP_STAGE}/dl -+ URL http://cdnetworks-us-1.dl.sourceforge.net/project/libcg/libcgroup/v0.37/${LIBCGROUP_VER}.tar.bz2 -+ #--Configure step ---------- -+ CONFIGURE_COMMAND cd ${LIBCGROUP_VER} ${CMD_TERM} ./configure --prefix=${LIBCGROUP_INSTALL_LOC} --enable-static=yes --disable-dependency-tracking -+ #--Build Step ---------- -+ BUILD_COMMAND cd ${LIBCGROUP_VER} ${CMD_TERM} make -+ BUILD_IN_SOURCE 1 -+ #--install Step ---------- -+ INSTALL_DIR ${LIBCGROUP_INSTALL_LOC} -+ INSTALL_COMMAND cd ${LIBCGROUP_VER} ${CMD_TERM} make install ) -+ -+ # Set the target dependencies which the rest of condor depends on. -+ set(LIBCGROUP_FOUND "${LIBCGROUP_INSTALL_LOC}/lib/libcgroup.a") -+ -+ #set ( LIBCGROUP_SHARE "${EXTERNAL_BUILD_PREFIX}/${LIBCGROUP_VER}/src/libcgroup/${LIBCGROUP_VER}/libcgroup" ) -+ -+ condor_post_external( libcgroup include OFF ) -+ -+ else( NOT PROPER ) -+ -+ find_multiple( "cgroup" LIBCGROUP_FOUND) -+ -+ endif( NOT PROPER ) -+ -+endif() -+ -+if (LIBCGROUP_FOUND) -+ set( LIBCGROUP_FOUND ${LIBCGROUP_FOUND} PARENT_SCOPE ) -+ set( HAVE_EXT_LIBCGROUP ON PARENT_SCOPE ) -+ message ( STATUS "external configured (LIBCGROUP_FOUND=${LIBCGROUP_FOUND})" ) -+else() -+ message (STATUS "external skipped (libcgroup)") -+endif() -diff --git a/externals/bundles/libdeltacloud/0.7/CMakeLists.txt b/externals/bundles/libdeltacloud/0.7/CMakeLists.txt -deleted file mode 100644 -index 08113bb..0000000 ---- a/externals/bundles/libdeltacloud/0.7/CMakeLists.txt -+++ /dev/null -@@ -1,65 +0,0 @@ -- ############################################################### -- # -- # Copyright 2011 Red Hat, Inc. -- # -- # Licensed under the Apache License, Version 2.0 (the "License"); you -- # may not use this file except in compliance with the License. You may -- # obtain a copy of the License at -- # -- # http://www.apache.org/licenses/LICENSE-2.0 -- # -- # Unless required by applicable law or agreed to in writing, software -- # distributed under the License is distributed on an "AS IS" BASIS, -- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- # See the License for the specific language governing permissions and -- # limitations under the License. -- # -- ############################################################### -- --if ( LINUX ) -- option(WITH_LIBDELTACLOUD "Compiling with support for Deltacloud" ON) --endif( LINUX ) -- --if (WITH_LIBDELTACLOUD) -- -- if ( NOT PROPER ) -- -- set(LIBDELTACLOUD_VER libdeltacloud-0.7) -- -- ExternalProject_Add(libdeltacloud -- DEPENDS curl libxml2 -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${LIBDELTACLOUD_VER} -- #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${LIBDELTACLOUD_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${LIBDELTACLOUD_VER}.tar.gz -- #--Configure step ---------- -- CONFIGURE_COMMAND cd ${LIBDELTACLOUD_VER} && ./configure --prefix=${EXTERNAL_STAGE} --with-libxml=${EXTERNAL_STAGE} --with-libcurl=${EXTERNAL_STAGE} --disable-shared -- #--Build Step ---------- -- BUILD_COMMAND cd ${LIBDELTACLOUD_VER} && make -- BUILD_IN_SOURCE 1 -- #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd ${LIBDELTACLOUD_VER} && make install ) -- -- # Set the target dependencies which the rest of condor depends on. -- set(LIBDELTACLOUD_FOUND "${EXTERNAL_STAGE}/lib/libdeltacloud.a") -- append_var( CONDOR_EXTERNALS libdeltacloud ) -- -- else( NOT PROPER ) -- -- find_multiple( "deltacloud" LIBDELTACLOUD_FOUND ) -- -- endif( NOT PROPER ) -- -- if (LIBDELTACLOUD_FOUND) -- message (STATUS "external configured (LIBDELTACLOUD_FOUND=${LIBDELTACLOUD_FOUND})") -- set( LIBDELTACLOUD_FOUND ${LIBDELTACLOUD_FOUND} PARENT_SCOPE ) -- set( HAVE_EXT_LIBDELTACLOUD ON PARENT_SCOPE ) -- endif(LIBDELTACLOUD_FOUND) -- --else(WITH_LIBDELTACLOUD) -- -- message (STATUS "external skipped (libdeltacloud)") -- --endif(WITH_LIBDELTACLOUD) -diff --git a/externals/bundles/libdeltacloud/0.8/CMakeLists.txt b/externals/bundles/libdeltacloud/0.8/CMakeLists.txt -new file mode 100644 -index 0000000..152b9e0 ---- /dev/null -+++ b/externals/bundles/libdeltacloud/0.8/CMakeLists.txt -@@ -0,0 +1,72 @@ -+ ############################################################### -+ # -+ # Copyright 2011 Red Hat, Inc. -+ # -+ # Licensed under the Apache License, Version 2.0 (the "License"); you -+ # may not use this file except in compliance with the License. You may -+ # obtain a copy of the License at -+ # -+ # http://www.apache.org/licenses/LICENSE-2.0 -+ # -+ # Unless required by applicable law or agreed to in writing, software -+ # distributed under the License is distributed on an "AS IS" BASIS, -+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ # See the License for the specific language governing permissions and -+ # limitations under the License. -+ # -+ ############################################################### -+ -+if ( LINUX ) -+ option(WITH_LIBDELTACLOUD "Compiling with support for Deltacloud" ON) -+endif( LINUX ) -+ -+if (WITH_LIBDELTACLOUD) -+ -+ if ( NOT PROPER ) -+ -+ condor_pre_external( LIBDELTACLOUD libdeltacloud-0.8 "lib;include" "lib/libdeltacloud.a") -+ -+ if ( BUILDING_LIBXML2 ) -+ set (LIBDELTACLOUD_DEPENDS ${CURL_REF} ${LIBXML2_REF}) -+ set (LIBDELTACLOUD_CONFIGURE --with-libxml=${LIBXML2_INSTALL_LOC}) -+ else () -+ set (LIBDELTACLOUD_DEPENDS ${CURL_REF}) -+ set (LIBDELTACLOUD_CONFIGURE "") -+ endif () -+ ExternalProject_Add(libdeltacloud -+ DEPENDS ${LIBDELTACLOUD_DEPENDS} -+ #-- Download Step ---------- -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${LIBDELTACLOUD_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${LIBDELTACLOUD_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${LIBDELTACLOUD_VER}.tar.gz -+ #--Configure step ---------- -+ CONFIGURE_COMMAND cd ${LIBDELTACLOUD_VER} && ./configure --prefix=${LIBDELTACLOUD_INSTALL_LOC} --with-libcurl=${CURL_INSTALL_LOC} --disable-shared ${LIBDELTACLOUD_CONFIGURE} -+ #--Build Step ---------- -+ BUILD_COMMAND cd ${LIBDELTACLOUD_VER} && make -+ BUILD_IN_SOURCE 1 -+ #--install Step ---------- -+ INSTALL_DIR ${LIBDELTACLOUD_INSTALL_LOC} -+ INSTALL_COMMAND cd ${LIBDELTACLOUD_VER} && make install ) -+ -+ # Set the target dependencies which the rest of condor depends on. -+ set(LIBDELTACLOUD_FOUND "${LIBDELTACLOUD_INSTALL_LOC}/lib/libdeltacloud.a") -+ -+ condor_post_external( libdeltacloud include OFF ) -+ -+ else( NOT PROPER ) -+ -+ find_multiple( "deltacloud" LIBDELTACLOUD_FOUND ) -+ -+ endif( NOT PROPER ) -+ -+ if (LIBDELTACLOUD_FOUND) -+ message (STATUS "external configured (LIBDELTACLOUD_FOUND=${LIBDELTACLOUD_FOUND})") -+ set( LIBDELTACLOUD_FOUND ${LIBDELTACLOUD_FOUND} PARENT_SCOPE ) -+ set( HAVE_EXT_LIBDELTACLOUD ON PARENT_SCOPE ) -+ endif(LIBDELTACLOUD_FOUND) -+ -+else(WITH_LIBDELTACLOUD) -+ -+ message (STATUS "external skipped (libdeltacloud)") -+ -+endif(WITH_LIBDELTACLOUD) -diff --git a/externals/bundles/libvirt/0.6.2/CMakeLists.txt b/externals/bundles/libvirt/0.6.2/CMakeLists.txt -index ef0f877..1e94237 100644 ---- a/externals/bundles/libvirt/0.6.2/CMakeLists.txt -+++ b/externals/bundles/libvirt/0.6.2/CMakeLists.txt -@@ -26,28 +26,38 @@ if (WITH_LIBVIRT) - - if ( NOT PROPER AND NOT LIBVIRT_FOUND ) - -- set (LIBVERT_VER libvirt-0.6.2) -+ set (LIBVIRT_REAL_VERSION libvirt-0.6.2) - -+ condor_pre_external( LIBVIRT ${LIBVIRT_REAL_VERSION}-p1 "lib;include" "lib/libvirt.a" ) -+ -+ if ( BUILDING_LIBXML2 ) -+ set (LIBVIRT_DEPENDS ${LIBXML2_REF}) -+ set (LIBVIRT_CONFIGURE --with-libxml=${LIBXML2_INSTALL_LOC}) -+ else () -+ set (LIBVIRT_DEPENDS "") -+ set (LIBVIRT_CONFIGURE "") -+ endif () - ExternalProject_Add(libvirt -- DEPENDS libxml2 -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${LIBVERT_VER} -+ DEPENDS ${LIBVIRT_DEPENDS} - #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${LIBVERT_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${LIBVERT_VER}.tar.gz -- PATCH_COMMAND cd ${LIBVERT_VER} && patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/no_gnutls.patch -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${LIBVIRT_REAL_VERSION}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${LIBVIRT_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${LIBVIRT_REAL_VERSION}.tar.gz -+ PATCH_COMMAND cd ${LIBVIRT_REAL_VERSION} && patch -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/no_gnutls.patch - #--Configure step ---------- -- CONFIGURE_COMMAND cd ${LIBVERT_VER} && ./configure --prefix=${EXTERNAL_STAGE} --disable-shared --without-python --without-xen --without-libvirtd --without-remote --without-test --without-uml --without-openvz --without-avahi --without-selinux --without-sasl --with-libxml=${EXTERNAL_STAGE} -+ CONFIGURE_COMMAND cd ${LIBVIRT_REAL_VERSION} && -+ ./configure --prefix=${LIBVIRT_INSTALL_LOC} --without-python --without-xen --without-libvirtd --without-remote --without-test --without-uml --without-openvz --without-avahi --without-selinux --without-sasl ${LIBVIRT_CONFIGURE} - #--Build Step ---------- -- BUILD_COMMAND cd ${LIBVERT_VER} && make -+ BUILD_COMMAND cd ${LIBVIRT_REAL_VERSION} && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd ${LIBVERT_VER} && make install ) -+ INSTALL_DIR ${LIBVIRT_INSTALL_LOC} -+ INSTALL_COMMAND cd ${LIBVIRT_REAL_VERSION} && make install ) - - # Set the target dependencies which the rest of condor depends on. -- set(LIBVIRT_FOUND "${EXTERNAL_STAGE}/lib/libvirt.a") -- append_var(CONDOR_EXTERNALS libvirt) -+ set(LIBVIRT_FOUND "${LIBVIRT_INSTALL_LOC}/lib/libvirt.so") -+ -+ condor_post_external( libvirt include OFF ) - - endif( NOT PROPER AND NOT LIBVIRT_FOUND ) - -diff --git a/externals/bundles/libxml2/2.7.3/CMakeLists.txt b/externals/bundles/libxml2/2.7.3/CMakeLists.txt -index 271f9dc..28168cf 100644 ---- a/externals/bundles/libxml2/2.7.3/CMakeLists.txt -+++ b/externals/bundles/libxml2/2.7.3/CMakeLists.txt -@@ -22,33 +22,36 @@ endif() - - if (WITH_LIBXML2) - -- if ( NOT PROPER ) -+ if ( NOT PROPER AND "${RPM_SYSTEM_NAME}" MATCHES "rhel3" ) -+ -+ condor_pre_external( LIBXML2 libxml2-2.7.3 "lib;include" "lib/libxml2") - -- set (LIBXML2_VER libxml2-2.7.3 ) - ExternalProject_Add( libxml2 -- DEPENDS zlib -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${LIBXML2_VER} -+ DEPENDS ${ZLIB_REF} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${LIBXML2_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${LIBXML2_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${LIBXML2_VER}.tar.gz - #--Configure step ---------- -- CONFIGURE_COMMAND cd ${LIBXML2_VER} && ./configure --prefix=${EXTERNAL_STAGE} --disable-shared --with-zlib=${EXTERNAL_STAGE} -+ CONFIGURE_COMMAND cd ${LIBXML2_VER} && ./configure --prefix=${LIBXML2_INSTALL_LOC} - #--Build Step ---------- - BUILD_COMMAND cd ${LIBXML2_VER} && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${LIBXML2_INSTALL_LOC} - INSTALL_COMMAND cd ${LIBXML2_VER} && make install ) - - # Set the target dependencies which the rest of condor depends on. -- set(LIBXML2_FOUND "${EXTERNAL_STAGE}/lib/libxml2.a") -- append_var(CONDOR_EXTERNALS libxml2) -+ set(LIBXML2_FOUND "${LIBXML2_INSTALL_LOC}/lib/libxml2.a") -+ set(BUILDING_LIBXML2 ON PARENT_SCOPE) -+ -+ condor_post_external( libxml2 OFF OFF ) -+ - else() - -- find_multiple( "xml2" LIBXML2_FOUND ) -+ find_multiple( "xml2" LIBXML2_FOUND ) - -- endif( NOT PROPER ) -+ endif( NOT PROPER AND "${RPM_SYSTEM_NAME}" MATCHES "rhel3" ) - - endif(WITH_LIBXML2) - -diff --git a/externals/bundles/openssl/0.9.8h-p2/CMakeLists.txt b/externals/bundles/openssl/0.9.8h-p2/CMakeLists.txt -index 7430df0..3d62b75 100644 ---- a/externals/bundles/openssl/0.9.8h-p2/CMakeLists.txt -+++ b/externals/bundles/openssl/0.9.8h-p2/CMakeLists.txt -@@ -22,7 +22,7 @@ if (WITH_OPENSSL) - - if ( NOT PROPER ) - -- set(OPENSSL_VER openssl-0.9.8h) -+ condor_pre_external( OPENSSL openssl-0.9.8h "lib;include" "include/openssl/ssl.h") - - if (WINDOWS) - set (OPENSSL_PATCH patch --binary -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/renegotiate.patch \r\n -@@ -31,23 +31,23 @@ if (WITH_OPENSSL) - set (OPENSSL_CONFIGURE perl Configure VC-WIN32 ) - set (OPENSSL_MAKE call ms/do_nt.bat \r\n - nmake -f ms/ntdll.mak ) -- set (OPENSSL_INSTALL cp out32dll/*.lib ${EXTERNAL_STAGE}/lib \r\n -- cp out32dll/*.dll ${EXTERNAL_STAGE}/lib \r\n -- cp -r inc32/* ${EXTERNAL_STAGE}/include \r\n -- cp ${CMAKE_CURRENT_SOURCE_DIR}/ossl_typ-post.h ${EXTERNAL_STAGE}/include/openssl/ossl_typ.h ) -+ set (OPENSSL_INSTALL cp out32dll/*.lib ${OPENSSL_INSTALL_LOC}/lib \r\n -+ cp out32dll/*.dll ${OPENSSL_INSTALL_LOC}/lib \r\n -+ cp -r inc32/* ${OPENSSL_INSTALL_LOC}/include \r\n -+ cp ${CMAKE_CURRENT_SOURCE_DIR}/ossl_typ-post.h ${OPENSSL_INSTALL_LOC}/include/openssl/ossl_typ.h ) - else(WINDOWS) - set (OPENSSL_PATCH patch --binary -p0 -i ${CMAKE_CURRENT_SOURCE_DIR}/renegotiate.patch && - sed 's/-fomit-frame-pointer//' Configure > Configure.new && - mv Configure.new Configure && - chmod a+rx Configure ) - -- set (OPENSSL_CONFIGURE ./config --prefix=${EXTERNAL_STAGE} no-asm ) -+ set (OPENSSL_CONFIGURE ./config --prefix=${OPENSSL_INSTALL_LOC} no-asm ) - - if (DARWIN) - string(SUBSTRING ${OS_VER} 0 2 DARWIN_MAJOR) - if(${DARWIN_MAJOR} STREQUAL "10") - dprint("OPENSSL_CONVERT") -- set (OPENSSL_CONFIGURE ./Configure darwin64-x86_64-cc --prefix=${EXTERNAL_STAGE} no-asm -fPIC ) -+ set (OPENSSL_CONFIGURE ./Configure darwin64-x86_64-cc --prefix=${OPENSSL_INSTALL_LOC} no-asm -fPIC ) - endif() - endif() - -@@ -59,10 +59,9 @@ if (WITH_OPENSSL) - endif(WINDOWS) - - ExternalProject_Add( openssl -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${OPENSSL_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${OPENSSL_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${OPENSSL_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${OPENSSL_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND cd ${OPENSSL_VER} ${CMD_TERM} ${OPENSSL_PATCH} -@@ -72,25 +71,23 @@ if (WITH_OPENSSL) - BUILD_COMMAND cd ${OPENSSL_VER} ${CMD_TERM} ${OPENSSL_MAKE} - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${OPENSSL_INSTALL_LOC} - INSTALL_COMMAND cd ${OPENSSL_VER} ${CMD_TERM} ${OPENSSL_INSTALL} ) - - # Set the target dependencies which the rest of condor depends on. - if (WINDOWS) -- set(OPENSSL_FOUND "${EXTERNAL_STAGE}/lib/libeay32.lib;${EXTERNAL_STAGE}/lib/ssleay32.lib") -+ set(OPENSSL_FOUND "${OPENSSL_INSTALL_LOC}/lib/libeay32.lib;${OPENSSL_INSTALL_LOC}/lib/ssleay32.lib") - - #this may become the common case. -- install ( FILES ${EXTERNAL_STAGE}/lib/libeay32.dll -- ${EXTERNAL_STAGE}/lib/ssleay32.dll -+ install ( FILES ${OPENSSL_INSTALL_LOC}/lib/libeay32.dll -+ ${OPENSSL_INSTALL_LOC}/lib/ssleay32.dll - DESTINATION ${C_LIB} ) -- -- set_property( TARGET openssl PROPERTY FOLDER "externals" ) - - else(WINDOWS) -- set(OPENSSL_FOUND "${EXTERNAL_STAGE}/lib/libssl.a;${EXTERNAL_STAGE}/lib/libcrypto.a") -+ set(OPENSSL_FOUND "${OPENSSL_INSTALL_LOC}/lib/libssl.a;${OPENSSL_INSTALL_LOC}/lib/libcrypto.a") - endif(WINDOWS) - -- append_var(CONDOR_EXTERNALS openssl) -+ condor_post_external( openssl include OFF ) - - else( NOT PROPER ) - -@@ -101,6 +98,7 @@ if (WITH_OPENSSL) - if (OPENSSL_FOUND) - message (STATUS "external configured (OPENSSL_FOUND=${OPENSSL_FOUND})") - set( OPENSSL_FOUND ${OPENSSL_FOUND} PARENT_SCOPE ) -+ set( OPENSSL_INSTALL_LOC ${OPENSSL_INSTALL_LOC} PARENT_SCOPE ) - set( HAVE_EXT_OPENSSL ON PARENT_SCOPE ) - set( HAVE_OPENSSL_SSL_H ON PARENT_SCOPE ) - endif(OPENSSL_FOUND) -diff --git a/externals/bundles/pcre/7.6/CMakeLists.txt b/externals/bundles/pcre/7.6/CMakeLists.txt -index 3c1e08a..1c0013d 100644 ---- a/externals/bundles/pcre/7.6/CMakeLists.txt -+++ b/externals/bundles/pcre/7.6/CMakeLists.txt -@@ -16,80 +16,70 @@ - # - ############################################################### - --# currently hard dependency --#option(WITH_PCRE "Compiling with support for PCRE" ON) --#if (WITH_PCRE) -+if ( NOT PROPER ) - -- if ( NOT PROPER ) -+ condor_pre_external( PCRE pcre-7.6 "lib;include" "include/pcre.h") - -- set (PCRE_VER pcre-7.6) -- if (WINDOWS) -- set (PCRE_PATCH cp ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.win32 . \r\n -- cp ${CMAKE_CURRENT_SOURCE_DIR}/pcre.h.win32 pcre.h \r\n -- cp ${CMAKE_CURRENT_SOURCE_DIR}/libpcre.def.win32 libpcre.def ) -- set (PCRE_CONFIGURE cp ${CMAKE_CURRENT_SOURCE_DIR}/config.h.win32 config.h) -- set (PCRE_MAKE gmake -f Makefile.win32 ) -- set (PCRE_INSTALL cp libpcre.lib ${EXTERNAL_STAGE}/lib \r\n -- cp libpcre.dll ${EXTERNAL_STAGE}/lib \r\n -- cp pcre.h ${EXTERNAL_STAGE}/include ) -- else() -- set (PCRE_PATCH patch --binary -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/longlong.patch && -- patch --binary -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/unittests.patch ) -- set (PCRE_CONFIGURE ./configure --prefix=${EXTERNAL_STAGE} --disable-cpp ) -- set (PCRE_MAKE make && make test ) -- set (PCRE_INSTALL make install ) -- endif() -- -- ExternalProject_Add(pcre -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${PCRE_VER} -- #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${PCRE_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${PCRE_VER}.tar.gz -- #--Patch step ---------- -- PATCH_COMMAND cd ${PCRE_VER} ${CMD_TERM} ${PCRE_PATCH} -- #--Configure step ---------- -- CONFIGURE_COMMAND cd ${PCRE_VER} ${CMD_TERM} ${PCRE_CONFIGURE} -- #--Build Step ---------- -- BUILD_COMMAND cd ${PCRE_VER} ${CMD_TERM} ${PCRE_MAKE} -- BUILD_IN_SOURCE 1 -- #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd ${PCRE_VER} ${CMD_TERM} ${PCRE_INSTALL} ) -- -- # Set the target dependencies which the rest of condor depends on. -- if (WINDOWS) -- set(PCRE_FOUND "${EXTERNAL_STAGE}/lib/libpcre.lib") -+ if (WINDOWS) -+ set (PCRE_PATCH cp ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.win32 . \r\n -+ cp ${CMAKE_CURRENT_SOURCE_DIR}/pcre.h.win32 pcre.h \r\n -+ cp ${CMAKE_CURRENT_SOURCE_DIR}/libpcre.def.win32 libpcre.def ) -+ set (PCRE_CONFIGURE cp ${CMAKE_CURRENT_SOURCE_DIR}/config.h.win32 config.h) -+ set (PCRE_MAKE gmake -f Makefile.win32 ) -+ set (PCRE_INSTALL cp libpcre.lib ${PCRE_INSTALL_LOC}/lib \r\n -+ cp libpcre.dll ${PCRE_INSTALL_LOC}/lib \r\n -+ cp pcre.h ${PCRE_INSTALL_LOC}/include ) -+ else() -+ set (PCRE_PATCH patch --binary -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/longlong.patch && -+ patch --binary -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/unittests.patch ) -+ set (PCRE_CONFIGURE ./configure --prefix=${PCRE_INSTALL_LOC} --disable-cpp ) -+ set (PCRE_MAKE make && make test ) -+ set (PCRE_INSTALL make install ) -+ endif() - -- #this may become the common case. -- install ( FILES ${EXTERNAL_STAGE}/lib/libpcre.dll DESTINATION ${C_LIB} ) -- -- set_property( TARGET pcre PROPERTY FOLDER "externals" ) -- -- else() -- set(PCRE_FOUND "${EXTERNAL_STAGE}/lib/libpcre.a") -- if ( AIX ) -- set (PCRE_FOUND "-Wl,-bstatic;${PCRE_FOUND};-Wl,-bdynamic") -- endif() -- endif() -+ ExternalProject_Add(pcre -+ #-- Download Step ---------- -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${PCRE_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${PCRE_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${PCRE_VER}.tar.gz -+ #--Patch step ---------- -+ PATCH_COMMAND cd ${PCRE_VER} ${CMD_TERM} ${PCRE_PATCH} -+ #--Configure step ---------- -+ CONFIGURE_COMMAND cd ${PCRE_VER} ${CMD_TERM} ${PCRE_CONFIGURE} -+ #--Build Step ---------- -+ BUILD_COMMAND cd ${PCRE_VER} ${CMD_TERM} ${PCRE_MAKE} -+ BUILD_IN_SOURCE 1 -+ #--install Step ---------- -+ INSTALL_DIR ${PCRE_INSTALL_LOC} -+ INSTALL_COMMAND cd ${PCRE_VER} ${CMD_TERM} ${PCRE_INSTALL} ) -+ -+ ################################################################# -+ # Set the target dependencies which the rest of condor depends on. -+ if (WINDOWS) -+ set(PCRE_FOUND "${PCRE_INSTALL_LOC}/lib/libpcre.lib") -+ install ( FILES ${PCRE_INSTALL_LOC}/lib/libpcre.dll DESTINATION ${C_LIB} ) -+ else() -+ set(PCRE_FOUND "${PCRE_INSTALL_LOC}/lib/libpcre.a") -+ endif() -+ # -+ ################################################################# - -- append_var(CONDOR_EXTERNALS pcre) -+ condor_post_external( pcre include OFF ) - -- else( NOT PROPER ) -+else( NOT PROPER ) - -- find_multiple( "pcre;libpcre" PCRE_FOUND ) -+ find_multiple( "pcre" PCRE_FOUND ) - -- endif( NOT PROPER ) -+endif( NOT PROPER ) - -- if (PCRE_FOUND) -- message (STATUS "external configured (PCRE_FOUND=${PCRE_FOUND})") -- set( PCRE_FOUND ${PCRE_FOUND} PARENT_SCOPE ) -- set( HAVE_EXT_PCRE ON PARENT_SCOPE ) -- set( HAVE_PCRE_H ON PARENT_SCOPE ) -- else() -- message (FATAL_ERROR "pcre not found and is required to build") -- endif(PCRE_FOUND) -+##################### -+## Hard failure if there is no PCRE -+if (PCRE_FOUND) -+ message (STATUS "external configured (PCRE_FOUND=${PCRE_FOUND})") -+ set( PCRE_FOUND ${PCRE_FOUND} PARENT_SCOPE ) -+ set( HAVE_EXT_PCRE ON PARENT_SCOPE ) -+ set( HAVE_PCRE_H ON PARENT_SCOPE ) -+else() -+ message (FATAL_ERROR "pcre not found and is required to build") -+endif(PCRE_FOUND) - --#else(WITH_PCRE) --# message (STATUS "external skipped (pcre)") --#endif(WITH_PCRE) -diff --git a/externals/bundles/postgresql/8.2.3-p1/CMakeLists.txt b/externals/bundles/postgresql/8.2.3-p1/CMakeLists.txt -index 67f8082..a928c2d 100644 ---- a/externals/bundles/postgresql/8.2.3-p1/CMakeLists.txt -+++ b/externals/bundles/postgresql/8.2.3-p1/CMakeLists.txt -@@ -26,30 +26,29 @@ if (WITH_POSTGRESQL) - - if ( NOT PROPER ) - -- set (POSTGRESQL_VER postgresql-8.2.3) -+ condor_pre_external( POSTGRESQL postgresql-8.2.3 "lib;include" "include/postgres.h") - - if (WINDOWS) - set (POSTGRESQL_CONFIGURE echo "Nothing to patch on Windows") - set (POSTGRESQL_MAKE cd src \r\n - nmake -f win32.mak ) -- set (POSTGRESQL_INSTALL cp src/interfaces/libpq/Release/*.lib ${EXTERNAL_STAGE}/lib \r\n -- cp src/interfaces/libpq/Release/*.dll ${EXTERNAL_STAGE}/lib \r\n -- cp src/interfaces/libpq/libpq-fe.h ${EXTERNAL_STAGE}/include \r\n -- cp -r src/include/* ${EXTERNAL_STAGE}/include ) -+ set (POSTGRESQL_INSTALL cp src/interfaces/libpq/Release/*.lib ${POSTGRESQL_INSTALL_LOC}/lib \r\n -+ cp src/interfaces/libpq/Release/*.dll ${POSTGRESQL_INSTALL_LOC}/lib \r\n -+ cp src/interfaces/libpq/libpq-fe.h ${POSTGRESQL_INSTALL_LOC}/include \r\n -+ cp -r src/include/* ${POSTGRESQL_INSTALL_LOC}/include ) - -- #mt.exe /manifest ${CMAKE_CURRENT_SOURCE_DIR}/libpq.dll.manifest /outputresource:${EXTERNAL_STAGE}/lib/libpq.dll) -+ #mt.exe /manifest ${CMAKE_CURRENT_SOURCE_DIR}/libpq.dll.manifest /outputresource:${POSTGRESQL_INSTALL_LOC}/lib/libpq.dll) - #imbedding custom manifests is a bad idea. - else() -- set (POSTGRESQL_CONFIGURE ./configure --prefix=${EXTERNAL_STAGE} --without-readline --without-zlib) -+ set (POSTGRESQL_CONFIGURE ./configure --prefix=${POSTGRESQL_INSTALL_LOC} --without-readline --without-zlib) - set (POSTGRESQL_MAKE make) - set (POSTGRESQL_INSTALL make install) - endif() - - ExternalProject_Add(postgresql -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${POSTGRESQL_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${POSTGRESQL_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${POSTGRESQL_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${POSTGRESQL_VER}.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND cd ${POSTGRESQL_VER} ${CMD_TERM} ${POSTGRESQL_CONFIGURE} -@@ -57,24 +56,22 @@ if (WITH_POSTGRESQL) - BUILD_COMMAND cd ${POSTGRESQL_VER} ${CMD_TERM} ${POSTGRESQL_MAKE} - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${POSTGRESQL_INSTALL_LOC} - INSTALL_COMMAND cd ${POSTGRESQL_VER} ${CMD_TERM} ${POSTGRESQL_INSTALL} ) - - # Set the target dependencies which the rest of condor depends on. - if (WINDOWS) -- set(POSTGRESQL_FOUND "${EXTERNAL_STAGE}/lib/libpqdll.lib") -+ set(POSTGRESQL_FOUND "${POSTGRESQL_INSTALL_LOC}/lib/libpqdll.lib") - - #this may become the common case. -- install ( FILES ${EXTERNAL_STAGE}/lib/libpq.dll -+ install ( FILES ${POSTGRESQL_INSTALL_LOC}/lib/libpq.dll - DESTINATION ${C_LIB}) - -- set_property( TARGET postgresql PROPERTY FOLDER "externals" ) -- - else() -- set(POSTGRESQL_FOUND "${EXTERNAL_STAGE}/lib/libpq.a") -+ set(POSTGRESQL_FOUND "${POSTGRESQL_INSTALL_LOC}/lib/libpq.a") - endif() - -- append_var(CONDOR_EXTERNALS postgresql) -+ condor_post_external( postgresql include OFF ) - - else( NOT PROPER ) - -diff --git a/externals/bundles/qpid/0.7.946106/CMakeLists.txt b/externals/bundles/qpid/0.7.946106/CMakeLists.txt -deleted file mode 100644 -index 82a4fa6..0000000 ---- a/externals/bundles/qpid/0.7.946106/CMakeLists.txt -+++ /dev/null -@@ -1,97 +0,0 @@ --############################################################### -- # -- # Copyright (C) 1990-2010, Red Hat Inc. -- # -- # Licensed under the Apache License, Version 2.0 (the "License"); you -- # may not use this file except in compliance with the License. You may -- # obtain a copy of the License at -- # -- # http://www.apache.org/licenses/LICENSE-2.0 -- # -- # Unless required by applicable law or agreed to in writing, software -- # distributed under the License is distributed on an "AS IS" BASIS, -- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- # See the License for the specific language governing permissions and -- # limitations under the License. -- # -- ############################################################### -- --# qpid is for condor_contrib/mgmt/qmf --if (WANT_CONTRIB AND (LINUX OR WINDOWS)) -- option(WITH_QPID "Compiling with support for QPID" ON) --endif() -- --if (WITH_QPID) -- -- if ( NOT PROPER ) -- -- set (QPID_VER qpid-cpp-mrg-0.7.946106 ) -- -- if (NOT WINDOWS) -- set (QPID_CONFIGURE ./bootstrap && ./configure --prefix=${EXTERNAL_STAGE} ) -- set (QPID_BUILD make ) -- set (QPID_INSTALL make install ) -- else() -- set (QPID_CONFIGURE cmake -DBOOST_ROOT:PATH=${BOOST_ROOT} -DCMAKE_INSTALL_PREFIX:PATH=${EXTERNAL_STAGE} -G \"Visual Studio 9 2008\" -DGEN_DOXYGEN:BOOL=OFF -DBoost_DEBUG:BOOL=TRUE ) -- set (QPID_BUILD devenv qpid-cpp.sln /Rebuild RelWithDebInfo /project INSTALL ) -- set (QPID_INSTALL echo "Done" ) -- endif() -- -- ExternalProject_Add(qpid -- DEPENDS boost -- PREFIX ${EXTERNAL_BUILD_PREFIX}/qpid-${QPID_VER} -- #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${QPID_VER}-28.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${QPID_VER}-28.tar.gz -- #--Configure step ---------- -- CONFIGURE_COMMAND cd ${QPID_VER}/cpp && ${QPID_CONFIGURE} -- #--Build Step ---------- -- BUILD_COMMAND cd ${QPID_VER}/cpp && ${QPID_BUILD} -- BUILD_IN_SOURCE 1 -- #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd ${QPID_VER}/cpp && ${QPID_INSTALL} ) -- -- # Set the target dependencies which the rest of condor depends on. -- # all of the below locations need to be verified. -- if (WINDOWS) -- set( QPID_FOUND "${EXTERNAL_STAGE}/bin/qpidcommon.lib;${EXTERNAL_STAGE}/bin/qpidclient.lib;${EXTERNAL_STAGE}/bin/qmf.lib;${EXTERNAL_STAGE}/bin/qpidtypes.lib" ) -- install ( FILES ${EXTERNAL_STAGE}/bin/qpidcommon.dll -- ${EXTERNAL_STAGE}/bin/qpidclient.dll -- ${EXTERNAL_STAGE}/bin/qmf.dll -- ${EXTERNAL_STAGE}/bin/qpidtypes.dll -- DESTINATION ${C_LIB} ) -- -- set( QMF_GEN ${EXTERNAL_STAGE}/managementgen/qmf-gen ) -- -- set_property( TARGET qpid PROPERTY FOLDER "externals" ) -- -- else() -- set( QPID_FOUND "${EXTERNAL_STAGE}/lib/libqpidcommon.so;${EXTERNAL_STAGE}/lib/libqpidclient.so;${EXTERNAL_STAGE}/lib/libqmf.so;${EXTERNAL_STAGE}/lib/libqpidtypes.so" ) -- # TODO: so are we going to need to install qpid.so's along with condor..? or should we -static the plugins. -- # add linux install target -- #set( QMF_GEN ${EXTERNAL_STAGE}/managementgen/qmf-gen ) ? -- endif() -- -- append_var(CONDOR_EXTERNALS qpid) -- -- else( NOT PROPER ) -- -- # I don't know how we check versions for native search of qpid-qmf? header check? program_exec? -- find_multiple( "qpidcommon;qpidclient;qmf;qmfengine;qpidtypes" QPID_FOUND) -- find_program ( QMF_GEN qmf-gen ) -- -- endif( NOT PROPER ) -- -- # you will need to update config.h.cmake with your var. -- message (STATUS "external configured QPID_FOUND=(${QPID_FOUND}) QMF_GEN=(${QMF_GEN})") -- set( HAVE_EXT_QPID ON PARENT_SCOPE ) -- set (QPID_FOUND ${QPID_FOUND} PARENT_SCOPE) -- set (QMF_GEN ${QMF_GEN} PARENT_SCOPE) -- --else(WITH_QPID) -- -- message (STATUS "external skipped (qpid)") -- --endif(WITH_QPID) -diff --git a/externals/bundles/qpid/0.8-RC3/CMakeLists.txt b/externals/bundles/qpid/0.8-RC3/CMakeLists.txt -index 05a688b..7088d84 100644 ---- a/externals/bundles/qpid/0.8-RC3/CMakeLists.txt -+++ b/externals/bundles/qpid/0.8-RC3/CMakeLists.txt -@@ -26,55 +26,53 @@ if (WITH_QPID) - if ( NOT PROPER ) - - set (QPID_VER 0.8) -+ condor_pre_external( QPID qpid-0.8 "lib;include" "include/qpid") - - if (NOT WINDOWS) -- set (QPID_CONFIGURE ./bootstrap && ./configure --prefix=${EXTERNAL_STAGE} ) -+ set (QPID_CONFIGURE ./bootstrap && ./configure --prefix=${QPID_INSTALL_LOC} ) - set (QPID_BUILD make ) - set (QPID_INSTALL make install ) - else() -- set (QPID_CONFIGURE cmake -DBOOST_ROOT:PATH=${BOOST_ROOT} -DCMAKE_INSTALL_PREFIX:PATH=${EXTERNAL_STAGE} -G \"Visual Studio 9 2008\" -DGEN_DOXYGEN:BOOL=OFF -DBoost_DEBUG:BOOL=TRUE ) -+ set (QPID_CONFIGURE cmake -DBOOST_ROOT:PATH=${BOOST_ROOT} -DCMAKE_INSTALL_PREFIX:PATH=${QPID_INSTALL_LOC} -G \"Visual Studio 9 2008\" -DGEN_DOXYGEN:BOOL=OFF -DBoost_DEBUG:BOOL=TRUE ) - set (QPID_BUILD devenv qpid-cpp.sln /Rebuild RelWithDebInfo /project INSTALL ) - set (QPID_INSTALL echo "Done" ) - endif() - - ExternalProject_Add(qpid - DEPENDS boost -- PREFIX ${EXTERNAL_BUILD_PREFIX}/qpid-${QPID_VER} - #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/qpid-${QPID_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/qpid-${QPID_VER}.tar.gz -+ DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${QPID_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${QPID_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${QPID_VER}.tar.gz - #--Configure step ---------- -- CONFIGURE_COMMAND cd qpid-${QPID_VER}/cpp && ${QPID_CONFIGURE} -+ CONFIGURE_COMMAND cd ${QPID_VER}/cpp && ${QPID_CONFIGURE} - #--Build Step ---------- -- BUILD_COMMAND cd qpid-${QPID_VER}/cpp && ${QPID_BUILD} -+ BUILD_COMMAND cd ${QPID_VER}/cpp && ${QPID_BUILD} - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd qpid-${QPID_VER}/cpp && ${QPID_INSTALL} ) -+ INSTALL_DIR ${QPID_INSTALL_LOC} -+ INSTALL_COMMAND cd ${QPID_VER}/cpp && ${QPID_INSTALL} ) - - # Set the target dependencies which the rest of condor depends on. - # all of the below locations need to be verified. - if (WINDOWS) -- set( QPID_FOUND "${EXTERNAL_STAGE}/bin/qpidcommon.lib;${EXTERNAL_STAGE}/bin/qpidclient.lib;${EXTERNAL_STAGE}/bin/qmf.lib;${EXTERNAL_STAGE}/bin/qpidtypes.lib" ) -- install ( FILES ${EXTERNAL_STAGE}/bin/qpidcommon.dll -- ${EXTERNAL_STAGE}/bin/qpidclient.dll -- ${EXTERNAL_STAGE}/bin/qmf.dll -- ${EXTERNAL_STAGE}/bin/qpidtypes.dll -+ set( QPID_FOUND "${QPID_INSTALL_LOC}/bin/qpidcommon.lib;${QPID_INSTALL_LOC}/bin/qpidclient.lib;${QPID_INSTALL_LOC}/bin/qmf.lib;${QPID_INSTALL_LOC}/bin/qpidtypes.lib" ) -+ install ( FILES ${QPID_INSTALL_LOC}/bin/qpidcommon.dll -+ ${QPID_INSTALL_LOC}/bin/qpidclient.dll -+ ${QPID_INSTALL_LOC}/bin/qmf.dll -+ ${QPID_INSTALL_LOC}/bin/qpidtypes.dll - DESTINATION ${C_LIB} ) - -- set( QMF_GEN ${EXTERNAL_STAGE}/managementgen/qmf-gen ) -- -- set_property( TARGET qpid PROPERTY FOLDER "externals" ) -+ set( QMF_GEN ${QPID_INSTALL_LOC}/managementgen/qmf-gen ) - - else() -- set( QPID_FOUND "${EXTERNAL_STAGE}/lib/libqpidcommon.so;${EXTERNAL_STAGE}/lib/libqpidclient.so;${EXTERNAL_STAGE}/lib/libqmf.so;${EXTERNAL_STAGE}/lib/libqpidtypes.so;${EXTERNAL_STAGE}/lib/qpidmessaging.so;${EXTERNAL_STAGE}/lib/libqmfconsole.so;${EXTERNAL_STAGE}/lib/libqmf2.so" ) -+ set( QPID_FOUND "${QPID_INSTALL_LOC}/lib/libqpidcommon.so;${QPID_INSTALL_LOC}/lib/libqpidclient.so;${QPID_INSTALL_LOC}/lib/libqmf.so;${QPID_INSTALL_LOC}/lib/libqpidtypes.so;${QPID_INSTALL_LOC}/lib/qpidmessaging.so;${QPID_INSTALL_LOC}/lib/libqmfconsole.so;${QPID_INSTALL_LOC}/lib/libqmf2.so" ) - # TODO: so are we going to need to install qpid.so's along with condor..? or should we -static the plugins. - # add linux install target -- #set( QMF_GEN ${EXTERNAL_STAGE}/managementgen/qmf-gen ) ? -+ #set( QMF_GEN ${QPID_INSTALL_LOC}/managementgen/qmf-gen ) ? - endif() - -- append_var(CONDOR_EXTERNALS qpid) -+ condor_post_external( qpid include OFF ) - - else( NOT PROPER ) - -@@ -84,14 +82,17 @@ if (WITH_QPID) - - endif( NOT PROPER ) - -+endif() -+ -+# only enable if qpid and qmf bits are all present. -+if (QPID_FOUND AND NOT "${QMF_GEN}" MATCHES "-NOTFOUND" ) - # you will need to update config.h.cmake with your var. - message (STATUS "external configured QPID_FOUND=(${QPID_FOUND}) QMF_GEN=(${QMF_GEN})") - set( HAVE_EXT_QPID ON PARENT_SCOPE ) - set (QPID_FOUND ${QPID_FOUND} PARENT_SCOPE) - set (QMF_GEN ${QMF_GEN} PARENT_SCOPE) -- --else(WITH_QPID) -+else() - - message (STATUS "external skipped (qpid)") - --endif(WITH_QPID) -+endif() -diff --git a/externals/bundles/unicoregahp/1.2.0/CMakeLists.txt b/externals/bundles/unicoregahp/1.2.0/CMakeLists.txt -index 0cd3871..9df2e1b 100644 ---- a/externals/bundles/unicoregahp/1.2.0/CMakeLists.txt -+++ b/externals/bundles/unicoregahp/1.2.0/CMakeLists.txt -@@ -20,26 +20,27 @@ option(WITH_UNICOREGAHP "Compiling with support for UNICOREGAHP" ON) - - if ( WITH_UNICOREGAHP AND NOT PROPER ) - -- set (UCGAHP_VER unicoregahp-1.2.0) -+ condor_pre_external( UNICOREGAHP unicoregahp-1.2.0 "usr/share/java" "usr/share/java/ugahp.jar") -+ - ExternalProject_Add(unicoregahp -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${UCGAHP_VER} - #-- Download Step ---------- -- DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${UCGAHP_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -- URL http://parrot.cs.wisc.edu/externals/${UCGAHP_VER}.tar.gz -+ DOWNLOAD_COMMAND wget -N -+ http://parrot.cs.wisc.edu/externals/${UNICOREGAHP_VER}.tar.gz ${CMD_TERM} -+ DOWNLOAD_DIR ${UNICOREGAHP_STAGE}/dl -+ URL http://parrot.cs.wisc.edu/externals/${UNICOREGAHP_VER}.tar.gz - #--Configure step ---------- - CONFIGURE_COMMAND echo "nothing to do" - #--Build Step ---------- - BUILD_COMMAND echo "nothing to do" - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE}/usr/share/java -- INSTALL_COMMAND cp ugahp.jar ${EXTERNAL_STAGE}/usr/share/java ) -+ INSTALL_DIR ${UNICOREGAHP_INSTALL_LOC}/usr/share/java -+ INSTALL_COMMAND cp ugahp.jar ${UNICOREGAHP_INSTALL_LOC}/usr/share/java ) - - message (STATUS "external configured (unicoregahp)") -- set( HAVE_EXT_UNICOREGAHP ON PARENT_SCOPE ) -- append_var(CONDOR_EXTERNALS unicoregahp) -- install(FILES ${EXTERNAL_STAGE}/usr/share/java/ugahp.jar DESTINATION ${C_LIB}) -+ -+ condor_post_external( unicoregahp OFF OFF ) -+ install(FILES "${UNICOREGAHP_INSTALL_LOC}/usr/share/java/ugahp.jar" DESTINATION ${C_LIB}) - - else() - message (STATUS "external skipped (unicoregahp)") -diff --git a/externals/bundles/voms/1.9.10_4/CMakeLists.txt b/externals/bundles/voms/1.9.10_4/CMakeLists.txt -index 99bbef6..81f54d7 100644 ---- a/externals/bundles/voms/1.9.10_4/CMakeLists.txt -+++ b/externals/bundles/voms/1.9.10_4/CMakeLists.txt -@@ -24,15 +24,20 @@ endif(LINUX OR DARWIN) - if ( WITH_VOMS ) - - if (NOT PROPER) -+ if(${SYS_ARCH} MATCHES "X86_64" AND LINUX) -+ set(VOMS_LIB lib64) -+ else() -+ set(VOMS_LIB lib) -+ endif() - -- set (VOMS_VER voms-1.9.10_4) -+ -+ condor_pre_external( VOMS voms-1.9.10_4 "include;${VOMS_LIB}" "done") - - ExternalProject_Add(voms -- DEPENDS expat openssl globus zlib -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${VOMS_VER} -+ DEPENDS ${EXPAT_REF} ${OPENSSL_RED} ${GLOBUS_REF} ${ZLIB_REF} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${VOMS_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${VOMS_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${VOMS_VER}.tar.gz - #--Patch step ---------- - PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/configure.patch && -@@ -42,28 +47,23 @@ if ( WITH_VOMS ) - #--Configure step ---------- - CONFIGURE_COMMAND cd org.glite.security.voms && - ./configure -- --prefix=${EXTERNAL_STAGE} -+ --prefix=${VOMS_INSTALL_LOC} - --with-api-only -- --with-openssl-prefix=${EXTERNAL_STAGE} -- --with-expat-prefix=${EXTERNAL_STAGE} -- --with-globus-prefix=${EXTERNAL_STAGE} -+ --with-openssl-prefix=${OPENSSL_INSTALL_LOC} -+ --with-expat-prefix=${EXPAT_INSTALL_LOC} -+ --with-globus-prefix=${GLOBUS_INSTALL_LOC} - --with-globus-flavor=${GLOBUS_FLAVOR} --disable-java --disable-docs --disable-glite - #--Build Step ---------- - BUILD_COMMAND cd org.glite.security.voms && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -- INSTALL_COMMAND cd org.glite.security.voms && make install -+ INSTALL_DIR ${VOMS_INSTALL_LOC} -+ INSTALL_COMMAND cd org.glite.security.voms && make install && touch ${VOMS_INSTALL_LOC}/done - ) - -- # On Mac OS X, giving the basename of the library causes -- # it to be dynamically linked. On linux, the library may -- # be in lib/ or lib64/. -- if ( DARWIN ) -- set( VOMS_FOUND "${EXTERNAL_STAGE}/lib/libvomsapi_${GLOBUS_FLAVOR}.a" ) -- else() -- set( VOMS_FOUND "libvomsapi_${GLOBUS_FLAVOR}.a" ) -- endif() -+ set( VOMS_FOUND "${VOMS_INSTALL_LOC}/${VOMS_LIB}/libvomsapi_${GLOBUS_FLAVOR}.a" ) -+ -+ condor_post_external( voms include/glite/security OFF ) - - else(NOT PROPER) - -@@ -75,8 +75,6 @@ if ( WITH_VOMS ) - message ( STATUS "external configured (VOMS_FOUND=${VOMS_FOUND})" ) - set( HAVE_EXT_VOMS ON PARENT_SCOPE ) - set( VOMS_FOUND ${VOMS_FOUND} PARENT_SCOPE ) -- append_var(CONDOR_EXTERNALS voms) -- append_var(EXTERNAL_INCLUDES ${EXTERNAL_STAGE}/include/glite/security) - endif() - - endif() -diff --git a/externals/bundles/wso2/2.1.0/CMakeLists.txt b/externals/bundles/wso2/2.1.0/CMakeLists.txt -new file mode 100644 -index 0000000..305dfd7 ---- /dev/null -+++ b/externals/bundles/wso2/2.1.0/CMakeLists.txt -@@ -0,0 +1,94 @@ -+ ############################################################### -+ # -+ # Copyright 2011 Red Hat, Inc. -+ # -+ # Licensed under the Apache License, Version 2.0 (the "License"); you -+ # may not use this file except in compliance with the License. You may -+ # obtain a copy of the License at -+ # -+ # http://www.apache.org/licenses/LICENSE-2.0 -+ # -+ # Unless required by applicable law or agreed to in writing, software -+ # distributed under the License is distributed on an "AS IS" BASIS, -+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ # See the License for the specific language governing permissions and -+ # limitations under the License. -+ # -+ ############################################################### -+if (WANT_CONTRIB AND LINUX AND PROPER) -+ option(WITH_WSO2 "Compiling with support for WITH_WSO2" ON) -+endif() -+ -+if (WITH_WSO2) -+ -+ # need to embed libDir in axis2.xml -+ if ( ${SYS_ARCH} STREQUAL "X86_64" ) -+ set (WS02_LIB_ROOT "/usr/lib64") -+ else() -+ set (WS02_LIB_ROOT "/usr/lib") -+ endif () -+ -+ if ( NOT PROPER ) -+ -+ set ( WSO2_VER wso2-2.0.1 ) -+ -+ #ExternalProject_Add(zlib -+ # PREFIX ${EXTERNAL_BUILD_PREFIX}/${WSO2_VER} -+ # #-- Download Step ---------- -+ # DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${WSO2_VER}.tar.gz ${CMD_TERM} -+ # DOWNLOAD_DIR ${EXTERNAL_DL} -+ # URL http://parrot.cs.wisc.edu/externals/${WSO2_VER}.tar.gz -+ # #--Configure step ---------- -+ # CONFIGURE_COMMAND cd ${WSO2_VER} && ./configure --prefix=${EXTERNAL_STAGE} -+ # #--Build Step ---------- -+ # BUILD_COMMAND cd ${WSO2_VER} && make -+ # #--install Step ---------- -+ # INSTALL_DIR ${EXTERNAL_STAGE} -+ # INSTALL_COMMAND cd ${WSO2_VER} && make install ) -+ # -+ # Set the target dependencies which the rest of condor depends on. -+ #set(WSO2_FOUND "${EXTERNAL_STAGE}/STUFF?") -+ #append_var(CONDOR_EXTERNALS zlib) -+ # -+ #install ( FILES ${EXTERNAL_STAGE}/lib/libz.a DESTINATION ${C_LIB} RENAME libcondor_z.a) -+ -+ -+ ######################################################### -+ #### import from pmackinn's stuff. -+ #if ( NOT DEFINED ENV{WSFCPP_HOME} ) -+ # message( FATAL_ERROR "WSFCPP_HOME not defined for non-proper build") -+ #endif () -+ # -+ #set ( AXIS2_LIBS -L$ENV{WSFCPP_HOME}/lib -+ # -libaxis2_engine -+ # -laxutil -laxis2_axiom -laxis2_parser -+ # -lneethi -lguththila -+ # -laxis2_http_common -laxis2_http_receiver -laxis2_http_sender -+ # -lwso2_wsf ) -+ # -+ #include_directories( -+ # $ENV{WSFCPP_HOME}/include/axis2-1.6.0 -+ # $ENV{WSFCPP_HOME}/include/wso2-wsf-cpp -+ # $ENV{WSFCPP_HOME}/include/axis2-1.6.0/platforms ) -+ # set(axis2_repo_loc $ENV{WSFCPP_HOME}) -+ else( ) -+ -+ find_multiple( "axis2_engine;axutil;axis2_axiom;axis2_parser;axis2_http_common;axis2_http_receiver;axis2_http_sender;neethi;guththila;wso2_wsf" WSO2_FOUND ) -+ append_var (WSO2_INCLUDES "/usr/include/axis2-1.6.0;/usr/include/wso2-wsf-cpp;/usr/include/axis2-1.6.0/platforms") -+ -+ install (CODE "execute_process(COMMAND echo Local testing instructions )" ) -+ install (CODE "execute_process(COMMAND echo set WSFCPP_HOME to \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_INSTALL_LOC}axis2.xml)" ) -+ install (CODE "execute_process(COMMAND echo change the servicesDir parameter in axis2.xml to \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_INSTALL_LOC}services)" ) -+ -+ endif( NOT PROPER ) -+ -+endif(WITH_WSO2) -+ -+if (WSO2_FOUND) -+ message (STATUS "external configured (WSO2_FOUND=${WSO2_FOUND})") -+ set( WSO2_FOUND ${WSO2_FOUND} PARENT_SCOPE ) -+ set( HAVE_EXT_WSO2 ON PARENT_SCOPE ) -+ set( WS02_LIB_ROOT ${WS02_LIB_ROOT} PARENT_SCOPE ) -+else() -+ message (STATUS "external skipped (wso2)") -+endif() -diff --git a/externals/bundles/zlib/1.2.3/CMakeLists.txt b/externals/bundles/zlib/1.2.3/CMakeLists.txt -index 5ffbda3..f473706 100644 ---- a/externals/bundles/zlib/1.2.3/CMakeLists.txt -+++ b/externals/bundles/zlib/1.2.3/CMakeLists.txt -@@ -23,28 +23,27 @@ if (WITH_ZLIB) - - if ( NOT PROPER ) - -- set (ZLIB_VER zlib-1.2.3) -+ condor_pre_external( ZLIB zlib-1.2.3 "lib;include" "lib/libz.a") - - ExternalProject_Add(zlib -- PREFIX ${EXTERNAL_BUILD_PREFIX}/${ZLIB_VER} - #-- Download Step ---------- - DOWNLOAD_COMMAND wget -N http://parrot.cs.wisc.edu/externals/${ZLIB_VER}.tar.gz ${CMD_TERM} -- DOWNLOAD_DIR ${EXTERNAL_DL} -+ DOWNLOAD_DIR ${ZLIB_STAGE}/dl - URL http://parrot.cs.wisc.edu/externals/${ZLIB_VER}.tar.gz - #--Configure step ---------- -- CONFIGURE_COMMAND cd ${ZLIB_VER} && ./configure --prefix=${EXTERNAL_STAGE} -+ CONFIGURE_COMMAND cd ${ZLIB_VER} && ./configure --prefix=${ZLIB_INSTALL_LOC} - #--Build Step ---------- - BUILD_COMMAND cd ${ZLIB_VER} && make - BUILD_IN_SOURCE 1 - #--install Step ---------- -- INSTALL_DIR ${EXTERNAL_STAGE} -+ INSTALL_DIR ${ZLIB_INSTALL_LOC} - INSTALL_COMMAND cd ${ZLIB_VER} && make install ) - - # Set the target dependencies which the rest of condor depends on. -- set(ZLIB_FOUND "${EXTERNAL_STAGE}/lib/libz.a") -- append_var(CONDOR_EXTERNALS zlib) -+ set(ZLIB_FOUND "${ZLIB_INSTALL_LOC}/lib/libz.a") -+ condor_post_external( zlib include OFF ) - -- install ( FILES ${EXTERNAL_STAGE}/lib/libz.a DESTINATION ${C_LIB} RENAME libcondor_z.a) -+ install ( FILES "${ZLIB_INSTALL_LOC}/lib/libz.a" DESTINATION ${C_LIB} RENAME libcondor_z.a) - - else( NOT PROPER ) - -diff --git a/msconfig/set_build_env.bat b/msconfig/set_build_env.bat -index 3ce64a3..cb66c05 100644 ---- a/msconfig/set_build_env.bat -+++ b/msconfig/set_build_env.bat -@@ -41,46 +41,86 @@ REM user's environments by the default compiler install.) - REM - REM - --REM assume that this file is in the msconfig subfolder of the condor --REM sources or that MSCONFIG_TOOLS_DIR is set. -+:: check to see if MSCONFIG_TOOLS_DIR is set, if it is not set assume that it -+:: is where this file is. also strip off an trailing \ from the path. -+:: - if "~%MSCONFIG_TOOLS_DIR%"=="~" set MSCONFIG_TOOLS_DIR=%~sdp0 - if "~%MSCONFIG_TOOLS_DIR:~-1%"=="~\" Set MSCONFIG_TOOLS_DIR=%MSCONFIG_TOOLS_DIR:~0,-1% --if not exist %MSCONFIG_TOOLS_DIR%\license.rtf echo MSCONFIG_TOOLS_DIR is not valid! -+if not exist %MSCONFIG_TOOLS_DIR%\license.rtf ( -+ echo MSCONFIG_TOOLS_DIR is not valid! -+) - --REM cmake should be in the path, or CMAKE_BIN_DIR must be set, --REM we don't want CMAKE_BIN_DIR to have a trailing slash. -+:: set CMAKE_BIN_DIR if it is not already set, look first in the path then -+:: in the registry and finally both of those fail just set it to C:\tools\cmake -+:: - if "~%CMAKE_BIN_DIR%"=="~" for %%I in (cmake.exe) DO Set CMAKE_BIN_DIR=%%~sdp$PATH:I -+if "~%CMAKE_BIN_DIR%"=="~" ( -+ @echo Searching for CMake.exe... -+ for /F "tokens=1,2*" %%I in ('reg query "HKLM\SOFTWARE" /k /f "CMake*" /ve /s') do ( -+ if "%%I"=="(Default)" ( -+ if "%%J"=="REG_SZ" ( -+ set CMAKE_BIN_DIR=%%K\bin -+ @echo found CMake in the registry at %%K -+ ) -+ ) -+ ) -+) - if "~%CMAKE_BIN_DIR%"=="~" set CMAKE_BIN_DIR=c:\Tools\CMake\bin -+ -+:: we don't want CMAKE_BIN_DIR to have a trailing slash. -+:: - if "~%CMAKE_BIN_DIR:~-1%"=="~\" Set CMAKE_BIN_DIR=%CMAKE_BIN_DIR:~0,-1% - echo CMAKE_BIN_DIR=%CMAKE_BIN_DIR% --if not exist %CMAKE_BIN_DIR%\cmake.exe echo CMake is not in CMAKE_BIN_DIR! -+if not exist %CMAKE_BIN_DIR%\cmake.exe ( -+ echo can't find CMake.exe, please set CMAKE_BIN_DIR to the path to it. -+) - --REM WiX should be in the path or WIX_BIN_DIR must be set -+:: find ActivePerl bin dir -+:: -+:: set PERL_BIN_DIR=%SystemDrive%\Perl\bin -+if "~%PERL_BIN_DIR%"=="~" for %%I in (perl.exe) DO Set PERL_BIN_DIR=%%~sdp$PATH:I -+if "~%PERL_BIN_DIR%"=="~" ( -+ @echo Searching for Perl.exe... -+ for /F "tokens=1,2*" %%I in ('reg query "HKLM\Software" /f "Perl.exe"') do ( -+ if "%%I"=="BinDir" ( -+ set PERL_BIN_DIR=%%~sfK -+ ) -+ ) -+) -+if "~%PERL_BIN_DIR:~-1%"=="~\" Set PERL_BIN_DIR=%PERL_BIN_DIR:~0,-1% -+echo PERL_BIN_DIR=%PERL_BIN_DIR% -+if not exist %PERL_BIN_DIR%\perl.exe echo could not find ActiveState Perl.exe, this is needed to build Condor -+ -+:: WiX should be in the path or WIX_BIN_DIR must be set -+:: - if "~%WIX_BIN_DIR%"=="~" for %%I in (wix.dll) DO Set WIX_BIN_DIR=%%~sdp$PATH:I - if "~%WIX_BIN_DIR%"=="~" set WIX_BIN_DIR=c:\Tools\WiX\bin - if "~%WIX_BIN_DIR:~-1%"=="~\" Set WIX_BIN_DIR=%WIX_BIN_DIR:~0,-1% - echo WIX_BIN_DIR=%WIX_BIN_DIR% --if not exist %WIX_BIN_DIR%\wix.dll echo Wix is not in WIX_BIN_DIR! -+if not exist %WIX_BIN_DIR%\wix.dll echo could not find WiX binaries which are needed to create the Installer - --REM need the 7zip path also -+:: need the 7zip path also -+:: - if "~%ZIP_BIN_DIR%"=="~" for %%I in (7z.exe) do set ZIP_BIN_DIR=%%~sdp$PATH:I - if "~%ZIP_BIN_DIR%"=="~" set ZIP_BIN_DIR=c:\Tools\7-zip - if "~%ZIP_BIN_DIR:~-1%"=="~\" Set ZIP_BIN_DIR=%ZIP_BIN_DIR:~0,-1% - echo ZIP_BIN_DIR=%ZIP_BIN_DIR% --if not exist %ZIP_BIN_DIR%\7z.exe echo 7z.exe is not in ZIP_BIN_DIR! -+if not exist %ZIP_BIN_DIR%\7z.exe echo could not find 7z.exe, this is needed to PACKAGE condor - --REM setup GIT_BIN_DIR if we can find git --REM -+:: setup GIT_BIN_DIR if we can find git. this isn't needed to build condor -+:: but it is needed to do condor development. -+:: - if "~%GIT_BIN_DIR%"=="~" for %%I in (git.exe) Do Set GIT_BIN_DIR=%%~sdp$PATH:I - if "~%GIT_BIN_DIR%"=="~" set GIT_BIN_DIR=c:\Tools\Git\bin - if "~%GIT_BIN_DIR:~-1%"=="~\" Set GIT_BIN_DIR=%GIT_BIN_DIR:~0,-1% - echo GIT_BIN_DIR=%GIT_BIN_DIR% --if not exist %GIT_BIN_DIR%\git.exe echo Git.exe is not in GIT_BIN_DIR! -+if not exist %GIT_BIN_DIR%\git.exe echo could not find Git.exe, (but it is not needed to build condor) - --REM set USER_TOOLS_DIR to point to c:\tools if it exists and doesn't --REM already point to something. -+:: set USER_TOOLS_DIR if it isn't already set. we point it at c:\tools if -+:: that directory exists. -+:: - if "~%USER_TOOLS_DIR%"=="~" ( -- if exist c:\Tools\NUL set USER_TOOLS_DIR=C:\Tools -+REM if exist c:\Tools\NUL set USER_TOOLS_DIR=C:\Tools - ) - echo USER_TOOLS_DIR=%USER_TOOLS_DIR% - -@@ -92,10 +132,14 @@ REM I'll harden it further if there is a requirement for it.) - set PROGRAMS_DIR=%ProgramFiles% - if not "~%ProgramFiles(x86)%"=="~" set PROGRAMS_DIR=%SystemDrive%\PROGRA~2 - -- -+:: If Visual Studio 2008 is installed, then VS90COMNTOOLS should be defined -+:: we can use that to setup the compiler environment. if it's not set -+:: then all we can do is choose default values for environment variables. -+:: - if "~%VS90COMNTOOLS%"=="~" goto use_default_paths --REM don't guess about paths, derive them from available from VS90COMNTOOLS --REM -+ -+:: derive from VS90COMNTOOLS -+:: - for /D %%I in ("%VS90COMNTOOLS%..") do set VS90ROOT=%%~sdpI - set VS_DIR=%VS90ROOT:~0,-1% - set VC_DIR=%VS_DIR%\VC -@@ -103,18 +147,27 @@ set VC_BIN=%VC_DIR%\bin - set DBG_TOOLS_DIR=%ProgramFiles%\Debugging Tools for Windows (x86);%ProgramFiles%\Debugging Tools for Windows (x64) - set DOTNET_DIRS=%SystemRoot%\Microsoft.NET\Framework\v3.5;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727 - --if "~%SDK_DIR%"=="~" set SDK_DIR=%SystemDrive%\PROGRA~1\MICROS~3\Windows\v7.0 --rem if "~%SDK_DIR%"=="~" set SDK_DIR=%SystemDrive%\Win2003Sdk --if "~%PERL_BIN_DIR%"=="~" set PERL_BIN_DIR=%SystemDrive%\Perl\bin -+:: find the latest windows SDK dir -+:: -+::set SDK_DIR=%SystemDrive%\PROGRA~1\MICROS~3\Windows\v7.0 -+if "~%SDK_DIR%"=="~" ( -+ for /F "tokens=1,2*" %%I in ('reg query "HKLM\Software\Microsoft\Microsoft SDKs\Windows" /v "CurrentInstallFolder"') do ( -+ if "%%I"=="CurrentInstallFolder" ( -+ set SDK_DIR=%%~sfK -+ ) -+ ) -+) -+if "~%SDK_DIR:~-1%"=="~\" Set SDK_DIR=%SDK_DIR:~0,-1% -+ -+ - goto got_paths - - --REM don't have VS90COMNTOOLS defined, so we will have to assume default --REM installation paths --REM -+:: don't have VS90COMNTOOLS defined, so we will have to assume default -+:: installation paths for compiler -+:: - :use_default_paths -- --REM Set paths to Visual C++, the Platform SDKs, and Perl -+:: Set default paths for Visual C++, the Platform SDKs, and Perl - set VS_DIR=%PROGRAMS_DIR%\Microsoft Visual Studio 9.0 - set VC_DIR=%VS_DIR%\VC - set VC_BIN=%VC_DIR%\bin -@@ -156,10 +209,25 @@ set LIB=%LIB%;%VC_DIR%\atlmfc\lib - if NOT "~%SDK_DIR%"=="~" set LIB=%LIB%;%SDK_DIR%\lib - - REM Dump the Windows build environment at this point --REM echo ----------------------- WIN ENV DUMP ---------------------- --@echo PATH=%PATH% --@echo INCLUDE=%INCLUDE% --@echo LIB=%LIB% --REM echo ----------------------- WIN ENV DUMP ---------------------- -+REM echo ----------------------- BUILD ENV ---------------------- -+setlocal -+@echo PATH is -+set _remain_=%PATH% -+call :listenv -+@echo INCLUDE is -+set _remain_=%INCLUDE% -+call :listenv -+@echo LIB is -+set _remain_=%LIB% -+call :listenv -+REM echo -------------------------------------------------------- - - exit /B 0 -+ -+:listenv -+if "~%_remain_%"=="~" goto :EOF -+for /F "delims=; tokens=1,*" %%I in ("%_remain_%") do ( -+ set _remain_=%%J -+ echo. %%I -+) -+goto listenv -diff --git a/nmi_tools/continuous/README b/nmi_tools/continuous/README -new file mode 100644 -index 0000000..5f135da ---- /dev/null -+++ b/nmi_tools/continuous/README -@@ -0,0 +1,5 @@ -+To add a new platform for a continuous run edit run.sh and submit and replace "PLATFORM" with -+the platform you wish to add (use the NMI platform string, e.g. x86_64_rhap_5). -+ -+Currently these are put in /home/cndrauto/continuous on nmi-s006. -+They are submitted to Condor (as Condor-Cron jobs) -diff --git a/nmi_tools/continuous/run.sh b/nmi_tools/continuous/run.sh -new file mode 100755 -index 0000000..ac752cb ---- /dev/null -+++ b/nmi_tools/continuous/run.sh -@@ -0,0 +1,26 @@ -+#!/bin/sh -+ -+GITDIR=/space/git/CONDOR_SRC.git -+export GITDIR -+ -+PATH=/prereq/bin:$PATH -+ -+cd /home/cndrauto/continuous/PLATFORM -+ -+set -x -+exec > run.sh.out -+exec 2>&1 -+ -+git --git-dir=$GITDIR fetch -+git --git-dir=/space/git/CONDOR_EXT.git fetch -+git --git-dir=/space/git/CONDOR_DOC.git fetch -+ -+sha1=`git --git-dir=$GITDIR log --pretty=oneline -n 1 origin/master | awk '{print $1}'` -+ -+git --git-dir=$GITDIR archive origin/master nmi_tools | tar xf - nmi_tools -+ -+./nmi_tools/condor_nmi_submit --notify=condor-builds@cs.wisc.edu --build --git --tag=origin/master --module=FOO --use-externals-cache --desc="Continuous Build - PLATFORM" --platforms="PLATFORM" --notify-fail-only --sha1=$sha1 > condor_nmi_submit.out -+ -+runid=`awk '/^Run ID:/ {print $3}' condor_nmi_submit.out` -+echo "$runid $sha1" >> runs.out -+exit 0 -diff --git a/nmi_tools/continuous/submit b/nmi_tools/continuous/submit -new file mode 100644 -index 0000000..a034a16 ---- /dev/null -+++ b/nmi_tools/continuous/submit -@@ -0,0 +1,27 @@ -+universe = local -+ -+BASE=/home/cndrauto/continuous/PLATFORM -+ -+executable = $(BASE)/run.sh -+ -+output = $(BASE)/output -+error = $(BASE)/error -+log = $(BASE)/log -+ -+# This isn't necessary to work properly, it is just in place to make -+# the condor_q command easily show which job is for which platform. -+Args = PLATFORM -+ -+CronHour = 1,4,7,9,10,11,12,13,14,15,16,17,18,19 -+CronMinute = 30 -+CronDayOfMonth = * -+CronMonth = * -+CronDayOfWeek = * -+ -+notification = never -+getenv = true -+ -+CronPrepTime = 6 -+deferral_window = 300 -+on_exit_remove = false -+queue -diff --git a/nmi_tools/glue/SubmitInfo.pm b/nmi_tools/glue/SubmitInfo.pm -index 62a03f8..05e0946 100755 ---- a/nmi_tools/glue/SubmitInfo.pm -+++ b/nmi_tools/glue/SubmitInfo.pm -@@ -33,16 +33,17 @@ package SubmitInfo; - # With nmi_condor_submit, one can request a build/test set to submit. - ############################################################################### - --# The sets of ports we know about nativly in the glue script. -+# The sets of ports we know about natively in the glue script. - our %build_and_test_sets = ( - # The ports we officially support and for which we provide native binaries - # on our download site. - # If you don't specify what platforms you'd like built, then this is the - # list to which we default. -- -+ - # NOTE: Keep the stable or developer release branches synchronized with - # https://condor-wiki.cs.wisc.edu/index.cgi/wiki?p=DeveloperReleasePlan - 'official_ports' => [ -+ 'x86_64_deb_6.0-updated', # this will switch to non-updated when NMI has that platform - 'x86_64_deb_5.0', - 'x86_64_rhap_5', - 'x86_64_rhas_3', -@@ -52,29 +53,35 @@ our %build_and_test_sets = ( - 'x86_rhas_3', - 'x86_winnt_5.1', - ], -- -- # Occasionally, NMI would like a port on a bunch of odd platforms. These -- # are those platforms. -+ -+ # NMI will need builds on a set of platforms that we do not provide in our -+ # core builds. These are those platforms. - 'nmi_one_offs' => [ -+ 'x86_64_sol_5.10', -+ 'x86_64_sol_5.11', -+ 'x86_freebsd_7.4', -+ 'x86_64_freebsd_8.2', -+ ], -+ -+ # We will build on a set of machines that we want to be sure continue building -+ # but we do not release them so they are not included in the 'official ports' -+ # section above. Platforms in this list include things like the latest Fedora -+ # release - a build problem on this platform could indicate problems on a future -+ # release of RHEL. -+ 'extra_builds' => [ - 'x86_64_rhap_5.3-updated', -+ 'x86_64_fedora_14-updated', - 'x86_64_opensuse_11.3-updated', - 'x86_64_opensuse_11.4-updated', -- 'x86_64_sol_5.10', -- 'x86_64_sol_5.11', -- 'x86_64_fedora_12-updated', - ], -- -- # This is a placeholder that is intended to remain empty in V7_6-branch. -- # It is populated in the master. -- 'extra_builds' => [], -- -+ - 'stduniv' => [ - 'x86_64_deb_5.0', - 'x86_64_rhap_5', - 'x86_64_rhas_3', - 'x86_deb_5.0', - ], --); -+ ); - - ############################################################################### - # For every build, test, and cross test, of condor everywhere, -@@ -90,7 +97,7 @@ my @default_prereqs = ( - 'bison-1.25', - 'wget-1.9.1', - 'm4-1.4.1', --); -+ ); - - ############################################################################### - # Minimal build configuration -@@ -103,29 +110,29 @@ my @default_prereqs = ( - ############################################################################### - my @minimal_build_configure_args = - ( -- '-DPROPER:BOOL=OFF' => undef, -- '-D_VERBOSE:BOOL=ON' => undef, -- '-DCLIPPED:BOOL=ON' => undef, -- '-DWITH_BLAHP:BOOL=OFF' => undef, -- '-DWITH_BOOST:BOOL=OFF' => undef, -- '-DWITH_COREDUMPER:BOOL=OFF' => undef, -- '-DWITH_CREAM:BOOL=OFF' => undef, -- '-DWITH_DRMAA:BOOL=OFF' => undef, -- '-DWITH_EXPAT:BOOL=OFF' => undef, -- '-DWITH_GCB:BOOL=OFF' => undef, -- '-DWITH_GLOBUS:BOOL=OFF' => undef, -- '-DWITH_GSOAP:BOOL=OFF' => undef, -- '-DWITH_HADOOP:BOOL=OFF' => undef, -- '-DWITH_KRB5:BOOL=OFF' => undef, -- '-DWITH_LIBDELTACLOUD:BOOL=OFF' => undef, -- '-DWITH_LIBVIRT:BOOL=OFF' => undef, -- '-DWITH_LIBXML2:BOOL=OFF' => undef, -- '-DWITH_UNICOREGAHP:BOOL=OFF' => undef, -- '-DWITH_VOMS:BOOL=OFF' => undef, -+ '-DPROPER:BOOL' => 'OFF', -+ '-D_VERBOSE:BOOL' => 'ON', -+ '-DCLIPPED:BOOL' => 'ON', -+ '-DWITH_BLAHP:BOOL' => 'OFF', -+ '-DWITH_BOOST:BOOL' => 'OFF', -+ '-DWITH_COREDUMPER:BOOL' => 'OFF', -+ '-DWITH_CREAM:BOOL' => 'OFF', -+ '-DWITH_DRMAA:BOOL' => 'OFF', -+ '-DWITH_EXPAT:BOOL' => 'OFF', -+ '-DWITH_GCB:BOOL' => 'OFF', -+ '-DWITH_GLOBUS:BOOL' => 'OFF', -+ '-DWITH_GSOAP:BOOL' => 'OFF', -+ '-DWITH_HADOOP:BOOL' => 'OFF', -+ '-DWITH_KRB5:BOOL' => 'OFF', -+ '-DWITH_LIBDELTACLOUD:BOOL' => 'OFF', -+ '-DWITH_LIBVIRT:BOOL' => 'OFF', -+ '-DWITH_LIBXML2:BOOL' => 'OFF', -+ '-DWITH_UNICOREGAHP:BOOL' => 'OFF', -+ '-DWITH_VOMS:BOOL' => 'OFF', - ); - - ############################################################################### --# Default List of Tests to Run. -+# DEFAULT List of Tests to Run. - # - # This specifies the test suite testclasses (more than one if you'd like) - # which are run by default for any test. The default of 'quick' means the -@@ -141,7 +148,7 @@ my @default_testclass = ( 'quick' ); - ############################################################################### - my @default_test_configure_args = - ( -- '-DNOTHING_SPECIAL:BOOL=ON' => undef, -+ '-DNOTHING_SPECIAL:BOOL' => 'ON', - ); - - ############################################################################### -@@ -155,9 +162,9 @@ my @default_test_configure_args = - ############################################################################### - my @default_build_configure_args = - ( -- '-DPROPER:BOOL=OFF' => undef, -- '-D_VERBOSE:BOOL=ON' => undef, -- #'-DSCRATCH_EXTERNALS:BOOL=ON' => undef, -+ '-DPROPER:BOOL' => 'OFF', -+ '-D_VERBOSE:BOOL' => 'ON', -+ #'-DSCRATCH_EXTERNALS:BOOL' => 'ON', - ); - - ############################################################################### -@@ -176,8 +183,8 @@ our %submit_info = ( - # A good sample of stuff to add in case it doesn't work is: - # --with-arch=X86_64 \ - # --with-os=LINUX \ -- # --with-kernel=2.6.18-194.3.1.el5 \ -- # --with-os_version=LINUX_UNKNOWN \ -+ # --with-kernel=2.6.18-194.3.1.el5 \ -+ # --with-os_version=LINUX_UNKNOWN \ - # --with-sysname=unknown \ - # - # -@@ -194,7 +201,7 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -202,7 +209,7 @@ our %submit_info = ( - # Microsoft Windows 6.0/2000/xp/whatever on x86_64 - # This probably doesn't work--glue scripts do funky things with it. - ########################################################################## -- 'x86_winnt_6.0' => { -+ 'x86_winnt_6.0' => { - 'build' => { - 'configure_args' => { '-G \"Visual Studio 9 2008\"' => undef }, - 'prereqs' => undef, -@@ -212,7 +219,7 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => undef, -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -230,7 +237,7 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => undef, -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -238,17 +245,20 @@ our %submit_info = ( - # Microsoft Windows 5.1/2000/xp/whatever on x86 - # the official "blessed" windows build configuration - ########################################################################## -- 'x86_winnt_5.1' => { -+ 'x86_winnt_5.1' => { - 'build' => { - 'configure_args' => { '-G \"Visual Studio 9 2008\"' => undef }, -- 'prereqs' => undef, -- 'xtests' => undef, -+ 'prereqs' => [ -+ 'cmake-2.8.3', '7-Zip-9.20', 'ActivePerl-5.10.1', -+ 'VisualStudio-9.0', 'WindowsSDK-6.1', -+ ], -+ 'xtests' => undef, - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, -- 'prereqs' => undef, -- 'testclass' => [ @default_testclass ], -+ 'prereqs' => [ ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -256,81 +266,139 @@ our %submit_info = ( - # Microsoft Windows 5.1/2000/xp/whatever on x86 - # CMake build testing configuration - ########################################################################## -- 'x86_winnt_5.1-tst' => { -+ 'x86_winnt_5.1-tst' => { - 'build' => { - 'configure_args' => { '-G \"Visual Studio 9 2008\"' => undef }, - 'prereqs' => undef, - # when it works add x86_64_winnt_5.1 to the x_tests -- 'xtests' => undef, -+ 'xtests' => [ "x86_winnt_5.1", "x86_64_winnt_5.1", "x86_winnt_6.0" ], - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => undef, -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## -- # Microsoft Windows 5.1/2000/xp/whatever on x86 -- # prereqs testing configuration (also cmake) -+ # Platform Debian 5.0 on x86_64 - ########################################################################## -- 'x86_winnt_5.1' => { -+ 'x86_64_deb_5.0' => { - 'build' => { -- 'configure_args' => { '-G \"Visual Studio 9 2008\"' => undef }, -- 'prereqs' => [ -- 'cmake-2.8.3', '7-Zip-9.20', 'ActivePerl-5.10.1', -- 'VisualStudio-9.0', 'WindowsSDK-6.1', -- ], -+ 'configure_args' => { @default_build_configure_args, -+ '-DCLIPPED:BOOL' => 'OFF', -+ }, -+ 'prereqs' => [ 'libtool-1.5.26', 'cmake-2.8.3' ], -+ 'xtests' => [ 'x86_64_ubuntu_10.04', ], -+ }, -+ -+ 'test' => { -+ 'configure_args' => { @default_test_configure_args }, -+ 'prereqs' => [ 'java-1.4.2_05' ], -+ 'testclass' => [ @default_testclass ], -+ }, -+ }, -+ -+ -+ ########################################################################## -+ # Platform Debian 6.0 on x86_64 -+ # As of this writing there is no x86_64_deb-6.0 (non updated) machine in -+ # the NMI pool. When they include one we should switch this from using -+ # the updated machine to the non-updated machine. -+ ########################################################################## -+ 'x86_64_deb_6.0-updated' => { -+ 'build' => { -+ 'configure_args' => { @default_build_configure_args, -+ '-DCLIPPED:BOOL' => 'OFF', -+ '-DWITH_KRB5:BOOL' => 'OFF', -+ '-DWITH_CREAM:BOOL' => 'OFF', -+ '-DWITH_COREDUMPER:BOOL' => 'OFF', -+ }, -+ 'prereqs' => [ 'cmake-2.8.3' ], -+ 'xtests' => [ 'x86_64_ubuntu_10.04', ], -+ }, -+ -+ 'test' => { -+ 'configure_args' => { @default_test_configure_args }, -+ 'prereqs' => [ 'java-1.4.2_05' ], -+ 'testclass' => [ @default_testclass ], -+ }, -+ }, -+ -+ ########################################################################## -+ # platform RHEL 6 on x86 -+ ########################################################################## -+ 'x86_rhap_6.0' => { -+ 'build' => { -+ 'configure_args' => { @default_build_configure_args, -+ # turn this back on when ready -+ # '-dclipped:bool=off' => undef, -+ }, -+ 'prereqs' => [ @default_prereqs ], - 'xtests' => undef, - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, -- 'prereqs' => undef, -+ 'prereqs' => [ @default_prereqs, 'java-1.4.2_05' ], - 'testclass' => [ @default_testclass ], - }, - }, -- -+ - ########################################################################## -- # Platform Debian 5.0 on x86_64 -+ # Platform RHEL 6 on x86. Unmanaged. - ########################################################################## -- 'x86_64_deb_5.0' => { -+ 'x86_rhap_6.0-updated' => 'x86_rhap_6.0', -+ -+ ########################################################################## -+ # Platform RHEL 6 on x86_64 -+ ########################################################################## -+ 'x86_64_rhap_6.0' => { - 'build' => { - 'configure_args' => { @default_build_configure_args, -- '-DCLIPPED:BOOL=OFF' => undef, -+ # Turn this back on when ready -+ # '-DCLIPPED:BOOL=OFF' => undef, - }, -- 'prereqs' => [ 'libtool-1.5.26', 'cmake-2.8.3' ], -- 'xtests' => [ 'x86_64_ubuntu_10.04', 'x86_64_ubuntu_8.04.3' ], -+ 'prereqs' => [ @default_prereqs ], -+ 'xtests' => undef, - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, -- 'prereqs' => [ 'java-1.4.2_05' ], -+ 'prereqs' => [ @default_prereqs, 'java-1.4.2_05' ], - 'testclass' => [ @default_testclass ], - }, - }, - -+ ########################################################################## -+ # Platform RHEL 6 on x86_64. Unmanaged. -+ ########################################################################## -+ 'x86_64_rhap_6.0-updated' => 'x86_64_rhap_6.0', - - ########################################################################## - # Platform RHEL 5 on x86_64 - ########################################################################## -- 'x86_64_rhap_5' => { -+ 'x86_64_rhap_5' => { - 'build' => { - 'configure_args' => { @default_build_configure_args, -- '-DCLIPPED:BOOL=OFF' => undef, -- }, -+ '-DCLIPPED:BOOL' => 'OFF', -+ }, - 'prereqs' => [ @default_prereqs ], - 'xtests' => [ -- 'x86_64_fedora_13', 'x86_64_rhap_5.2', -- 'x86_64_fedora_12', 'x86_64_fedora_12-updated', -- 'x86_64_fedora_13-updated' ], -+ 'x86_64_fedora_14-updated', -+ 'x86_64_fedora_13', 'x86_64_fedora_13-updated', -+ 'x86_64_rhap_5.2', 'x86_64_rhap_5.3', 'x86_64_rhap_5.3-updated', -+ 'x86_64_sl_5.5', -+ 'x86_64_opensuse_11.3-updated', 'x86_64_opensuse_11.4-updated', -+ 'x86_64_rhap_6.0-updated', -+ ], - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.4.2_05' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -338,10 +406,11 @@ our %submit_info = ( - ########################################################################## - # Platform RHEL 3 on x86_64 - ########################################################################## -- 'x86_64_rhas_3' => { -+ 'x86_64_rhas_3' => { - 'build' => { - 'configure_args' => { @default_build_configure_args, -- '-DCLIPPED:BOOL=OFF' => undef, -+ '-DCLIPPED:BOOL' => 'OFF', -+ '-DWITH_LIBCGROUP:BOOL' => 'OFF', - }, - 'prereqs' => [ @default_prereqs ], - 'xtests' => [ -@@ -352,26 +421,26 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.4.2_05', 'perl-5.8.5', -- 'VMware-server-1.0.7' ], -- 'testclass' => [ @default_testclass ], -+ 'VMware-server-1.0.7' ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## - # Platform Debian 5 on x86 - ########################################################################## -- 'x86_deb_5.0' => { -+ 'x86_deb_5.0' => { - 'build' => { - 'configure_args' => { @default_build_configure_args, -- '-DCLIPPED:BOOL=OFF' => undef -- }, -- 'prereqs' => [ 'libtool-1.5.26', 'cmake-2.8.3' ], -- 'xtests' => undef, -+ '-DCLIPPED:BOOL' => 'OFF', -+ }, -+ 'prereqs' => [ 'libtool-1.5.26', 'cmake-2.8.3' ], -+ 'xtests' => [ 'x86_ubuntu_10.04', ], - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, -- 'prereqs' => [ 'java-1.4.2_05' ], -+ 'prereqs' => [ 'java-1.4.2_05' ], - 'testclass' => [ @default_testclass ], - }, - }, -@@ -383,13 +452,13 @@ our %submit_info = ( - 'build' => { - 'configure_args' => { @default_build_configure_args }, - 'prereqs' => [ @default_prereqs, -- 'coreutils-5.2.1', -- 'libtool-1.5.26',], -+ 'coreutils-5.2.1', -+ 'libtool-1.5.26',], - 'xtests' => [ - 'x86_64_macos_10.5-updated', - 'x86_64_macos_10.6', - 'x86_64_macos_10.6-updated', -- ], -+ ], - }, - - 'test' => { -@@ -398,8 +467,8 @@ our %submit_info = ( - @default_prereqs, - 'java-1.4.2_12', - 'coreutils-5.2.1' -- ], -- 'testclass' => [ @default_testclass ], -+ ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -407,20 +476,20 @@ our %submit_info = ( - # Platform Mac OSX 10.5 on x86_64 - # condor actually builds naturally for this one, we just don't release it - ########################################################################## -- 'x86_64_macos_10.5' => { -+ 'x86_64_macos_10.5' => { - 'build' => { - 'configure_args' => { @default_build_configure_args }, - 'prereqs' => [ - @default_prereqs, - 'libtool-1.5.26', -- ], -- 'xtests' => undef, -+ ], -+ 'xtests' => undef, - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -428,81 +497,84 @@ our %submit_info = ( - # Platform Mac OSX 10.5 on x86_64 with updates - # condor actually builds naturally for this one, we just don't release it - ########################################################################## -- 'x86_64_macos_10.5-updated' => 'x86_64_macos_10.5', -+ 'x86_64_macos_10.5-updated' => 'x86_64_macos_10.5', - - - ########################################################################## - # Platform Mac OSX 10.6 on x86_64 - ########################################################################## -- 'x86_64_macos_10.6' => { -+ 'x86_64_macos_10.6' => { - 'build' => { - 'configure_args' => { @default_build_configure_args }, - 'prereqs' => [ - @default_prereqs, - 'libtool-1.5.26', -- ], -- 'xtests' => undef, -+ ], -+ 'xtests' => undef, - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## - # Platform Mac OSX 10.6 with updates on x86_64 - ########################################################################## -- 'x86_64_macos_10.6-updated' => 'x86_64_macos_10.6', -+ 'x86_64_macos_10.6-updated' => 'x86_64_macos_10.6', - - - ########################################################################## - # Platform RHEL 5 on x86 - ########################################################################## -- 'x86_rhap_5' => { -+ 'x86_rhap_5' => { - 'build' => { - 'configure_args' => { @default_build_configure_args, -- '-DCLIPPED:BOOL=OFF' => undef, -- }, -+ '-DCLIPPED:BOOL' => 'OFF', -+ }, - 'prereqs' => [ @default_prereqs ], - 'xtests' => [ - 'x86_64_rhap_5.2', -+ 'x86_64_rhap_5.3', -+ 'x86_64_rhap_5.3-updated', - 'unmanaged-x86_rhap_5' -- ], -+ ], - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.4.2_05'], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## - # Platform RHEL 3 on x86 - ########################################################################## -- 'x86_rhas_3' => { -+ 'x86_rhas_3' => { - 'build' => { - 'configure_args' => { @default_build_configure_args, -- '-DCLIPPED:BOOL=OFF' => undef, -- }, -+ '-DCLIPPED:BOOL' => 'OFF', -+ '-DWITH_LIBCGROUP:BOOL' => 'OFF', -+ }, - 'prereqs' => [ - @default_prereqs, - 'perl-5.8.5', 'gzip-1.3.3', 'autoconf-2.59' -- ], -- 'xtests' => [ -- 'x86_rhas_4', -- 'x86_64_rhas_3', -- 'x86_64_rhas_4', -- ], -+ ], -+ 'xtests' => [ -+ 'x86_rhas_4', -+ 'x86_64_rhas_3', -+ 'x86_64_rhas_4', -+ ], - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.4.2_05', 'perl-5.8.5', -- 'VMware-server-1.0.7' ], -- 'testclass' => [ @default_testclass ], -+ 'VMware-server-1.0.7' ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -516,15 +588,11 @@ our %submit_info = ( - # builds of Condor are as clipped as possible to ensure compilation. - - ########################################################################## -- # Platform Fedora 12 on x86_64 -- # This might work. -+ # Platform Fedora 13 on x86_64 - ########################################################################## -- 'x86_64_fedora_12' => { -+ 'x86_64_fedora_13' => { - 'build' => { -- 'configure_args' => { @minimal_build_configure_args, -- '-DWITHOUT_SOAP_TEST:BOOL=ON' => undef, -- '-DWITHOUT_AMAZON_TEST:BOOL=ON' => undef, -- }, -+ 'configure_args' => { @minimal_build_configure_args }, - 'prereqs' => [ @default_prereqs ], - 'xtests' => undef, - }, -@@ -532,38 +600,35 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.5.0_08' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## -- # Platform Fedora 12 with updates on x86_64 -- # This might work. -+ # Platform Fedora 13 with updates on x86_64 - ########################################################################## -- 'x86_64_fedora_12-updated' => { -+ 'x86_64_fedora_13-updated' => { - 'build' => { -- 'configure_args' => { @minimal_build_configure_args, -- '-DWITHOUT_SOAP_TEST:BOOL=ON' => undef, -- '-DWITHOUT_AMAZON_TEST:BOOL=ON' => undef, -- }, -+ 'configure_args' => { @minimal_build_configure_args }, - 'prereqs' => [ @default_prereqs ], - 'xtests' => undef, - }, - - 'test' => { - 'configure_args' => { @default_test_configure_args }, -- 'prereqs' => [ @default_prereqs, 'java-1.5.0_08', 'perl-5.8.9' ], -- 'testclass' => [ @default_testclass ], -+ 'prereqs' => [ @default_prereqs, 'java-1.5.0_08' ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## -- # Platform Fedora 13 on x86_64 -- # This might work. -+ # Platform Fedora 14 on x86_64 - ########################################################################## -- 'x86_64_fedora_13' => { -+ 'x86_64_fedora_14' => { - 'build' => { -- 'configure_args' => { @minimal_build_configure_args }, -+ 'configure_args' => { @minimal_build_configure_args, -+ '-DWITH_EXPAT:BOOL' => 'ON', -+ }, - 'prereqs' => [ @default_prereqs ], - 'xtests' => undef, - }, -@@ -571,17 +636,18 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.5.0_08' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## -- # Platform Fedora 13 with updates on x86_64 -- # This might work. -+ # Platform Fedora 14 with updates on x86_64 - ########################################################################## -- 'x86_64_fedora_13-updated' => { -+ 'x86_64_fedora_14-updated' => { - 'build' => { -- 'configure_args' => { @minimal_build_configure_args }, -+ 'configure_args' => { @minimal_build_configure_args, -+ '-DWITH_EXPAT:BOOL' => 'ON', -+ }, - 'prereqs' => [ @default_prereqs ], - 'xtests' => undef, - }, -@@ -589,24 +655,24 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.5.0_08' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## - # Platform Solaris 11 on x86_64 -- # Building openssl is problematic on this platform. There is -+ # Building openssl is problematic on this platform. There is - # some confusion betwen 64-bit and 32-bit, which causes linkage -- # problems. Since ssh_to_job depends on openssl's base64 functions, -+ # problems. Since ssh_to_job depends on openssl's base64 functions, - # that is also disabled. - ########################################################################## - 'x86_64_sol_5.11' => { - 'build' => { - 'configure_args' => { @minimal_build_configure_args, -- '-DWITH_OPENSSL:BOOL=OFF' => undef, -- '-DWITH_CURL:BOOL=OFF' => undef, -- '-DHAVE_SSH_TO_JOB:BOOL=OFF' => undef, -- '-DWITHOUT_SOAP_TEST:BOOL=ON' => undef, -+ '-DWITH_OPENSSL:BOOL' => 'OFF', -+ '-DWITH_CURL:BOOL' => 'OFF', -+ '-DHAVE_SSH_TO_JOB:BOOL' => 'OFF', -+ '-DWITHOUT_SOAP_TEST:BOOL' => 'ON', - }, - 'prereqs' => [ @default_prereqs, 'perl-5.8.9', 'binutils-2.15', - 'gzip-1.3.3', 'wget-1.9.1', 'coreutils-6.9', -@@ -618,24 +684,24 @@ our %submit_info = ( - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'perl-5.8.9', 'binutils-2.15', - 'gzip-1.3.3', 'wget-1.9.1', 'coreutils-6.9' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## - # Platform Solaris 10 on x86_64 -- # Building openssl is problematic on this platform. There is -+ # Building openssl is problematic on this platform. There is - # some confusion betwen 64-bit and 32-bit, which causes linkage -- # problems. Since ssh_to_job depends on openssl's base64 functions, -+ # problems. Since ssh_to_job depends on openssl's base64 functions, - # that is also disabled. - ########################################################################## - 'x86_64_sol_5.10' => { - 'build' => { - 'configure_args' => { @minimal_build_configure_args, -- '-DWITH_OPENSSL:BOOL=OFF' => undef, -- '-DWITH_CURL:BOOL=OFF' => undef, -- '-DHAVE_SSH_TO_JOB:BOOL=OFF' => undef, -- '-DWITHOUT_SOAP_TEST:BOOL=ON' => undef, -+ '-DWITH_OPENSSL:BOOL' => 'OFF', -+ '-DWITH_CURL:BOOL' => 'OFF', -+ '-DHAVE_SSH_TO_JOB:BOOL' => 'OFF', -+ '-DWITHOUT_SOAP_TEST:BOOL' => 'ON', - }, - 'prereqs' => [ @default_prereqs, 'perl-5.8.9', 'binutils-2.21', - 'gzip-1.3.3', 'wget-1.9.1', 'coreutils-8.9', -@@ -647,7 +713,7 @@ our %submit_info = ( - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'perl-5.8.9', 'binutils-2.21', - 'gzip-1.3.3', 'wget-1.9.1', 'coreutils-8.9' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -655,7 +721,7 @@ our %submit_info = ( - # Platform RHEL 5 on x86 (umanaged!) - # This might work. - ########################################################################## -- 'unmanaged-x86_rhap_5' => { -+ 'unmanaged-x86_rhap_5' => { - 'build' => { - 'configure_args' => { @default_build_configure_args }, - 'prereqs' => [ @default_prereqs ], -@@ -665,7 +731,7 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.5.0_08' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -684,7 +750,7 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -703,7 +769,7 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -722,7 +788,7 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.4.2_05' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - -@@ -741,15 +807,34 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## -+ # Platform SL 5.5 on X86_64 -+ # I suspect this could be a real port if we bothered. -+ ########################################################################## -+ 'x86_64_sl_5.5' => { -+ 'build' => { -+ 'configure_args' => { @minimal_build_configure_args }, -+ 'prereqs' => [ @default_prereqs ], -+ 'xtests' => undef, -+ }, -+ -+ 'test' => { -+ 'configure_args' => { @default_test_configure_args }, -+ 'prereqs' => [ @default_prereqs ], -+ 'testclass' => [ @default_testclass ], -+ }, -+ }, -+ -+ -+ ########################################################################## - # Platform RHEL 4 on X86_64 - # This might work. - ########################################################################## -- 'x86_64_rhas_4' => { -+ 'x86_64_rhas_4' => { - 'build' => { - 'configure_args' => { @minimal_build_configure_args }, - 'prereqs' => [ @default_prereqs ], -@@ -759,14 +844,14 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.5.0_08', 'perl-5.8.9' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## - # Platform SLES 9 on x86_64 - ########################################################################## -- 'x86_64_sles_9' => { -+ 'x86_64_sles_9' => { - 'build' => { - 'configure_args' =>{ @minimal_build_configure_args }, - 'prereqs' => [ @default_prereqs, 'wget-1.9.1' ], -@@ -779,15 +864,15 @@ our %submit_info = ( - - }, - 'prereqs' => [ @default_prereqs, 'wget-1.9.1', 'java-1.4.2_05' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## -- # Platform Ubuntu 8.04.3 on x86_64 -+ # Platform Ubuntu 10.04 on x86_64 - # This might work. - ########################################################################## -- 'x86_64_ubuntu_8.04.3' => { -+ 'x86_64_ubuntu_10.04' => { - 'build' => { - 'configure_args' => { @minimal_build_configure_args }, - 'prereqs' => [ @default_prereqs ], -@@ -796,16 +881,15 @@ our %submit_info = ( - - 'test' => { - 'configure_args' => { @default_test_configure_args }, -- 'prereqs' => [ @default_prereqs , 'java-1.4.2_05' ], -- 'testclass' => [ @default_testclass ], -+ 'prereqs' => [ @default_prereqs ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## -- # Platform Ubuntu 10.04 on x86_64 -- # This might work. -+ # Platform Ubuntu 10.04 on x86 - ########################################################################## -- 'x86_64_ubuntu_10.04' => { -+ 'x86_ubuntu_10.04' => { - 'build' => { - 'configure_args' => { @minimal_build_configure_args }, - 'prereqs' => [ @default_prereqs ], -@@ -815,15 +899,14 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## - # Platform RHEL 4 on x86 -- # This might work. - ########################################################################## -- 'x86_rhas_4' => { -+ 'x86_rhas_4' => { - 'build' => { - 'configure_args' => { @minimal_build_configure_args }, - 'prereqs' => [ @default_prereqs ], -@@ -833,24 +916,65 @@ our %submit_info = ( - 'test' => { - 'configure_args' => { @default_test_configure_args }, - 'prereqs' => [ @default_prereqs, 'java-1.4.2_05', 'perl-5.8.5' ], -- 'testclass' => [ @default_testclass ], -+ 'testclass' => [ @default_testclass ], - }, - }, - - ########################################################################## - # Platform openSUSE 11.3 on x86_64 (& updated) - ########################################################################## -- 'x86_64_opensuse_11.3' => { -+ 'x86_64_opensuse_11.3' => { -+ 'build' => { -+ 'configure_args' => { @minimal_build_configure_args, -+ '-DWITHOUT_SOAP_TEST:BOOL' => 'ON', -+ '-DWITHOUT_AMAZON_TEST:BOOL' => 'ON', -+ '-DWITH_CURL:BOOL' => 'ON', -+ '-DWITH_EXPAT:BOOL' => 'ON', -+ '-DWITH_LIBVIRT:BOOL' => 'ON', -+ '-DWITH_LIBXML2:BOOL' => 'ON', -+ }, -+ 'prereqs' => [ @default_prereqs ], -+ 'xtests' => undef, -+ }, -+ -+ 'test' => { -+ 'configure_args' => { -+ @default_test_configure_args -+ -+ }, -+ 'prereqs' => [ @default_prereqs, 'java-1.4.2_05' ], -+ 'testclass' => [ @default_testclass ], -+ }, -+ }, -+ 'x86_64_opensuse_11.3-updated' => 'x86_64_opensuse_11.3', -+ 'x86_64_opensuse_11.4' => 'x86_64_opensuse_11.3', -+ 'x86_64_opensuse_11.4-updated' => 'x86_64_opensuse_11.4', -+ -+ -+ ########################################################################## -+ # Platform FreeBSD 7.4 on x86 -+ ########################################################################## -+ 'x86_freebsd_7.4' => { - 'build' => { - 'configure_args' => { @minimal_build_configure_args, - '-DWITHOUT_SOAP_TEST:BOOL=ON' => undef, - '-DWITHOUT_AMAZON_TEST:BOOL=ON' => undef, -- '-DWITH_CURL:BOOL=ON' => undef, -+ '-DENABLE_JAVA_TESTS:BOOL=OFF' => undef, -+ '-DWITH_CURL:BOOL=OFF' => undef, - '-DWITH_EXPAT:BOOL=ON' => undef, -- '-DWITH_LIBVIRT:BOOL=ON' => undef, -+ '-DWITH_LIBVIRT:BOOL=OFF' => undef, - '-DWITH_LIBXML2:BOOL=ON' => undef, - }, -- 'prereqs' => [ @default_prereqs ], -+ 'prereqs' => [ 'tar-1.14', -+ 'patch-2.6.1', -+ 'cmake-2.8.3', -+ 'flex-2.5.4a', -+ 'make-3.80', -+ 'byacc-1.9', -+ 'bison-1.25', -+ 'wget-1.9.1', -+ 'm4-1.4.1', -+ ], - 'xtests' => undef, - }, - -@@ -859,13 +983,22 @@ our %submit_info = ( - @default_test_configure_args - - }, -- 'prereqs' => [ @default_prereqs, 'java-1.4.2_05' ], -+ 'prereqs' => [ 'tar-1.14', -+ 'patch-2.6.1', -+ 'cmake-2.8.3', -+ 'flex-2.5.4a', -+ 'make-3.80', -+ 'byacc-1.9', -+ 'bison-1.25', -+ 'wget-1.9.1', -+ 'm4-1.4.1', -+ ], - 'testclass' => [ @default_testclass ], - }, - }, -- 'x86_64_opensuse_11.3-updated' => 'x86_64_opensuse_11.3', -- 'x86_64_opensuse_11.4' => 'x86_64_opensuse_11.3', -- 'x86_64_opensuse_11.4-updated' => 'x86_64_opensuse_11.4', -+ 'x86_64_freebsd_7.4' => 'x86_freebsd_7.4', -+ 'x86_freebsd_8.2' => 'x86_freebsd_7.4', -+ 'x86_64_freebsd_8.2' => 'x86_freebsd_7.4', - ); - - while( 1 ) { -@@ -879,7 +1012,7 @@ while( 1 ) { - if ( ! exists $submit_info{$target} ) { - die "No matching platform '$target' for alias '$platform'"; - } -- if ( ref($submit_info{$target}) eq "HASH" ) { -+ if ( ref($submit_info{$target}) eq "HASH" ) { - $submit_info{$platform} = $submit_info{$target}; - $fixed++; - } -@@ -901,49 +1034,54 @@ while( 1 ) { - # perl script if desired. - ############################################################################### - --sub typecheck --{ -+sub typecheck { - my $result = 1; # assume the typecheck passed. -- my $p; - - print "Running typecheck of submit_info.conf:\n"; - - return $result; - - # An example, much more could be done... -- foreach $p (sort keys %submit_info) { -+ foreach my $p (sort keys %submit_info) { - # ensure configure_args is present and defined -- if (!exists($submit_info{$p}{'configure_args'})) { -+ if (!exists($submit_info{$p}{build}{configure_args})) { - print "ERROR: Platform $p 'configure_args' not present\n"; - $result = 0; - } - # ensure 'configure_args' is defined properly. -- if (!defined($submit_info{$p}{'configure_args'})) { -+ if (!defined($submit_info{$p}{build}{configure_args})) { -+ print "ERROR: Platform $p 'configure_args' not defined\n"; -+ $result = 0; -+ } -+ -+ # ensure configure_args is present and defined -+ if (!exists($submit_info{$p}{test}{configure_args})) { -+ print "ERROR: Platform $p 'configure_args' not present\n"; -+ $result = 0; -+ } -+ # ensure 'configure_args' is defined properly. -+ if (!defined($submit_info{$p}{test}{configure_args})) { - print "ERROR: Platform $p 'configure_args' not defined\n"; - $result = 0; - } - } - -- # XXX Add that the prereqs must contain unique entries. -+ # TODO: Add that the prereqs must contain unique entries. - - return $result; - } - - # A simple thing explaining some statistics about submit_info. Mostly useful - # for grant work, I'm sure. :) --sub statistics --{ -- my $nump; -- my $p; -- -+sub statistics { - print "Statistics of submit_info:\n"; - -- $nump = scalar(keys(%submit_info)); -+ my $nump = scalar(keys(%submit_info)); - - print "\tNumber of nmi platforms described: $nump\n"; - - #print "\tPlatforms:\n"; -- #foreach $p (sort keys %submit_info) { -+ #foreach my $p (sort keys %submit_info) { - # print "\t\t$p\n"; - #} - }; -@@ -1049,16 +1187,15 @@ sub dump_info - - # This function converts (and resonably escapes) an argument hash into an array - # usually used for hashes like 'configure_args' --sub args_to_array --{ -+sub args_to_array { - my ($arg_ref) = (@_); -- my $k; - my @result; - -- foreach $k (sort keys %{$arg_ref}) { -+ foreach my $k (sort keys %{$arg_ref}) { - if (defined($arg_ref->{$k})) { -- push @result, "$k='$arg_ref->{$k}'"; -- } else { -+ push @result, "$k='" . $arg_ref->{$k} . "'"; -+ } -+ else { - push @result, "$k"; - } - } -@@ -1077,16 +1214,16 @@ sub main - } - exit( 0 ); - } -- elsif ( ( $arg eq "-a" ) or ( $arg eq "--all" ) ) { -+ elsif ( ( $arg eq "-a" ) or ( $arg eq "--all" ) ) { - push( @platforms, "/.*/" ); - } -- elsif ( ( $arg eq "-h" ) or ( $arg eq "--help" ) ) { -+ elsif ( ( $arg eq "-h" ) or ( $arg eq "--help" ) ) { - print "$usage\n"; -- print " --help|-h: This help\n"; -- print " --list|-l: List available platforms\n"; -- print " --all|-a: Dump info on all available platforms\n"; -- print " : Dump info named platform\n"; -- print " //: Dump info on all platforms matching \n"; -+ print " --help|-h: This help\n"; -+ print " --list|-l: List available platforms\n"; -+ print " --all|-a: Dump info on all available platforms\n"; -+ print " : Dump info named platform\n"; -+ print " //: Dump info on all platforms matching \n"; - exit(0); - } - elsif ( $arg =~ /_/ or $arg =~ /^\// ) { -@@ -1104,8 +1241,8 @@ sub main - } - } - if ( ! scalar(@platforms) ) { -- print "$usage\n"; -- exit( 1 ); -+ print "$usage\n"; -+ exit( 1 ); - } - $#ARGV = -1; - -@@ -1132,3 +1269,8 @@ if (!defined($main::slaved_module)) { - } - - 1; -+ -+### Local Variables: *** -+### mode:perl *** -+### tab-width: 4 *** -+### End: *** -diff --git a/nmi_tools/glue/build/build.win.bat b/nmi_tools/glue/build/build.win.bat -index 7e4d5f0..e92e625 100644 ---- a/nmi_tools/glue/build/build.win.bat -+++ b/nmi_tools/glue/build/build.win.bat -@@ -1,5 +1,7 @@ -+@echo off - @echo CD=%CD% - @echo HOME=%HOME% -+@echo CONDOR_BLD_EXTERNAL_STAGE=%CONDOR_BLD_EXTERNAL_STAGE% - @echo LIB=%LIB% - @echo INCLUDE=%INCLUDE% - @echo PATH=%PATH% -@@ -23,10 +25,18 @@ set PERL_PATH=c:\perl\site\bin;c:\perl\bin - for /D %%I in ("c:\prereq\ActivePerl*") do set ACTIVE_PERL_DIR=%%~fI - if NOT "~%ACTIVE_PERL_DIR%"=="~" set PERL_PATH=%ACTIVE_PERL_DIR%\site\bin;%ACTIVE_PERL_DIR%\bin;%PERL_PATH% - --set ZIP_PATH=%ProgramFiles%\7-Zip -+if "~%_NMI_PREREQ_7_Zip_ROOT%"=="~" ( -+ set ZIP_PATH=%ProgramFiles%\7-Zip -+) else ( -+ set ZIP_PATH=%_NMI_PREREQ_7_Zip_ROOT% -+) - set WIX_PATH=%WIX% - set MSCONFIG_TOOLS_DIR=%BUILD_ROOT%\msconfig --set CMAKE_BIN_DIR=%ProgramFiles%\CMake 2.8\bin -+if "~%_NMI_PREREQ_cmake_ROOT%"=="~" ( -+ set CMAKE_BIN_DIR=%ProgramFiles%\CMake 2.8\bin -+) else ( -+ set CMAKE_BIN_DIR=%_NMI_PREREQ_cmake_ROOT%\bin -+) - - set PATH=%SystemRoot%\system32;%SystemRoot%;%PERL_PATH%;%MSCONFIG_TOOLS_DIR%;%VS_DIR%\Common7\IDE;%VC_BIN%;%CMAKE_BIN_DIR%;%ZIP_PATH%;%WIX_PATH% - @echo PATH=%PATH% -diff --git a/nmi_tools/glue/build/remote_pre b/nmi_tools/glue/build/remote_pre -index 4196663..0dd064d 100755 ---- a/nmi_tools/glue/build/remote_pre -+++ b/nmi_tools/glue/build/remote_pre -@@ -49,6 +49,8 @@ $| = 1; - - if ($ENV{NMI_PLATFORM} =~ /winnt/) { - $ENV{PATH} = "C:\\Program Files\\CMake 2.8\\bin;$ENV{VS90COMNTOOLS}..\\IDE;$ENV{VS90COMNTOOLS}..\\..\\VC\\BIN;$ENV{PATH}"; -+ $externals_loc = "c:/temp/condor"; -+ $ENV{CONDOR_BLD_EXTERNAL_STAGE} = "$externals_loc"; - } else { - $ENV{PATH} ="$ENV{PATH}:/sw/bin:/sw/sbin:/usr/kerberos/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/condor/bin:/usr/local/condor/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/ccs/bin:/usr/lib/java/bin"; - } -diff --git a/nmi_tools/glue/build/remote_task b/nmi_tools/glue/build/remote_task -index 12fbf01..38efe78 100755 ---- a/nmi_tools/glue/build/remote_task -+++ b/nmi_tools/glue/build/remote_task -@@ -72,7 +72,7 @@ print "Executing task '$taskname' on host '$hostname'\n"; - if( $taskname eq $EXTERNALS_TASK ) { - # Since we do not declare the externals task on Windows, we don't have - # to handle invoking the Windows build tools in this step. -- $execstr = "make externals"; -+ $execstr = "make VERBOSE=1 externals"; - } - elsif ($taskname eq $UNSTRIPPED_TASK) { - $execstr = get_cmake_args(); -diff --git a/nmi_tools/glue/test/TestGlue.pm b/nmi_tools/glue/test/TestGlue.pm -new file mode 100644 -index 0000000..0a96bc9 ---- /dev/null -+++ b/nmi_tools/glue/test/TestGlue.pm -@@ -0,0 +1,143 @@ -+#!/usr/bin/env perl -+##************************************************************** -+## -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, -+## University of Wisconsin-Madison, WI. -+## -+## Licensed under the Apache License, Version 2.0 (the "License"); you -+## may not use this file except in compliance with the License. You may -+## obtain a copy of the License at -+## -+## http://www.apache.org/licenses/LICENSE-2.0 -+## -+## Unless required by applicable law or agreed to in writing, software -+## distributed under the License is distributed on an "AS IS" BASIS, -+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+## See the License for the specific language governing permissions and -+## limitations under the License. -+## -+##************************************************************** -+ -+use strict; -+use warnings; -+use Cwd; -+use File::Spec; -+ -+package TestGlue; -+ -+ -+sub print_debug_header { -+ my $cwd = Cwd::getcwd(); -+ -+ print "----------- Debug Header ----------------\n"; -+ print "Current time: " . scalar(localtime) . "\n"; -+ print "Current host: " . `/bin/hostname -f`; -+ print "CWD: $cwd\n"; -+ print "Perl path: $^X\n"; -+ print "Perl version: $]\n"; -+ dir_listing("."); -+ print "---------- End Debug Header --------------\n"; -+} -+ -+sub setup_test_environment { -+ -+ my $base_dir = Cwd::getcwd(); -+ -+ if( not is_windows() ) { -+ set_env("BASE_DIR", $base_dir); -+ set_env("PATH", "$base_dir/nmi_tools/glue/test:$base_dir/condor/bin:$base_dir/condor/sbin:$ENV{PATH}"); -+ set_env("CONDOR_CONFIG", "$base_dir/condor_tests/TestingPersonalCondor/condor_config"); -+ } -+ else { -+ # Get the right slashes for Windows. Apparently getcwd() returns forward slashes, even -+ # on Windows. -+ $base_dir =~ s|/|\\|g; -+ set_env("BASE_DIR", $base_dir); -+ -+ # Create the Windows PATH -+ my $path = "$base_dir\\nmi_tools\\glue\\test;$base_dir\\condor\\bin;"; -+ -+ # We installed some tools (unzip, tar) in C:\tools on our Windows NMI machines -+ $path .= "C:\\tools;"; -+ -+ # We need to add Perl to the path -+ #$path .= "C:\\prereq\\ActivePerl-5.10.1\\bin;"; -+ -+ # Windows requires the SystemRoot directory to the PATH. This is generally C:\Windows. -+ # Also, add the system32 subdirectory in this folder -+ #my $system_paths = "$ENV{SystemRoot};" . File::Spec->catdir($ENV{SystemRoot}, "system32"); -+ #$path .= "$ENV{SystemRoot};"; -+ #$path .= File::Spec->catdir($ENV{SystemRoot}, "system32") . ";"; -+ -+ set_env("PATH", "$ENV{PATH};$path"); -+ -+ # Condor will want Win32-style paths for CONDOR_CONFIG -+ set_env("CONDOR_CONFIG", "$base_dir\\condor_tests\\TestingPersonalCondor\\condor_config"); -+ -+ # also, throw in the WIN32 version of the base directory path for later use -+ set_env("WIN32_BASE_DIR", $base_dir); -+ -+ print "----------------------------------\n"; -+ print "Dumping environment:\n"; -+ system("set"); -+ print "----------------------------------\n\n"; -+ } -+} -+ -+ -+ -+sub setup_task_environment { -+ set_env("GCBTARGET", "nmi-s006.cs.wisc.edu"); -+} -+ -+ -+sub set_env { -+ my ($key, $val) = @_;; -+ print "Setting environment variable:\n"; -+ print "\t$key -> '$val'\n"; -+ $ENV{$key} = $val; -+} -+ -+ -+sub dir_listing { -+ my (@path) = @_; -+ -+ my $path = File::Spec->catdir(@path); -+ -+ # If we have a relative path then show the CWD -+ my $cwd = ""; -+ if(not File::Spec->file_name_is_absolute($path)) { -+ $cwd = "(CWD: '" . Cwd::getcwd() . "')"; -+ } -+ print "Showing directory contents of path '$path' $cwd\n"; -+ -+ # We have to check $^O because the platform_* scripts will be executed on a Linux -+ # submit node - but the nmi platform string will have winnt -+ if( is_windows() && $^O ne "linux" ) { -+ system("dir $path"); -+ } -+ else { -+ system("ls -l $path"); -+ } -+} -+ -+ -+sub which { -+ my ($exe) = @_; -+ -+ if( is_windows() ) { -+ return system('for /F %I in ("' . $exe . '") do echo %~$PATH:I'); -+ } -+ else { -+ return system("which $exe"); -+ } -+} -+ -+sub is_windows { -+ if( $ENV{NMI_PLATFORM} =~ /winnt/ ) { -+ return 1; -+ } -+ return 0; -+} -+ -+1; -diff --git a/nmi_tools/glue/test/platform_post b/nmi_tools/glue/test/platform_post -index ff3eca5..af8b88e 100755 ---- a/nmi_tools/glue/test/platform_post -+++ b/nmi_tools/glue/test/platform_post -@@ -1,7 +1,7 @@ - #!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -@@ -18,34 +18,38 @@ - ## - ##************************************************************** - -+use strict; -+use warnings; -+use File::Spec; -+use File::Basename; -+ -+my $dir = dirname($0); -+unshift @INC, $dir; -+require "TestGlue.pm"; - - ################################################################## --#We will be removing the platform app_input.tar.gz until NMI does -+# We will be removing the platform app_input.tar.gz until NMI does - ################################################################## -+# The reason for this section is unknown. Todd Miller guessed that -+# it is here to save disk space. -+ -+TestGlue::dir_listing("..", ".."); - --$appinput = "../../" . $ENV{NMI_PLATFORM} . "_app_input.tar.gz"; --print "../.. has the following:\n"; --system("ls -l ../.."); --print "Looking to see is $appinput is around and removing\n"; --system("rm -f $appinput"); -+my $appinput = File::Spec->catfile("..", "..", "$ENV{NMI_PLATFORM}_app_input.tar.gz"); -+if(-e $appinput) { -+ print "File '$appinput' exists. Removing it.\n"; -+ unlink($appinput); -+} -+else { -+ print "File '$appinput' does not exist.\n"; -+} - - ################################################################## - # We do not need to hang on to the source tarball - ################################################################## - --#my $vers_file = "CONDOR-VERSION"; --#print "Finding version of Condor\n"; --#open( VERS, "$vers_file" ) || die "Can't open $vers_file: $!\n"; --#while( ) { --# chomp; --# $vers = $_; --#} --#close( VERS ); --#if( ! $vers ) { --# die "Can't find Condor version in $vers_file!\n"; --#} --print "Remove unwanted binaries ....\n"; --$binaries_file = "condor-*.tar.gz"; --system("rm -f $binaries_file"); -+my @binaries = ; -+print "Remove unwanted binaries:\n\t" . join("\n\t", @binaries) . "\n"; -+unlink(@binaries); - - exit(0); -diff --git a/nmi_tools/glue/test/platform_pre b/nmi_tools/glue/test/platform_pre -index 79ce555..acdf286 100755 ---- a/nmi_tools/glue/test/platform_pre -+++ b/nmi_tools/glue/test/platform_pre -@@ -1,7 +1,7 @@ - #!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -@@ -34,112 +34,118 @@ - # done them prior. This way we can remove things like results.tar.gz - # once we have extracted what we care about etc... - ###################################################################### -+use strict; -+use warnings; - use Cwd; -+use File::Basename; -+use File::Spec; - --$extractdone = "RESULTEXTRACTIONDONE"; -+my $dir = dirname($0); -+unshift @INC, $dir; -+require "TestGlue.pm"; -+TestGlue::print_debug_header(); -+ -+my $extractdone = "RESULTEXTRACTIONDONE"; - - # autoflush our STDOUT - $| = 1; - - my $BaseDir = getcwd(); - --print "Currently in $BaseDir which contains the following:\n"; --system("ls -l"); -- - my $tarball_file = "CONDOR-TARBALL-NAME"; -+ - my $results = "results.tar.gz"; ---f $results || die "$results does not exist!\n"; -+die "$results does not exist!\n" unless(-f $results); - - ###################################################################### - # -1) If we are dealing with a Windows build simply save the - # results.tar.gz name in the marker file because it holds only - # what we want. Then leave. - ###################################################################### --if( ($ENV{NMI_PLATFORM} =~ /winnt/) ) { -- -- print "Unzipping results.tar.gz\n"; -- system("tar -xzf $results"); -- print "Moving public/* to $BaseDir\n"; -+if( TestGlue::is_windows() ) { -+ # Note that even though this is Windows this code executes on a Linux submit host -+ # so it is ok to use Unix commands (tar, mv, chmod, etc) -+ print "Untarring results.tar.gz\n"; -+ system("tar -xzvf $results"); -+ print "\nMoving public/* to $BaseDir\n"; - system("mv public/* $BaseDir"); - system("chmod a+r *.tar.gz"); - - print "All steps completed successfully\n"; -- print "Currently in $BaseDir which contains the following:\n"; -- system("ls -l"); -- -- # NOTE: windows quits here!! -- # -+ print "Contents of '$BaseDir':\n"; -+ system("ls -l ."); -+ -+ # NOTE: windows quits here!! - exit 0; - } - --my $testbin = "public/condor_*"; - print "Preparing input test job in $BaseDir\n"; - - ###################################################################### - # 1) find the specific binary we care about - ###################################################################### --if(!(-f $extractdone)) { -- print "Searching in results.tar.gz for binaries\n"; -- open( LTAR, "tar -xvzf $results |" ) || -- die "Can't open tar -xzvf $results : $!\n"; -- my $saved_tarball; -- while( ) { -- chomp; -- print "Considering: $_\n"; -- if( /.*condor-.*-stripped.*\.tar\.(gz|Z)$/ ) { -- $saved_tarball = $_; -- print "Found tarball!\n"; -- } -- } -- close( LTAR ); -- if( ! $saved_tarball ) { -- die "Can't find any tarball in $results\n"; -- } -- --###################################################################### --# 2) Now that we found the binary we want, untar it from the tarball, --# move it to this parent directory. --###################################################################### -- -- @path_parts = split( '/', $saved_tarball ); -- $tar_name = pop( @path_parts ); -- print "TarName is: $tar_name\n"; -+if(!-f $extractdone) { -+ my $pattern = "public/condor-*-stripped.tar.gz"; -+ print "Extracting '$pattern', condor_examples, and condor_tests from results.tar.gz\n"; - -- # Now, copy it to the parent -- print "Moving $tar_name to $BaseDir\n"; -- system( "mv $saved_tarball $BaseDir" ); -- if( $? ) { -- die "'mv $saved_tarball $BaseDir' failed with status $?\n"; -- } -+ my $ret = system("tar -xvzf $results $pattern public/condor_tests public/condor_examples"); - --###################################################################### --# 2) Now that we found the binary we want, untar the pre-built test --# programs from the tarball and move them to this parent directory. --###################################################################### -- -- # Now, copy it to the parent -- print "Copying $testbin to $BaseDir\n"; -- system( "cp -r $testbin $BaseDir" ); -- if( $? ) { -- die "'cp $testbin $BaseDir' failed with status $?\n"; -- } -- -- print "Writing tarball filename to $tarball_file\n"; -- open( TARBALL_FILE, ">$tarball_file" ) || -- die "Can't open $tarball_file: $!\n"; -- print TARBALL_FILE "$tar_name\n"; -- close( TARBALL_FILE ); --} -+ if($ret) { -+ die "Could not extract tarball or test dir from $results: $!\n"; -+ } -+ -+ print "Time: " . scalar(localtime) . "\n\n"; -+ my $saved_tarball = glob($pattern); -+ print "Tarball extracted: '$saved_tarball'\n"; -+ my $tar_name = basename($saved_tarball); -+ print "Tarball name is: $tar_name\n"; -+ -+ ###################################################################### -+ # 2) Now that we found the binary we want, untar it from the tarball, -+ # move it to this parent directory. -+ ###################################################################### -+ -+ print "\n"; -+ print "Moving $tar_name to $BaseDir\n"; -+ if(not rename($saved_tarball, "$BaseDir/$tar_name")) { -+ die "Could not move $saved_tarball to $BaseDir: $!"; -+ } -+ -+ ###################################################################### -+ # 2) Now that we found the binary we want, untar the pre-built test -+ # programs from the tarball and move them to this parent directory. -+ ###################################################################### -+ -+ # Now, copy it to the parent -+ my $test_dir = "public/condor_tests"; -+ print "Moving $test_dir to $BaseDir\n"; -+ if(not rename($test_dir, "$BaseDir/condor_tests")) { -+ die "Could not move $test_dir into $BaseDir: $!\n"; -+ } -+ -+ my $example_dir = "public/condor_examples"; -+ print "Moving $example_dir to $BaseDir\n"; -+ if(not rename($example_dir, "$BaseDir/condor_examples")) { -+ die "Could not move $example_dir into $BaseDir: $!\n"; -+ } -+ -+ print "Writing tarball filename to $tarball_file.\n"; -+ open(TARBALL_FILE, '>', $tarball_file ) || die "Can't open $tarball_file for writing: $!\n"; -+ print TARBALL_FILE "$tar_name\n"; -+ close(TARBALL_FILE); -+ } - - # Mark all processing done and results.tar.gz processing etc is done --system("touch $extractdone"); -+open(SENTINEL, '>', $extractdone) or die("Can't touch $extractdone: $!"); -+close(SENTINEL); - - # Finally, blow away anything still in public and the results.tar.gz - print "Removing all other arch-dependent data\n"; - system( "rm -rf public $results results" ); - if( $? ) { -- die "'rm -rf public $results results' failed with status $?\n"; -+ die "'rm -rf public $results results' failed with status $? ($!)\n"; - } - - print "All steps completed successfully\n"; -+print "End time: " . scalar(localtime) . "\n"; - exit 0; -diff --git a/nmi_tools/glue/test/post_all b/nmi_tools/glue/test/post_all -index 91099f5..a6fd2bf 100755 ---- a/nmi_tools/glue/test/post_all -+++ b/nmi_tools/glue/test/post_all -@@ -1,7 +1,7 @@ - #!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -diff --git a/nmi_tools/glue/test/pre_all b/nmi_tools/glue/test/pre_all -index 6f87f90..6052292 100755 ---- a/nmi_tools/glue/test/pre_all -+++ b/nmi_tools/glue/test/pre_all -@@ -1,7 +1,7 @@ - #!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -@@ -18,41 +18,5 @@ - ## - ##************************************************************** - -- --###################################################################### --# $Id: pre_all,v 1.4 2007-11-08 22:53:46 nleroy Exp $ --# Submit-side NMI build system infrastructure to setup source --# input for test jobs before the platform-specific stuff is called. --# All we have to do is untar the common/results.tar.gz file so that --# when the NMI infrastructure copies everything into each platform- --# specific directory, "results.tar.gz" doesn't get clobbered. --# We assume we're born inside the "common" directory... --###################################################################### -- --use Getopt::Long; -- --# autoflush our STDOUT --$| = 1; -- --# Set up environment file for talking to tests on remote execute node --setupTestEnvFile(); -- --print "All steps completed successfully\n"; --exit 0; -- --sub setupTestEnvFile --{ -- ###################################################################### -- # set up environment and create env file for test tasks -- ###################################################################### -- -- print "Setting up environtment file 'setup_test_env' for other scripts\n"; -- open( ENVSETUP, ">test_task_env" ) || -- die "cannot open test_task_env for writing\n"; -- -- print ENVSETUP "GCBTARGET=nmi-s006.cs.wisc.edu\n"; -- print ENVSETUP "export GCBTARGET\n"; -- close(ENVSETUP); --} -- -- -+print "Nothing to do for pre-all currently.\n"; -+exit(0); -diff --git a/nmi_tools/glue/test/remote_declare b/nmi_tools/glue/test/remote_declare -index bd8f720..5f23f87 100755 ---- a/nmi_tools/glue/test/remote_declare -+++ b/nmi_tools/glue/test/remote_declare -@@ -1,7 +1,7 @@ --#!/bin/sh -+#!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -@@ -18,22 +18,227 @@ - ## - ##************************************************************** - -+use strict; -+use warnings; -+use Getopt::Long; -+use vars qw/ @opt_testclasses /; -+use File::Basename; -+use File::Spec; - --# $Id: remote_declare,v 1.3 2007-11-08 22:53:46 nleroy Exp $ -+my $dir = dirname($0); -+unshift @INC, $dir; -+require "TestGlue.pm"; -+TestGlue::print_debug_header(); -+TestGlue::setup_test_environment(); - --# Condor implementation of NMI test infrastructure interface --# Simple wrapper to source the environment file and spawn the --# corresponding perl script for a given stage of the test. -+parseOptions(); - --ENV_FILE=setup_test_env -+###################################################################### -+# generate list of all tests to run -+###################################################################### - --# include the environment info from the pre-script --if [ ! -f $ENV_FILE ]; then -- echo "$ENV_FILE does not exist!" -- exit 1 --fi --. $ENV_FILE -+my $BaseDir = $ENV{BASE_DIR} || die "BASE_DIR not in environment!\n"; -+my $TaskFile = File::Spec->catfile($BaseDir, "tasklist.nmi"); -+my $UserdirTaskFile = File::Spec->catfile($BaseDir, "..", "tasklist.nmi"); -+my $testdir = "condor_tests"; - --exec remote_declare.pl $* -+# Look for a specific file that contains overrides for the default timeouts for some tests -+my %CustomTimeouts = load_custom_timeout_file(); -+my %RuncountChanges = load_custom_runcount_file(); - -+# file which contains the list of tests to run on Windows -+my $WinTestList = File::Spec->catfile($BaseDir, $testdir, "Windows_list"); -+my $ShortWinTestList = File::Spec->catfile($BaseDir, $testdir, "Windows_shortlist"); - -+# Figure out what testclasses we should declare based on our -+# command-line arguments. If none are given, we declare the testclass -+# "all", which is *all* the tests in the test suite. -+my @classlist = @opt_testclasses; -+if( ! @classlist ) { -+ push( @classlist, "all" ); -+} -+ -+# The rest of argv, after the -- are any additional configure arguments. -+my $configure_args = join(' ', @ARGV); -+ -+print "****************************************************\n"; -+print "**** Preparing to declare tests for these classes:\n"; -+foreach my $class (@classlist) { -+ print "**** $class\n"; -+} -+ -+# Make sure we can write to the tasklist file, and have the filehandle -+# open for use throughout the rest of the script. -+open(TASKFILE, '>', $TaskFile ) || die "Can't open $TaskFile for writing: $!\n"; -+open(USERTASKFILE, '>', $UserdirTaskFile ) || die "Can't open $UserdirTaskFile for writing: $!\n"; -+ -+ -+###################################################################### -+# For each testclass, generate the list of tests that match it -+###################################################################### -+ -+my %tasklist; -+ -+if( not TestGlue::is_windows() ) { -+ foreach my $class (@classlist) { -+ print "****************************************************\n"; -+ print "**** Finding tests for class: '$class'\n"; -+ print "****************************************************\n"; -+ my $tests = findTests( $class, "top" ); -+ %tasklist = (%tasklist, %$tests); -+ } -+} -+else { -+ # eat the file Windows_list into tasklist hash -+ foreach my $class (@classlist) { -+ print "****************************************************\n"; -+ print "**** Finding Windows tests '$class'\n"; -+ print "****************************************************\n"; -+ if($class eq "quick") { -+ open(WINDOWSTESTS, '<', $WinTestList) || die "Can't open $WinTestList: $!\n"; -+ } -+ elsif($class eq "short") { -+ open( WINDOWSTESTS, '<', $ShortWinTestList) || die "Can't open $ShortWinTestList: $!\n"; -+ } -+ else { -+ # if things got confused just run the hourly tests -+ print "Unknown test class provided for Windows: '$class' (only quick and short are supported)\n"; -+ print "We will run the short tests in this undefined case.\n"; -+ open( WINDOWSTESTS, '<', $ShortWinTestList) || die "Can't open $ShortWinTestList: $!\n"; -+ } -+ -+ # Load the tasks, one per line. Skip comments (lines starting with #) -+ %tasklist = map { chomp; $_ => 1} grep !/^\s*\#/, ; -+ print join("\n", sort keys %tasklist) . "\n"; -+ close(WINDOWSTESTS); -+ } -+} -+ -+my $total_tests = scalar(keys %tasklist); -+print "-- Found $total_tests test(s) in all directories\n"; -+ -+print "****************************************************\n"; -+print "**** Writing out tests to tasklist.nmi\n"; -+print "****************************************************\n"; -+foreach my $task (sort keys %tasklist) { -+ my $test_count = defined($RuncountChanges{$task}) ? $RuncountChanges{$task} : 1; -+ -+ if(defined($CustomTimeouts{"$task"})) { -+ print "CustomTimeout:$task $CustomTimeouts{$task}\n"; -+ foreach(1..$test_count) { -+ print TASKFILE "$task-$_ $CustomTimeouts{$task}\n"; -+ print USERTASKFILE "$task-$_ $CustomTimeouts{$task}\n"; -+ } -+ } -+ else { -+ foreach(1..$test_count) { -+ print TASKFILE "$task-$_\n"; -+ print USERTASKFILE "$task-$_\n"; -+ } -+ } -+} -+close( TASKFILE ); -+close( USERTASKFILE ); -+print "Wrote " . scalar(keys %tasklist) . " unique tests.\n"; -+exit(0); -+ -+sub findTests { -+ my( $classname, $dir_arg ) = @_; -+ my ($ext, $dir); -+ -+ if( $dir_arg eq "top" ) { -+ $ext = ""; -+ $dir = $testdir; -+ } -+ else { -+ $ext = ".$dir_arg"; -+ $dir = "$testdir/$dir_arg"; -+ } -+ print "-- Searching directory '$dir' for tests with class '$classname'\n"; -+ chdir( "$BaseDir/$dir" ) || die "Can't chdir($BaseDir/$dir): $!\n"; -+ -+ my $list_target = "list_$classname"; -+ open(LIST, '<', $list_target) || die "cannot open $list_target: $!\n"; -+ my %tasklist = map { chomp; "$_$ext" => 1 } ; -+ close(LIST); -+ -+ print join("\n", sort keys %tasklist) . "\n"; -+ -+ my $total = scalar(keys %tasklist); -+ print "-- Found $total test(s) in directory '$dir' for class '$classname'\n\n"; -+ return \%tasklist; -+} -+ -+sub usage { -+ print < \@opt_testclasses, -+ 'help' => \&usage, -+ ); -+ -+ if( !$rc ) { -+ usage(); -+ } -+ -+ # allow comma separated list in addition to multiple occurrences. -+ @opt_testclasses = split(/,/, join(',', @opt_testclasses)); -+ -+ if (!defined(@opt_testclasses)) { -+ die "Please supply a test class!\n"; -+ } -+} -+ -+ -+sub load_custom_timeout_file { -+ my %timeouts = (); -+ my $TimeoutFile = File::Spec->catfile($BaseDir, $testdir, "TimeoutChanges"); -+ if( -f $TimeoutFile) { -+ print "Found a custom timeout file at '$TimeoutFile'. Loading it...\n"; -+ open(TIMEOUTS, '<', $TimeoutFile) || die "Failed to open $TimeoutFile for reading: $!\n"; -+ while() { -+ if(/^\s*([\-\w]*)\s+(\d*)\s*$/) { -+ print "\tCustom Timeout: $1:$2\n"; -+ $timeouts{$1} = $2; -+ } -+ } -+ close(TIMEOUTS); -+ } -+ else { -+ print "INFO: No custom timeout file found.\n"; -+ } -+ -+ return %timeouts; -+} -+ -+ -+sub load_custom_runcount_file { -+ my %runcounts = (); -+ my $RuncountFile = File::Spec->catfile($BaseDir, $testdir, "RuncountChanges"); -+ if( -f $RuncountFile) { -+ print "Found a custom runcount file at '$RuncountFile'. Loading it...\n"; -+ open(RUNCOUNT, '<', $RuncountFile) || die "Failed to open $RuncountFile for reading: $!\n"; -+ while() { -+ if(/^\s*([\w\-]+)\s+(\d*)\s*$/) { -+ print "\tCustom Runcount: $1:$2\n"; -+ $runcounts{$1} = $2; -+ } -+ } -+ close(RUNCOUNT); -+ } -+ else { -+ print "INFO: No custom runcount file found.\n"; -+ } -+ -+ return %runcounts; -+} -diff --git a/nmi_tools/glue/test/remote_declare.pl b/nmi_tools/glue/test/remote_declare.pl -deleted file mode 100755 -index 3cc10d8..0000000 ---- a/nmi_tools/glue/test/remote_declare.pl -+++ /dev/null -@@ -1,260 +0,0 @@ --#!/usr/bin/env perl --##************************************************************** --## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, --## University of Wisconsin-Madison, WI. --## --## Licensed under the Apache License, Version 2.0 (the "License"); you --## may not use this file except in compliance with the License. You may --## obtain a copy of the License at --## --## http://www.apache.org/licenses/LICENSE-2.0 --## --## Unless required by applicable law or agreed to in writing, software --## distributed under the License is distributed on an "AS IS" BASIS, --## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --## See the License for the specific language governing permissions and --## limitations under the License. --## --##************************************************************** -- --use Getopt::Long; --use vars qw/ @opt_testclasses $opt_help /; -- --parseOptions(); -- --###################################################################### --# generate list of all tests to run --###################################################################### -- --my $BaseDir = $ENV{BASE_DIR} || die "BASE_DIR not in environment!\n"; --my $TaskFile = "$BaseDir/tasklist.nmi"; --my $UserdirTaskFile = "$BaseDir/../tasklist.nmi"; --my $testdir = "condor_tests"; -- --my %CustomTimeouts; --my $TimeoutFile = "$BaseDir/condor_tests/TimeoutChanges"; --# Do we have a file with non-default timeouts for some tests? --if( -f "$TimeoutFile") { -- open(TIMEOUTS,"<$TimeoutFile") || die "Failed to open $TimeoutFile: $!\n"; -- my $line; -- while() { -- chomp($_); -- $line = $_; -- if($line =~ /^\s*([\-\w]*)\s+(\d*)\s*$/) { -- print "Custom Timeout: $1:$2\n"; -- $CustomTimeouts{"$1"} = $2; -- } -- } -- close(TIMEOUTS); --} -- --my %RuncountChanges; --my $RuncountFile = "$BaseDir/condor_tests/RuncountChanges"; --# Do we have a file with non-default runtimes for some tests? --if( -f "$RuncountFile") { -- open(RUNCOUNT,"<$RuncountFile") || die "Failed to open $RuncountFile: $!\n"; -- my $line; -- while() { -- chomp($_); -- $line = $_; -- if($line =~ /^\s*([\w\-]+)\s+(\d*)\s*$/) { -- print "Custom Runcount: $1:$2\n"; -- $RuncountChanges{"$1"} = $2; -- } -- } -- close(RUNCOUNT); --} --# file which contains the list of tests to run on Windows --my $WinTestList = "$BaseDir/condor_tests/Windows_list"; --my $ShortWinTestList = "$BaseDir/condor_tests/Windows_shortlist"; -- --# Figure out what testclasses we should declare based on our --# command-line arguments. If none are given, we declare the testclass --# "all", which is *all* the tests in the test suite. --my @classlist = @opt_testclasses; --if( ! @classlist ) { -- push( @classlist, "all" ); --} -- --# The rest of argv, after the -- are any additional configure arguments. --my $configure_args = join(' ', @ARGV); -- --print "****************************************************\n"; --print "**** Preparing to declare tests for these classes:\n"; --foreach $class (@classlist) { -- print "**** $class\n"; --} -- --# Make sure we can write to the tasklist file, and have the filehandle --# open for use throughout the rest of the script. --open( TASKFILE, ">$TaskFile" ) || die "Can't open $TaskFile: $!\n"; --open( USERTASKFILE, ">$UserdirTaskFile" ) || die "Can't open $UserdirTaskFile: $!\n"; -- -- --###################################################################### --# For each testclass, generate the list of tests that match it --###################################################################### -- --my %tasklist; --my $total_tests; -- --if( !($ENV{NMI_PLATFORM} =~ /winnt/) ) { -- foreach $class (@classlist) { -- print "****************************************************\n"; -- print "**** Finding tests for class: \"$class\"\n"; -- print "****************************************************\n"; -- $total_tests = 0; -- $total_tests += findTests( $class, "top" ); -- -- # this compiler specific tests for std:u is total crap. -- #foreach $cmplr (@compilers) { -- # $total_tests += findTests( $class, $cmplr ); -- #} -- } --} else { -- # eat the file Windows_list into tasklist hash -- foreach $class (@classlist) { -- print "****************************************************\n"; -- print "**** Finding Windows tests \"$class\"\n"; -- print "****************************************************\n"; -- if($class eq "quick") { -- open( WINDOWSTESTS, "<$WinTestList" ) || die "Can't open $WinTestList: $!\n"; -- } elsif($class eq "short") { -- open( WINDOWSTESTS, "<$ShortWinTestList" ) || die "Can't open $ShortWinTestList: $!\n"; -- } else { -- # if things got confused just run the hourly tests -- open( WINDOWSTESTS, "<$ShortWinTestList" ) || die "Can't open $ShortWinTestList: $!\n"; -- } -- $total_tests = 0; -- $testnm = ""; -- while() { -- chomp(); -- $testnm = $_; -- if( $testnm =~ /^\s*#.*/) { -- # skip the comment -- } else { -- $total_tests += 1; -- $tasklist{$testnm} = 1; -- } -- } -- } --} -- --if( $total_tests == 1) { -- $word = "test"; --} else { -- $word = "tests"; --} --print "-- Found $total_tests $word in all " . -- "directories\n"; -- --print "****************************************************\n"; --print "**** Writing out tests to tasklist.nmi\n"; --print "****************************************************\n"; --my $unique_tests = 0; --my $repeat_test; --foreach $task (sort keys %tasklist ) { -- $tempt = $CustomTimeouts{"$task"}; -- $tempr = $RuncountChanges{"$task"}; -- if( exists $RuncountChanges{"$task"} ) { -- $repeat_test = $tempr; -- } else { -- $repeat_test = 1; -- } -- -- if( exists $CustomTimeouts{"$task"} ) { -- foreach(1..$repeat_test) { -- print TASKFILE $task . "-" . $_ . " " . $CustomTimeouts{"$task"} . "\n"; -- print USERTASKFILE $task . "-" . $_ . " " . $CustomTimeouts{"$task"} . "\n"; -- } -- print "CustomTimeout:$task $tempt\n"; -- } else { -- foreach(1..$repeat_test) { -- print TASKFILE $task . "-" . $_ . "\n"; -- print USERTASKFILE $task . "-" . $_ . "\n"; -- } -- } -- $unique_tests++; --} --close( TASKFILE ); --close( USERTASKFILE ); --print "Wrote $unique_tests unique tests\n"; --exit(0); -- --sub findTests () { -- my( $classname, $dir_arg ) = @_; -- my ($ext, $dir); -- my $total = 0; -- -- if( $dir_arg eq "top" ) { -- $ext = ""; -- $dir = $testdir; -- } else { -- $ext = ".$dir_arg"; -- $dir = "$testdir/$dir_arg"; -- } -- print "-- Searching \"$dir\" for \"$classname\"\n"; -- chdir( "$BaseDir/$dir" ) || die "Can't chdir($BaseDir/$dir): $!\n"; -- -- $list_target = "list_" . $classname; -- -- open( LIST, $list_target ) || die "cannot open $list_target: $!\n"; -- while( ) { -- print; -- chomp; -- $taskname = $_ . $ext; -- $total++; -- $tasklist{$taskname} = 1; -- } -- if( $total == 1 ) { -- $word = "test"; -- } else { -- $word = "tests"; -- } -- print "-- Found $total $word in \"$dir\" for \"$classname\"\n\n"; -- return $total; --} -- --sub usage --{ --print < \@opt_testclasses, -- 'help' => \$opt_help, -- ); -- -- if( !$rc ) { -- usage(); -- } -- -- if (defined($opt_help)) { -- usage(); -- } -- -- # allow comma separated list in addition to multiple occurrances. -- @opt_testclasses = split(/,/, join(',', @opt_testclasses)); -- -- if (!defined(@opt_testclasses)) { -- die "Please supply a test class!\n"; -- } --} -- -- -- -- -diff --git a/nmi_tools/glue/test/remote_post b/nmi_tools/glue/test/remote_post -index 07a9979..9b1ca1a 100755 ---- a/nmi_tools/glue/test/remote_post -+++ b/nmi_tools/glue/test/remote_post -@@ -1,7 +1,7 @@ --#!/bin/sh -+#!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -@@ -19,19 +19,95 @@ - ##************************************************************** - - --# $Id: remote_post,v 1.3 2007-11-08 22:53:46 nleroy Exp $ -+###################################################################### -+# post script for Condor testsuite runs -+###################################################################### - --# Condor implementation of NMI test infrastructure interface --# Simple wrapper to source the environment file and spawn the --# corresponding perl script for a given stage of the test. -+use strict; -+use warnings; -+use File::Basename; - --ENV_FILE=setup_test_env -+my $dir = dirname($0); -+unshift @INC, $dir; -+require "TestGlue.pm"; -+TestGlue::setup_test_environment(); - --# include the environment info from the pre-script --if [ ! -f $ENV_FILE ]; then -- echo "$ENV_FILE does not exist!" -- exit 1 --fi --. $ENV_FILE -+my $BaseDir = $ENV{BASE_DIR} || die "BASE_DIR not in environment!\n"; -+my $exit_status = 0; - --exec remote_post.pl $* -+# This is debugging output for the sake of the NWO infrastructure. -+# However, it might be useful to us some day so we can see what's -+# going on in case of failures... -+if( defined $ENV{_NMI_STEP_FAILED} ) { -+ print "The value of _NMI_STEP_FAILED is: '$ENV{_NMI_STEP_FAILED}'\n"; -+} -+else { -+ print "The _NMI_STEP_FAILED variable is not set\n"; -+} -+ -+ -+###################################################################### -+# kill test suite personal condor daemons -+###################################################################### -+ -+ -+print "Seeing if personal condor needs killing\n"; -+ -+my $personal_condor_dir = File::Spec->catdir($BaseDir, "condor_tests", "TestingPersonalCondor"); -+my $sentinel = File::Spec->catfile($personal_condor_dir, "local", "log", ".scheduler_address"); -+if( -f $sentinel ) { -+ # Came up and had a scheduler running. good -+ $ENV{CONDOR_CONFIG} = File::Spec->catfile($personal_condor_dir, "condor_config"); -+ if( defined $ENV{_NMI_STEP_FAILED} ) { -+ print "Not calling condor_off for $ENV{CONDOR_CONFIG}\n"; -+ } -+ else { -+ print "Calling condor_off for $ENV{CONDOR_CONFIG}\n"; -+ my $condor_off = File::Spec->catfile($BaseDir, "condor", "sbin", "condor_off"); -+ system("$condor_off -master"); -+ -+ # give some time for condor to shutdown -+ sleep(30); -+ print "Done calling condor_off for $ENV{CONDOR_CONFIG}\n"; -+ } -+} -+else { -+ # if there's no pid_file, there must be no personal condor running -+ # which we'd have to kill. this would be caused by an empty -+ # tasklist. so, make sure the tasklist is empty. if so, we can -+ # move on with success. if there are tasks but no pid_file, -+ # that's a weird fatal error and we should propagate that. -+ if( ! -f "tasklist.nmi" || -z "tasklist.nmi" ) { -+ # our tasklist is empty, good. -+ print "tasklist.nmi is empty and there's no condor_master_pid file.\n"; -+ print "Nothing to cleanup, returning SUCCESS.\n"; -+ } -+ else { -+ print "ERROR: tasklist.nmi contains data but condor_master_pid does not exist!\n"; -+ $exit_status = 1; -+ } -+} -+ -+ -+###################################################################### -+# save and tar up test results -+###################################################################### -+ -+if( ! -f "tasklist.nmi" || -z "tasklist.nmi" ) { -+ # our tasklist is empty, so don't do any real work -+ print "No tasks in tasklist.nmi, nothing to do\n"; -+ exit $exit_status; -+} -+ -+print "cding to $BaseDir \n"; -+chdir("$BaseDir") || die "Can't chdir($BaseDir): $!\n"; -+ -+#---------------------------------------- -+# final tar and exit -+#---------------------------------------- -+print "Tarring up all results\n"; -+chdir("$BaseDir") || die "Can't chdir($BaseDir): $!\n"; -+my $test_dir = File::Spec->catdir($BaseDir, "condor_tests"); -+system("tar zcf results.tar.gz --exclude *.exe $test_dir local"); -+ -+exit $exit_status; -diff --git a/nmi_tools/glue/test/remote_post.pl b/nmi_tools/glue/test/remote_post.pl -deleted file mode 100755 -index 6a91b05..0000000 ---- a/nmi_tools/glue/test/remote_post.pl -+++ /dev/null -@@ -1,131 +0,0 @@ --#!/usr/bin/env perl --##************************************************************** --## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, --## University of Wisconsin-Madison, WI. --## --## Licensed under the Apache License, Version 2.0 (the "License"); you --## may not use this file except in compliance with the License. You may --## obtain a copy of the License at --## --## http://www.apache.org/licenses/LICENSE-2.0 --## --## Unless required by applicable law or agreed to in writing, software --## distributed under the License is distributed on an "AS IS" BASIS, --## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --## See the License for the specific language governing permissions and --## limitations under the License. --## --##************************************************************** -- -- --###################################################################### --# post script for Condor testsuite runs --###################################################################### -- --use File::Copy; -- --my $BaseDir = $ENV{BASE_DIR} || die "BASE_DIR not in environment!\n"; --my $testdir = "condor_tests"; --my $exit_status = 0; -- --# This is debugging output for the sake of the NWO infrastructure. --# However, it might be useful to us some day so we can see what's --# going on in case of failures... --if( defined $ENV{_NMI_STEP_FAILED} ) { -- my $nmi_task_failure = "$ENV{_NMI_STEP_FAILED}"; -- print "The value of _NMI_STEP_FAILED is: '$nmi_task_failure'\n"; --} else { -- print "The _NMI_STEP_FAILED variable is not set\n"; --} -- -- --###################################################################### --# kill test suite personal condor daemons --###################################################################### -- -- --print "Seeing if personal condor needs killing\n"; -- --if( -f "$BaseDir/condor_tests/TestingPersonalCondor/local/log/.scheduler_address" ) { -- # Came up and had a scheduler running. good -- $ENV{"CONDOR_CONFIG"} = "$BaseDir/condor_tests/TestingPersonalCondor/condor_config"; -- if( defined $ENV{_NMI_STEP_FAILED} ) { -- print "not calling condor_off for $BaseDir/condor_tests/TestingPersonalCondor/condor_config\n"; -- } else { -- print "calling condor_off for $BaseDir/condor_tests/TestingPersonalCondor/condor_config\n"; -- system("$BaseDir/userdir/condor/sbin/condor_off -master"); -- # give some time for condor to shutdown -- sleep(30); -- print "done calling condor_off for $BaseDir/condor_tests/TestingPersonalCondor/condor_config\n"; -- } --} else { -- # if there's no pid_file, there must be no personal condor running -- # which we'd have to kill. this would be caused by an empty -- # tasklist. so, make sure the tasklist is empty. if so, we can -- # move on with success. if there are tasks but no pid_file, -- # that's a weird fatal error and we should propagate that. -- if( ! -f "tasklist.nmi" || -z "tasklist.nmi" ) { -- # our tasklist is empty, good. -- print "tasklist.nmi is empty and there's no condor_master_pid " . -- "file.\nNothing to cleanup, returning SUCCESS.\n"; -- } else { -- print "ERROR: tasklist.nmi contains data but " . -- "condor_master_pid does not exist!\n"; -- $exit_status = 1; -- } --} -- -- --###################################################################### --# save and tar up test results --###################################################################### -- --if( ! -f "tasklist.nmi" || -z "tasklist.nmi" ) { -- # our tasklist is empty, so don't do any real work -- print "No tasks in tasklist.nmi, nothing to do\n"; -- exit $exit_status; --} -- --print "cding to $BaseDir \n"; --chdir("$BaseDir") || die "Can't chdir($BaseDir): $!\n"; -- --#---------------------------------------- --# final tar and exit --#---------------------------------------- -- --$results = "results.tar.gz"; --print "Tarring up all results\n"; --chdir("$BaseDir") || die "Can't chdir($BaseDir): $!\n"; --system( "tar zcf $results --exclude *.exe $BaseDir/condor_tests local" ); --# don't care if condor is still running or sockets --# are being skipped. Save what we can and don't bitch --#if( $? >> 8 ) { -- #print "Can't tar zcf src/condor_tests local\n"; -- #$exit_status = 1; --#} -- --exit $exit_status; -- -- --###################################################################### --# helper methods --###################################################################### -- --sub copy_file { -- my( $src, $dest, $required ) = @_; -- my $had_error = false; -- copy($src, $dest); -- if( $? >> 8 ) { -- if( $required ) { -- print "ERROR: Can't copy $src to $dest: $!\n"; -- } else { -- print "Optional file $src not copied into $dest: $!\n"; -- } -- $had_error = true; -- } else { -- print "Copied $src to $dest\n"; -- } -- return $had_error; --} -- -diff --git a/nmi_tools/glue/test/remote_pre b/nmi_tools/glue/test/remote_pre -index 0f58519..71076a5 100755 ---- a/nmi_tools/glue/test/remote_pre -+++ b/nmi_tools/glue/test/remote_pre -@@ -1,7 +1,7 @@ --#!/bin/sh -+#!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -@@ -19,19 +19,151 @@ - ##************************************************************** - - --# $Id: remote_pre,v 1.3 2007-11-08 22:53:46 nleroy Exp $ -+###################################################################### -+# script to set up for Condor testsuite run -+###################################################################### - --# Condor implementation of NMI test infrastructure interface --# Simple wrapper to source the environment file and spawn the --# corresponding perl script for a given stage of the test. -+use strict; -+use warnings; -+use Cwd; -+use Env; -+use File::Copy; -+use File::Basename; - --ENV_FILE=setup_test_env -+my $dir = dirname($0); -+unshift @INC, $dir; -+require "TestGlue.pm"; -+TestGlue::setup_test_environment(); - --# include the environment info from the pre-script --if [ ! -f $ENV_FILE ]; then -- echo "$ENV_FILE does not exist!" -- exit 1 --fi --. $ENV_FILE -+# Don't buffer output. -+$|=1; - --exec remote_pre.pl $* -+my $BaseDir = $ENV{BASE_DIR} || die "BASE_DIR not in environment!\n"; -+my $logsize = "50000000"; # size for logs of personal Condor -+ -+# Hard-coded filename, defined in test_platform_pre -+my $tarball_file = "CONDOR-TARBALL-NAME"; -+ -+if( -z "tasklist.nmi" ) { -+ # our tasklist is empty, so don't do any real work -+ print "No tasks in tasklist.nmi, nothing to do\n"; -+ exit 0; -+} -+ -+ -+###################################################################### -+# untar pre-built tarball -+###################################################################### -+ -+my $release_tarball; -+my $version; -+if( TestGlue::is_windows() ) { -+ # on Windows, condor is in a zip file, not a tarball -+ print "Finding release zip file\n"; -+ my ($release_zipfile) = glob("condor-*.zip"); -+ -+ print "Release zip file is '$release_zipfile'\n"; -+ -+ if( ! $release_zipfile ) { -+ die "Could not find a condor release zip file!\n"; -+ } -+ -+ if ( ! mkdir("condor") ) { -+ die "Could not make the condor folder\n"; -+ } -+ -+ # We are explicitly calling unzip from C:\tools so that we do not use Cygwin's -+ # version of unzip. When Cygwin unzips a tarball it removes the execute bits -+ # and we have to restore them. We want to avoid this so use non-Cygwin unzip -+ print "Unzipping $release_zipfile ...\n"; -+ system("C:\\tools\\unzip $release_zipfile -d condor") && die "Can't unzip $release_zipfile: $!\n"; -+ print "Unzipped $release_zipfile.\n"; -+ -+ (my $tmp_dir = basename($release_zipfile)) =~ s/\.zip$//; -+ print "\$tmp_dir = '$tmp_dir'\n"; -+ TestGlue::dir_listing("condor"); -+ my $tmp_dir_path = File::Spec->catdir("condor", $tmp_dir); -+ if( -d $tmp_dir_path ) { -+ print "$tmp_dir_path exists. Trying to move...\n"; -+ system("move $tmp_dir_path\\* condor\\"); -+ } -+ TestGlue::dir_listing("condor"); -+ -+ $version = substr($release_zipfile, 0, -4); -+ print "VERSION string is $version from $release_zipfile\n"; -+} -+else { -+ print "Finding release tarball\n"; -+ open(TARBALL_FILE, '<', $tarball_file ) || die "Can't open $tarball_file: $!\n"; -+ while() { -+ chomp; -+ $release_tarball = $_; -+ } -+ -+ print "Release tarball is '$release_tarball'\n"; -+ -+ if( ! $release_tarball ) { -+ die "$tarball_file does not contain a filename!\n"; -+ } -+ if( ! -f $release_tarball ) { -+ die "$release_tarball (from $tarball_file) does not exist!\n"; -+ } -+ -+ print "Release tarball file exists:\n"; -+ TestGlue::dir_listing($release_tarball); -+ -+ print "Untarring $release_tarball ...\n"; -+ system("tar -xzvf $release_tarball" ) && die "Can't untar $release_tarball: $!\n"; -+ print "Untarred $release_tarball.\n"; -+ -+ ($version) = $release_tarball =~ /^(.*)\.[^.]+\.[^.]+$/; -+ print "VERSION string is $version from $release_tarball\n"; -+} -+ -+###################################################################### -+# setup the personal condor -+###################################################################### -+ -+print "Condor version: $version\n"; -+ -+print "SETTING UP PERSONAL CONDOR\n"; -+ -+# I'm not 100% certain wtf this actually does. -+if( not TestGlue::is_windows() ) { -+ mkdir( "$BaseDir/local", 0777 ) || die "Can't mkdir $BaseDir/local: $!\n"; -+ system("mv $BaseDir/$version $BaseDir/condor" ); -+ -+ # Remove leftovers from extracting built binaries. -+ print "Removing $version tar file and extraction\n"; -+ unlink(<$version*>); -+} -+else { -+ # windows personal condor setup -+ mkdir( "local", 0777 ) || die "Can't mkdir $BaseDir/local: $!\n"; -+ mkdir( "local/spool", 0777 ) || die "Can't mkdir $BaseDir/local/spool: $!\n"; -+ mkdir( "local/execute", 0777 ) || die "Can't mkdir $BaseDir/local/execute: $!\n"; -+ mkdir( "local/log", 0777 ) || die "Can't mkdir $BaseDir/local/log: $!\n"; -+ -+ # Remove leftovers from extracting built binaries. -+ print "Removing $version.zip file\n"; -+ unlink("$version.zip"); -+ -+ my $Win32BaseDir = $ENV{WIN32_BASE_DIR} || die "WIN32_BASE_DIR not in environment!\n"; -+ -+ TestGlue::which("condor_master.exe"); -+} -+ -+ -+# move into the condor_tests directory first -+my $test_dir = File::Spec->catdir($BaseDir, "condor_tests"); -+chdir($test_dir) || die "Can't chdir($test_dir for personal condor setup): $!\n"; -+ -+# -p means just set up the personal condor for the test run -+my $batch_test = File::Spec->catfile($test_dir, "batch_test.pl"); -+my $command_line = "$batch_test --debug -p"; -+print "About to run '$command_line'\n"; -+system("perl $command_line"); -+ -+if( $? != 0 ) { -+ exit 2; -+} -diff --git a/nmi_tools/glue/test/remote_pre.pl b/nmi_tools/glue/test/remote_pre.pl -deleted file mode 100755 -index 58602ed..0000000 ---- a/nmi_tools/glue/test/remote_pre.pl -+++ /dev/null -@@ -1,217 +0,0 @@ --#!/usr/bin/env perl --##************************************************************** --## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, --## University of Wisconsin-Madison, WI. --## --## Licensed under the Apache License, Version 2.0 (the "License"); you --## may not use this file except in compliance with the License. You may --## obtain a copy of the License at --## --## http://www.apache.org/licenses/LICENSE-2.0 --## --## Unless required by applicable law or agreed to in writing, software --## distributed under the License is distributed on an "AS IS" BASIS, --## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --## See the License for the specific language governing permissions and --## limitations under the License. --## --##************************************************************** -- -- --###################################################################### --# script to set up for Condor testsuite run --###################################################################### -- --use Cwd; --use Env; --use File::Copy; --use File::Basename; -- --# Don't buffer output. --$|=1; -- --my $BaseDir = $ENV{BASE_DIR} || die "BASE_DIR not in environment!\n"; --my $logsize = "50000000"; # size for logs of personal Condor -- --# Hard-coded filename, defined in test_platform_pre --my $tarball_file = "CONDOR-TARBALL-NAME"; -- --if( -z "tasklist.nmi" ) { -- # our tasklist is empty, so don't do any real work -- print "No tasks in tasklist.nmi, nothing to do\n"; -- exit 0; --} -- -- --###################################################################### --# untar pre-built tarball --###################################################################### -- --my $release_tarball; --my $version; --if( $ENV{NMI_PLATFORM} =~ /winnt/) { -- -- # on Windows, condor is in a zip file, not a tarball -- print "Finding release zip file\n"; -- my ($release_zipfile) = glob("condor-*.zip"); -- -- print "Release zip file is $release_zipfile\n"; -- -- if( ! $release_zipfile ) { -- die "Could not find a condor release zip file!\n"; -- } -- -- if ( ! mkdir("condor") ) { -- die "Could not make the condor folder\n"; -- } -- -- print "Unzipping $release_zipfile ...\n"; -- system("unzip $release_zipfile -d condor") && die "Can't unzip $release_zipfile !\n"; -- print "Unzipped $release_zipfile ...\n"; -- -- (my $tmp_dir = basename($release_zipfile)) =~ s/\.zip$//; -- print "\$tmp_dir = '$tmp_dir'\n"; -- print "Directory listing of 'condor':\n"; -- print `dir condor`; -- if(-d "condor/$tmp_dir") { -- print "condor/$tmp_dir exists. Trying to move...\n"; -- system("mv condor/$tmp_dir/* condor/"); -- } -- print "Second directory listing of 'condor':\n"; -- print `dir condor`; -- -- print "fixing execute bits ...\n"; -- system("chmod a+x condor/bin/*"); -- -- #debug code... -- #system("ls"); -- #system("ls -l condor"); -- -- $version = substr($release_zipfile, 0, -4); -- print "VERSION string is $version from $release_zipfile\n"; -- --} else { -- print "Finding release tarball\n"; -- open( TARBALL_FILE, "$tarball_file" ) || -- die "Can't open $tarball_file: $!\n"; -- while( ) { -- chomp; -- $release_tarball = $_; -- } -- -- print "Release tarball is $release_tarball\n"; -- -- if( ! $release_tarball ) { -- die "$tarball_file does not contain a filename!\n"; -- } -- if( ! -f $release_tarball ) { -- die "$release_tarball (from $tarball_file) does not exist!\n"; -- } -- -- print "Release tarball file exists\n"; -- -- print "Untarring $release_tarball ...\n"; -- system("tar -xzvf $release_tarball" ) && die "Can't untar $release_tarball: $!\n"; -- print "Untarred $release_tarball ...\n"; -- -- ($basename,$ext_gz) = $release_tarball =~ /^(.*)(\.[^.]*)$/; -- ($version,$ext_tar) = $basename =~ /^(.*)(\.[^.]*)$/; -- print "VERSION string is $version from $release_tarball and $basename\n"; --} -- --###################################################################### --# setup the personal condor --###################################################################### -- --print "Condor version: $version\n"; -- --print "SETTING UP PERSONAL CONDOR\n"; -- --# I'm not 100% certain wtf this actually does. --if( !($ENV{NMI_PLATFORM} =~ /winnt/) ) { -- -- mkdir( "$BaseDir/local", 0777 ) || die "Can't mkdir $BaseDir/local: $!\n"; -- system("mv $BaseDir/$version $BaseDir/condor" ); -- -- # Remove leftovers from extracting built binaries. -- print "Removing $version tar file and extraction\n"; -- system("rm -rf $version*"); -- -- # Add condor to the path and set a condor_config variable -- my $OldPath = $ENV{PATH} || die "PATH not in environment!\n"; -- my $NewPath = "$BaseDir/condor/sbin:" . "$BaseDir/condor/bin:" . $OldPath; -- $ENV{PATH} = $NewPath; -- $ENV{CONDOR_CONFIG} = "$BaseDir/condor/condor_config"; -- --} else { -- # windows personal condor setup -- -- mkdir( "local", 0777 ) || die "Can't mkdir $BaseDir/local: $!\n"; -- mkdir( "local/spool", 0777 ) || die "Can't mkdir $BaseDir/local/spool: $!\n"; -- mkdir( "local/execute", 0777 ) || die "Can't mkdir $BaseDir/local/execute: $!\n"; -- mkdir( "local/log", 0777 ) || die "Can't mkdir $BaseDir/local/log: $!\n"; -- -- # Remove leftovers from extracting built binaries. -- print "Removing $version.zip file\n"; -- system("rm -rf $version.zip"); -- -- $Win32BaseDir = $ENV{WIN32_BASE_DIR} || die "WIN32_BASE_DIR not in environment!\n"; -- -- #print "current dir\n"; -- #system("ls -l"); -- #print "$BaseDir/condor_tests\n"; -- #system("ls -l $BaseDir/condor_tests"); -- #print "$BaseDir/condor/bin\n"; -- #system("ls -l $BaseDir/condor/bin"); -- -- # Add condor to the path -- my $OldPath = $ENV{PATH} || die "PATH not in environment!\n"; -- print "PATH=$OldPath\n"; -- system ("which condor_master.exe"); -- print "adding condor to the path\n"; -- my $NewPath = "$BaseDir/condor/bin:" . $OldPath; -- $ENV{PATH} = $NewPath; -- print "PATH=$ENV{PATH}\n"; --} -- -- --# -p means just set up the personal condor for the test run --# move into the condor_tests directory first -- --chdir( "$BaseDir/condor_tests" ) || -- die "Can't chdir($BaseDir/condor_tests for personal condor setup): $!\n"; -- --print "About to run batch_test.pl --debug -p\n"; --#system("env"); -- --system("perl $BaseDir/condor_tests/batch_test.pl --debug -p"); --$batchteststatus = $?; -- --# figure out here if the setup passed or failed. --if( $batchteststatus != 0 ) { -- exit 2; --} -- --# sub copy_file { --# my( $src, $dest ) = @_; --# copy($src, $dest); --# if( $? >> 8 ) { --# print "Can't copy $src to $dest: $!\n"; --# } else { --# print "Copied $src to $dest\n"; --# } --# } --# --# sub safe_copy { --# my( $src, $dest ) = @_; --# copy($src, $dest); --# if( $? >> 8 ) { --# print "Can't copy $src to $dest: $!\n"; --# return 0; --# } else { --# print "Copied $src to $dest\n"; --# return 1; --# } --# } --# -diff --git a/nmi_tools/glue/test/remote_pre_declare b/nmi_tools/glue/test/remote_pre_declare -index 8629fc9..342b6b9 100755 ---- a/nmi_tools/glue/test/remote_pre_declare -+++ b/nmi_tools/glue/test/remote_pre_declare -@@ -1,7 +1,7 @@ - #!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -@@ -18,68 +18,5 @@ - ## - ##************************************************************** - --###################################################################### --# script to set up for Condor testsuite run --###################################################################### -- --use Cwd; -- --my $BaseDir = getcwd(); -- --if( ($ENV{NMI_PLATFORM} =~ /winnt/) ){ -- my $newbase = `cygpath -u $BaseDir`; -- chomp($newbase); -- $BaseDir = $newbase; --} -- --# autoflush our STDOUT --$| = 1; -- --###################################################################### --# set up environment and create env file for the rest of the scripts --###################################################################### -- --print "Setting up environtment file 'setup_test_env' for other scripts\n"; --open( ENVSETUP, ">setup_test_env" ) || -- die "cannot open setup_test_env for writing\n"; -- --print ENVSETUP "BASE_DIR=$BaseDir\n"; --print ENVSETUP "export BASE_DIR\n"; -- --if( !($ENV{NMI_PLATFORM} =~ /winnt/) ) { -- print ENVSETUP "PATH=$BaseDir/nmi_tools/glue/test:$BaseDir/condor/bin:$BaseDir/condor/sbin:\$PATH\n"; -- print ENVSETUP "CONDOR_CONFIG=$BaseDir/condor_tests/TestingPersonalCondor/condor_config\n"; --} else { -- # we want UNIX-style paths for PATH (since we're using cygwin) -- print ENVSETUP "PATH=$BaseDir/nmi_tools/glue/test:$BaseDir/condor/bin:/bin:/usr/bin\n"; -- -- # Condor will want Win32-style paths for CONDOR_CONFIG -- my $Win32BaseDir = getcwd(); -- print ENVSETUP "CONDOR_CONFIG=$Win32BaseDir\\condor_tests\\TestingPersonalCondor\\condor_config\n"; -- -- # also, throw in the WIN32 version of the base directory path for later use -- print ENVSETUP "WIN32_BASE_DIR=$Win32BaseDir\n"; -- print ENVSETUP "export WIN32_BASE_DIR\n"; --} -- --print ENVSETUP "export PATH\n"; --print ENVSETUP "export CONDOR_CONFIG\n"; --close(ENVSETUP); -- --if( ($ENV{NMI_PLATFORM} =~ /winnt/) ){ -- $res = system("d2u setup_test_env"); -- if($res != 0) { -- die "Failed to convert environment variable file\n"; -- } --} -- --close(ENVSETUP); -- --if( ($ENV{NMI_PLATFORM} =~ /winnt/) ){ -- $res = system("d2u setup_test_env"); -- if($res != 0) { -- die "Failed to convert environment variable file\n"; -- } --} -- --print "All steps completed successfully\n"; -+print "Nothing to do for remote_pre_declare currently.\n"; -+exit(0); -diff --git a/nmi_tools/glue/test/remote_task b/nmi_tools/glue/test/remote_task -index 1877c26..9599f0d 100755 ---- a/nmi_tools/glue/test/remote_task -+++ b/nmi_tools/glue/test/remote_task -@@ -1,7 +1,7 @@ --#!/bin/sh -+#!/usr/bin/env perl - ##************************************************************** - ## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+## Copyright (C) 1990-2011, Condor Team, Computer Sciences Department, - ## University of Wisconsin-Madison, WI. - ## - ## Licensed under the Apache License, Version 2.0 (the "License"); you -@@ -19,28 +19,196 @@ - ##************************************************************** - - --# $Id: remote_task,v 1.3 2007-11-08 22:53:46 nleroy Exp $ -+###################################################################### -+# run a test in the Condor testsuite -+# return val is the status of the test -+# 0 = built and passed -+# 1 = build failed -+# 2 = run failed -+# 3 = internal fatal error (a.k.a. die) -+###################################################################### - --# Condor implementation of NMI test infrastructure interface --# Simple wrapper to source the environment file and spawn the --# corresponding perl script for a given stage of the test. -+###################################################################### -+###### WARNING!!! The return value of this script has special ###### -+###### meaning, so you can NOT just call die(). you MUST ###### -+###### use the special c_die() method so we return 3!!!! ###### -+###################################################################### - --ENV_FILE=setup_test_env --TEST_FILE=test_task_env -+use strict; -+use warnings; -+use File::Copy; -+use File::Basename; - --# include the environment info from the pre-script --if [ ! -f $ENV_FILE ]; then -- echo "$ENV_FILE does not exist!" -- exit 1 --fi --. $ENV_FILE -+my $dir = dirname($0); -+unshift @INC, $dir; -+require "TestGlue.pm"; -+TestGlue::setup_test_environment(); -+TestGlue::setup_task_environment(); - --# look for passed in test environment file --if [ ! -f $TEST_FILE ]; then -- echo "No task environment file found!" --else -- echo "Found environment file for tests!" -- . $TEST_FILE --fi -+if( ! defined $ENV{_NMI_TASKNAME} ) { -+ die "_NMI_TASKNAME not in environment, can't test anything!\n"; -+} -+my $fulltestname = $ENV{_NMI_TASKNAME}; - --exec remote_task.pl $* -+print "Test environment variable GCBTARGET = '$ENV{GCBTARGET}'\n"; -+ -+if( $fulltestname =~ /remote_task/) { -+ die "_NMI_TASKNAME set to remote_task meaning 0 tests seen!\n"; -+} -+ -+if( ! $fulltestname ) { -+ # if we have no task, just return success immediately -+ print "No tasks specified, returning SUCCESS\n"; -+ exit 0; -+} -+ -+my $BaseDir = $ENV{BASE_DIR} || c_die("BASE_DIR is not in environment!\n"); -+my $test_dir = File::Spec->catdir($BaseDir, "condor_tests"); -+ -+# iterations have numbers placed at the end of the name -+# for unique db tracking in nmi for now. -+if($fulltestname =~ /([\w\-\.\+]+)-\d+/) { -+ my $matchingtest = $fulltestname . ".run"; -+ if(!(-f $matchingtest)) { -+ # if we don't have a test called this, strip iterator off -+ $fulltestname = $1; -+ } -+} -+ -+ -+###################################################################### -+# get the testname and group -+###################################################################### -+ -+my @testinfo = split(/\./, $fulltestname); -+my $testname = $testinfo[0]; -+my $compiler = $testinfo[1]; -+ -+if( ! $testname ) { -+ c_die("Invalid input for testname\n"); -+} -+ -+#track time..... -+print scalar(localtime); -+ -+print "Testname: '$testname'\n"; -+if( not TestGlue::is_windows() ) { -+ if( $compiler ) { -+ print "compiler is $compiler\n"; -+ } -+ else { -+ $compiler = "."; -+ } -+} -+else { -+ $compiler = "."; -+} -+ -+###################################################################### -+# run the test using batch_test.pl -+###################################################################### -+ -+# Some of the tests fail because the schedd fsync can take 30 seconds -+# or more on busy nmi filesystems, which causes the tools to timeout. -+# Up the tool timeout multipler to try to deal with this. -+$ENV{_condor_TOOL_TIMEOUT_MULTIPLIER}="4"; -+ -+print "RUNNING $testname\n"; -+chdir($test_dir) || c_die("Can't chdir($test_dir): $!\n"); -+ -+# -b means build & test and ensures the first time that we have our testing -+# personal condor configured from release generic config files. -+print "About to run batch_test.pl\n"; -+ -+system("perl batch_test.pl --no-error -d $compiler -t $testname -b"); -+my $batchteststatus = $?; -+ -+# figure out here if the test passed or failed. -+my $teststatus; -+if( $batchteststatus != 0 ) { -+ $teststatus = 2; -+} -+else { -+ $teststatus = 0; -+} -+ -+###################################################################### -+# print output from .run script to stdout of this task, and final exit -+###################################################################### -+ -+my $compiler_path = File::Spec->catpath($test_dir, $compiler); -+chdir($compiler_path) || c_die("Can't chdir($compiler_path): $!\n"); -+my $run_out = "$testname.run.out"; -+my $run_out_path = File::Spec->catfile($compiler_path, $run_out); -+my $test_out = "$testname.out"; -+my $test_out_path = File::Spec->catfile($compiler_path, $test_out); -+my $test_err = "$testname.err"; -+my $test_err_path = File::Spec->catfile($compiler_path, $test_err); -+ -+if( ! -f $run_out_path ) { -+ if( $teststatus == 0 ) { -+ # if the test passed but we don't have a run.out file, we -+ # should consider that some kind of weird error -+ c_die("ERROR: test passed but $run_out does not exist!"); -+ } -+ else { -+ # if the test failed, this isn't suprising. we can print it, -+ # but we should just treat it as if the test failed, not an -+ # internal error. -+ print "\n\nTest failed and $run_out does not exist\n"; -+ } -+} -+else { -+ # spit out the contents of the run.out file to the stdout of the task -+ if( open(RES, '<', $run_out_path) ) { -+ print "\n\n----- Start of $run_out -----\n"; -+ while() { -+ print "$_"; -+ } -+ close RES; -+ print "\n----- End of $run_out -----\n"; -+ } -+ else { -+ print "\n\nERROR: failed to open $run_out_path: $!\n"; -+ } -+} -+ -+# add test.out and test.err to run output if they exist -+ -+# spit out the contents of the test.out file to the stdout of the task -+if( open(RES, '<', $test_out_path) ) { -+ print "\n\n----- Start of $test_out -----\n"; -+ while() { -+ print "$_"; -+ } -+ close RES; -+ print "\n----- End of $test_out -----\n"; -+} -+else { -+ print "\n\nERROR: failed to open $test_out_path: $!\n"; -+} -+ -+# spit err the contents of the test.err file to the stdout of the task -+if( open(RES, '<', $test_err_path) ) { -+ print "\n\n----- Start of $test_err -----\n"; -+ while() { -+ print "$_"; -+ } -+ close RES; -+ print "\n----- End of $test_err -----\n"; -+} -+else { -+ print "\n\nERROR: failed to open $test_err_path: $!\n"; -+} -+ -+exit $teststatus; -+ -+###################################################################### -+# helper methods -+###################################################################### -+ -+sub c_die { -+ my( $msg ) = @_; -+ print $msg; -+ exit 3; -+} -diff --git a/nmi_tools/glue/test/remote_task.pl b/nmi_tools/glue/test/remote_task.pl -deleted file mode 100755 -index b73e1e7..0000000 ---- a/nmi_tools/glue/test/remote_task.pl -+++ /dev/null -@@ -1,209 +0,0 @@ --#!/usr/bin/env perl --##************************************************************** --## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, --## University of Wisconsin-Madison, WI. --## --## Licensed under the Apache License, Version 2.0 (the "License"); you --## may not use this file except in compliance with the License. You may --## obtain a copy of the License at --## --## http://www.apache.org/licenses/LICENSE-2.0 --## --## Unless required by applicable law or agreed to in writing, software --## distributed under the License is distributed on an "AS IS" BASIS, --## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --## See the License for the specific language governing permissions and --## limitations under the License. --## --##************************************************************** -- -- --###################################################################### --# run a test in the Condor testsuite --# return val is the status of the test --# 0 = built and passed --# 1 = build failed --# 2 = run failed --# 3 = internal fatal error (a.k.a. die) --###################################################################### -- --###################################################################### --###### WARNING!!! The return value of this script has special ###### --###### meaning, so you can NOT just call die(). you MUST ###### --###### use the special c_die() method so we return 3!!!! ###### --###################################################################### -- --use File::Copy; -- --if( ! defined $ENV{_NMI_TASKNAME} ) { -- die "_NMI_TASKNAME not in environment, can't test anything!\n"; --} --my $fulltestname = $ENV{_NMI_TASKNAME}; -- --my $testenvtst = $ENV{GCBTARGET}; --print "Test for test environment variable GCBTARGET yields <$testenvtst>\n"; -- --if( $fulltestname =~ /remote_task/) { -- die "_NMI_TASKNAME set to remote_task meaning 0 tests seen!\n"; --} -- --if( ! $fulltestname ) { -- # if we have no task, just return success immediately -- print "No tasks specified, returning SUCCESS\n"; -- exit 0; --} -- --my $BaseDir = $ENV{BASE_DIR} || c_die("BASE_DIR is not in environment!\n"); --my $testdir = "condor_tests"; -- --# iterations have numbers placed at the end of the name --# for unique db tracking in nmi for now. --if($fulltestname =~ /([\w\-\.\+]+)-\d+/) { -- my $matchingtest = $fulltestname . ".run"; -- if(!(-f $matchingtest)) { -- # if we don't have a test called this, strip iterator off -- $fulltestname = $1; -- } --} -- -- --###################################################################### --# get the testname and group --###################################################################### -- --@testinfo = split(/\./, $fulltestname); --my $testname = $testinfo[0]; --my $compiler = $testinfo[1]; -- --if( ! $testname ) { -- c_die("Invalid input for testname\n"); --} -- --#track time..... -- --system("date"); -- --print "testname is $testname\n"; --if( !($ENV{NMI_PLATFORM} =~ /winnt/) ) { -- if( $compiler ) { -- print "compiler is $compiler\n"; -- $targetdir = "$BaseDir/$testdir/$compiler"; -- } else { -- $compiler = "."; -- $targetdir = "$BaseDir/$testdir"; -- } --} else { -- $compiler = "."; -- $targetdir = "$BaseDir/$testdir"; --} -- --###################################################################### --# run the test using batch_test.pl --###################################################################### -- --print "RUNNING $testinfo\n"; --chdir("$BaseDir/$testdir") || c_die("Can't chdir($BaseDir/$testdir): $!\n"); -- --print "About to run batch_test.pl\n"; -- --# -b means build & test and ensures the first time that --# we have our testing personal condor configered from --# release generic config files. -- --system("perl ./batch_test.pl --no-error -d $compiler -t $testname -b"); --$batchteststatus = $?; -- --# figure out here if the test passed or failed. --if( $batchteststatus != 0 ) { -- $teststatus = 2; --} else { -- $teststatus = 0; --} -- --###################################################################### --# print output from .run script to stdout of this task, and final exit --###################################################################### -- --chdir( "$BaseDir/$testdir/$compiler" ) || -- c_die("Can't chdir($BaseDir/$testdir/$compiler): $!\n"); --$local_out = "$BaseDir/$testdir/TestingPersonalCondor/condor_config.local"; --$run_out = "$testname.run.out"; --$run_out_full = "$BaseDir/$testdir/$compiler/$run_out"; --$test_out = "$testname.out"; --$test_out_full = "$BaseDir/$testdir/$compiler/$test_out"; --$test_err = "$testname.err"; --$test_err_full = "$BaseDir/$testdir/$compiler/$test_err"; -- --if( ! -f $run_out_full ) { -- if( $teststatus == 0 ) { -- # if the test passed but we don't have a run.out file, we -- # should consider that some kind of weird error -- c_die("ERROR: test passed but $run_out does not exist!"); -- } else { -- # if the test failed, this isn't suprising. we can print it, -- # but we should just treat it as if the test failed, not an -- # internal error. -- print "\n\nTest failed and $run_out does not exist\n"; -- } --} else { -- # spit out the contents of the run.out file to the stdout of the task -- if( open(RES, "<$run_out_full") ) { -- print "\n\n----- Start of $run_out -----\n"; -- while() { -- print "$_"; -- } -- close RES; -- print "\n----- End of $run_out -----\n"; -- } else { -- print "\n\nERROR: failed to open $run_out_full: $!\n"; -- } --} --# add test.out and test.err to run output if they exist -- --# spit out the contents of the test.out file to the stdout of the task --if( open(RES, "<$test_out_full") ) { -- print "\n\n----- Start of $test_out -----\n"; -- while() { -- print "$_"; -- } -- close RES; -- print "\n----- End of $test_out -----\n"; --} else { -- print "\n\nERROR: failed to open $test_out_full: $!\n"; --} -- --# spit err the contents of the test.err file to the stdout of the task --if( open(RES, "<$test_err_full") ) { -- print "\n\n----- Start of $test_err -----\n"; -- while() { -- print "$_"; -- } -- close RES; -- print "\n----- End of $test_err -----\n"; --} else { -- print "\n\nERROR: failed to open $test_err_full: $!\n"; --} --# add local config file --if( open(RES, "<$local_out") ) { -- print "\n\n----- Start of TestingPersonalCondor/condor_config.local -----\n"; -- while() { -- print "$_"; -- } -- close RES; -- print "\n----- End of TestingPersonalCondor/condor_config.local -----\n"; --} else { -- print "\n\nERROR: failed to open $test_err_full: $!\n"; --} -- --exit $teststatus; -- --###################################################################### --# helper methods --###################################################################### -- --sub c_die { -- my( $msg ) = @_; -- print $msg; -- exit 3; --} -diff --git a/nmi_tools/www/results/Condor-testsuite-home.php b/nmi_tools/www/results/Condor-testsuite-home.php -deleted file mode 100644 -index 91e69f2..0000000 ---- a/nmi_tools/www/results/Condor-testsuite-home.php -+++ /dev/null -@@ -1,106 +0,0 @@ -- -- -- --Condor testsuite results --

Condor testsuite results

-- --
", ""); -- -- $query1 = "SELECT * FROM Run where description='$description' and run_type='test' ORDER BY runid"; -- $platforms = array(); -- $runids = array("0" => ""); -- $basedir = "rundir"; -- -- $db = mysql_connect("mysql.batlab.org", "$dbUsername", "$dbPassword") or die ("Could not connect : " . mysql_error()); -- mysql_select_db("$dbName") or die("Could not select database"); -- $result1 = mysql_query($query1) or die ("Query failed : " . mysql_error()); -- -- while( $myrow = mysql_fetch_array($result1) ) { -- $gid = $myrow["gid"]; -- $runid = $myrow["runid"]; -- $run_type = $myrow["run_type"]; -- $description = $myrow["description"]; -- $result = $myrow["result"]; -- $base = "$basedir/$gid"; -- $temprunid = $myrow["runid"]; -- $runids["$temprunid"] = "$base"; -- } -- echo "
"; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- -- foreach ($runids as $key => $val) { -- if ($key != "0" ) { -- echo ""; -- $total = 0; -- $found = 0; -- $running = 0; -- $query2 = "SELECT * FROM Task where runid=$key"; -- $result2 = mysql_query($query2) or die ("Query failed : " . mysql_error()); -- while( $myrow = mysql_fetch_array($result2) ) { -- $platform = $myrow["platform"]; -- array_push( $platforms, "$platform" ); -- $result = $myrow["result"]; -- -- $taskname = $myrow["name"]; -- if ( $taskname == "remote_task") { -- $total = $result; -- $found = 1; -- } -- # find if the run is complete -- if ( is_null($result) ) { -- $running = 1; -- } -- } -- $platforms = array_unique( $platforms ); -- unset($platforms['local']); -- -- foreach ($platforms as $key1 ) { -- $currPlat = $key1; -- unset($platforms['$currPlat']); -- } -- echo ""; -- printf("", $currPlat); -- -- if ($found == 0) { # no remote task result, the test run failed miserably -- printf("", "testsuite failed"); -- } else if ( $running == 1) { # tests in progress -- printf("", "running"); -- } else if ( $total == 0) { # all tests passed -- printf("", $total); -- } else { # some tests failed -- printf("", $total); -- } -- echo ""; -- echo ""; -- } -- } -- echo "
RunidPlatformResultsrun dir
$key%s%s%s%s%srun dir
"; -- echo "
"; -- --#mysql_free_result($result1); --#mysql_free_result($result2); --mysql_close($db); -- --?> -- -- -- -diff --git a/nmi_tools/www/results/Queue-depth.php b/nmi_tools/www/results/Queue-depth.php -index e372c0e..ac0f5c3 100644 ---- a/nmi_tools/www/results/Queue-depth.php -+++ b/nmi_tools/www/results/Queue-depth.php -@@ -1,18 +1,25 @@ - -+ - - --NMI - Queue depths for core platforms -+NMI - Build queue depths for core platforms - - - -@@ -24,92 +31,104 @@ mysql_select_db(DB_NAME) or die("Could not select database"); - - include "last.inc"; - --// --// First get a runid of a recent build. --// --$sql = "SELECT runid -+// Create the sidebar -+echo "
"; -+make_sidebar(); -+ -+// Now create the HTML tables. -+echo "
\n"; -+ -+echo "

NMI build queue depths:

\n"; -+echo "

This page contains depth information for jobs of type \"build\" only

\n"; -+ -+ -+foreach ($branches as $branch) { -+ // -+ // First get a runid of a recent build. -+ // -+ $sql = "SELECT runid - FROM Run -- WHERE component='condor' AND -- project='condor' AND -- run_type='build' AND -- user = '$user' AND -- description LIKE '".$branch."%'". -- " ORDER BY runid DESC ". -- " LIMIT 1"; -- --$result = mysql_query($sql) or die ("Query {$sql} failed : " . mysql_error()); --while ($row = mysql_fetch_array($result)) { -- $runid = $row["runid"]; -- //echo "Using RunID: $runid"; --} --mysql_free_result($result); -- --// --// Then get the platform list using that runid --// --$sql = "SELECT DISTINCT(platform) AS platform -- FROM Run, Task -- WHERE Task.runid = $runid -+ WHERE component='condor' AND -+ project='condor' AND -+ run_type='$type' AND -+ user = '$user' AND -+ description LIKE '$branch%' -+ ORDER BY runid DESC -+ LIMIT 1"; -+ -+ $result = mysql_query($sql) or die ("Query {$sql} failed : " . mysql_error()); -+ while ($row = mysql_fetch_array($result)) { -+ $runid = $row["runid"]; -+ //echo "Using RunID: $runid"; -+ } -+ mysql_free_result($result); -+ -+ // -+ // Then get the platform list using that runid -+ // -+ $sql = "SELECT DISTINCT(platform) AS platform -+ FROM Run, Task -+ WHERE Task.runid = $runid - AND Task.runid = Run.runid - AND Run.user = '$user' - AND Task.platform != 'local' "; - --$result = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); --$platforms = Array(); --while ($row = mysql_fetch_array($result)) { -- array_push($platforms, $row["platform"]); --} --mysql_free_result($result); --//echo "Found platforms: " . implode(", ", $platforms); --?> --

NMI queue depths:

-- -- -- -- 0 and $depth < 3) { -- $color = "#00FF00"; -- } -- elseif($depth >= 3 and $depth < 6) { -- $color = "#FFFF00"; -- } -- elseif($depth >= 6) { -- $color = "#FF0000"; -+ $result = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); -+ $platforms = Array(); -+ while ($row = mysql_fetch_array($result)) { -+ array_push($platforms, $row["platform"]); - } -+ mysql_free_result($result); - -- echo "\n"; --} --?> -+ echo "

Branch - $branch

\n"; -+ echo "
$display $queue_depth
\n"; -+ echo "\n"; - --"; -+ // show link to run directory for each platform -+ foreach ($platforms AS $platform) { -+ // We will remove 'nmi:' from the front of the platform and also split it -+ // onto two separate lines because the length of the header determines the -+ // width of the resulting table column. -+ $display = preg_replace("/nmi:/", "", $platform); -+ #$display = preg_replace("/_/", "_ ", $display, 1); -+ -+ $ret = get_queue_for_nmi_platform($platform, $type); -+ $depth = $ret[0]; -+ $queue_depth = $ret[1]; -+ -+ $color = ""; -+ if($depth == 0) { -+ $color = "#00FFFF"; -+ } -+ elseif($depth > 0 and $depth < 3) { -+ $color = "#00FF00"; -+ } -+ elseif($depth >= 3 and $depth < 6) { -+ $color = "#FFFF00"; -+ } -+ elseif($depth >= 6) { -+ $color = "#FF0000"; -+ } -+ -+ echo "\n"; -+ } - -+ echo "
$display $queue_depth
\n"; -+} - mysql_close($db); - ?> - -

Legend: - - -- -+ - - - - -+ -+ -+ -+ - - -diff --git a/nmi_tools/www/results/Run-condor-details.php b/nmi_tools/www/results/Run-condor-details.php -index 2841097..9084fd4 100644 ---- a/nmi_tools/www/results/Run-condor-details.php -+++ b/nmi_tools/www/results/Run-condor-details.php -@@ -1,27 +1,25 @@ - - - -@@ -35,7 +33,7 @@ - $db = mysql_connect(WEB_DB_HOST, DB_READER_USER, DB_READER_PASS) or die ("Could not connect : " . mysql_error()); - mysql_select_db(DB_NAME) or die("Could not select database"); - --include "last.inc"; -+include "dashboard.inc"; - - // - // need to have the branch if we get a request for a test history -@@ -75,6 +73,10 @@ mysql_free_result($result); - echo "

Condor Latest Build/Test Results " . - ":: ".ucfirst($type)."s for Build ID $runid $branch (".date("m/d/Y", $start).")

\n"; - -+if(!$timed) { -+ echo "

Show this page with test times\n"; -+} -+ - // - // Platforms - // -@@ -135,12 +137,11 @@ else { - $result = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); - while ($row = mysql_fetch_array($result)) { - $task_name = $row["name"]; -- //echo "

$tmp

"; - - // - // Now for each task, get the status from the platforms - // -- $sql = "SELECT platform, result, runid ". -+ $sql = "SELECT platform, result, runid, TIME_TO_SEC(TIMEDIFF(Finish, Start)) as length ". - " FROM Task ". - " WHERE Task.runid IN (".implode(",", $runids).") ". - " AND Task.name = '$task_name'"; -@@ -149,6 +150,7 @@ while ($row = mysql_fetch_array($result)) { - $platform = $task_row["platform"]; - $platform_runids[$platform] = $task_row["runid"]; - $result_value = $task_row["result"]; -+ $length = $task_row["length"]; - - if (is_null($result_value)) { - $result_value = PLATFORM_PENDING; -@@ -159,33 +161,28 @@ while ($row = mysql_fetch_array($result)) { - $platform_status[$platform] = PLATFORM_FAILED; - $task_status[$task_name] = PLATFORM_FAILED; - } -- elseif (!$platform_status[$platform]) { -+ elseif(!array_key_exists($platform, $platform_status)) { - $platform_status[$platform] = PLATFORM_PASSED; - } -- if (!$task_status[$task_name]) { -+ -+ if(!array_key_exists($task_name, $task_status)) { - $task_status[$task_name] = PLATFORM_PASSED; - } -- $data[$row["name"]][$task_row["platform"]] = $result_value; -- } // WHILE -+ $data[$row["name"]][$task_row["platform"]] = Array($result_value, $length); -+ } - mysql_free_result($task_result); --} // WHILE -+} - mysql_free_result($result); --// need to lookup location later.....mysql_close($db); -- --?> - --
Depth 0Depth 0Depth 1-2Depth 3-5Depth 6+
-- -- --\n"; -+echo "\n"; -+echo " \n"; -+ -+$hosts = get_hosts(Array($runid)); -+ - // show link to run directory for each platform - foreach ($platforms AS $platform) { -- // We will remove 'nmi:' from the front of the platform and also split it -- // onto two separate lines because the length of the header determines the -- // width of the resulting table column. - $display = preg_replace("/nmi:/", "", $platform); -- $display = preg_replace("/_/", "_ ", $display, 1); -- - - // have to lookup the file location now - $filepath = ""; -@@ -203,21 +200,23 @@ foreach ($platforms AS $platform) { - $queue_depth = $ret[1]; - } - -- $display = "$display"; -- echo "\n"; --} // FOREACH -+ $remote_host = ""; -+ if(array_key_exists($display, $hosts[$runid])) { -+ $remote_host = "
" . $hosts[$runid][$display] . ""; -+ } -+ -+ $display = "$display"; -+ echo "\n"; -+} -+ - ?> - - - click"; -- echo "\n"; --} // FOREACH -+ $display = "click"; -+ echo "\n"; -+} -+ - foreach ($data AS $task => $arr) { - if ($type == 'test') { - $history_url = sprintf(HISTORY_URL,$branch,rawurlencode($task)); -@@ -244,17 +244,42 @@ foreach ($data AS $task => $arr) { - "".limitSize($task, 30)."\n"; - } - foreach ($platforms AS $platform) { -- $result = $arr[$platform]; -+ if(!array_key_exists($platform, $arr)) { -+ echo "\n"; -+ continue; -+ } -+ -+ $result = $arr[$platform][0]; -+ $length = $arr[$platform][1]; - if ($result == PLATFORM_PENDING) { -- echo "\n"; -+ echo "\n"; - } - else { - if ($result == '') { -- echo "\n"; -+ echo "\n"; - } - else { -- $display = "$result"; -- echo "\n"; -+ $height = ""; -+ if($timed) { -+ if($task != "platform_job" and $task != "remote_task") { -+ # Keep the font from getting too small or too large -+ $size = ($length < 50) ? 50 : (($length > 1000) ? 1000 : $length); -+ $height = "font-size:$size%;"; -+ } -+ } -+ -+ $display = ""; -+ if($timed) { -+ $display .= sec_to_min($length) . " ("; -+ } -+ -+ $display .= "$result"; -+ -+ if($timed) { -+ $display .= ")"; -+ } -+ -+ echo "\n"; - } - } - } -@@ -269,9 +294,17 @@ function limitSize($str, $cnt) { - return ($str); - } - -+function sec_to_min($sec) { -+ $min = floor($sec / 60); -+ $sec = $sec % 60; -+ if($sec < 10) { -+ $sec = "0$sec"; -+ } -+ return "$min:$sec"; -+} -+ - // done looking up locations.....mysql_close($db); - mysql_close($db); - ?> - - -- -diff --git a/nmi_tools/www/results/Run-condor-taskdetails.php b/nmi_tools/www/results/Run-condor-taskdetails.php -index e06b299..0f4ca08 100644 ---- a/nmi_tools/www/results/Run-condor-taskdetails.php -+++ b/nmi_tools/www/results/Run-condor-taskdetails.php -@@ -133,9 +133,11 @@ while( $myrow = mysql_fetch_array($result) ) { - else { - $stat = stat("$filepath.out"); - $stdout_size = $stat['size']; -+ $stdout_size_display = number_format($stdout_size); - - $stat = stat("$filepath.err"); - $stderr_size = $stat['size']; -+ $stderr_size_display = number_format($stderr_size); - - $stdout_url = "".basename($filepath).".out"; - $stderr_url = "".basename($filepath).".err"; -@@ -160,34 +162,31 @@ while( $myrow = mysql_fetch_array($result) ) { - - $resultval = $myrow["result"]; - $test_results_url = "".$resultval.""; -- echo "

"; -- echo "

Name
Name$display $queue_depth$display $remote_host $queue_depth
Results$display$display --  $display$display
"; --# echo ""; -- #echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo ""; -- echo "
Run ID:".$myrow["runid"]."
Run ID:Run ID:".$myrow["runid"]."
GID:".$myrow["gid"] ."
Task ID:".$myrow["task_id"] ."
Start:".$myrow["start"] ."
Finish: ".$myrow["finish"] ."
Duration: ".$myrow["duration"] ."
Result: $test_results_url
Stdout: $stdout_url - (size: $stdout_size bytes)
Stderr: $stderr_url - (size: $stderr_size bytes)
Run Results: $results_url
# warnings STDOUT:$num_warnings
# warnings STDERR:$num_warnings_stderr
"; -- echo "

"; -+ echo "

"; -+ echo ""; -+# echo ""; -+ #echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo ""; -+ echo "
Run ID:".$myrow["runid"]."
Run ID:Run ID:".$myrow["runid"]."
GID:".$myrow["gid"] ."
Task ID:".$myrow["task_id"] ."
Start:".$myrow["start"] ."
Finish: ".$myrow["finish"] ."
Duration: ".$myrow["duration"] ."
Result: $test_results_url
Stdout: $stdout_url - (size: $stdout_size_display bytes)
Stderr: $stderr_url - (size: $stderr_size_display bytes)
Run Results: $results_url
# warnings STDOUT:$num_warnings
# warnings STDERR:$num_warnings_stderr
"; -+ echo "

"; - - if($file_found) { - if($stdout_size > 0) { - show_file_content("STDOUT", "$filepath.out"); - } - -- if($stderr_size > 0) { -- show_file_content("STDERR", "$filepath.err"); -- } - } - } - -@@ -201,33 +200,19 @@ function show_file_content($header, $file) { - if($_REQUEST["type"] == "build" && preg_match("/_win/", $_REQUEST["platform"])) { - // For windows we have a script that does some smarter parsing - $lines = `./parse-windows-build.pl $file`; -- echo "

Tried to do some smart parsing for Windows:\n"; -- echo "

Click to show Windows build info\n"; -- echo "

\n"; - echo "
$lines
\n"; -- echo "
\n"; - } - else { -- // For linux we'll just grep for errors for now. This can probably be improved -- $lines = `grep -C 5 -i error $file`; -- echo "

Showing all instances of the word 'error' in $header:\n"; -- if(strlen($lines) > 0) { -- $lines = preg_replace("/(error)/i", "$1", $lines); -- echo "

Click to show errors in $header\n"; -- echo "

\n"; -- echo "
$lines
\n"; -- echo "
\n"; -- } -- else { -- echo "

The string 'error' was not present in $header\n"; -- } -+ // For linux show some lines from the bottom of the file -+ $count = 20; -+ $lines = `tail -$count $file`; -+ -+ // Do some nice highlighting to make warnings/errors more obvious -+ $lines = preg_replace("/(error)/i", "$1", $lines); -+ echo "

Last $count lines of $header:\n"; -+ echo "

$lines
"; - } - -- // Always show the last 10 lines -- $count = 10; -- $lines = `tail -$count $file`; -- echo "

Last $count lines of $header:\n"; -- echo "

$lines
"; - } - - ?> -diff --git a/nmi_tools/www/results/Run-condor.php b/nmi_tools/www/results/Run-condor.php -index c911cce..7af1bd4 100644 ---- a/nmi_tools/www/results/Run-condor.php -+++ b/nmi_tools/www/results/Run-condor.php -@@ -1,24 +1,17 @@ - - - -@@ -27,21 +20,10 @@ - - - --

Condor Latest Build/Test Results

-- -- -- -- -- -- -- -- -- -- -- - \n". -- " \n". -- "\n"; -- } -- -- // -------------------------------- -- // BUILDS -- // -------------------------------- -- $sql = "SELECT Task.platform, Task.result" . -- " FROM Task, Run ". -- " WHERE Run.runid = {$runid} AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' ". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) or die ("Query {$sql} failed : " . mysql_error()); -- $data["build"] = Array(); -- $data["build"]["totals"] = Array(); -- $data["build"]["platforms"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- $data["build"]["totals"]["total"]++; -- if($platforms["result"] == NULL) { -- $data["build"]["totals"]["pending"]++; -- $data["build"]["platforms"][$platforms["platform"]] = "pending"; -- } -- elseif($platforms["result"] == 0) { -- $data["build"]["totals"]["passed"]++; -- $data["build"]["platforms"][$platforms["platform"]] = "passed"; -- } -- elseif($platforms["result"] != 0) { -- $data["build"]["totals"]["failed"]++; -- $data["build"]["platforms"][$platforms["platform"]] = "failed"; -- } -- } -- mysql_free_result($result2); -- -- // -------------------------------- -- // TESTS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending, ". -- " Task.platform" . -- " FROM Task, Run, Method_nmi ". -- " WHERE Method_nmi.input_runid = {$runid} AND ". -- " Run.runid = Method_nmi.runid AND ". -- " Run.user = '$user' AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' AND ". -- " ((Run.project_version = Run.component_version) OR (Run.component_version = 'native' ))". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) or die ("Query {$sql} failed : " . mysql_error()); -- $data["test"] = Array(); -- $data["test"]["totals"] = Array(); -- $data["test"]["platforms"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- $data["test"]["totals"]["total"]++; -- if($platforms["failed"] > 0) { -- $data["test"]["totals"]["failed"]++; -- $data["test"]["platforms"][$platforms["platform"]] = "failed"; -- } -- elseif($platforms["pending"] > 0) { -- $data["test"]["totals"]["pending"]++; -- $data["test"]["platforms"][$platforms["platform"]] = "pending"; -- } -- elseif($platforms["passed"] > 0) { -- $data["test"]["totals"]["passed"]++; -- $data["test"]["platforms"][$platforms["platform"]] = "passed"; -- } -- } -- mysql_free_result($result2); -- -- // -------------------------------- -- // CROSS TESTS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending, ". -- " Task.platform " . -- " FROM Task, Run, Method_nmi ". -- " WHERE Method_nmi.input_runid = {$runid} AND ". -- " Run.runid = Method_nmi.runid AND ". -- " Run.user = '$user' AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' AND ". -- " project_version != component_version AND ". -- " component_version != 'native' ". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) or die ("Query {$sql} failed : " . mysql_error()); -- $data["crosstest"] = Array(); -- $data["crosstest"]["totals"] = Array(); -- $data["crosstest"]["platforms"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- $data["crosstest"]["totals"]["total"]++; -- if($platforms["failed"] > 0) { -- $data["crosstest"]["totals"]["failed"]++; -- $data["crosstest"]["platforms"][$platforms["platform"]] = "failed"; -- } -- elseif($platforms["pending"] > 0) { -- $data["crosstest"]["totals"]["pending"]++; -- $data["crosstest"]["platforms"][$platforms["platform"]] = "pending"; -- } -- elseif($platforms["passed"] > 0) { -- $data["crosstest"]["totals"]["passed"]++; -- $data["crosstest"]["platforms"][$platforms["platform"]] = "passed"; -- } -- } -- mysql_free_result($result2); -- -- // -- // HTML Table Row -- // -- $branch_url = sprintf(BRANCH_URL, $branch, $user); -- -- // -- // If there's nothing at all, just skip -- // -- // We only want to do this for one-off builds, if the nightly build -- // completely crapped out on us, we need to show it -- // Andy - 11/30/2006 -- // -- if ($user != CONDOR_USER && !count($data["build"]["platforms"]) && !count($data["test"]["platforms"])) continue; -- -- // Is this top level run pinned or not(probably not but could be one of a kind) -- -- $findpin="SELECT -- run_type, -- runid, -- user, -- archived, -- archive_results_until -- FROM -- Run -- WHERE -- runid = $runid "; -- -- $pincheck = mysql_query($findpin) or die ("Query {$findpin} failed : " . mysql_error()); -- while ($pindetails = mysql_fetch_array($pincheck)) { -- $pin = $pindetails["archive_results_until"]; -- $archived = $pindetails["archived"]; -- if( !(is_null($pin))) { -- $pinstr = "pin ". "$pin"; -- } -- else { -- $pinstr = ""; -- } -- if( $archived == '0' ) { -- $archivedstr = "$runid". "
D "; -- } -- else { -- $archivedstr = "$runid"; -- } -- } -- -- echo << -- -- -- -- --EOF; -- -- foreach (Array("build", "test", "crosstest") AS $type) { -- $platforms = $data[$type]["platforms"]; -- $totals = $data[$type]["totals"]; -- -- // Form a status table -- $list = Array(); -- $list["passed"] = Array(); -- $list["pending"] = Array(); -- $list["failed"] = Array(); -- foreach ($platforms as $platform) { -- $list[$platforms[$platform]] .= $platform; -- } -- -- if($totals["failed"] > 0) { -- $status = "FAILED"; -- $color = "FAILED"; -+ $runid = $row["runid"]; -+ $branch = $row["branch"]; -+ $user = $row["user"]; -+ $run_result = $row["result"]; -+ -+ if(preg_match("/Continuous/", $branch)) { -+ $skip = 0; -+ foreach ($continuous_blacklist as $blacklisted_platform) { -+ if(preg_match("/ $blacklisted_platform$/", $branch)) { -+ $skip = 1; -+ break; - } -- elseif($totals["pending"] > 0) { -- $status = "PENDING"; -- $color = "PENDING"; -+ } -+ if($skip == 1) { -+ continue; -+ } -+ -+ $continuous_buf[$branch] = Array(); -+ $continuous_buf[$branch]["user"] = $user; -+ $continuous_buf[$branch]["results"] = create_sparkline($branch, $user, $SPARK_DAYS); -+ } -+ else { -+ if($user == CONDOR_USER) { -+ $cndrauto_buf[$branch] = Array(); -+ $cndrauto_buf[$branch]["user"] = $user; -+ $cndrauto_buf[$branch]["start"] = $row["start"]; -+ $cndrauto_buf[$branch]["start_epoch"] = $row["start_epoch"]; -+ $cndrauto_buf[$branch]["results"] = get_results(&$cndrauto_buf[$branch], $runid, $user, $row["result"]); -+ } -+ else { -+ # The branch might not be unique for one-off builds so we need to make a more unique key -+ $key = "$branch ($user)"; -+ $oneoff_buf[$key] = Array(); -+ $oneoff_buf[$key]["branch"] = $branch; -+ $oneoff_buf[$key]["user"] = $user; -+ $oneoff_buf[$key]["start"] = $row["start"]; -+ $oneoff_buf[$key]["results"] = get_results(&$oneoff_buf[$key], $runid, $user, $row["result"]); -+ } -+ } -+} -+mysql_free_result($result); -+mysql_close($db); -+ -+// Create the sidebar -+echo "
"; -+make_sidebar(); -+ -+// Now create the HTML tables. -+echo "
\n"; -+ -+// -+// 1) Continuous builds -+// -+if(!$one_offs) { -+ echo "

Continuous Builds

\n"; -+ -+ echo "

Continuous blacklist: " . implode(", ", $continuous_blacklist) . "

"; -+ -+ echo "
\n"; -+ echo "

Days: \n"; -+ -+ $help_text = "

    \n"; -+ $help_text .= "
  • The last $SPARK_DAYS days of results are shown for each platform.
  • \n"; -+ $help_text .= "
  • The newest results are at the left.
  • \n"; -+ $help_text .= "
  • Thick black bars designate commits to the repository between runs.
  • \n"; -+ $help_text .= "
  • The number shown in the build line is the hour in which the test ran.
  • \n"; -+ $help_text .= "
  • If a number is shown in the test line it is the number of tests that failed.
  • \n"; -+ $help_text .= "
"; -+ echo "

Hover here to have this section explained$help_text"; -+ -+ echo "

Branch
Click to see branch history
RunidSubmittedUserBuild ResultsTest ResultsCross Test Results
One-off Builds
{$branch}
$pinstr
{$archivedstr}{$start}{$user}
\n"; -+ -+ $branches = array_keys($continuous_buf); -+ sort($branches); -+ -+ $runs = Array(); -+ foreach ($branches as $branch) { -+ $info = $continuous_buf[$branch]; -+ foreach (array_keys($info["results"]["build"]) as $key) { -+ $runs[$key] = $info["results"]["build"][$key]["sha1"]; -+ } -+ } -+ krsort($runs); -+ -+ $table = Array(); -+ -+ foreach ($branches as $branch) { -+ $info = $continuous_buf[$branch]; -+ $branch_url = sprintf(BRANCH_URL, $branch, $info["user"]); -+ $branch_display = preg_replace("/^Continuous Build - /", "", $branch); -+ $out = "\n"; -+ $out .= " \n"; -+ $out .= " \n"; -+ -+ $counter = 0; -+ $commits = Array(); -+ $last_sha1 = ""; -+ foreach (array_keys($runs) as $key) { -+ $counter += 1; -+ $style = ""; -+ if($runs[$key] != $last_sha1 && $last_sha1 != "") { -+ $style .= "border-left-width:4px; border-left-color:black; "; -+ array_push($commits, $counter); -+ $counter = 0; - } -- elseif($totals["passed"] > 0) { -- $status = "PASSED"; -- $color = "PASSED"; -+ $last_sha1 = $runs[$key]; -+ -+ if(array_key_exists($key, $info["results"]["build"])) { -+ $run = $info["results"]["build"][$key]; -+ $out .= " \n"; - } - else { -- $status = "No Results"; -- $color = "NORESULTS"; -+ $out .= " \n"; - } -+ } -+ -+ $out .= "\n"; -+ $out .="\n"; -+ $out .= " \n"; - -- ## -- ## Check for missing tests -- ## Since we know how many builds have passed and should fire off tests, -- ## we can do a simple check to make sure the total number of tests -- ## is equal to the the number of builds -- ## Andy - 01.09.2007 -- ## -- if ($type == "test") { -- $no_test_cnt = 0; -- if (count($no_test_platforms)) { -- $sql = "SELECT count(DISTINCT platform) AS count ". -- " FROM Run, Task ". -- " WHERE Run.runid = {$runid} AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform IN ('".implode("','", $no_test_platforms)."') "; -- $cnt_result = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $res = mysql_fetch_array($cnt_result); -- $no_test_cnt = $res["count"]; -- } -- $totals["missing"] = $data["build"]["totals"]["passed"] - $totals["total"] - $no_test_cnt; -- if ($totals["missing"] > 0) $color = "FAILED"; -- elseif ($totals["missing"] < 0) $totals["missing"] = 0; -+ $last_sha1 = ""; -+ foreach (array_keys($runs) as $key) { -+ $style = "text-align:center; "; -+ if($runs[$key] != $last_sha1 && $last_sha1 != "") { -+ $style .= "border-left-width:4px; border-left-color:black; "; - } -+ $last_sha1 = $runs[$key]; - -- if($type == "crosstest") { -- $detail_url = sprintf(CROSS_DETAIL_URL, $runid, $type, $user); -+ if(array_key_exists($key, $info["results"]["test"])) { -+ $run = $info["results"]["test"][$key]; -+ $out .= " \n"; - } - else { -- $detail_url = sprintf(DETAIL_URL, $runid, $type, $user); -+ $out .= " \n"; - } -+ } -+ -+ $out .= "\n"; -+ array_push($table, $out); -+ } -+ -+ // We want to have a little spacing between the sparklines. If we stack them one on top of -+ // the other they look crowded. But we want the spacing to be minimal, so we'll make it only -+ // a few pixels high. Also, it looks really nice to have the black commit lines continue -+ // through the spacing. It's a little bit more code to generate this "separator" row correctly. -+ $sep = ""; -+ $sum = 1; -+ foreach ($commits as $len) { -+ $sep .= ""; -+ $sum += $len; -+ } -+ $final_cell = sizeof($runs) + 2 - $sum; -+ $sep .= ""; -+ $sep .= "\n"; -+ -+ echo implode($sep, $table); -+ echo "
$branch_displayBuild"; -+ $out .= $run["html"] . "   
Test"; -+ $out .= $run["html"] . "   
\n"; -+} -+ -+ -+ -+// -+// 2) cndrauto builds -+// -+if(!$one_offs) { -+ echo "

Auto builds - user '" . CONDOR_USER . "'

\n"; -+ echo "\n"; -+ echo "\n"; -+ echo "\n"; -+ -+ $branches = array_keys($cndrauto_buf); -+ usort($branches, "cndrauto_sort"); -+ -+ foreach ($branches as $branch) { -+ $info = $cndrauto_buf[$branch]; -+ $branch_url = sprintf(BRANCH_URL, $branch, $info["user"]); -+ -+ // Print a "warning" if this branch has not been submitted for >1 day. This makes it easier to spot old -+ // builds from the dashboard. -+ $warning = ""; -+ $diff = time() - $info["start_epoch"]; -+ if($diff > 60*60*24) { -+ $days = floor($diff / (60*60*24)); -+ $warning = "

$days+ days old

"; -+ } -+ -+ $style = ""; -+ if(preg_match("/^NMI/", $branch)) { -+ $style = "style='border-bottom-width:4px;'"; -+ } -+ else { -+ $style = "style='border-top-width:4px;'"; -+ } -+ -+ echo "\n"; -+ echo " \n"; -+ echo " \n"; -+ echo " \n"; -+ echo $info["results"]; -+ echo "\n"; -+ } -+ echo "
BranchRunidSubmittedBuild ResultsTest ResultsCross Test Results
$branch
" . $info["pin"] . "
" . $info["runid"] . "" . $info["start"] . $warning . "
\n"; -+} -+ -+// -+// 3) One-off builds -+// -+if($one_offs) { -+ echo "

One-off builds

\n"; -+ echo "\n"; -+ echo "\n"; -+ echo "\n"; -+ -+ foreach (array_keys($oneoff_buf) as $key) { -+ $info = $oneoff_buf[$key]; -+ $branch_url = sprintf(BRANCH_URL, $info["branch"], $info["user"]); -+ echo "\n"; -+ echo " \n"; -+ echo " \n"; -+ echo " \n"; -+ echo " \n"; -+ echo $info["results"]; -+ echo "\n"; -+ } -+ echo "
BranchRunidSubmittedUserBuild ResultsTest ResultsCross Test Results
" . $info["branch"] . "
" . $info["pin"] . "
" . $info["runid"] . "" . $info["start"] . "" . $info["user"] . "
\n"; -+} -+ -+echo "
\n"; -+echo "\n"; -+echo "
\n"; -+ -+ -+ -+ -+ -+ -+// We are going to build "sparklines" for the Continuous builds to make -+// it easier to visualize their performance over time -+function create_sparkline($branch, $user, $num_spark_days) { -+ // First get all the recent build runs. We'll use the runids from the -+ // build runs to determine which tests to match to them -+ $sql = "SELECT runid,result,project_version, " . -+ " convert_tz(start, 'GMT', 'US/Central') as start " . -+ "FROM Run " . -+ "WHERE run_type='build' AND " . -+ " component='condor' AND " . -+ " project='condor' AND " . -+ " DATE_SUB(CURDATE(), INTERVAL $num_spark_days DAY) <= start AND " . -+ " Description = '$branch' " . -+ " ORDER BY runid DESC"; -+ $result2 = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); -+ -+ $output = Array(); -+ $output["build"] = Array(); -+ $output["test"] = Array(); -+ -+ $builds = Array(); -+ $runids = Array(); -+ while ($build = mysql_fetch_array($result2)) { -+ array_push($runids, $build["runid"]); -+ -+ $color = "passed"; -+ if($build["result"] == NULL) { -+ $color = "pending"; -+ } -+ elseif($build["result"] != 0) { -+ $color = "failed"; -+ } -+ -+ $details = " "; -+ $details .= " "; -+ $details .= " "; -+ $details .= " "; -+ $details .= " "; -+ $details .= " "; -+ $details .= "
Status$color
NMI RunID" . $build["runid"] . "
Submitted" . $build["start"] . "
SHA1" . substr($build["project_version"], 0, 15) . "
Host__PUT_HOST_HERE__
"; -+ -+ $hour = preg_replace("/^.+(\d\d):\d\d:\d\d.*$/", "$1", $build["start"]); -+ -+ $detail_url = sprintf(DETAIL_URL, $build["runid"], "build", $user); -+ $popup_html = "$hour$details"; -+ -+ $tmp = Array(); -+ $tmp["runid"] = $build["runid"]; -+ $tmp["sha1"] = substr($build["project_version"], 0, 15); -+ $tmp["html"] = $popup_html; -+ $tmp["color"] = $color; -+ $tmp["hour"] = $hour; -+ $tmp["start"] = $build["start"]; -+ -+ // The key is currently formed by using a combination of the date and the SHA1. Since we run -+ // builds every hour but the SHA1 might remain the same we need to use the date to provide -+ // uniqueness. We use the year/month/day and the hour, but we strip off the minute and second -+ // because we want to be able to correlate runs across platforms (which will be submitted each -+ // hour but at different minutes). Eventually when we do per-commit builds this should -+ // probably just become the SHA1 without the date. -+ $tmp["key"] = preg_replace("/:.+$/", "", $build["start"]) . $tmp["sha1"]; -+ -+ array_push($builds, $tmp); -+ } -+ mysql_free_result($result2); -+ -+ // Figure out the hostname for each execute node -+ $hosts = get_hosts($runids); -+ $platform = preg_replace("/Continuous Build - /", "", $branch); -+ -+ for ($i=0; $i < count($builds); $i++) { -+ $key = $builds[$i]["key"]; -+ $output["build"][$key] = Array(); -+ $output["build"][$key]["sha1"] = $builds[$i]["sha1"]; -+ $output["build"][$key]["color"] = $builds[$i]["color"]; -+ -+ $tmp = preg_replace("/__PUT_HOST_HERE__/", $hosts[$builds[$i]["runid"]][$platform], $builds[$i]["html"]); -+ $output["build"][$key]["html"] = $tmp; -+ } -+ -+ // And now for the tests. This is trickier because we have to line it up -+ // with the builds above -+ $sql = "SELECT runid,result,description," . -+ " convert_tz(start, 'GMT', 'US/Central') as start " . -+ "FROM Run ". -+ "WHERE run_type = 'TEST' AND " . -+ " component = 'condor' AND " . -+ " project = 'condor' AND " . -+ " DATE_SUB(CURDATE(), INTERVAL $num_spark_days DAY) <= start AND " . -+ " description LIKE 'Auto-Test Suite for ($platform, %' " . -+ "ORDER BY description DESC"; -+ $result2 = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); -+ -+ $runids = Array(); -+ $tests = Array(); -+ while ($test = mysql_fetch_array($result2)) { -+ $build_runid = preg_replace("/Auto-Test Suite for \($platform, (.+)\)/", "$1", $test["description"]); -+ $runid = $test["runid"]; -+ array_push($runids, $runid); -+ $color = "passed"; -+ $hour = "   "; -+ $failed_tests = ""; -+ if($test["result"] == NULL) { -+ $color = "pending"; -+ } -+ elseif($test["result"] != 0) { -+ $color = "failed"; -+ -+ $sql = "SELECT name -+ FROM Task -+ WHERE runid=$runid AND Result!=0"; - -- // -- // No results -- // -- if (!count($platforms)) { -- // -- // If this is a nightly build, we can check whether it failed and -- // give a failure notice. Without this, the box will just be empty -- // and people won't know what really happended -- // -- if (!empty($run_result) && $type == 'build') { -- $status = "FAILED"; -- echo << -- -- -- -- --
$status
-- --EOF; -- // -- // Just display an empty cell -- // -- } -- elseif($type == "test") { -- echo << -- -- -- -- -- --
No Completed Builds
 
 
 
-- --EOF; -- } -- else { -- echo " \n"; -- } -- // -- // Show Summary -- // -+ $result3 = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); -+ -+ $hour = 0; -+ $LIMIT = 5; // Cap the number of entries we show in the pop-up box -+ $failed_parents = ""; -+ while ($task = mysql_fetch_array($result3)) { -+ if($task["name"] == "platform_job" || $task["name"] == "remote_task") { -+ $failed_parents .= "" . $task["name"] . "
"; -+ } -+ else { -+ $hour += 1; -+ if($hour <= $LIMIT) { -+ $failed_tests .= "" . $task["name"] . "
"; -+ } -+ } - } -- else { -- -- echo << -- -- -- -- --EOF; -- // -- // Show the different status tallies for platforms -- // -- foreach ($result_types AS $key) { -- if ($key == "missing" && empty($totals[$key])) continue; -- $prefix = $postfix = ""; -- if ($key == "missing") { -- $prefix = ""; -- $postfix = ""; -- } -- -- echo "\n". -- " \n". -- " \n". -- "\n"; -- } -- echo "
-- $status --
{$prefix}".ucfirst($key)."{$postfix}{$prefix}".(int)$totals[$key]."{$postfix}
\n"; -- } // RESULTS -- } // FOREACH -- -- echo ""; -- $last_user = $user; --} // WHILE --mysql_free_result ($result); -- --echo ""; --echo "
"; - --mysql_close($db); -+ # Add a max number of failures we'll show -+ if($hour > $LIMIT) { -+ $failed_tests .= ($hour - $LIMIT) . " more..."; -+ } -+ elseif($hour == 0) { -+ # We only want to display the failed parents if there were no failed tests to display. -+ $failed_tests = $failed_parents; -+ } -+ } -+ -+ $details = ""; -+ $details .= ""; -+ $details .= ""; -+ $details .= ""; -+ $details .= ""; -+ $details .= ""; -+ $details .= "
Status$color
Start" . $test["start"] . "
SHA1__PUT_SHA_HERE__
Host__PUT_HOST_HERE__
Failed tests$failed_tests
"; -+ -+ $detail_url = sprintf(DETAIL_URL, $build_runid, "test", $user); -+ $popup_html = "$hour$details"; -+ -+ $tests[$build_runid] = Array(); -+ $tests[$build_runid]["color"] = $color; -+ $tests[$build_runid]["html"] = $popup_html; -+ $tests[$build_runid]["runid"] = $runid; -+ } -+ mysql_free_result($result2); -+ -+ $hosts = get_hosts($runids); -+ -+ for ($i=0; $i < count($builds); $i++) { -+ $build = $builds[$i]; -+ -+ $key = $builds[$i]["key"]; -+ $output["test"][$key] = Array(); -+ -+ if(array_key_exists($build["runid"], $tests)) { -+ $test = $tests[$build["runid"]]; -+ $tmp = preg_replace("/__PUT_SHA_HERE__/", $build["sha1"], $test["html"]); -+ $tmp = preg_replace("/__PUT_HOUR_HERE__/", $build["hour"], $tmp); -+ $tmp = preg_replace("/__PUT_HOST_HERE__/", $hosts[$test["runid"]][$platform], $tmp); -+ $output["test"][$key]["color"] = $test["color"]; -+ $output["test"][$key]["html"] = $tmp; -+ } -+ else { -+ $output["test"][$key]["color"] = "noresults"; -+ $output["test"][$key]["html"] = " "; -+ } -+ } -+ -+ return $output; -+} -+ -+// Define a custom sort that puts trunk ahead of other builds, and NMI immediately -+// after the matching core build. -+function cndrauto_sort($a, $b) { -+ $a_is_nmi = preg_match("/^NMI/", $a); -+ $b_is_nmi = preg_match("/^NMI/", $b); -+ -+ $a = preg_replace("/^NMI Ports - /", "", $a); -+ $b = preg_replace("/^NMI Ports - /", "", $b); -+ -+ if($a == $b) { -+ if($a_is_nmi and !$b_is_nmi) { -+ return 1; -+ } -+ elseif($b_is_nmi and !$a_is_nmi) { -+ return -1; -+ } -+ } -+ -+ if(preg_match("/trunk/", $a)) { -+ return -1; -+ } -+ elseif(preg_match("/trunk/", $b)) { -+ return 1; -+ } -+ -+ return strcasecmp($b, $a); -+} - - ?> - -diff --git a/nmi_tools/www/results/Run-condor.php.almost b/nmi_tools/www/results/Run-condor.php.almost -deleted file mode 100644 -index 8bbbafc..0000000 ---- a/nmi_tools/www/results/Run-condor.php.almost -+++ /dev/null -@@ -1,344 +0,0 @@ -- -- -- --NMI - Condor Latest Build/Test Results -- -- -- -- --

Condor Latest Build/Test Results

-- -- -- -- -- -- -- -- -- -- -- --\n". -- " \n". -- "\n"; -- } -- -- // -------------------------------- -- // BUILDS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending ". -- " FROM Task, Run ". -- " WHERE Run.runid = {$runid} AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' ". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $data["build"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- if (!empty($platforms["failed"])) { -- $data["build"]["failed"]++; -- } elseif (!empty($platforms["pending"])) { -- $data["build"]["pending"]++; -- } elseif (!empty($platforms["passed"])) { -- $data["build"]["passed"]++; -- } -- } // WHILE -- mysql_free_result($result2); -- -- // -------------------------------- -- // TESTS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending ". -- " FROM Task, Run, Method_nmi ". -- " WHERE Method_nmi.input_runid = {$runid} AND ". -- " Run.runid = Method_nmi.runid AND ". -- " Run.user = '$user' AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' AND ". -- " ((Run.project_version = Run.component_version) OR (Run.component_version = 'native' ))". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $data["test"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- if (!empty($platforms["failed"])) { -- $data["test"]["failed"]++; -- $data["test"]["total"]++; -- } elseif (!empty($platforms["pending"])) { -- $data["test"]["pending"]++; -- $data["test"]["total"]++; -- } elseif (!empty($platforms["passed"])) { -- $data["test"]["passed"]++; -- $data["test"]["total"]++; -- } -- } // WHILE -- mysql_free_result($result2); -- -- // -------------------------------- -- // CROSS TESTS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending ". -- " FROM Task, Run, Method_nmi ". -- " WHERE Method_nmi.input_runid = {$runid} AND ". -- " Run.runid = Method_nmi.runid AND ". -- " Run.user = '$user' AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' AND ". -- " project_version != component_version AND ". -- " component_version != 'native' ". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $data["crosstest"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- if (!empty($platforms["failed"])) { -- $data["crosstest"]["failed"]++; -- $data["crosstest"]["total"]++; -- } elseif (!empty($platforms["pending"])) { -- $data["crosstest"]["pending"]++; -- $data["crosstest"]["total"]++; -- } elseif (!empty($platforms["passed"])) { -- $data["crosstest"]["passed"]++; -- $data["crosstest"]["total"]++; -- } -- } // WHILE -- mysql_free_result($result2); -- -- // -- // HTML Table Row -- // -- $branch_url = sprintf(BRANCH_URL, $branch, $user); -- -- // -- // If there's nothing at all, just skip -- // -- // We only want to do this for one-off builds, if the nightly build -- // completely crapped out on us, we need to show it -- // Andy - 11/30/2006 -- // -- if ($user != CONDOR_USER && !count($data["build"]) && !count($data["test"])) continue; -- -- // Is this top level run pinned or not(probably not but could be one of a kind) -- -- $findpin=" -- SELECT -- run_type, -- runid, -- user, -- archived, -- archive_results_until -- FROM -- Run -- WHERE -- runid = $runid "; -- -- $pincheck = mysql_query($findpin) -- or die ("Query {$findpin} failed : " . mysql_error()); -- while ($pindetails = mysql_fetch_array($pincheck)) { -- $pin = $pindetails["archive_results_until"]; -- $archived = $pindetails["archived"]; -- if( !(is_null($pin))) { -- $pinstr = "pin ". "$pin"; -- } else { -- $pinstr = ""; -- } -- if( $archived == '0' ) { -- $archivedstr = "$runid". "
D "; -- } else { -- $archivedstr = "$runid"; -- } -- } -- -- echo << -- -- -- -- --EOF; -- -- foreach (Array("build", "test", "crosstest") AS $type) { -- $cur = $data[$type]; -- $status = ($cur["failed"] ? "FAILED" : -- ($cur["pending"] ? "PENDING" : "PASSED")); -- $color = $status; -- -- ## -- ## Check for missing tests -- ## Since we know how many builds have passed and should fire off tests, -- ## we can do a simple check to make sure the total number of tests -- ## is equal to the the number of builds -- ## Andy - 01.09.2007 -- ## -- if ($type == "test") { -- $no_test_cnt = 0; -- if (count($no_test_platforms)) { -- $sql = "SELECT count(DISTINCT platform) AS count ". -- " FROM Run, Task ". -- " WHERE Run.runid = {$runid} AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform IN ('".implode("','", $no_test_platforms)."') "; -- $cnt_result = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $res = mysql_fetch_array($cnt_result); -- $no_test_cnt = $res["count"]; -- } -- $cur["missing"] = $data["build"]["passed"] - $cur["total"] - $no_test_cnt; -- if ($cur["missing"] > 0) $color = "FAILED"; -- elseif ($cur["missing"] < 0) $cur["missing"] = 0; -- } -- -- if($type == "crosstest") { -- $detail_url = sprintf(CROSS_DETAIL_URL, $runid, $type, $user); -- } else { -- $detail_url = sprintf(DETAIL_URL, $runid, $type, $user); -- } -- -- // -- // No results -- // -- if (!count($cur)) { -- // -- // If this is a nightly build, we can check whether it failed and -- // give a failure notice. Without this, the box will just be empty -- // and people won't know what really happended -- // -- if (!empty($run_result) && $type == 'build') { -- $status = "FAILED"; -- echo << --
Branch
Click to see branch history
RunidLast buildUserBuild ResultsTest ResultsCross Test Results
One-off Builds
{$branch}
$pinstr
{$archivedstr}{$start}{$user}
-- -- -- --
$status
-- --EOF; -- // -- // Just display an empty cell -- // -- } else { -- echo " \n"; -- } -- // -- // Show Summary -- // -- } else { -- -- echo << -- -- -- -- --EOF; -- // -- // Show the different status tallies for platforms -- // -- foreach ($result_types AS $key) { -- if ($key == "missing" && empty($cur[$key])) continue; -- if ($key == "missing") { -- $prefix = ""; -- $postfix = ""; -- } else { -- $prefix = $postfix = ""; -- } -- -- echo "\n". -- " \n". -- " \n". -- "\n"; -- } // FOREACH -- echo "
$status
{$prefix}".ucfirst($key)."{$postfix}{$prefix}".(int)$cur[$key]."{$postfix}
\n"; -- } // RESULTS -- } // FOREACH -- -- echo ""; -- $last_user = $user; --} // WHILE --mysql_free_result ($result); -- --echo ""; --echo ""; -- --mysql_close($db); -- --?> -- -- -diff --git a/nmi_tools/www/results/Test-branch-temp.php b/nmi_tools/www/results/Test-branch-temp.php -deleted file mode 100644 -index 83b75ba..0000000 ---- a/nmi_tools/www/results/Test-branch-temp.php -+++ /dev/null -@@ -1,116 +0,0 @@ -- -- -- -- NMI - Condor <?= $branch; ?> Build/Test Results -- -- -- --

Condor Latest Build/Test Results ::

-- --
-- -- --Rows:   -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- --EOF; -- -- -- echo ""; --} // WHILE --echo "
BranchRunidLast build
{$desc}{$runid}{$start}
"; --echo ""; -- --mysql_free_result($results); --mysql_close($db); -- --?> -- -- -diff --git a/nmi_tools/www/results/Test-branch-tmp.php b/nmi_tools/www/results/Test-branch-tmp.php -deleted file mode 100644 -index b9693b4..0000000 ---- a/nmi_tools/www/results/Test-branch-tmp.php -+++ /dev/null -@@ -1,116 +0,0 @@ -- -- -- -- NMI - Condor <?= $branch; ?> Build/Test Results -- -- -- --

Condor Latest Build/Test Results ::

-- --
-- -- --Rows:   -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- --EOF; -- -- -- echo ""; --} // WHILE --echo "
BranchRunidLast build
{$desc}{$runid}{$start}
"; --echo ""; -- --mysql_free_result($results); --mysql_close($db); -- --?> -- -- -diff --git a/nmi_tools/www/results/condor-warnings-graph.php b/nmi_tools/www/results/condor-warnings-graph.php -deleted file mode 100644 -index d6c9adb..0000000 ---- a/nmi_tools/www/results/condor-warnings-graph.php -+++ /dev/null -@@ -1,18 +0,0 @@ -- -diff --git a/nmi_tools/www/results/condor-warnings.php b/nmi_tools/www/results/condor-warnings.php -deleted file mode 100644 -index 3182770..0000000 ---- a/nmi_tools/www/results/condor-warnings.php -+++ /dev/null -@@ -1,81 +0,0 @@ -- -- --Condor Warnings Graph Generator -- --

Condor Warnings Graph Generator

-- -- --

--
-- -- -- -- -- -- -- -- -- -- -- -- --
-- Branch -- -- Platform -- -- Warning Type --
--
-- --
--
-- -- -- -diff --git a/nmi_tools/www/results/condor.css b/nmi_tools/www/results/condor.css -index 75cebdc..c44ecff 100644 ---- a/nmi_tools/www/results/condor.css -+++ b/nmi_tools/www/results/condor.css -@@ -12,6 +12,7 @@ a:link { color: #1C3F75; } - .noresults { - background-color: #aaaaaa; - } -+ - .details { - font-size: 10px; - } -@@ -21,15 +22,22 @@ a:link { color: #1C3F75; } - .title { - color: black; - } --TABLE { -+ -+table { - border-collapse: collapse; - cellspacing: 0; - cellpadding: 0; - border: 1px solid grey; - } --TD { -+td { - border: 1px solid grey; - } -+.sparkheader { -+ font-size: 75%; -+ border-top-style: none; -+ border-bottom-style: none; -+ border-left-style: none; -+} - - - -@@ -62,3 +70,24 @@ span.link a:hover span { - text-align: left; - text-decoration: none; - } -+ -+ -+// Page layout -+#wrap { -+ margin: 0 auto; -+} -+ -+#nav { -+ padding: 10px; -+ width:125px; -+ float:left; -+} -+ -+#main { -+ float:left; -+} -+ -+#footer { -+ clear:both; -+ background: #ffffff; -+} -diff --git a/nmi_tools/www/results/condor.php b/nmi_tools/www/results/condor.php -deleted file mode 100644 -index f456c01..0000000 ---- a/nmi_tools/www/results/condor.php -+++ /dev/null -@@ -1,268 +0,0 @@ -- -- -- --NMI - Condor Latest Build/Test Results -- -- -- -- --

Condor Latest Build/Test Results

-- -- -- -- -- -- -- -- -- -- \n". -- " \n". -- "\n"; -- } -- -- // -------------------------------- -- // BUILDS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending ". -- " FROM Task, Run ". -- " WHERE Run.runid = {$runid} AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' ". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $data["build"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- if (!empty($platforms["failed"])) { -- $data["build"]["failed"]++; -- } elseif (!empty($platforms["pending"])) { -- $data["build"]["pending"]++; -- } elseif (!empty($platforms["passed"])) { -- $data["build"]["passed"]++; -- } -- } // WHILE -- mysql_free_result($result2); -- -- // -------------------------------- -- // TESTS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending ". -- " FROM Task, Run, Method_nmi ". -- " WHERE Method_nmi.input_runid = {$runid} AND ". -- " Run.runid = Method_nmi.runid AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' ". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $data["test"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- if (!empty($platforms["failed"])) { -- $data["test"]["failed"]++; -- $data["test"]["total"]++; -- } elseif (!empty($platforms["pending"])) { -- $data["test"]["pending"]++; -- $data["test"]["total"]++; -- } elseif (!empty($platforms["passed"])) { -- $data["test"]["passed"]++; -- $data["test"]["total"]++; -- } -- } // WHILE -- mysql_free_result($result2); -- -- // -- // HTML Table Row -- // -- $branch_url = sprintf(BRANCH_URL, $branch, $user); -- -- // -- // If there's nothing at all, just skip -- // -- // We only want to do this for one-off builds, if the nightly build -- // completely crapped out on us, we need to show it -- // Andy - 11/30/2006 -- // -- if ($user != CONDOR_USER && !count($data["build"]) && !count($data["test"])) continue; -- -- echo << -- -- -- --EOF; -- -- foreach (Array("build", "test") AS $type) { -- $cur = $data[$type]; -- $status = ($cur["failed"] ? "FAILED" : -- ($cur["pending"] ? "PENDING" : "PASSED")); -- $color = $status; -- -- ## -- ## Check for missing tests -- ## Since we know how many builds have passed and should fire off tests, -- ## we can do a simple check to make sure the total number of tests -- ## is equal to the the number of builds -- ## Andy - 01.09.2007 -- ## -- if ($type == "test") { -- $no_test_cnt = 0; -- if (count($no_test_platforms)) { -- $sql = "SELECT count(DISTINCT platform) AS count ". -- " FROM Run, Task ". -- " WHERE Run.runid = {$runid} AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform IN ('".implode("','", $no_test_platforms)."') "; -- $cnt_result = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $res = mysql_fetch_array($cnt_result); -- $no_test_cnt = $res["count"]; -- } -- $cur["missing"] = $data["build"]["passed"] - $cur["total"] - $no_test_cnt; -- if ($cur["missing"] > 0) $color = "FAILED"; -- elseif ($cur["missing"] < 0) $cur["missing"] = 0; -- } -- -- $detail_url = sprintf(DETAIL_URL, $runid, $type, $user); -- -- // -- // No results -- // -- if (!count($cur)) { -- // -- // If this is a nightly build, we can check whether it failed and -- // give a failure notice. Without this, the box will just be empty -- // and people won't know what really happended -- // -- if (!empty($run_result) && $type == 'build') { -- $status = "FAILED"; -- echo << --
Branch
Click to see branch history
Last buildUserBuild ResultsTest Results
One-off Builds
{$branch}{$start}{$user}
-- -- -- --
$status
-- --EOF; -- // -- // Just display an empty cell -- // -- } else { -- echo " \n"; -- } -- // -- // Show Summary -- // -- } else { -- -- echo << -- -- -- -- --EOF; -- // -- // Show the different status tallies for platforms -- // -- foreach ($result_types AS $key) { -- if ($key == "missing" && empty($cur[$key])) continue; -- if ($key == "missing") { -- $prefix = ""; -- $postfix = ""; -- } else { -- $prefix = $postfix = ""; -- } -- -- echo "\n". -- " \n". -- " \n". -- "\n"; -- } // FOREACH -- echo "
$status
{$prefix}".ucfirst($key)."{$postfix}{$prefix}".(int)$cur[$key]."{$postfix}
\n"; -- } // RESULTS -- } // FOREACH -- -- echo ""; -- $last_user = $user; --} // WHILE --mysql_free_result ($result); -- --echo ""; --echo "
"; -- --mysql_close($db); -- --?> -- -- -diff --git a/nmi_tools/www/results/condor_test_display.php b/nmi_tools/www/results/condor_test_display.php -deleted file mode 100644 -index c592d1f..0000000 ---- a/nmi_tools/www/results/condor_test_display.php -+++ /dev/null -@@ -1,53 +0,0 @@ -- -- -- --Condor test results --

Condor test results

-- -- --
-- Select a tag from the dropdown list

--
"; -- } --?> -- -- --
--

or enter a build tag

-- --
-- -- --
-- -- -- -- -- -diff --git a/nmi_tools/www/results/dashboard.inc b/nmi_tools/www/results/dashboard.inc -new file mode 100644 -index 0000000..eaad929 ---- /dev/null -+++ b/nmi_tools/www/results/dashboard.inc -@@ -0,0 +1,385 @@ -+ type -+ if($type == "crosstest") $type = "test"; -+ -+ $platform_without_prefix = preg_replace("/nmi:/", "", $platform); -+ $output = `/usr/local/condor/bin/condor_q -global -const 'nmi_target_platform=="$platform_without_prefix" && nmi_run_type=="$type"' -format '%-2s ' 'ifThenElse(JobStatus==0,"U",ifThenElse(JobStatus==1,"I",ifThenElse(JobStatus==2,"R",ifThenElse(JobStatus==3,"X",ifThenElse(JobStatus==4,"C",ifThenElse(JobStatus==5,"H",ifThenElse(JobStatus==6,"E",string(JobStatus))))))))' -format "%6d " ClusterId -format " %-14s " Owner -format '%-11s ' 'formatTime(QDate,"%0m/%d %H:%M")' -format '%-11s\n' 'formatTime(EnteredCurrentStatus,"%0m/%d %H:%M")'`; -+ $queue_contents = split("\n", $output); -+ $depth = sizeof($queue_contents) - 1; -+ $has_running_job = 0; -+ if($depth != 0) { -+ $output = "\n"; -+ foreach ($queue_contents as $line) { -+ $items = preg_split("/\s+/", $line); -+ if(sizeof($items) == 7) { -+ $style = "background-color:#FFFFAA; text-decoration:none;"; -+ if($items[0] == "R") { -+ $style = "background-color:#0097C5;"; -+ $has_running_job++; -+ } -+ else { -+ # If the job is not running we don't care about 'EnteredCurrentStatus', -+ # a.k.a. "Start Time" -+ $items[5] = ""; -+ $items[6] = ""; -+ if($items[0] == "H") { -+ $style = "background-color:#A1A1A1;"; -+ } -+ } -+ $output .= "\n"; -+ } -+ } -+ $output .= "
StateIDOwnerSubmittedStarted
$items[0]$items[1]$items[2]$items[3] $items[4]$items[5] $items[6]
\n"; -+ } -+ else { -+ $output = "No jobs in queue"; -+ } -+ -+ $note = ""; -+ if($has_running_job == 0 && $depth != 0) { -+ $note = "*"; -+ $output = "* No job is running!
$output"; -+ } -+ -+ $ret = Array(); -+ $ret[0] = $depth; -+ $ret[1] = "
Q Depth: $depth$note$output"; -+ return $ret; -+} -+ -+function make_sidebar() { -+ echo "\n"; -+} -+ -+ -+function get_results($info, $runid, $user, $run_result) { -+ // We need to get information about the builds, tests, and crosstests for each run -+ $html = ""; // the return information -+ -+ // -------------------------------- -+ // BUILDS -+ // -------------------------------- -+ $sql = "SELECT platform," . -+ " SUM(IF(result != 0, 1, 0)) AS failed," . -+ " SUM(IF(result IS NULL, 1, 0)) AS pending " . -+ " FROM Task ". -+ " WHERE runid = $runid AND ". -+ " platform != 'local' ". -+ " GROUP BY platform "; -+ $result2 = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); -+ $data["build"] = Array(); -+ $data["build"]["totals"] = Array("total" => 0, "failed" => 0, "pending" => 0, "passed" => 0); -+ $data["build"]["platforms"] = Array(); -+ while ($platforms = mysql_fetch_array($result2)) { -+ $data["build"]["totals"]["total"]++; -+ if($platforms["failed"] > 0) { -+ $data["build"]["totals"]["failed"]++; -+ $data["build"]["platforms"][$platforms["platform"]] = "failed"; -+ } -+ elseif($platforms["pending"] > 0) { -+ $data["build"]["totals"]["pending"]++; -+ $data["build"]["platforms"][$platforms["platform"]] = "pending"; -+ } -+ else { -+ $data["build"]["totals"]["passed"]++; -+ $data["build"]["platforms"][$platforms["platform"]] = "passed"; -+ } -+ } -+ mysql_free_result($result2); -+ -+ // -------------------------------- -+ // TESTS -+ // -------------------------------- -+ $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -+ " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -+ " SUM(IF(Task.result IS NULL, 1, 0)) AS pending, ". -+ " Task.platform" . -+ " FROM Task, Run, Method_nmi ". -+ " WHERE Method_nmi.input_runid = $runid AND ". -+ " Run.runid = Method_nmi.runid AND ". -+ " Run.user = '$user' AND ". -+ " Task.runid = Run.runid AND ". -+ " Task.platform != 'local' AND ". -+ " ((Run.project_version = Run.component_version) OR (Run.component_version = 'native' ))". -+ " GROUP BY Task.platform "; -+ $result2 = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); -+ $data["test"] = Array(); -+ $data["test"]["totals"] = Array("total" => 0, "failed" => 0, "pending" => 0, "passed" => 0); -+ $data["test"]["platforms"] = Array(); -+ while ($platforms = mysql_fetch_array($result2)) { -+ $data["test"]["totals"]["total"]++; -+ if($platforms["failed"] > 0) { -+ $data["test"]["totals"]["failed"]++; -+ $data["test"]["platforms"][$platforms["platform"]] = "failed"; -+ } -+ elseif($platforms["pending"] > 0) { -+ $data["test"]["totals"]["pending"]++; -+ $data["test"]["platforms"][$platforms["platform"]] = "pending"; -+ } -+ elseif($platforms["passed"] > 0) { -+ $data["test"]["totals"]["passed"]++; -+ $data["test"]["platforms"][$platforms["platform"]] = "passed"; -+ } -+ } -+ mysql_free_result($result2); -+ -+ // -------------------------------- -+ // CROSS TESTS -+ // -------------------------------- -+ $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -+ " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -+ " SUM(IF(Task.result IS NULL, 1, 0)) AS pending, ". -+ " Task.platform " . -+ " FROM Task, Run, Method_nmi ". -+ " WHERE Method_nmi.input_runid = $runid AND ". -+ " Run.runid = Method_nmi.runid AND ". -+ " Run.user = '$user' AND ". -+ " Task.runid = Run.runid AND ". -+ " Task.platform != 'local' AND ". -+ " project_version != component_version AND ". -+ " component_version != 'native' ". -+ " GROUP BY Task.platform "; -+ $result2 = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); -+ $data["crosstest"] = Array(); -+ $data["crosstest"]["totals"] = Array("total" => 0, "failed" => 0, "pending" => 0, "passed" => 0); -+ $data["crosstest"]["platforms"] = Array(); -+ while ($platforms = mysql_fetch_array($result2)) { -+ $data["crosstest"]["totals"]["total"]++; -+ if($platforms["failed"] > 0) { -+ $data["crosstest"]["totals"]["failed"]++; -+ $data["crosstest"]["platforms"][$platforms["platform"]] = "failed"; -+ } -+ elseif($platforms["pending"] > 0) { -+ $data["crosstest"]["totals"]["pending"]++; -+ $data["crosstest"]["platforms"][$platforms["platform"]] = "pending"; -+ } -+ elseif($platforms["passed"] > 0) { -+ $data["crosstest"]["totals"]["passed"]++; -+ $data["crosstest"]["platforms"][$platforms["platform"]] = "passed"; -+ } -+ } -+ mysql_free_result($result2); -+ -+ // -+ // If there's nothing at all, just skip -+ // -+ // We only want to do this for one-off builds, if the nightly build -+ // completely crapped out on us, we need to show it -+ // Andy - 11/30/2006 -+ // -+ if($user != CONDOR_USER) { -+ if(!count($data["build"]["platforms"]) && !count($data["test"]["platforms"])) { -+ return ""; -+ } -+ } -+ -+ // If this run is pinned we want to display it -+ $findpin="SELECT -+ run_type, -+ runid, -+ user, -+ archived, -+ archive_results_until -+ FROM -+ Run -+ WHERE -+ runid = $runid "; -+ -+ $pincheck = mysql_query($findpin) or die ("Query $findpin failed : " . mysql_error()); -+ while ($pindetails = mysql_fetch_array($pincheck)) { -+ $pin = $pindetails["archive_results_until"]; -+ $archived = $pindetails["archived"]; -+ $info["pin"] = ""; -+ if( !(is_null($pin))) { -+ $info["pin"] = "pin $pin"; -+ } -+ $info["runid"] = "$runid"; -+ -+ if( $archived == '0' ) { -+ $info["runid"] .= "
D "; -+ } -+ } -+ -+ foreach (Array("build", "test", "crosstest") AS $type) { -+ $platforms = $data[$type]["platforms"]; -+ $totals = $data[$type]["totals"]; -+ -+ // Form a status table -+ /* -+ $list = Array(); -+ $list["passed"] = Array(); -+ $list["pending"] = Array(); -+ $list["failed"] = Array(); -+ foreach ($platforms as $platform) { -+ array_push($list[$platforms[$platform]], $platform); -+ } -+ */ -+ -+ if($totals["failed"] > 0) { -+ $status = "FAILED"; -+ $color = "FAILED"; -+ } -+ elseif($totals["pending"] > 0) { -+ $status = "PENDING"; -+ $color = "PENDING"; -+ } -+ elseif($totals["passed"] > 0) { -+ $status = "PASSED"; -+ $color = "PASSED"; -+ } -+ else { -+ $status = "No Results"; -+ $color = "NORESULTS"; -+ } -+ -+ // -+ // Check for missing tests -+ // Since we know how many builds have passed and should fire off tests, -+ // we can do a simple check to make sure the total number of tests -+ // is equal to the the number of builds -+ // Andy - 01.09.2007 -+ // -+ if ($type == "test") { -+ $no_test_cnt = 0; -+ //if (count($no_test_platforms)) { -+ // $sql = "SELECT count(DISTINCT platform) AS count ". -+ // " FROM Run, Task ". -+ // " WHERE Run.runid = $runid AND ". -+ // " Task.runid = Run.runid AND ". -+ // " Task.platform IN ('".implode("','", $no_test_platforms)."') "; -+ // $cnt_result = mysql_query($sql) or die ("Query $sql failed : " . mysql_error()); -+ // $res = mysql_fetch_array($cnt_result); -+ // $no_test_cnt = $res["count"]; -+ //} -+ $totals["missing"] = $data["build"]["totals"]["passed"] - $totals["total"] - $no_test_cnt; -+ if ($totals["missing"] > 0) $color = "FAILED"; -+ elseif ($totals["missing"] < 0) $totals["missing"] = 0; -+ } -+ -+ if($type == "crosstest") { -+ $detail_url = sprintf(CROSS_DETAIL_URL, $runid, $type, $user); -+ } -+ else { -+ $detail_url = sprintf(DETAIL_URL, $runid, $type, $user); -+ } -+ -+ // -+ // No results -+ // -+ if (!count($platforms)) { -+ // -+ // If this is a nightly build, we can check whether it failed and -+ // give a failure notice. Without this, the box will just be empty -+ // and people won't know what really happended -+ // -+ if (!empty($run_result) && $type == 'build') { -+ $status = "FAILED"; -+ $html .= "\n"; -+ $html .= " \n"; -+ $html .= " \n"; -+ $html .= "
$status
\n"; -+ $html .= "\n"; -+ } -+ elseif($type == "test") { -+ $html .= "\n"; -+ $html .= " \n"; -+ $html .= " \n"; -+ $html .= " \n"; -+ $html .= " \n"; -+ $html .= " \n"; -+ $html .= "
None
 
 
 
\n"; -+ $html .= "\n"; -+ -+ } -+ else { -+ $html .= " \n"; -+ } -+ // -+ // Show Summary -+ // -+ } -+ else { -+ $html .= "\n"; -+ $html .= " \n"; -+ $html .= " "; -+ -+ // -+ // Show the different status tallies for platforms -+ // -+ $result_types = Array( "passed", "pending", "failed", "missing" ); -+ foreach ($result_types AS $key) { -+ if ($key == "missing" && empty($totals[$key])) continue; -+ -+ $name_display = ucfirst($key); -+ $num_display = $totals[$key] ? $totals[$key] : 0; -+ if ($key == "missing") { -+ $name_display = "$name_display"; -+ $num_display = "$num_display"; -+ } -+ -+ $html .= "\n"; -+ $html .= " \n"; -+ $html .= " \n"; -+ $html .= "\n"; -+ } -+ $html .= "
$status
$name_display$num_display
\n"; -+ } // RESULTS -+ } // Foreach build/test/crosstest -+ return $html; -+} -+ -+?> -diff --git a/nmi_tools/www/results/find_last.php b/nmi_tools/www/results/find_last.php -deleted file mode 100644 -index c4a17e9..0000000 ---- a/nmi_tools/www/results/find_last.php -+++ /dev/null -@@ -1,24 +0,0 @@ -- -- -- -- --
--

UW NMI "Who broke the build?" query.

--
-- --Click here to see the diffs vs the last successful build.
\n"; --echo "
\n"; --mysql_close($db); --?> -- -- -- -diff --git a/nmi_tools/www/results/index.html b/nmi_tools/www/results/index.html -deleted file mode 100644 -index 3a5277a..0000000 ---- a/nmi_tools/www/results/index.html -+++ /dev/null -@@ -1,21 +0,0 @@ -- -- --NWO Build Page -- -- --
--

NMI Build and Test System

--
-- --

--
Run Results
--

--
UW NMI Home
--

--
--
--

-- -- -- -- -diff --git a/nmi_tools/www/results/last.inc b/nmi_tools/www/results/last.inc -index 469e100..ab9a55c 100644 ---- a/nmi_tools/www/results/last.inc -+++ b/nmi_tools/www/results/last.inc -@@ -103,30 +103,42 @@ function get_queue_for_nmi_platform($platform, $type) { - if($type == "crosstest") $type = "test"; - - $platform_without_prefix = preg_replace("/nmi:/", "", $platform); -- $output = `/usr/local/condor/bin/condor_q -global -const 'nmi_target_platform=="$platform_without_prefix" && nmi_run_type=="$type"' -format '%-2s ' 'ifThenElse(JobStatus==0,"U",ifThenElse(JobStatus==1,"I",ifThenElse(JobStatus==2,"R",ifThenElse(JobStatus==3,"X",ifThenElse(JobStatus==4,"C",ifThenElse(JobStatus==5,"H",ifThenElse(JobStatus==6,"E",string(JobStatus))))))))' -format "%6d " ClusterId -format " %-14s " Owner -format '%-11s\n' 'formatTime(QDate,"%0m/%d %H:%M")'`; -+ $output = `/usr/local/condor/bin/condor_q -global -const 'nmi_target_platform=="$platform_without_prefix" && nmi_run_type=="$type"' -format '%-2s ' 'ifThenElse(JobStatus==0,"U",ifThenElse(JobStatus==1,"I",ifThenElse(JobStatus==2,"R",ifThenElse(JobStatus==3,"X",ifThenElse(JobStatus==4,"C",ifThenElse(JobStatus==5,"H",ifThenElse(JobStatus==6,"E",string(JobStatus))))))))' -format "%6d " ClusterId -format " %-14s " Owner -format '%-11s ' 'formatTime(QDate,"%0m/%d %H:%M")' -format '%-11s\n' 'formatTime(EnteredCurrentStatus,"%0m/%d %H:%M")'`; - $queue_contents = split("\n", $output); - $depth = sizeof($queue_contents) - 1; -- $output = "\n"; -- $has_running_job = 0; -- foreach ($queue_contents as $line) { -- $items = preg_split("/\s+/", $line); -- if(sizeof($items) == 5) { -- $style = "background-color:#FFFFAA; text-decoration:none;"; -- if($items[0] == "R") { -- $style = "background-color:#0097C5;"; -- $has_running_job++; -+ if($depth != 0) { -+ $output = "
StateIDOwnerSubmitted
\n"; -+ $has_running_job = 0; -+ foreach ($queue_contents as $line) { -+ $items = preg_split("/\s+/", $line); -+ if(sizeof($items) == 7) { -+ $style = "background-color:#FFFFAA; text-decoration:none;"; -+ if($items[0] == "R") { -+ $style = "background-color:#0097C5;"; -+ $has_running_job++; -+ } -+ else { -+ # If the job is not running we don't care about 'EnteredCurrentStatus', -+ # a.k.a. "Start Time" -+ $items[5] = ""; -+ $items[6] = ""; -+ if($items[0] == "H") { -+ $style = "background-color:#A1A1A1;"; -+ } -+ } -+ $output .= "\n"; - } -- elseif($items[0] == "H") { -- $style = "background-color:#A1A1A1;"; -- } -- $output .= "\n"; - } -+ $output .= "
StateIDOwnerSubmittedStarted
$items[0]$items[1]$items[2]$items[3] $items[4]$items[5] $items[6]
$items[0]$items[1]$items[2]$items[3] $items[4]
\n"; -+ } -+ else { -+ $output = "No jobs in queue"; - } -- $output .= "\n"; - - $note = ""; -- if($has_running_job == 0) { -+ if($has_running_job == 0 && $depth != 0) { - $note = "*"; -+ $output = "* No job is running!
$output"; - } - - $ret = Array(); -@@ -135,5 +147,14 @@ function get_queue_for_nmi_platform($platform, $type) { - return $ret; - } - --?> -+function make_sidebar() { -+ echo "\n"; -+} -+ -+?> -diff --git a/nmi_tools/www/results/parse-windows-build.pl b/nmi_tools/www/results/parse-windows-build.pl -index 1147de9..dfd795f 100755 ---- a/nmi_tools/www/results/parse-windows-build.pl -+++ b/nmi_tools/www/results/parse-windows-build.pl -@@ -22,31 +22,42 @@ $ARGV[0] =~ s/[|<>]//g; - - open(FILE, '<', $ARGV[0]) or die("Cannot open $ARGV[0]: $!"); - -+my @output; - my @chunk; - my $begin_re = qr/^------ /; - my $end_re = qw/ error\(s\),/; - while() { -- if(/$begin_re/ .. /$end_re/) { -+ if(/\d+\s+succeeded/) { -+ # We want this to print first, so make sure it's at the beginning of @output -+ unshift @output, $_; -+ } -+ elsif(/$begin_re/ .. /$end_re/) { - push @chunk, $_; - - if(/$end_re/) { - if(/\s0\s+error\(s\),/) { - if(/,\s+0\s+warning/) { -- print $_; -+ # TJ requested that we do not print this line. So for now, do nothing -+ # print $_; - } - else { - $_ =~ s/,\s+(\d+\s+warning\(s\))/, $1<\/font>/; -- print $_; -+ push @output, $_; - } - } - else { - pop @chunk; -- print @chunk; -+ -+ my @tmp = map { s/(error \S+)/$1<\/font>/; $_ } grep / (error|warning) (C|LNK|PRJ)\d+/, @chunk; -+ push @output, @tmp; -+ - - $_ =~ s/\s(\d+\s+error\(s\))/ $1<\/font>/; -- print $_; -+ push @output, $_; - } - @chunk = (); - } - } - } -+ -+print @output; -diff --git a/nmi_tools/www/results/test.php b/nmi_tools/www/results/test.php -deleted file mode 100644 -index 2b4d60c..0000000 ---- a/nmi_tools/www/results/test.php -+++ /dev/null -@@ -1,348 +0,0 @@ -- -- -- --NMI - Condor Latest Build/Test Results -- -- -- -- --

Condor Latest Build/Test Results

-- -- -- -- -- -- -- -- -- -- -- --\n". -- " \n". -- "\n"; -- } -- -- echo "\n"; -- echo <<$runid - $used --EOF; -- // -------------------------------- -- // BUILDS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending ". -- " FROM Task, Run ". -- " WHERE Run.runid = {$runid} AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' ". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $data["build"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- if (!empty($platforms["failed"])) { -- $data["build"]["failed"]++; -- } elseif (!empty($platforms["pending"])) { -- $data["build"]["pending"]++; -- } elseif (!empty($platforms["passed"])) { -- $data["build"]["passed"]++; -- } -- } // WHILE -- mysql_free_result($result2); -- -- // -------------------------------- -- // TESTS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending ". -- " FROM Task, Run, Method_nmi ". -- " WHERE Method_nmi.input_runid = {$runid} AND ". -- " Run.runid = Method_nmi.runid AND ". -- " Run.user = '$user' AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' AND ". -- " ((Run.project_version = Run.component_version) OR (Run.component_version = 'native' ))". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $data["test"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- if (!empty($platforms["failed"])) { -- $data["test"]["failed"]++; -- $data["test"]["total"]++; -- } elseif (!empty($platforms["pending"])) { -- $data["test"]["pending"]++; -- $data["test"]["total"]++; -- } elseif (!empty($platforms["passed"])) { -- $data["test"]["passed"]++; -- $data["test"]["total"]++; -- } -- } // WHILE -- mysql_free_result($result2); -- -- // -------------------------------- -- // CROSS TESTS -- // -------------------------------- -- $sql = "SELECT SUM(IF(Task.result = 0, 1, 0)) AS passed, ". -- " SUM(IF(Task.result != 0, 1, 0)) AS failed, ". -- " SUM(IF(Task.result IS NULL, 1, 0)) AS pending ". -- " FROM Task, Run, Method_nmi ". -- " WHERE Method_nmi.input_runid = {$runid} AND ". -- " Run.runid = Method_nmi.runid AND ". -- " Run.user = '$user' AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform != 'local' AND ". -- " project_version != component_version AND ". -- " component_version != 'native' ". -- " GROUP BY Task.platform "; -- $result2 = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $data["crosstest"] = Array(); -- while ($platforms = mysql_fetch_array($result2)) { -- if (!empty($platforms["failed"])) { -- $data["crosstest"]["failed"]++; -- $data["crosstest"]["total"]++; -- } elseif (!empty($platforms["pending"])) { -- $data["crosstest"]["pending"]++; -- $data["crosstest"]["total"]++; -- } elseif (!empty($platforms["passed"])) { -- $data["crosstest"]["passed"]++; -- $data["crosstest"]["total"]++; -- } -- } // WHILE -- mysql_free_result($result2); -- -- // -- // HTML Table Row -- // -- $branch_url = sprintf(BRANCH_URL, $branch, $user); -- -- // -- // If there's nothing at all, just skip -- // -- // We only want to do this for one-off builds, if the nightly build -- // completely crapped out on us, we need to show it -- // Andy - 11/30/2006 -- // -- if ($user != CONDOR_USER && !count($data["build"]) && !count($data["test"])) continue; -- -- // Is this top level run pinned or not(probably not but could be one of a kind) -- -- $findpin=" -- SELECT -- run_type, -- runid, -- user, -- archived, -- archive_results_until -- FROM -- Run -- WHERE -- runid = $runid "; -- -- $pincheck = mysql_query($findpin) -- or die ("Query {$findpin} failed : " . mysql_error()); -- while ($pindetails = mysql_fetch_array($pincheck)) { -- $pin = $pindetails["archive_results_until"]; -- $archived = $pindetails["archived"]; -- if( !(is_null($pin))) { -- $pinstr = "pin ". "$pin"; -- } else { -- $pinstr = ""; -- } -- if( $archived == '0' ) { -- $archivedstr = "$runid". "
D "; -- } else { -- $archivedstr = "$runid"; -- } -- } -- -- echo << --
-- -- -- --EOF; -- -- foreach (Array("build", "test", "crosstest") AS $type) { -- $cur = $data[$type]; -- $status = ($cur["failed"] ? "FAILED" : -- ($cur["pending"] ? "PENDING" : "PASSED")); -- $color = $status; -- -- ## -- ## Check for missing tests -- ## Since we know how many builds have passed and should fire off tests, -- ## we can do a simple check to make sure the total number of tests -- ## is equal to the the number of builds -- ## Andy - 01.09.2007 -- ## -- if ($type == "test") { -- $no_test_cnt = 0; -- if (count($no_test_platforms)) { -- $sql = "SELECT count(DISTINCT platform) AS count ". -- " FROM Run, Task ". -- " WHERE Run.runid = {$runid} AND ". -- " Task.runid = Run.runid AND ". -- " Task.platform IN ('".implode("','", $no_test_platforms)."') "; -- $cnt_result = mysql_query($sql) -- or die ("Query {$sql} failed : " . mysql_error()); -- $res = mysql_fetch_array($cnt_result); -- $no_test_cnt = $res["count"]; -- } -- $cur["missing"] = $data["build"]["passed"] - $cur["total"] - $no_test_cnt; -- if ($cur["missing"] > 0) $color = "FAILED"; -- elseif ($cur["missing"] < 0) $cur["missing"] = 0; -- } -- -- if($type == "crosstest") { -- $detail_url = sprintf(CROSS_DETAIL_URL, $runid, $type, $user); -- } else { -- $detail_url = sprintf(DETAIL_URL, $runid, $type, $user); -- } -- -- // -- // No results -- // -- if (!count($cur)) { -- // -- // If this is a nightly build, we can check whether it failed and -- // give a failure notice. Without this, the box will just be empty -- // and people won't know what really happended -- // -- if (!empty($run_result) && $type == 'build') { -- $status = "FAILED"; -- echo << --
Branch
Click to see branch history
RunidLast buildUserBuild ResultsTest ResultsCross Test Results
One-off Builds
{$branch}
$pinstr
{$archivedstr}{$start}{$user}
-- -- -- --
$status
-- --EOF; -- // -- // Just display an empty cell -- // -- } else { -- echo " \n"; -- } -- // -- // Show Summary -- // -- } else { -- -- echo << -- -- -- -- --EOF; -- // -- // Show the different status tallies for platforms -- // -- foreach ($result_types AS $key) { -- if ($key == "missing" && empty($cur[$key])) continue; -- if ($key == "missing") { -- $prefix = ""; -- $postfix = ""; -- } else { -- $prefix = $postfix = ""; -- } -- -- echo "\n". -- " \n". -- " \n". -- "\n"; -- } // FOREACH -- echo "
$status
{$prefix}".ucfirst($key)."{$postfix}{$prefix}".(int)$cur[$key]."{$postfix}
\n"; -- } // RESULTS -- } // FOREACH -- -- echo ""; -- $last_user = $user; --} // WHILE --mysql_free_result ($result); -- --echo ""; --echo "
"; -- --mysql_close($db); -- --?> -- -- -diff --git a/src/.deprecate_classad.old/CMakeLists.txt b/src/.deprecate_classad.old/CMakeLists.txt -deleted file mode 100644 -index 3c1adda..0000000 ---- a/src/.deprecate_classad.old/CMakeLists.txt -+++ /dev/null -@@ -1,29 +0,0 @@ -- ############################################################### -- # -- # Copyright 2011 Red Hat, Inc. -- # -- # Licensed under the Apache License, Version 2.0 (the "License"); you -- # may not use this file except in compliance with the License. You may -- # obtain a copy of the License at -- # -- # http://www.apache.org/licenses/LICENSE-2.0 -- # -- # Unless required by applicable law or agreed to in writing, software -- # distributed under the License is distributed on an "AS IS" BASIS, -- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- # See the License for the specific language governing permissions and -- # limitations under the License. -- # -- ############################################################### -- -- --if (WANT_OLD_CLASSADS) -- file( GLOB ClassAdsOldRmvSrcs classad_lookup* *test*) -- -- condor_glob( ClassAdsOldHdrs ClassAdsOldSrcs "${ClassAdsOldRmvSrcs}" ) -- -- #create the library -- condor_static_lib( classad.old "${ClassAdsOldHdrs};${ClassAdsOldSrcs}" ) --else() -- message(STATUS "NOTE: skipping classads.old") --endif() -diff --git a/src/.deprecate_classad.old/YourString.h b/src/.deprecate_classad.old/YourString.h -deleted file mode 100644 -index ec4ece6..0000000 ---- a/src/.deprecate_classad.old/YourString.h -+++ /dev/null -@@ -1,38 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#ifndef YOUR_STRING_H --#define YOUR_STRING_H -- --// This is a simple wrapper class to enable char *'s --// that we don't manage to be put into HashTables -- --// HashTable needs operator==, which we define to be --// case-insensitive for ClassAds -- --class YourString { -- public: -- YourString() : s(0) {} -- YourString(const char *str) : s(str) {} -- bool operator==(const YourString &rhs) { -- return (strcasecmp(s,rhs.s) == 0); -- } -- const char *s; // Someone else owns this --}; --#endif -diff --git a/src/.deprecate_classad.old/ast.cpp b/src/.deprecate_classad.old/ast.cpp -deleted file mode 100644 -index bddc1e3..0000000 ---- a/src/.deprecate_classad.old/ast.cpp -+++ /dev/null -@@ -1,3441 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2010, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --//****************************************************************************** --// ast.cpp --// --// Implementation of the AST module with an interface to the AttrList module. --// --//****************************************************************************** -- --#include "condor_common.h" --#include "condor_exprtype.h" --#include "condor_ast.h" --#include "condor_classad.h" --#include "condor_buildtable.h" --#include "condor_string.h" -- --#include "Regex.h" -- --// gcc doesn't seem to define FLT_MIN on OpenSolaris 2009.06 --#if !defined(FLT_MIN) && defined(__FLT_MIN__) -- #define FLT_MIN __FLT_MIN__ --#endif --#if !defined(FLT_MAX) && defined(__FLT_MAX__) -- #define FLT_MAX __FLT_MAX__ --#endif -- --extern char * format_time(int); --extern void evalFromEnvironment (const char *, EvalResult *); --static bool name_in_list(const char *name, StringList &references); --static void printComparisonOpToStr (char *, ExprTree *, ExprTree *, char *); --static int calculate_math_op_length(ExprTree *lArg, ExprTree *rArg, int op_length); --static void dprintResult(ExprTree *tree, EvalResult *result); -- --bool classad_debug_function_run = 0; -- --#define EatSpace(ptr) while(*ptr != '\0') ptr++; -- --int EvalExprTree( ExprTree *expr, const AttrList *source, const AttrList *target, -- EvalResult *result ) --{ -- return expr->EvalTree( source, target, result ); --} -- --const char *ExprTreeToString( ExprTree *expr ) { -- static MyString value; -- if ( expr == NULL ) { -- return NULL; -- } -- expr->PrintToStr( value ); -- return value.Value(); --} -- --// EvalResult ctor --EvalResult::EvalResult() --{ -- type = LX_UNDEFINED; -- debug = false; --} -- --// EvalResult dtor --EvalResult::~EvalResult() --{ -- if ((type == LX_STRING || type == LX_TIME) && (s)) { -- delete [] s; -- } --} -- --void --EvalResult::deepcopy(const EvalResult & rhs) --{ -- type = rhs.type; -- debug = rhs.debug; -- switch ( type ) { -- case LX_INTEGER: -- case LX_BOOL: -- i = rhs.i; -- break; -- case LX_FLOAT: -- f = rhs.f; -- break; -- case LX_STRING: -- // need to make a deep copy of the string -- s = strnewp( rhs.s ); -- break; -- default: -- break; -- } --} -- --// EvalResult copy ctor --EvalResult::EvalResult(const EvalResult & rhs) --{ -- deepcopy(rhs); --} -- --// EvalResult assignment op --EvalResult & EvalResult::operator=(const EvalResult & rhs) --{ -- if ( this == &rhs ) { // object assigned to itself -- return *this; // all done. -- } -- -- // deallocate any state in this object by invoking dtor -- this->~EvalResult(); -- -- // call copy ctor to make a deep copy of data -- deepcopy(rhs); -- -- // return reference to invoking object -- return *this; --} -- -- --void EvalResult::fPrintResult(FILE *fi) --{ -- switch(type) -- { -- case LX_INTEGER : -- -- fprintf(fi, "%d", this->i); -- break; -- -- case LX_FLOAT : -- -- fprintf(fi, "%f", this->f); -- break; -- -- case LX_STRING : -- -- fprintf(fi, "%s", this->s); -- break; -- -- case LX_NULL : -- -- fprintf(fi, "NULL"); -- break; -- -- case LX_UNDEFINED : -- -- fprintf(fi, "UNDEFINED"); -- break; -- -- case LX_ERROR : -- -- fprintf(fi, "ERROR"); -- break; -- -- default : -- -- fprintf(fi, "type unknown"); -- break; -- } -- fprintf(fi, "\n"); --} -- --//////////////////////////////////////////////////////////////////////////////// --// Expression tree node constructors. --//////////////////////////////////////////////////////////////////////////////// -- --//////////////////////////////////////////////////////////////////////////////// --// ">" operator. --//////////////////////////////////////////////////////////////////////////////// -- --int Integer::operator >(ExprTree& tree) --{ -- EvalResult tmpResult; -- -- tree.EvalTree((AttrList*)NULL, &tmpResult); -- if(tmpResult.type == LX_INTEGER) -- { -- return value > tmpResult.i; -- } -- else if(tmpResult.type == LX_FLOAT) -- { -- return value > tmpResult.f; -- } -- return FALSE; --} -- --int Float::operator >(ExprTree& tree) --{ -- EvalResult tmpResult; -- -- tree.EvalTree((AttrList*)NULL, &tmpResult); -- if(tmpResult.type == LX_INTEGER) -- { -- return value > tmpResult.i; -- } -- else if(tmpResult.type == LX_FLOAT) -- { -- return value > tmpResult.f; -- } -- return FALSE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// ">=" operator. --//////////////////////////////////////////////////////////////////////////////// -- --int Integer::operator >=(ExprTree& tree) --{ -- EvalResult tmpResult; -- -- tree.EvalTree((AttrList*)NULL, &tmpResult); -- if(tmpResult.type == LX_INTEGER) -- { -- return value >= tmpResult.i; -- } -- else if(tmpResult.type == LX_FLOAT) -- { -- return value >= tmpResult.f; -- } -- return FALSE; --} -- --int Float::operator >=(ExprTree& tree) --{ -- EvalResult tmpResult; -- -- tree.EvalTree((AttrList*)NULL, &tmpResult); -- if(tmpResult.type == LX_INTEGER) -- { -- return value >= tmpResult.i; -- } -- else if(tmpResult.type == LX_FLOAT) -- { -- return value >= tmpResult.f; -- } -- return FALSE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// "<" operator. --//////////////////////////////////////////////////////////////////////////////// -- --int Integer::operator <(ExprTree& tree) --{ -- EvalResult tmpResult; -- -- tree.EvalTree((AttrList*)NULL, &tmpResult); -- if(tmpResult.type == LX_INTEGER) -- { -- return value < tmpResult.i; -- } -- else if(tmpResult.type == LX_FLOAT) -- { -- return value < tmpResult.f; -- } -- return FALSE; --} -- --int Float::operator <(ExprTree& tree) --{ -- EvalResult tmpResult; -- -- tree.EvalTree((AttrList*)NULL, &tmpResult); -- if(tmpResult.type == LX_INTEGER) -- { -- return value < tmpResult.i; -- } -- else if(tmpResult.type == LX_FLOAT) -- { -- return value < tmpResult.f; -- } -- return FALSE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// "<=" operator. --//////////////////////////////////////////////////////////////////////////////// -- --int Integer::operator <=(ExprTree& tree) --{ -- EvalResult tmpResult; -- -- tree.EvalTree((AttrList*)NULL, &tmpResult); -- if(tmpResult.type == LX_INTEGER) -- { -- return value <= tmpResult.i; -- } -- else if(tmpResult.type == LX_FLOAT) -- { -- return value <= tmpResult.f; -- } -- return FALSE; --} -- --int Float::operator <=(ExprTree& tree) --{ -- EvalResult tmpResult; -- -- tree.EvalTree((AttrList*)NULL, &tmpResult); -- if(tmpResult.type == LX_INTEGER) -- { -- return value <= tmpResult.i; -- } -- else if(tmpResult.type == LX_FLOAT) -- { -- return value <= tmpResult.f; -- } -- return FALSE; -- } -- -- --//////////////////////////////////////////////////////////////////////////////// --// Two overloaded evaluation functions. One take a AttrList, one takes a --// AttrList list. --//////////////////////////////////////////////////////////////////////////////// -- --//------tw 11/16/95 --// add one more overloaded evaluation function, it takes two AttrLists, --// one AttrList for "MY." variable valuation and the other AttrList for "TARGET." variable --// evaluation. --//---------- -- --int ExprTree::EvalTree(const AttrList* l, EvalResult* r) --{ -- return EvalTree(l, NULL, r); --} -- --int ExprTree::EvalTree(const AttrList* l1, const AttrList* l2, EvalResult* r) --{ -- int rval; -- -- if (evalFlag) { -- // circular evaluation -- evalFlag = false; -- r->type = LX_ERROR; -- return FALSE; -- } -- -- // set evalFlag, evaluate, clear evalFlag -- evalFlag = true; -- rval = _EvalTree(l1, l2, r); -- evalFlag = false; -- -- return rval; --} -- --int Variable::_EvalTree(const AttrList* classad, EvalResult* val) --{ -- ExprTree* tmp = NULL; -- -- if(!val || !classad) -- { -- return FALSE; -- } -- -- if(!(tmp = classad->LookupExpr(name))) -- { -- val->type = LX_UNDEFINED; -- dprintResult(this, val); -- return TRUE; -- } -- -- int result = tmp->EvalTree(classad, val); -- dprintResult(this, val); -- -- return result; --} -- --int Variable::_EvalTree( const AttrList* my_classad, const AttrList* target_classad, EvalResult* val) --{ -- return _EvalTreeRecursive( name, my_classad, target_classad, val, false ); --} -- --/* --Split a variable name into scope.target --If there is no scope, evaluate it simply. --Otherwise, identify the ClassAd corresponding to the scope, and re-evaluate. --*/ -- --int Variable::_EvalTreeRecursive( const char *adName, const AttrList* my_classad, const AttrList* target_classad, EvalResult* val, bool restrict_search) --{ -- if( !val || !adName ) return FALSE; -- -- MyString n(adName); -- MyString prefix; -- MyString rest; -- -- int dotPos = n.FindChar('.'); -- -- if (dotPos == -1) { -- // no dots in name -- rest = n; -- } else { -- prefix = n.Substr(0, dotPos - 1); -- rest = n.Substr(dotPos + 1, n.Length()); -- } -- -- if(prefix.Length() > 0) { -- // Note that we use restrict_search=true instead of simply -- // passing NULL for the other ClassAd. This is because we might -- // still need to refer to the other ClassAd. For example, evaluating -- // A in ClassAd 1 should give 3 -- // ClassAd 1: A = TARGET.B; C = 3 -- // ClassAd 2: B = TARGET.C -- if(!strcasecmp(prefix.Value(),"MY") ) { -- return _EvalTreeRecursive(rest.Value(),my_classad,target_classad,val, true); -- } else if(!strcasecmp(prefix.Value(),"TARGET")) { -- return _EvalTreeRecursive(rest.Value(),target_classad,my_classad,val, true); -- } -- } else { -- return this->_EvalTreeSimple(rest.Value(),my_classad,target_classad,val, restrict_search); -- } -- -- val->type = LX_UNDEFINED; -- return TRUE; --} -- --/* --Once it has been reduced to a simple name, resolve the variable by --looking it up first in MY, then TARGET, and finally, the environment. --*/ -- --int Variable::_EvalTreeSimple( const char *adName, const AttrList *my_classad, const AttrList *target_classad, EvalResult *val, bool restrict_search ) --{ -- ExprTree *tmp; -- -- if(my_classad) -- { -- tmp = my_classad->LookupExpr(adName); -- if(tmp) { -- int result = tmp->EvalTree(my_classad, target_classad, val); -- dprintResult(this, val); -- return result; -- } -- } -- -- if(!restrict_search && target_classad) -- { -- tmp = target_classad->LookupExpr(adName); -- if(tmp) { -- int result = tmp->EvalTree(target_classad, my_classad, val); -- dprintResult(this, val); -- return result; -- } -- } -- -- evalFromEnvironment(adName,val); -- dprintResult(this, val); -- return TRUE; --} -- --int Integer::_EvalTree(const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_INTEGER; -- if(unit == 'k') -- { -- val->i = value / 1024; -- } -- else -- { -- val->i = value; -- } -- -- return TRUE; --} -- --//-------tw------------- --int Integer::_EvalTree(const AttrList*, const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_INTEGER; -- if(unit == 'k') -- { -- val->i = value / 1024; -- } -- else -- { -- val->i = value; -- } -- -- return TRUE; --} -- --//-------------------- --int Float::_EvalTree(const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_FLOAT; -- if(unit == 'k') -- { -- val->f = value / 1024; -- } -- else -- { -- val->f = value; -- } -- -- return TRUE; --} -- -- --//-------tw------------- --int Float::_EvalTree(const AttrList*, const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_FLOAT; -- if(unit == 'k') -- { -- val->f = value / 1024; -- } -- else -- { -- val->f = value; -- } -- -- return TRUE; --} -- --//-------------------------------- --int String::_EvalTree(const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_STRING; -- val->s = new char[strlen(value) + 1]; -- strcpy(val->s, value); -- return TRUE; --} -- --int ISOTime::_EvalTree(const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_TIME; -- val->s = new char[strlen(time) + 1]; -- strcpy(val->s, time); -- return TRUE; --} -- --//-------tw----------------------------- -- --int String::_EvalTree(const AttrList*, const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_STRING; -- val->s = new char[strlen(value) + 1]; -- strcpy(val->s, value); -- return TRUE; --} -- --int ISOTime::_EvalTree(const AttrList*, const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_TIME; -- val->s = new char[strlen(time) + 1]; -- strcpy(val->s, time); -- return TRUE; --} -- --//----------------------------------- --int ClassadBoolean::_EvalTree(const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_INTEGER; -- val->i = value; -- return TRUE; --} -- -- --//-----------tw------------------------ -- --int ClassadBoolean::_EvalTree(const AttrList*, const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_INTEGER; -- val->i = value; -- return TRUE; --} -- --//----------------------------------- -- -- --int Undefined::_EvalTree(const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_UNDEFINED; -- return TRUE; --} -- --//------------tw------------------- --int Undefined::_EvalTree(const AttrList*, const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_UNDEFINED; -- return TRUE; --} --//-------------------------------- -- --int Error::_EvalTree(const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_ERROR; -- return TRUE; --} -- --//------------tw------------------- --int Error::_EvalTree(const AttrList*, const AttrList*, EvalResult* val) --{ -- if(!val) -- { -- return FALSE; -- } -- val->type = LX_ERROR; -- return TRUE; --} --//-------------------------------- -- --void ExprTree::GetReferences(const AttrList * /* base_attlrist */, -- StringList & /* internal_references */, -- StringList & /* external_references */) const --{ -- return; --} -- --void BinaryOpBase::GetReferences(const AttrList *base_attrlist, -- StringList &internal_references, -- StringList &external_references) const --{ -- if (lArg != NULL) { -- lArg->GetReferences(base_attrlist, internal_references, external_references); -- } -- if (rArg != NULL) { -- rArg->GetReferences(base_attrlist, internal_references, external_references); -- } -- return; --} -- --void AssignOpBase::GetReferences(const AttrList *base_attrlist, -- StringList &internal_references, -- StringList &external_references) const --{ -- // We don't look at the left argument, because we know that -- // we won't want to add it to the internal or external references. -- if (rArg != NULL) { -- rArg->GetReferences(base_attrlist, internal_references, external_references); -- } -- return; --} -- --void VariableBase::GetReferences(const AttrList *base_attrlist, -- StringList &internal_references, -- StringList &external_references) const --{ -- bool is_external_reference; // otherwise, internal -- char *simplified_name; -- -- is_external_reference = base_attrlist->IsExternalReference(name, -- &simplified_name); -- if (is_external_reference) { -- if (!name_in_list(simplified_name, external_references)) { -- external_references.append(simplified_name); -- } -- } -- else { -- if (!name_in_list(simplified_name, internal_references)) { -- internal_references.append(simplified_name); -- } -- } -- // We added simplified_name to the list, but it was copied -- // when we did the append, so we need to free it now. -- free(simplified_name); -- -- return; --} -- --static bool name_in_list(const char *name, StringList &references) --{ -- return ( references.contains_anycase(name) ? true : false ); --} -- --// Calculate how many bytes an expression will print to --int Variable::CalcPrintToStr(void) --{ -- return strlen(name); --} -- --int Integer::CalcPrintToStr(void) --{ -- int length; -- char printed_representation[256]; -- printed_representation[0] = 0; -- PrintToStr(printed_representation); -- length = strlen(printed_representation); -- return length; --} -- --int Float::CalcPrintToStr(void) --{ -- int length; -- char printed_representation[256]; -- printed_representation[0] = 0; -- PrintToStr(printed_representation); -- length = strlen(printed_representation); -- return length; --} -- --int String::CalcPrintToStr(void) --{ -- int length; -- char *p; -- length = 0; -- -- // Unfortunately, we have to walk the string to find the length. -- // This is because it contain quote marks -- for (p = value; p && *p != 0; p++) { -- if (*p == '"') { -- length += 2; -- } else { -- length++; -- } -- } -- // Then we have to add 2, for the opening and closing quote marks. -- return length + 2; --} -- --int ISOTime::CalcPrintToStr(void) --{ -- // Add 2, for the opening and closing quote (') marks. -- return strlen(time) + 2; --} -- --int ClassadBoolean::CalcPrintToStr(void) --{ -- int length; -- char printed_representation[256]; -- printed_representation[0] = 0; -- PrintToStr(printed_representation); -- length = strlen(printed_representation); -- return length; --} -- --int Error::CalcPrintToStr(void) --{ -- int length; -- char printed_representation[256]; -- printed_representation[0] = 0; -- PrintToStr(printed_representation); -- length = strlen(printed_representation); -- return length; --} -- --int Undefined::CalcPrintToStr(void) --{ -- int length; -- char printed_representation[256]; -- printed_representation[0] = 0; -- PrintToStr(printed_representation); -- length = strlen(printed_representation); -- return length; --} -- --int AddOp::CalcPrintToStr(void) --{ -- int length; -- -- if (lArg == NULL) { -- length = 1 // Left parenthesis -- + rArg->CalcPrintToStr() // Parenthesized expressions -- + 1; // Right parenthesis -- } -- else { -- length = lArg->CalcPrintToStr() // Left subexpression -- + 3 // for " + " -- + rArg->CalcPrintToStr(); // Right subexpression -- if (unit == 'k') { -- length += 2; // for " k" -- } -- } -- -- return length; --} -- --int SubOp::CalcPrintToStr(void) --{ -- int length; -- -- length = calculate_math_op_length(lArg, rArg, 3); -- -- if (unit == 'k') { -- length += 2; // for " k" -- } -- -- return length; --} -- --int MultOp::CalcPrintToStr(void) --{ -- int length; -- -- length = calculate_math_op_length(lArg, rArg, 3); -- -- if (unit == 'k') { -- length += 2; // for " k" -- } -- -- return length; --} -- -- --int DivOp::CalcPrintToStr(void) --{ -- int length; -- -- length = calculate_math_op_length(lArg, rArg, 3); -- -- if (unit == 'k') { -- length += 2; // for " k" -- } -- -- return length; --} -- --/// ---------------- --int MetaEqOp::CalcPrintToStr(void) --{ -- // 5 for " =?= " -- return calculate_math_op_length(lArg, rArg, 5); --} -- --int MetaNeqOp::CalcPrintToStr(void) --{ -- // 5 for " =!= " -- return calculate_math_op_length(lArg, rArg, 5); --} -- --int EqOp::CalcPrintToStr(void) --{ -- // 4 for " == " -- return calculate_math_op_length(lArg, rArg, 4); --} -- --int NeqOp::CalcPrintToStr(void) --{ -- // 4 for " != " -- return calculate_math_op_length(lArg, rArg, 4); --} -- --int GtOp::CalcPrintToStr(void) --{ -- // 3 for " > " -- return calculate_math_op_length(lArg, rArg, 3); --} -- --int GeOp::CalcPrintToStr(void) --{ -- // 4 for " >= " -- return calculate_math_op_length(lArg, rArg, 4); --} -- --int LtOp::CalcPrintToStr(void) --{ -- // 3 for " < " -- return calculate_math_op_length(lArg, rArg, 3); --} -- --int LeOp::CalcPrintToStr(void) --{ -- // 4 for " <= " -- return calculate_math_op_length(lArg, rArg, 4); --} -- --int AndOp::CalcPrintToStr(void) --{ -- // 4 for " && " -- return calculate_math_op_length(lArg, rArg, 4); --} -- --int OrOp::CalcPrintToStr(void) --{ -- // 4 for " || " -- return calculate_math_op_length(lArg, rArg, 4); --} -- --int AssignOp::CalcPrintToStr(void) --{ -- // 3 for " = " -- return calculate_math_op_length(lArg, rArg, 3); --} -- --/// ----------------- -- --//////////////////////////////////////////////////////////////////////////////// --// Print an Expression to a string. // --//////////////////////////////////////////////////////////////////////////////// -- --void Variable::PrintToStr(char* str) --{ -- strcat(str, name); --} -- --void Integer::PrintToStr(char* str) --{ -- sprintf(str+strlen(str), "%d", value); -- if(unit == 'k') -- strcat(str, " k"); --} -- --void Float::PrintToStr(char* str) --{ -- sprintf(str+strlen(str), "%f", value); -- if(unit == 'k') -- strcat(str, " k"); --} -- --void String::PrintToStr(char* str) --{ -- char* ptr1 = value; -- char* ptr2 = str; -- -- while(*ptr2 != '\0') ptr2++; -- *ptr2 = '"'; -- ptr2++; -- while( ptr1 && *ptr1 != '\0') -- { -- if(*ptr1 == '"') -- { -- *ptr2 = '\\'; -- ptr2++; -- } -- *ptr2 = *ptr1; -- ptr1++; -- ptr2++; -- } -- *ptr2 = '"'; -- *(ptr2 + 1) = '\0'; --} -- --void ISOTime::PrintToStr(char* str) --{ -- char* ptr1 = time; -- char* ptr2 = str; -- -- while(*ptr2 != '\0') ptr2++; -- *ptr2 = '\''; -- ptr2++; -- while(*ptr1 != '\0') -- { -- *ptr2 = *ptr1; -- ptr1++; -- ptr2++; -- } -- *ptr2 = '\''; -- *(ptr2 + 1) = '\0'; --} -- --void ClassadBoolean::PrintToStr(char* str) --{ -- if( value ) -- strcat( str, "TRUE" ); -- else -- strcat( str, "FALSE" ); --} -- --void Undefined::PrintToStr(char* str) --{ -- strcat( str, "UNDEFINED" ); --} -- --void Error::PrintToStr(char* str) --{ -- strcat( str, "ERROR" ); --} -- --void AddOp::PrintToStr(char* str) --{ -- if( !lArg ) { -- // HACK!! No lArg implies user-directed parenthesization -- strcat( str, "(" ); -- ((ExprTree*)rArg)->PrintToStr( str ); -- strcat( str, ")" ); -- return; -- } -- -- // lArg available --- regular addition operation -- ((ExprTree*)lArg)->PrintToStr(str); -- strcat(str, " + "); -- ((ExprTree*)rArg)->PrintToStr(str); -- if(unit == 'k') strcat(str, " k"); --} -- --void SubOp::PrintToStr(char* str) --{ -- if(lArg) { -- ((ExprTree*)lArg)->PrintToStr(str); -- } -- strcat(str, " - "); -- if(rArg) { -- ((ExprTree*)rArg)->PrintToStr(str); -- } -- if(unit == 'k') strcat(str, " k"); --} -- -- --void MultOp::PrintToStr(char* str) --{ -- if(lArg) { -- ((ExprTree*)lArg)->PrintToStr(str); -- } -- strcat(str, " * "); -- if(rArg) { -- ((ExprTree*)rArg)->PrintToStr(str); -- } -- if(unit == 'k') strcat(str, " k"); --} -- --void DivOp::PrintToStr(char* str) --{ -- if(lArg) { -- ((ExprTree*)lArg)->PrintToStr(str); -- } -- strcat(str, " / "); -- if(rArg) { -- ((ExprTree*)rArg)->PrintToStr(str); -- } -- if(unit == 'k') strcat(str, " k"); --} -- --void MetaEqOp::PrintToStr(char* str) --{ -- printComparisonOpToStr (str, lArg, rArg, " =?= "); --} -- --void MetaNeqOp::PrintToStr(char* str) --{ -- printComparisonOpToStr (str, lArg, rArg, " =!= "); --} -- --void EqOp::PrintToStr(char* str) --{ -- printComparisonOpToStr (str, lArg, rArg, " == "); --} -- --void NeqOp::PrintToStr(char* str) --{ -- printComparisonOpToStr (str, lArg, rArg, " != "); --} -- --void GtOp::PrintToStr(char* str) --{ -- printComparisonOpToStr (str, lArg, rArg, " > "); --} -- --void GeOp::PrintToStr(char* str) --{ -- printComparisonOpToStr (str, lArg, rArg, " >= "); --} -- --void LtOp::PrintToStr(char* str) --{ -- printComparisonOpToStr (str, lArg, rArg, " < "); --} -- --void LeOp::PrintToStr(char* str) --{ -- printComparisonOpToStr (str, lArg, rArg, " <= "); --} -- --void AndOp::PrintToStr(char* str) --{ -- if(lArg) { -- ((ExprTree*)lArg)->PrintToStr(str); -- } -- strcat(str, " && "); -- if(rArg) { -- ((ExprTree*)rArg)->PrintToStr(str); -- } --} -- --void OrOp::PrintToStr(char* str) --{ -- if( lArg )((ExprTree*)lArg)->PrintToStr(str); -- strcat(str, " || "); -- if(rArg) ((ExprTree*)rArg)->PrintToStr(str); --} -- --void AssignOp::PrintToStr(char* str) --{ -- if(lArg) ((ExprTree*)lArg)->PrintToStr(str); -- strcat(str, " = "); -- if(rArg) ((ExprTree*)rArg)->PrintToStr(str); --} -- -- -- --static void --printComparisonOpToStr (char *str, ExprTree *lArg, ExprTree *rArg, char *op) --{ -- if(lArg) { -- ((ExprTree*)lArg)->PrintToStr(str); -- } -- strcat(str, op); -- if(rArg) { -- ((ExprTree*)rArg)->PrintToStr(str); -- } --} -- --static int --calculate_math_op_length(ExprTree *lArg, ExprTree *rArg, int op_length) --{ -- int length; -- -- length = 0; -- if (lArg) { -- length += lArg->CalcPrintToStr(); -- } -- length += op_length; // Like " - " -- if (rArg) { -- length += rArg->CalcPrintToStr(); -- } -- return length; --} -- --ExprTree* --Variable::DeepCopy(void) const --{ -- Variable *copy; -- -- copy = new Variable(name); -- CopyBaseExprTree(copy); -- -- return copy; --} -- --ExprTree* --Integer::DeepCopy(void) const --{ -- Integer *copy; -- -- copy = new Integer(value); -- CopyBaseExprTree(copy); -- -- return copy; --} -- --ExprTree* --Float::DeepCopy(void) const --{ -- Float *copy; -- -- copy = new Float(value); -- CopyBaseExprTree(copy); -- -- return copy; --} -- --ExprTree* --ClassadBoolean::DeepCopy(void) const --{ -- ClassadBoolean *copy; -- -- copy = new ClassadBoolean(value); -- CopyBaseExprTree(copy); -- -- return copy; --} -- --ExprTree* --String::DeepCopy(void) const --{ -- String *copy; -- -- copy = new String(value); -- CopyBaseExprTree(copy); -- -- return copy; --} -- --ExprTree* --ISOTime::DeepCopy(void) const --{ -- ISOTime *copy; -- -- copy = new ISOTime(time); -- CopyBaseExprTree(copy); -- -- return copy; --} -- --ExprTree* --Undefined::DeepCopy(void) const --{ -- Undefined *copy; -- -- copy = new Undefined(); -- CopyBaseExprTree(copy); -- -- return copy; --} -- --ExprTree* --Error::DeepCopy(void) const --{ -- Error *copy; -- -- copy = new Error(); -- CopyBaseExprTree(copy); -- -- return copy; --} -- --ExprTree* --AddOp::DeepCopy(void) const --{ -- AddOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- /* We have to be careful with the AddOp, because it is overloaded to be used -- * as the parenthesis grouping. -- */ -- copy_of_larg = copy_of_rarg = NULL; -- if (lArg != NULL) { -- copy_of_larg = lArg->DeepCopy(); -- } -- if (rArg != NULL) { -- copy_of_rarg = rArg->DeepCopy(); -- } -- -- copy = new AddOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --SubOp::DeepCopy(void) const --{ -- SubOp *copy; -- ExprTree *copy_of_larg = NULL; -- ExprTree *copy_of_rarg; -- -- if(lArg) { -- copy_of_larg = lArg->DeepCopy(); -- } -- ASSERT(rArg); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new SubOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --MultOp::DeepCopy(void) const --{ -- MultOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new MultOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --DivOp::DeepCopy(void) const --{ -- DivOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new DivOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --MetaEqOp::DeepCopy(void) const --{ -- MetaEqOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new MetaEqOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --MetaNeqOp::DeepCopy(void) const --{ -- MetaNeqOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new MetaNeqOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --EqOp::DeepCopy(void) const --{ -- EqOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new EqOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --NeqOp::DeepCopy(void) const --{ -- NeqOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new NeqOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --GtOp::DeepCopy(void) const --{ -- GtOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new GtOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --GeOp::DeepCopy(void) const --{ -- GeOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new GeOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --LtOp::DeepCopy(void) const --{ -- LtOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new LtOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --LeOp::DeepCopy(void) const --{ -- LeOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new LeOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --AndOp::DeepCopy(void) const --{ -- AndOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new AndOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --OrOp::DeepCopy(void) const --{ -- OrOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new OrOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} -- --ExprTree* --AssignOp::DeepCopy(void) const --{ -- AssignOp *copy; -- ExprTree *copy_of_larg; -- ExprTree *copy_of_rarg; -- -- copy_of_larg = lArg->DeepCopy(); -- copy_of_rarg = rArg->DeepCopy(); -- -- copy = new AssignOp(copy_of_larg, copy_of_rarg); -- CopyBaseExprTree(copy); -- return copy; --} --#ifdef HAVE_DLFCN_H --#include --#endif -- --#include "classad_shared.h" -- --int Function::CalcPrintToStr(void) --{ -- int length; -- int i; -- int num_args; -- ExprTree *arg; -- -- length = 0; -- length += strlen(name); -- length += 1; // for left paren -- -- arguments->Rewind(); -- i = 0; -- num_args = arguments->Length(); -- while (arguments->Next(arg)) { -- length += arg->CalcPrintToStr(); -- i++; -- if (i < num_args) { -- length += 2; // for "; " -- } -- } -- length += 1; // for right paren -- -- return length; --} -- --void Function::PrintToStr(char *s) --{ -- ExprTree *arg; -- int i, num_args; -- -- arguments->Rewind(); -- i = 0; -- num_args = arguments->Length(); -- strcat(s, name); -- strcat(s, "("); -- while (arguments->Next(arg)) { -- arg->PrintToStr(s); -- i++; -- if (i < num_args) { -- strcat(s, ", "); -- } -- } -- strcat(s, ")"); -- -- return; --} -- --ExprTree *Function::DeepCopy(void) const --{ -- Function *copy; -- -- copy = new Function(name); -- CopyBaseExprTree(copy); -- -- ListIterator< ExprTree > iter(*arguments); -- ExprTree *arg; -- -- iter.ToBeforeFirst(); -- while (iter.Next(arg)) { -- copy->AppendArgument(arg->DeepCopy()); -- } -- -- return copy; --} -- --int Function::_EvalTree(const AttrList *attrlist, EvalResult *result) --{ -- _EvalTree(attrlist, NULL, result); -- return 0; --} -- --int Function::_EvalTree(const AttrList *attrlist1, const AttrList *attrlist2, EvalResult *result) --{ -- int number_of_args, i; -- int successful_eval; -- EvalResult *evaluated_args; -- bool must_eval_to_strings = false; -- bool done = false; -- -- if ( result == NULL ) { -- return FALSE; -- } -- -- successful_eval = FALSE; -- result->type = LX_UNDEFINED; -- -- if ( !strcasecmp(name, "debug") ) { -- result->debug = true; -- } -- -- // treat calls to function IfThenElse() special, because we cannot -- // evaluate the arguments ahead of time (argument evaluation must -- // be lazy for IfThenElse). -- // also, many of the string functions need all their arguments -- // converted to strings - set a flag if we need to do this. -- if ( !strcasecmp(name,"ifthenelse") ) { -- successful_eval = FunctionIfThenElse(attrlist1,attrlist2,result); -- done = true; -- } else -- if ( -- !strcasecmp(name,"strcat") || -- !strcasecmp(name,"strcmp") || -- !strcasecmp(name,"stricmp") || -- !strcasecmp(name,"toUpper") || -- !strcasecmp(name,"toLower") || -- !strcasecmp(name,"size") || -- !strcasecmp(name,"eval") ) -- { -- must_eval_to_strings = true; -- } -- -- if (!done) { -- number_of_args = arguments->Length(); -- evaluated_args = new EvalResult[number_of_args]; -- -- ListIterator iter(*arguments); -- ExprTree *arg; -- -- i = 0; -- while (iter.Next(arg)) { -- evaluated_args[i].debug = result->debug; -- if ( must_eval_to_strings ) { -- if (!EvaluateArgumentToString(arg, attrlist1,attrlist2, -- &evaluated_args[i++])) -- { -- // if all args must be converted to strings, and we -- // fail to convert an arg to a string, then fail. -- result->type = LX_ERROR; -- done = true; -- break; // no need to look at the other args -- } -- } else { -- EvaluateArgument( arg, attrlist1, attrlist2, &evaluated_args[i++] ); -- } -- } -- -- if ( !done ) { -- if (!strcasecmp(name, "gettime")) { -- successful_eval = FunctionGetTime(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "time")) { -- successful_eval = FunctionTime(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "interval")) { -- successful_eval = FunctionInterval(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "random")) { -- successful_eval = FunctionRandom(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "_debug_function_")) { -- successful_eval = FunctionClassadDebugFunction(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "isundefined")) { -- successful_eval = FunctionIsUndefined(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "iserror")) { -- successful_eval = FunctionIsError(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "isstring")) { -- successful_eval = FunctionIsString(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "isinteger")) { -- successful_eval = FunctionIsInteger(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "isreal")) { -- successful_eval = FunctionIsReal(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "isboolean")) { -- successful_eval = FunctionIsBoolean(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "string")) { -- successful_eval = FunctionString(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "real")) { -- successful_eval = FunctionReal(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "int")) { -- successful_eval = FunctionInt(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "floor")) { -- successful_eval = FunctionFloor(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "round")) { -- successful_eval = FunctionRound(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "ceiling")) { -- successful_eval = FunctionCeiling(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "strcat")) { -- successful_eval = FunctionStrcat(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "substr")) { -- successful_eval = FunctionSubstr(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "strcmp")) { -- successful_eval = FunctionStrcmp(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stricmp")) { -- successful_eval = FunctionStricmp(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "toupper")) { -- successful_eval = FunctionToUpper(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "tolower")) { -- successful_eval = FunctionToLower(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "size")) { -- successful_eval = FunctionSize(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stringlistsize")) { -- successful_eval = FunctionStringlistSize(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stringlistsum")) { -- successful_eval = FunctionStringlistSum(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stringlistavg")) { -- successful_eval = FunctionStringlistAvg(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stringlistmin")) { -- successful_eval = FunctionStringlistMin(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stringlistmax")) { -- successful_eval = FunctionStringlistMax(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stringlistmember")) { -- successful_eval = FunctionStringlistMember(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stringlistimember")) { -- successful_eval = FunctionStringlistIMember(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "stringlist_regexpMember")) { -- successful_eval = FunctionStringlistRegexpMember(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "regexp")) { -- successful_eval = FunctionRegexp(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "regexps")) { -- successful_eval = FunctionRegexps(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "formattime")) { -- successful_eval = FunctionFormatTime(number_of_args, evaluated_args, result); -- } else if (!strcasecmp(name, "debug")) { -- *result = evaluated_args[0]; -- successful_eval = true; -- } else if (!strcasecmp(name, "eval")) { -- successful_eval = FunctionEval(attrlist1, attrlist2, number_of_args, evaluated_args, result); -- } --#ifdef HAVE_DLOPEN -- else { -- successful_eval = FunctionSharedLibrary(number_of_args, -- evaluated_args, result); -- } --#else -- else { -- successful_eval = false; -- } --#endif -- -- dprintResult(this, result); -- -- if (result->debug) { -- if (strcasecmp(name, "debug") == 0) { -- result->debug = false; -- } -- } -- } // of if (!done) -- -- delete [] evaluated_args; -- } -- -- return successful_eval; --} -- --void EvalResult::toString(bool force) --{ -- switch(type) { -- case LX_STRING: -- break; -- case LX_FLOAT: { -- MyString buf; -- buf.sprintf("%lf",f); -- s = strnewp(buf.Value()); -- type = LX_STRING; -- break; -- } -- case LX_BOOL: -- type = LX_STRING; -- if (i) { -- s = strnewp("TRUE"); -- } else { -- s = strnewp("FALSE"); -- } -- break; -- case LX_INTEGER: { -- MyString buf; -- buf.sprintf("%d",i); -- s = strnewp(buf.Value()); -- type = LX_STRING; -- break; -- } -- case LX_UNDEFINED: -- if( force ) { -- s = strnewp("UNDEFINED"); -- type = LX_STRING; -- } -- break; -- case LX_ERROR: -- if( force ) { -- s = strnewp("ERROR"); -- type = LX_STRING; -- } -- break; -- default: -- ASSERT("Unknown classad result type"); -- } --} -- --int Function::EvaluateArgumentToString( -- ExprTree *arg, -- const AttrList *attrlist1, -- const AttrList *attrlist2, -- EvalResult *result) const // OUT: the result of calling the function --{ -- result->type = LX_ERROR; -- -- EvaluateArgument( arg, attrlist1, attrlist2, result ); -- -- result->toString(); -- -- if ( result->type == LX_STRING ) { -- return TRUE; -- } else { -- return FALSE; -- } --} -- --bool string_is_all_whitespace(char *s) --{ -- bool is_all_whitespace = true; -- -- while (*s != 0) { -- if (!isspace(*s)) { -- is_all_whitespace = false; -- break; -- } else { -- s++; -- } -- } -- return is_all_whitespace; --} -- --#ifdef HAVE_DLOPEN --int Function::FunctionSharedLibrary( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- char *shared_library_location; -- int eval_succeeded; -- -- eval_succeeded = false; -- if ((shared_library_location = param("CLASSAD_LIB_PATH")) != NULL){ -- void *dl_handle; -- ClassAdSharedFunction function; -- -- dl_handle = dlopen(shared_library_location, RTLD_LAZY); -- if (dl_handle) { -- function = (ClassAdSharedFunction) dlsym(dl_handle, name); -- if (function != NULL) { -- ClassAdSharedValue function_result; -- ClassAdSharedValue *function_args; -- -- // Prepare the arguments for passing to the external library -- // Note that we don't just use EvalResult, because we -- // want to give the DZero folks a header file that is completely -- // independent of anything else in Condor. -- if (number_of_args > 0) { -- function_args = new ClassAdSharedValue[number_of_args]; -- for (int arg_index = 0; arg_index < number_of_args; arg_index++) { -- switch (evaluated_args[arg_index].type) { -- case LX_INTEGER: -- function_args[arg_index].type = ClassAdSharedType_Integer; -- function_args[arg_index].integer = evaluated_args[arg_index].i; -- break; -- case LX_FLOAT: -- function_args[arg_index].type = ClassAdSharedType_Float; -- function_args[arg_index].real = evaluated_args[arg_index].f; -- break; -- case LX_STRING: -- function_args[arg_index].type = ClassAdSharedType_String; -- function_args[arg_index].text = evaluated_args[arg_index].s; -- break; -- case LX_UNDEFINED: -- function_args[arg_index].type = ClassAdSharedType_Undefined; -- break; -- default: -- function_args[arg_index].type = ClassAdSharedType_Error; -- break; -- } -- } -- } else { -- function_args = NULL; -- } -- -- function(number_of_args, function_args, &function_result); -- delete [] function_args; -- -- switch (function_result.type) { -- case ClassAdSharedType_Integer: -- result->type = LX_INTEGER; -- result->i = function_result.integer; -- break; -- case ClassAdSharedType_Float: -- result->type = LX_FLOAT; -- result->f = function_result.real; -- break; -- case ClassAdSharedType_String: -- result->type = LX_STRING; -- result->s = function_result.text; -- break; -- case ClassAdSharedType_Undefined: -- result->type = LX_UNDEFINED; -- break; -- default: -- result->type = LX_ERROR; -- break; -- } -- eval_succeeded = true; -- } -- } -- free(shared_library_location); -- } -- return eval_succeeded; --} --#endif -- --int Function::FunctionGetTime( -- int /* number_of_args */, // IN: size of evaluated args array -- EvalResult * /* evaluated_args */, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- time_t current_time = time(NULL); -- -- result->i = (int) current_time; -- result->type = LX_INTEGER; -- return TRUE; --} -- --int Function::FunctionTime( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- return FunctionGetTime(number_of_args, evaluated_args, result); --} -- --int Function::FunctionInterval( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- if (evaluated_args[0].type != LX_INTEGER) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_STRING; -- result->s = strnewp(format_time(evaluated_args[0].i)); -- return TRUE; --} -- --extern "C" int get_random_int(); --extern "C" float get_random_float(); -- --int Function::FunctionRandom( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- bool success = false; -- result->type = LX_ERROR; -- -- if (number_of_args == 0) { -- // If we get no arguments, we return a random number between 0 and 1.0 -- result->f = get_random_float(); -- result->type = LX_FLOAT; -- success = true; -- } else if (number_of_args == 1) { -- // If we get one integer argument, we return a random number -- // between 0 and that number -- if (evaluated_args[0].type == LX_INTEGER) { -- result->type = LX_INTEGER; -- result->i = get_random_int() % evaluated_args[0].i; -- success = true; -- } -- if (evaluated_args[0].type == LX_FLOAT) { -- result->type = LX_FLOAT; -- result->f = get_random_float() * evaluated_args[0].f; -- success = true; -- } -- } -- -- return success; --} -- --int Function::FunctionIsUndefined( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_INTEGER; -- if ( evaluated_args[0].type == LX_UNDEFINED ) { -- result->i = 1; -- } else { -- result->i = 0; -- } -- -- return true; --} -- --int Function::FunctionIsError( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_INTEGER; -- if ( evaluated_args[0].type == LX_ERROR ) { -- result->i = 1; -- } else { -- result->i = 0; -- } -- -- return true; --} -- --int Function::FunctionIsString( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_INTEGER; -- if ( evaluated_args[0].type == LX_STRING ) { -- result->i = 1; -- } else { -- result->i = 0; -- } -- -- return true; --} -- -- --int Function::FunctionIsInteger( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_INTEGER; -- if ( evaluated_args[0].type == LX_INTEGER ) { -- result->i = 1; -- } else { -- result->i = 0; -- } -- -- return true; --} -- -- --int Function::FunctionIsReal( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_INTEGER; -- if ( evaluated_args[0].type == LX_FLOAT ) { -- result->i = 1; -- } else { -- result->i = 0; -- } -- -- return true; --} -- --int Function::FunctionIsBoolean( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_INTEGER; -- if ( (evaluated_args[0].type == LX_BOOL) || -- (evaluated_args[0].type == LX_INTEGER && // int val of 0 or 1 is bool -- (evaluated_args[0].i == 0 || evaluated_args[0].i == 1)) ) -- { -- result->i = 1; -- } else { -- result->i = 0; -- } -- -- return true; --} -- -- --int Function::FunctionString( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- *result = evaluated_args[0]; -- result->toString(); -- if( result->type == LX_ERROR ) { -- return FALSE; -- } -- -- return TRUE; --} -- --int Function::FunctionReal( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_FLOAT; -- result->f = 0; -- -- switch ( evaluated_args[0].type ) { -- case LX_FLOAT: -- // if input x is a Real, the result is x. -- result->f = evaluated_args[0].f; -- break; -- case LX_INTEGER: -- // if integer, upgrade to a Real. -- // to implement, we just cast, since this is what C++ will do. -- result->f = (float)(evaluated_args[0].i); -- break; -- case LX_BOOL: -- if ( evaluated_args[0].i ) -- result->f = 1.0; -- else -- result->f = 0.0; -- break; -- case LX_STRING: -- // convert string to Real, or return error if string -- // does not represent a Real. -- if (!evaluated_args[0].s) { -- result->type = LX_ERROR; -- return false; -- } -- if (sscanf(evaluated_args[0].s,"%f",&result->f) != 1) { -- result->type = LX_ERROR; -- return false; -- } -- break; -- default: -- // likely error or undefined -- result->type = LX_ERROR; -- return false; -- } -- -- return true; --} -- --int Function::FunctionFloor( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_INTEGER; -- result->i = 0; -- -- // If input arg x is integer, return x. Otherwise, x is converted -- // to a real w/ FunctionReal(), and floor() is applied. -- if ( evaluated_args[0].type == LX_INTEGER ) { -- result->i = evaluated_args[0].i; -- } else { -- EvalResult real_result; -- if ( FunctionReal(number_of_args,evaluated_args,&real_result) ) { -- result->i = (int)floor(real_result.f); -- } else { -- result->type = LX_ERROR; -- return FALSE; -- } -- } -- -- return TRUE; --} -- -- --int Function::FunctionRound( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_INTEGER; -- result->i = 0; -- -- // If input arg x is integer, return x. Otherwise, x is converted -- // to a real w/ FunctionReal(), and ceil() is applied. -- if ( evaluated_args[0].type == LX_INTEGER ) { -- result->i = evaluated_args[0].i; -- } else { -- EvalResult real_result; -- if ( FunctionReal(number_of_args,evaluated_args,&real_result) ) { -- result->i = (int)rint(real_result.f); -- } else { -- result->type = LX_ERROR; -- return FALSE; -- } -- } -- -- return TRUE; --} -- --int Function::FunctionCeiling( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_INTEGER; -- result->i = 0; -- -- // If input arg x is integer, return x. Otherwise, x is converted -- // to a real w/ FunctionReal(), and ceil() is applied. -- if ( evaluated_args[0].type == LX_INTEGER ) { -- result->i = evaluated_args[0].i; -- } else { -- EvalResult real_result; -- if ( FunctionReal(number_of_args,evaluated_args,&real_result) ) { -- result->i = (int)ceil(real_result.f); -- } else { -- result->type = LX_ERROR; -- return FALSE; -- } -- } -- -- return TRUE; --} -- -- --int Function::FunctionStrcat( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- // NOTE: ALL ARGUMENTS HAVE BEEN CONVERTED INTO STRING TYPES -- // BEFORE THIS FUNCTION WAS INVOKED. -- -- int i; -- MyString tempStr; -- -- for (i=0; i< number_of_args; i++) { -- ASSERT(evaluated_args[i].type == LX_STRING); -- tempStr += evaluated_args[i].s; -- } -- -- result->type = LX_STRING; -- result->s = strnewp( tempStr.Value() ); -- -- return TRUE; --} -- -- -- --int Function::FunctionInt( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return false; -- } -- -- result->type = LX_INTEGER; -- result->i = 0; -- -- switch ( evaluated_args[0].type ) { -- case LX_INTEGER: -- // if input x is an Integer, the result is x. -- result->i = evaluated_args[0].i; -- break; -- case LX_FLOAT: -- // if input x is Float, it is truncated towards zero. -- // to implement, we just cast, since this is what C++ will do. -- result->i = (int)(evaluated_args[0].f); -- break; -- case LX_BOOL: -- if ( evaluated_args[0].i ) -- result->i = 1; -- else -- result->i = 0; -- break; -- case LX_STRING: -- // convert string to int, or return error if string -- // does not represent an int. -- if (!evaluated_args[0].s) { -- result->type = LX_ERROR; -- return false; -- } -- result->i = atoi(evaluated_args[0].s); -- if ( result->i == 0 ) { -- // this sucks. atoi returns 0 on error, so -- // here we try to figure out if we have a 0 -- // because that is what the string has, or -- // we have a 0 due to an error. -- int c; -- int i=0; -- while ( (c=evaluated_args[0].s[i++]) ) { -- if ( (!isspace(c)) && c!='0' && -- c!='+' && c!='-' && c!='.' ) -- { -- result->type = LX_ERROR; -- return false; -- } -- } -- } -- break; -- default: -- // likely error or undefined -- result->type = LX_ERROR; -- return false; -- } -- -- return true; --} -- -- -- --/* -- IfThenElse( condition ; then ; else ) -- If condition evaluates to TRUE, return evaluated 'then'. -- If condition evaluates to FALSE, return evaluated 'else'. -- If condition evaluates to UNDEFIEND, return UNDEFINED. -- If condition evaluates to ERROR, return ERROR. -- If condition is of type string or null, return ERROR. -- If three arguments are not passed in, return ERROR. --*/ --int Function::FunctionIfThenElse( -- const AttrList *attrlist1, -- const AttrList *attrlist2, -- EvalResult *result) // OUT: the result of calling the function --{ -- bool condition = false; -- EvalResult conditionclause; -- ExprTree *arg = NULL; -- -- int number_of_args = arguments->Length(); -- -- conditionclause.debug = result->debug; -- -- if ( number_of_args != 3 ) { -- // we must have three arguments -- result->type = LX_ERROR; -- return false; -- } -- -- ListIterator iter(*arguments); -- -- // pop off and evaluate the condition clause (1st argument) -- iter.Next(arg); // arg now has the first argument (condition clause) -- EvaluateArgument( arg, attrlist1, attrlist2, &conditionclause ); -- -- switch ( conditionclause.type ) { -- case LX_BOOL: -- case LX_INTEGER: -- if ( conditionclause.i ) { -- condition = true; -- } -- break; -- case LX_FLOAT: -- if ( conditionclause.f ) { -- condition = true; -- } -- break; -- case LX_UNDEFINED: -- result->type = LX_UNDEFINED; -- return true; -- default: // will catch types null, error, string -- result->type = LX_ERROR; -- return false; -- } // end of switch -- -- if ( condition ) { -- // Condition is true - we want to return the second argument -- iter.Next(arg); // arg now has the second argument (then clause) -- // evaluate the second argument (then clause), store in result -- EvaluateArgument( arg, attrlist1, attrlist2, result ); -- } else { -- // Condition is false - we want to return the third argument -- iter.Next(arg); // arg now has the second argument (then clause) -- iter.Next(arg); // arg now has the third argument (else clause) -- // evaluate the third argument (else clause), store in result -- EvaluateArgument( arg, attrlist1, attrlist2, result ); -- } -- -- return true; --} -- --int Function::FunctionClassadDebugFunction( -- int /* number_of_args */, -- EvalResult * /* evaluated_args */, -- EvalResult *result) --{ -- classad_debug_function_run = true; -- result->i = 1; -- result->type = LX_INTEGER; -- -- return TRUE; --} -- --int Function::FunctionSubstr( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- -- /* -- substr(string s, int offset [, int length ]) returns string. -- -- The result is the substring of s starting at the position indicated by -- offset with the length indicated by length. The first character of s is at -- offset 0. If offset is negative, it is replaced by length(s) - offset. If -- length is omitted, the substring extends to the end of s. If length is -- negative, an intermediate result is computed as if length were omitted, and -- then -length characters are deleted from the right end of the result. If -- the resulting substring lies partially outside the limits of s, the part -- that lies within s is returned. If the substring lies entirely outside s or -- has negative length (because of a negative length argument), the result is -- the null string. -- */ -- int length; -- int offset; -- char *s; -- -- if ( (number_of_args < 2) || ( number_of_args > 3 )) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- if( (evaluated_args[0].type != LX_STRING) || -- (evaluated_args[1].type != LX_INTEGER)) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- s = evaluated_args[0].s; -- offset = evaluated_args[1].i; -- -- if (offset < 0) { -- offset = strlen(s) + offset; -- } -- -- if ( number_of_args == 3 ) { -- if (evaluated_args[2].type != LX_INTEGER) { -- result->type = LX_ERROR; -- return FALSE; -- } -- length = evaluated_args[2].i; -- } else { -- length = strlen(s) - offset; -- } -- -- if( ( offset < 0) || ( ((unsigned) offset) > strlen(s) )) { -- result->type = LX_STRING; -- result->s = strnewp(""); -- return TRUE; -- } -- -- if (length > (signed) strlen(s + offset)) { -- length = strlen(s) - offset; -- } -- -- if (length < 0) { -- length = strlen(s) - offset + length; -- } -- -- if (length <= 0) { -- result->type = LX_STRING; -- result->s = strnewp(""); -- return TRUE; -- } -- -- result->type = LX_STRING; -- result->s = strnewp(s + offset); -- result->s[length] = '\0'; -- return TRUE; --} -- --int Function::FunctionStrcmp( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- strcmp(any a, any b) returns int. -- -- The operands are converted to Strings by the ``string'' function above. The -- result is an Integer less than, equal to, or greater than zero according to -- whether a is lexicographically less than, equal to, or greater than b. Note -- that case is significant in the comparison. -- */ -- -- // NOTE: ALL ARGUMENTS HAVE BEEN CONVERTED INTO STRING TYPES -- // BEFORE THIS FUNCTION WAS INVOKED. -- -- if ( number_of_args != 2 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_INTEGER; -- result->i = strcmp( evaluated_args[0].s, evaluated_args[1].s); -- -- return TRUE; --} -- --int Function::FunctionStricmp( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stricmp(any a, any b) returns int. -- -- The same as strcmp except that upper and lower case letters are considered -- equivalent. -- */ -- -- // NOTE: ALL ARGUMENTS HAVE BEEN CONVERTED INTO STRING TYPES -- // BEFORE THIS FUNCTION WAS INVOKED. -- -- if ( number_of_args != 2 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_INTEGER; -- result->i = ::strcasecmp( evaluated_args[0].s, evaluated_args[1].s); -- -- return TRUE; --} -- --int Function::FunctionToUpper( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- toUpper(any s) returns string. -- -- The operand is converted to a String by the ``string'' function above. The -- result is a String that is identical to s except that all lowercase letters -- in s are converted to uppercase. -- */ -- -- // NOTE: ALL ARGUMENTS HAVE BEEN CONVERTED INTO STRING TYPES -- // BEFORE THIS FUNCTION WAS INVOKED. -- -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_STRING; -- result->s = strnewp( evaluated_args[0].s); -- char *p = result->s; -- while (*p) { -- *p = toupper(*p); -- p++; -- } -- -- return TRUE; --} -- --int Function::FunctionToLower( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- toLower(any s) returns string. -- -- The operand is converted to a String by the ``string'' function above. The -- result is a String that is identical to s except that all uppercase letters -- in s are converted to lowercase. -- */ -- -- // NOTE: ALL ARGUMENTS HAVE BEEN CONVERTED INTO STRING TYPES -- // BEFORE THIS FUNCTION WAS INVOKED. -- -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_STRING; -- result->s = strnewp( evaluated_args[0].s); -- char *p = result->s; -- while (*p) { -- *p = tolower(*p); -- p++; -- } -- -- return TRUE; --} -- --int Function::FunctionSize( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- size(string s) returns int. -- -- Returns the number of characters of the string s. -- */ -- -- // NOTE: ALL ARGUMENTS HAVE BEEN CONVERTED INTO STRING TYPES -- // BEFORE THIS FUNCTION WAS INVOKED. -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_INTEGER; -- result->i = strlen( evaluated_args[0].s); -- -- return TRUE; --} -- --int Function::FunctionStringlistSize( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stringlistSize(string l [, string d]) returns int. -- -- If any of the arguments is not of type String, the result is an error. -- Returns the number of elements in the string list l. The characters -- specified in optional argument d are treated as the delimiters for the -- string list. If not specified, d defaults to " ," (space and comma -- characters). -- */ -- -- char *d; -- -- if (( number_of_args == 0) || ( number_of_args > 2 )) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- if(evaluated_args[0].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- if ( number_of_args == 2) { -- if(evaluated_args[1].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- d = evaluated_args[1].s; -- } else { -- d = " ,"; -- } -- -- StringList sl(evaluated_args[0].s, d); -- result->type = LX_INTEGER; -- result->i = sl.number(); -- return TRUE; --} -- --static int StringListNumberIterator( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result, // OUT: the result of calling the function -- void (*func)(double, double *), -- double *accumulator) --{ -- char *d; -- -- if (( number_of_args == 0) || ( number_of_args > 2 )) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- if ( number_of_args == 2) { -- if (evaluated_args[1].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- d = evaluated_args[1].s; -- } else { -- d = " ,"; -- } -- -- if (evaluated_args[0].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- char *s = evaluated_args[0].s; -- -- StringList sl(s, d); -- -- if (sl.number() == 0) { -- result->type = LX_UNDEFINED; -- return TRUE; -- } -- -- result->type = LX_INTEGER; -- -- sl.rewind(); -- char *entry; -- while( (entry = sl.next())) { -- float temp; -- int r = sscanf(entry, "%f", &temp); -- if (r != 1) { -- result->type = LX_ERROR; -- return FALSE; -- } -- if (strspn(entry, "+-0123456789") != strlen(entry)) { -- result->type = LX_FLOAT; -- } -- func(temp, accumulator); -- } -- -- if (result->type == LX_INTEGER) { -- result->i = (int)*accumulator; -- } else { -- result->f = *accumulator; -- } -- -- return TRUE; --} -- --static void sum(double entry, double *accumulator) { -- *accumulator += entry; --} -- --int Function::FunctionStringlistSum( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stringlistSum(string l [, string d]) returns number. -- -- If any of the arguments is not of type String, the result is an error. If l -- is composed only of numbers, the result is the sum of the values, as a Real -- if any value is Real, and as an Integer otherwise. If the list is empty, -- the result is 0. In other cases, the result is ERROR. The characters -- specified in optional argument d are treated as the delimiters for the -- string list. If not specified, d defaults to " ," (space and comma -- characters). -- */ -- -- double accumulator = 0.0;; -- int r = StringListNumberIterator( -- number_of_args, evaluated_args, result, sum, &accumulator); -- -- // zero length array sums to zero -- if (result->type == LX_UNDEFINED) { -- result->type = LX_INTEGER; -- result->i = 0; -- } -- return r; --} -- --static void avg(double entry, double *pair) { -- pair[0] += entry; -- pair[1]++; --} -- --int Function::FunctionStringlistAvg( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stringlistAvg(string l [, string d]) returns number. -- -- If any of the arguments is not of type String, the result is an error. If l -- is composed only of numbers, the result is the average of the values, as a -- Real. If the list is empty, the result is 0. In other cases, the result is -- ERROR. The characters specified in optional argument d are treated as the -- delimiters for the string list. If not specified, d defaults to " ," -- (space and comma characters). -- */ -- -- // array[0] is the sum of all the entries, array[1] is the number of entries -- double array[2]; -- array[0] = 0.0; -- array[1] = 0.0; -- -- int r = StringListNumberIterator( -- number_of_args, evaluated_args, result, avg, array); -- -- if (!r) { -- return FALSE; -- } -- -- if (result->type == LX_UNDEFINED) { -- result->f = 0.0; -- } else { -- result->f = array[0] / array[1]; -- } -- result->type = LX_FLOAT; -- return TRUE; --} -- --static void minner(double entry, double *best) { -- if (entry < *best) { -- *best = entry; -- } --} -- --int Function::FunctionStringlistMin( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stringlistMin(string l [, string d]) returns number. -- -- If any of the arguments is not of type String, the result is an error. If l -- is composed only of numbers, the result is the minimum of the values, as a -- Real if any value is Real, and as an Integer otherwise. If the list is -- empty, the result is UNDEFINED. In other cases, the result is ERROR. The -- characters specified in optional argument d are treated as the delimiters -- for the string list. If not specified, d defaults to " ," (space and comma -- characters). -- */ -- -- double lowest = FLT_MAX; -- return StringListNumberIterator( -- number_of_args, evaluated_args, result, minner, &lowest); --} -- --static void maxer(double entry, double *best) { -- if (entry > *best) { -- *best = entry; -- } --} -- --int Function::FunctionStringlistMax( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stringlistMax(string l [, string d]) returns number. -- -- If any of the arguments is not of type String, the result is an error. If l -- is composed only of numbers, the result is the maximum of the values, as a -- Real if any value is Real, and as an Integer otherwise. If the list is -- empty, the result is UNDEFINED. In other cases, the result is ERROR. The -- characters specified in optional argument d are treated as the delimiters -- for the string list. If not specified, d defaults to " ," (space and comma -- characters). -- */ -- -- double maxest = FLT_MIN; -- return StringListNumberIterator( -- number_of_args, evaluated_args, result, maxer, &maxest); --} -- --static int stringlistmember( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result, // OUT: the result of calling the function -- bool ignore_case) --{ -- if ((number_of_args < 2) || (number_of_args > 3)) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- if ((evaluated_args[0].type != LX_STRING) || -- (evaluated_args[1].type != LX_STRING)) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- char *d = " ,"; -- if (number_of_args == 3) { -- if (evaluated_args[2].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- d = evaluated_args[2].s; -- } -- -- result->type = LX_INTEGER; -- StringList sl(evaluated_args[1].s, d); -- sl.rewind(); -- char *entry; -- while( (entry = sl.next())) { -- if (ignore_case) { -- if (strcasecmp(entry, evaluated_args[0].s) == 0) { -- result->i = 1; -- return TRUE; -- } -- } else { -- if (strcmp(entry, evaluated_args[0].s) == 0) { -- result->i = 1; -- return TRUE; -- } -- } -- } -- -- result->i = 0; -- return TRUE; --} -- --int Function::FunctionStringlistMember( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stringlistMember(string x, string l [, string d]) returns boolean. -- -- If any of the arguments is not of type String, the result is an error. If -- any of the values in string list l are equal to x in the sense of the -- strcmp() function, then the result is true, otherwise it is false. The -- characters specified in optional argument d are treated as the delimiters -- for the string list. If not specified, d defaults to " ," (space and comma -- characters). -- */ -- -- return stringlistmember(number_of_args, evaluated_args, result, false); --} -- --int Function::FunctionStringlistIMember( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stringlistIMember(string x, string l [, string d]) returns boolean. -- -- If any of the arguments is not of type String, the result is an error. If -- any of the values in string list l are equal to x in the sense of the -- stricmp() function, then the result is true, otherwise it is false. The -- characters specified in optional argument d are treated as the delimiters -- for the string list. If not specified, d defaults to " ," (space and comma -- characters). -- */ -- -- return stringlistmember(number_of_args, evaluated_args, result, true); --} -- --static int regexp_str_to_options(char *option_str) { -- int options = 0; -- while (*option_str) { -- switch (*option_str) { -- case 'i': -- case 'I': -- options |= Regex::caseless; -- break; -- case 'm': -- case 'M': -- options |= Regex::multiline; -- break; -- case 's': -- case 'S': -- options |= Regex::dotall; -- break; -- case 'x': -- case 'X': -- options |= Regex::extended; -- break; -- default: -- // Ignore for forward compatibility -- break; -- } -- option_str++; -- } -- return options; --} -- --int Function::FunctionStringlistRegexpMember( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- stringlistRegexpMember(string pattern, string l -- [, string d] [, string options]) returns boolean. -- -- If l is not a stringlist or any of the other arguments is not of type -- String, the result is an error. If any of the values in string list do -- not eveluate to a string it returns an error. Otherwise, if any of the -- values in the list matches the pattern accoring to the regexp function, -- the result is true. If there is no match the result is false. -- -- The characters in the optional argument d are treated as the delimiters -- for the stringlist. If this is not enumerated the delimiter defaults to -- " ," (space and comma characters). The options string behaves as in -- regexp function below. -- */ -- -- if (( number_of_args < 2) || ( number_of_args > 4 )) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- char *d = " ,"; -- -- if (number_of_args == 3) { -- if (evaluated_args[2].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- d = evaluated_args[2].s; -- } -- -- char *option_str = ""; -- -- if (number_of_args == 4) { -- if (evaluated_args[3].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- option_str = evaluated_args[3].s; -- } -- -- if ((evaluated_args[0].type != LX_STRING) || -- (evaluated_args[1].type != LX_STRING)) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- Regex r; -- const char *errstr = 0; -- int errpos = 0; -- bool valid; -- int options = regexp_str_to_options(option_str); -- -- /* can the pattern be compiled */ -- valid = r.compile(evaluated_args[0].s, &errstr, &errpos, options); -- if (!valid) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->type = LX_INTEGER; -- StringList sl(evaluated_args[1].s, d); -- sl.rewind(); -- char *entry; -- int match = 0; -- while( (entry = sl.next())) { -- if (r.match(entry)) { -- match = 1; -- } -- } -- -- if(match) { -- result->i = 1; -- return TRUE; -- } -- -- result->i = 0; -- return TRUE; --} -- --int Function::FunctionRegexp( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- regexp(string pattern, string target , string output[, string -- options ]) returns boolean. -- -- If any of the arguments is not of type String or if pattern is not -- a valid regular expression, the result is an error. Otherwise, if -- pattern matches target, the result is string, otherwise error. -- The resultant string is the string "output", with backticks -- references (e.g. \1 \2) replaced by the captured regexps inside -- the pattern. -- -- The details of the syntax and semantics of the regular expressions -- follows the perl-compatible regular expression format as supported -- by the PCRE library (see http://www.pcre.org/). The options -- argument, if present, may contain the following characters to -- alter the exact details. Unrecognized options are silently -- ignored. -- -- i or I -- -- Ignore case. -- -- m or M -- -- Multi-line: A carat (^) matches not only the start of the -- subject string, but also after each newline. Similarly, dollar -- ($) matches before a newline. -- -- s or S -- -- Single-line: Dot (.) matches any character, including newline. -- -- x or X -- -- Extended: Whitespace and comments (from # to the next newline) -- in the pattern are ignored. -- */ -- -- if (( number_of_args < 2) || ( number_of_args > 3 )) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- char *option_str = ""; -- -- if (number_of_args == 3) { -- if (evaluated_args[2].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- option_str = evaluated_args[2].s; -- } -- -- if ((evaluated_args[0].type != LX_STRING) || (evaluated_args[1].type != LX_STRING)) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- Regex r; -- const char *errstr = 0; -- int errpos = 0; -- bool valid; -- int options = regexp_str_to_options(option_str); -- -- valid = r.compile(evaluated_args[0].s, &errstr, &errpos, options); -- if (!valid) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- result->i = r.match(evaluated_args[1].s); -- result->type = LX_INTEGER; -- -- return TRUE; --} -- --int Function::FunctionRegexps( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- regexps(string pattern, string target, string substitute [, string -- options ]) returns string. -- -- Like regexp except that it returns the string substitute as modified by -- matches from regexp. -- -- If any of the arguments is not of type String or if pattern is not a valid -- regular expression, the result is an error. Otherwise, if pattern matches -- target, the result is true, otherwise it is false. -- -- The details of the syntax and semantics of the regular expressions follows -- the perl-compatible regular expression format as supported by the PCRE -- library (see http://www.pcre.org/). The options argument, if present, may -- contain the following characters to alter the exact details. Unrecognized -- options are silently ignored. -- -- i or I -- -- Ignore case. -- -- m or M -- -- Multi-line: A carat (^) matches not only the start of the -- subject string, but also after each newline. Similarly, dollar -- ($) matches before a newline. -- -- s or S -- -- Single-line: Dot (.) matches any character, including newline. -- -- x or X -- -- Extended: Whitespace and comments (from # to the next newline) -- in the pattern are ignored. -- */ -- -- if (( number_of_args < 3) || ( number_of_args > 4 )) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- char *option_str = ""; -- -- if (number_of_args == 4) { -- if (evaluated_args[3].type != LX_STRING) { -- result->type = LX_ERROR; -- return FALSE; -- } -- option_str = evaluated_args[3].s; -- } -- -- if ((evaluated_args[0].type != LX_STRING) || -- (evaluated_args[1].type != LX_STRING) || -- (evaluated_args[2].type != LX_STRING)) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- Regex r; -- const char *errstr = 0; -- int errpos = 0; -- bool valid; -- int options = regexp_str_to_options(option_str); -- -- -- valid = r.compile(evaluated_args[0].s, &errstr, &errpos, options); -- if (!valid) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- ExtArray a; -- MyString output; -- char *input = evaluated_args[2].s; -- -- if (!r.match(evaluated_args[1].s, &a)) { -- result->type = LX_STRING; -- result->s = strnewp(""); -- return TRUE; -- } -- -- result->type = LX_STRING; -- while (*input) { -- if (*input == '\\') { -- if (isdigit(input[1])) { -- int offset = input[1] - '0'; -- input++; -- output += a[offset]; -- } else { -- output += '\\'; -- } -- } else { -- output += *input; -- } -- input++; -- } -- result->s = strnewp(output.Value()); -- return TRUE; --} -- --int Function::FunctionFormatTime( -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- -- /* -- formatTime([int t], [string s]) returns string. -- -- This function creates a formatted string that is a representation of time t. -- -- The argument t is interpreted as an epoch time (seconds since 1/1/1970 GMT). -- The argument s is interpreted similarly to the format argument of -- the ANSI C strftime function. It consists of arbitary text plus placeholders -- for elements of the time. These placeholders are percent signs (%) followed -- by a single letter. To have a percent sign in your output, you must use a -- double percent sign (%%). -- If t is not specified, it defaults to the current time as reported by the OS. -- If s is not specified, it defaults to "%c". -- */ -- -- time_t epoch_time; // parameter one -- char *format_string; // parameter two -- -- if ( number_of_args > 2 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- // grab optional paramter 1, the time -- if ( number_of_args > 0 ) { -- // caller provided a time -- if( (evaluated_args[0].type != LX_INTEGER) || -- (evaluated_args[0].i < 0) ) -- { -- result->type = LX_ERROR; -- return FALSE; -- } -- epoch_time = evaluated_args[0].i; -- } else { -- // no time specified, default to current time -- time(&epoch_time); // yuck. -- } -- -- // grab optional paramter 2, the format string -- if( number_of_args == 2 ) { -- // caller provided a format string -- if ( evaluated_args[1].type != LX_STRING ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- format_string = evaluated_args[1].s; -- } else { -- // no format string specified, default to %c -- format_string = "%c"; -- } -- -- struct tm * time_components = localtime(&epoch_time); // not thread safe -- -- // the crux of this function is just a call to strftime(). -- int ret = 0; -- char output[1024]; // yuck!! -- if ( time_components ) { -- ret = strftime(output,sizeof(output),format_string,time_components); -- } -- -- result->type = LX_STRING; -- -- // if strftime wrote something, use that as the result. -- if ( ret > 0 ) { -- result->s = strnewp(output); -- } else { -- result->s = strnewp(""); -- } -- -- return TRUE; --} -- -- --int Function::FunctionEval( -- AttrList const *attrlist1, -- AttrList const *attrlist2, -- int number_of_args, // IN: size of evaluated args array -- EvalResult *evaluated_args, // IN: the arguments to the function -- EvalResult *result) // OUT: the result of calling the function --{ -- /* -- eval(string s) returns the result of the string s evaluated -- as a ClassAd expression. -- */ -- -- if ( number_of_args != 1 ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- if( (evaluated_args[0].type != LX_STRING) || -- (evaluated_args[0].i < 0) ) -- { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- char const *expr_str = evaluated_args[0].s; -- ExprTree *expr_tree; -- ParseClassAdRvalExpr(expr_str,expr_tree); -- if( !expr_tree ) { -- result->type = LX_ERROR; -- return FALSE; -- } -- -- int rc = expr_tree->EvalTree(attrlist1,attrlist2,result); -- -- delete expr_tree; -- return rc; --} -- -- --void dprintResult(ExprTree *tree, EvalResult *result) { -- if (result->debug) { -- char *s = NULL; -- tree->PrintToNewStr(&s); -- -- switch ( result->type ) { -- case LX_INTEGER : -- dprintf(D_ALWAYS, "Classad debug: %s --> %d\n", s, result->i); -- break; -- -- case LX_FLOAT : -- -- dprintf(D_ALWAYS, "Classad debug: %s --> %f\n", s, result->f); -- break; -- -- case LX_STRING : -- -- dprintf(D_ALWAYS, "Classad debug: %s --> %s\n", s, result->s); -- break; -- -- case LX_NULL : -- -- dprintf(D_ALWAYS, "Classad debug: %s --> NULL\n", s); -- break; -- -- case LX_UNDEFINED : -- -- dprintf(D_ALWAYS, "Classad debug: %s --> UNDEFINED\n", s); -- break; -- -- case LX_ERROR : -- -- dprintf(D_ALWAYS, "Classad debug: %s --> ERROR\n", s); -- break; -- -- default : -- -- dprintf(D_ALWAYS, "Classad debug: %s --> ???\n", s); -- break; -- } -- free(s); -- } --} -diff --git a/src/.deprecate_classad.old/astbase.cpp b/src/.deprecate_classad.old/astbase.cpp -deleted file mode 100644 -index 4d748f1..0000000 ---- a/src/.deprecate_classad.old/astbase.cpp -+++ /dev/null -@@ -1,1225 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --//****************************************************************************// --// astbase.C // --// // --// Implementation of the base Abstract Syntax Tree (AST) module. // --// // --//****************************************************************************// -- --#include "condor_common.h" --#include "condor_exprtype.h" --#include "condor_astbase.h" --#include "condor_debug.h" --#include "MyString.h" --#include "string_list.h" -- --#define AdvancePtr(ptr) while(*ptr != '\0') ptr++; -- --#include "stringSpace.h" --StringSpace *ExprTree::string_space = NULL; --int ExprTree::string_space_references = 0; -- --//////////////////////////////////////////////////////////////////////////////// --// Tree node constructors. // --//////////////////////////////////////////////////////////////////////////////// -- --VariableBase::VariableBase(char* varName) --{ -- this->stringSpaceIndex = string_space->getCanonical((const char *&)varName); -- // I apologize for casting away the const-ness of the char * here -- // I'm trying to make minimal changes in the code to add string space, -- // and it is safe. -- this->name = (char *) (*string_space)[stringSpaceIndex]; -- this->type = LX_VARIABLE; --} -- --IntegerBase::IntegerBase(int v) --{ -- this->value = v; -- this->type = LX_INTEGER; --} -- --FloatBase::FloatBase(float v) --{ -- this->value = v; -- this->type = LX_FLOAT; --} -- --BooleanBase::BooleanBase(int v) --{ -- this->value = v; -- this->type = LX_BOOL; --} -- --StringBase::StringBase(char* str) --{ -- stringSpaceIndex = string_space->getCanonical((const char *&)str); -- // I apologize for casting away the const-ness of the char * here -- // I'm trying to make minimal changes in the code to add string space, -- // and it is safe. -- value = (char *) (*string_space)[stringSpaceIndex]; -- this->type = LX_STRING; --} -- --ISOTimeBase::ISOTimeBase(char* str) --{ -- stringSpaceIndex = string_space->getCanonical((const char *&)str); -- // I apologize for casting away the const-ness of the char * here -- // I'm trying to make minimal changes in the code to add string space, -- // and it is safe. -- time = (char *) (*string_space)[stringSpaceIndex]; -- this->type = LX_TIME; --} -- --UndefinedBase::UndefinedBase() --{ -- this->type = LX_UNDEFINED; --} -- --ErrorBase::ErrorBase() --{ -- this->type = LX_ERROR; --} -- --AddOpBase::AddOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_ADD; --} -- --SubOpBase::SubOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_SUB; --} -- --MultOpBase::MultOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_MULT; --} -- --DivOpBase::DivOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_DIV; --} -- --MetaEqOpBase::MetaEqOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_META_EQ; --} -- --MetaNeqOpBase::MetaNeqOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_META_NEQ; --} -- --EqOpBase::EqOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_EQ; --} -- --NeqOpBase::NeqOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_NEQ; --} -- --GtOpBase::GtOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_GT; --} -- --GeOpBase::GeOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_GE; --} -- --LtOpBase::LtOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_LT; --} -- --LeOpBase::LeOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_LE; --} -- --AndOpBase::AndOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_AND; --} -- --OrOpBase::OrOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_OR; --} -- --AssignOpBase::AssignOpBase(ExprTree* l, ExprTree* r) --{ -- this->lArg = l; -- this->rArg = r; -- this->type = LX_ASSIGN; --} -- --//////////////////////////////////////////////////////////////////////////////// --// Destructors --//////////////////////////////////////////////////////////////////////////////// --VariableBase::~VariableBase() --{ -- string_space->disposeByIndex(stringSpaceIndex); --} -- --StringBase::~StringBase() --{ -- string_space->disposeByIndex(stringSpaceIndex); --} -- --ISOTimeBase::~ISOTimeBase() --{ -- string_space->disposeByIndex(stringSpaceIndex); --} -- --BinaryOpBase::~BinaryOpBase() --{ -- if (lArg != NULL) { -- delete lArg; -- } -- if (rArg != NULL) { -- delete rArg; -- } -- return; --} -- -- --//////////////////////////////////////////////////////////////////////////////// --// Comparison operator // --//////////////////////////////////////////////////////////////////////////////// -- --int ExprTree::operator ==(ExprTree& tree) --{ -- if(tree.type != this->type) -- { -- return FALSE; -- } -- return TRUE; --} -- --int VariableBase::operator==(ExprTree& tree) --{ -- if(tree.MyType() == LX_VARIABLE) -- { -- return !strcmp(this->name, ((VariableBase&)tree).name); -- } -- return FALSE; --} -- --int IntegerBase::operator ==(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return this->value == ((IntegerBase&)tree).value; -- } -- return FALSE; --} -- --int FloatBase::operator ==(ExprTree& tree) --{ -- if(tree.MyType() == LX_FLOAT) -- { -- return this->value == ((FloatBase&)tree).value; -- } -- return FALSE; --} -- --int StringBase::operator ==(ExprTree& tree) --{ -- if(tree.MyType() == LX_STRING) -- { -- return !strcmp(this->value, ((StringBase&)tree).value); -- } -- return FALSE; --} -- --int ISOTimeBase::operator ==(ExprTree& tree) --{ -- if(tree.MyType() == LX_TIME) -- { -- return !strcmp(this->time, ((ISOTimeBase&)tree).time); -- } -- return FALSE; --} -- --int BooleanBase::operator ==(ExprTree& tree) --{ -- if(tree.MyType() == LX_BOOL) -- { -- return this->value == ((BooleanBase&)tree).value; -- } -- return FALSE; --} -- --int BinaryOpBase::operator ==(ExprTree& tree) --{ -- // HACK!! No lArg implies user-directed parenthesization -- if ( this->lArg == NULL || ((BinaryOpBase&)tree).LArg() == NULL ) { -- return (this->lArg == ((BinaryOpBase&)tree).LArg()) && -- (*this->rArg == *((BinaryOpBase&)tree).RArg()); -- } else if (tree.MyType() == this->MyType()) { -- return (*this->lArg == *((BinaryOpBase&)tree).LArg()) && -- (*this->rArg == *((BinaryOpBase&)tree).RArg()); -- } -- return FALSE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// ">" operator. --//////////////////////////////////////////////////////////////////////////////// -- --int ExprTree::operator >(ExprTree&) --{ -- return FALSE; --} -- --int IntegerBase::operator >(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return value > ((IntegerBase*)&tree)->Value(); -- } -- else if(tree.MyType() == LX_FLOAT) -- { -- return value > ((FloatBase*)&tree)->Value(); -- } -- return FALSE; --} -- --int FloatBase::operator >(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return value > ((IntegerBase*)&tree)->Value(); -- } -- else if(tree.MyType() == LX_FLOAT) -- { -- return value > ((FloatBase*)&tree)->Value(); -- } -- return FALSE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// ">=" operator. --//////////////////////////////////////////////////////////////////////////////// -- --int ExprTree::operator >=(ExprTree&) --{ -- return FALSE; --} -- --int IntegerBase::operator >=(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return value >= ((IntegerBase*)&tree)->Value(); -- } -- else if(tree.MyType() == LX_FLOAT) -- { -- return value >= ((FloatBase*)&tree)->Value(); -- } -- return FALSE; --} -- --int FloatBase::operator >=(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return value >= ((IntegerBase*)&tree)->Value(); -- } -- else if(tree.MyType() == LX_FLOAT) -- { -- return value >= ((FloatBase*)&tree)->Value(); -- } -- return FALSE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// "<" operator. --//////////////////////////////////////////////////////////////////////////////// -- --int ExprTree::operator <(ExprTree&) --{ -- return FALSE; --} -- --int IntegerBase::operator <(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return value < ((IntegerBase*)&tree)->Value(); -- } -- else if(tree.MyType() == LX_FLOAT) -- { -- return value < ((FloatBase*)&tree)->Value(); -- } -- return FALSE; --} -- --int FloatBase::operator <(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return value < ((IntegerBase*)&tree)->Value(); -- } -- else if(tree.MyType() == LX_FLOAT) -- { -- return value < ((FloatBase*)&tree)->Value(); -- } -- return FALSE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// "<=" operator. --//////////////////////////////////////////////////////////////////////////////// -- --int ExprTree::operator <=(ExprTree&) --{ -- return FALSE; --} -- --int IntegerBase::operator <=(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return value <= ((IntegerBase*)&tree)->Value(); -- } -- else if(tree.MyType() == LX_FLOAT) -- { -- return value <= ((FloatBase*)&tree)->Value(); -- } -- return FALSE; --} -- --int FloatBase::operator <=(ExprTree& tree) --{ -- if(tree.MyType() == LX_INTEGER) -- { -- return value <= ((IntegerBase*)&tree)->Value(); -- } -- else if(tree.MyType() == LX_FLOAT) -- { -- return value <= ((FloatBase*)&tree)->Value(); -- } -- return FALSE; --} -- --// This is used by the various CopyDeep()s to get the variables from the base --// ExprTree class. --void ExprTree::CopyBaseExprTree(ExprTree * const recipient) const --{ -- recipient->unit = unit; -- recipient->type = type; -- recipient->evalFlag = evalFlag; -- recipient->invisible = invisible; -- return; --} -- --void ExprTree::PrintToNewStr(char **str) --{ -- int length; -- char *new_str; -- -- // Before we allocate new space for this string, we determine how -- // much space is needed. -- length = CalcPrintToStr(); -- new_str = (char *) malloc(length + 1); // +1 for termination -- *new_str = 0; // necessary, because PrintToStr begins at end of string -- -- // Now that we have a correctly sized string, fill it up. -- PrintToStr(new_str); -- -- // Sanity check--I've tested this quite thoroughly, so it shouldn't -- // except. It's a good idea to run test_classads though, should you -- // ever change the code. Catch errors before shipping. -- if (strlen(new_str) != (size_t) length) { -- EXCEPT("Bad length calculation in class ads. Expected %d, " -- "got %d (\"%s\"", -- length, strlen(new_str), new_str); -- } -- *str = new_str; -- -- return; --} -- --void ExprTree::PrintToStr(MyString & str) { -- char * tmp = 0; -- PrintToNewStr(&tmp); -- str = tmp; -- free(tmp); --} -- --//////////////////////////////////////////////////////////////////////////////// --// Display an expression tree. --//////////////////////////////////////////////////////////////////////////////// -- --void ExprTree::Display() --{ -- dprintf (D_NOHEADER | D_ALWAYS, "Unknown type"); --} -- --void VariableBase::Display() --{ -- dprintf (D_NOHEADER | D_ALWAYS, "%s", name); --} -- --void IntegerBase::Display() --{ -- dprintf(D_NOHEADER | D_ALWAYS, "%d", value); -- if(unit == 'k') -- { -- dprintf(D_NOHEADER | D_ALWAYS, " k"); -- } --} -- --void FloatBase::Display() --{ -- dprintf(D_NOHEADER | D_ALWAYS, "%f", value); -- if(unit == 'k') -- { -- dprintf(D_NOHEADER | D_ALWAYS, " k"); -- } --} -- --void StringBase::Display() --{ -- dprintf (D_NOHEADER | D_ALWAYS, "\"%s\"", value); --} -- --void ISOTimeBase::Display() --{ -- dprintf (D_NOHEADER | D_ALWAYS, "\"%s\"", time); --} -- --void BooleanBase::Display() --{ -- dprintf(D_NOHEADER | D_ALWAYS, (char *)(value ? "TRUE" : "FALSE") ); --} -- -- --void UndefinedBase::Display() --{ -- dprintf(D_NOHEADER | D_ALWAYS, "UNDEFINED"); --} -- --void ErrorBase::Display() --{ -- dprintf(D_NOHEADER | D_ALWAYS, "ERROR"); --} -- --void AddOpBase::Display() --{ -- if( !lArg ) { -- dprintf( D_NOHEADER | D_ALWAYS, "(" ); -- rArg->Display( ); -- dprintf( D_NOHEADER | D_ALWAYS, ")" ); -- } -- -- lArg->Display(); -- -- dprintf(D_NOHEADER | D_ALWAYS, " + "); -- if(rArg) -- { -- rArg->Display(); -- } -- if(unit == 'k') -- { -- dprintf(D_NOHEADER | D_ALWAYS, " k"); -- } --} -- --void SubOpBase::Display() --{ -- if(lArg) -- { -- lArg->Display(); -- } -- dprintf(D_NOHEADER | D_ALWAYS, " - "); -- if(rArg && (rArg->MyType() == LX_ADD || rArg->MyType() == LX_SUB)) -- { -- dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- } else -- { -- rArg->Display(); -- } -- if(unit == 'k') -- { -- dprintf(D_NOHEADER | D_ALWAYS, " k"); -- } --} -- --void MultOpBase::Display() --{ -- if(lArg && (lArg->MyType() == LX_ADD || lArg->MyType() == LX_SUB)) -- { -- dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- } else -- { -- lArg->Display(); -- } -- dprintf(D_NOHEADER | D_ALWAYS, " * "); -- if(rArg && (rArg->MyType() == LX_ADD || rArg->MyType() == LX_SUB)) -- { -- dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- } else -- { -- rArg->Display(); -- } -- if(unit == 'k') -- { -- dprintf(D_NOHEADER | D_ALWAYS, " k"); -- } --} -- --void DivOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_ADD : -- case LX_SUB : -- case LX_DIV : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default : lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " / "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_ADD : -- case LX_SUB : -- case LX_MULT: -- case LX_DIV : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default : rArg->Display(); -- } -- } -- if(unit == 'k') -- { -- dprintf(D_NOHEADER | D_ALWAYS, " k"); -- } --} -- --void MetaEqOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " =?= "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: rArg->Display(); -- } -- } --} -- --void MetaNeqOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " =!= "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: rArg->Display(); -- } -- } --} -- --void EqOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " == "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: rArg->Display(); -- } -- } --} -- --void NeqOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " != "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: rArg->Display(); -- } -- } --} -- -- --void GtOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " > "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: rArg->Display(); -- } -- } --} -- -- --void GeOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " >= "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: rArg->Display(); -- } -- } --} -- -- --void LtOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " < "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: rArg->Display(); -- } -- } --} -- -- --void LeOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: lArg->Display(); -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " <= "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default: rArg->Display(); -- } -- } --} -- --void AndOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_ADD : -- case LX_SUB : -- case LX_MULT : -- case LX_DIV : -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : -- case LX_OR : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default : lArg->Display(); -- break; -- } -- } -- -- dprintf(D_NOHEADER | D_ALWAYS, " && "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_ADD : -- case LX_SUB : -- case LX_MULT : -- case LX_DIV : -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : -- case LX_OR : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default : rArg->Display(); -- break; -- } -- } --} -- --void OrOpBase::Display() --{ -- if(lArg) -- { -- switch(lArg->MyType()) -- { -- case LX_ADD : -- case LX_SUB : -- case LX_MULT : -- case LX_DIV : -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : -- case LX_AND : dprintf(D_NOHEADER | D_ALWAYS, "("); -- lArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default : lArg->Display(); -- break; -- } -- } -- dprintf(D_NOHEADER | D_ALWAYS, " || "); -- if(rArg) -- { -- switch(rArg->MyType()) -- { -- case LX_ADD : -- case LX_SUB : -- case LX_MULT : -- case LX_DIV : -- case LX_EQ : -- case LX_NEQ : -- case LX_GT : -- case LX_GE : -- case LX_LT : -- case LX_LE : -- case LX_AND : dprintf(D_NOHEADER | D_ALWAYS, "("); -- rArg->Display(); -- dprintf(D_NOHEADER | D_ALWAYS, ")"); -- break; -- default : rArg->Display(); -- break; -- } -- } --} -- --void AssignOpBase::Display() --{ -- if(lArg) -- { -- lArg->Display(); -- } -- dprintf(D_NOHEADER | D_ALWAYS, " = "); -- if(rArg) -- { -- rArg->Display(); -- } --} -- --int IntegerBase::Value() --{ -- return value; --} -- --float FloatBase::Value() --{ -- return value; --} -- --const char * StringBase::Value() --{ -- return value; --} -- --const char * ISOTimeBase::Value() --{ -- return time; --} -- --int BooleanBase::Value() --{ -- return value; --} -- --FunctionBase::FunctionBase(char *tName) --{ -- this->stringSpaceIndex = string_space->getCanonical((const char *&)tName); -- // I apologize for casting away the const-ness of the char * here -- // I'm trying to make minimal changes in the code to add string space, -- // and it is safe. -- this->name = (char *) (*string_space)[stringSpaceIndex]; -- this->type = LX_FUNCTION; -- arguments = new List(); -- return; --} -- --FunctionBase::~FunctionBase() --{ -- ExprTree *arg = NULL; -- -- arguments->Rewind(); -- while(arguments->Next(arg)) { -- if(arg) { -- delete arg; -- arg = NULL; -- } -- } -- delete arguments; -- -- string_space->disposeByIndex(stringSpaceIndex); -- -- return; --} -- --int --FunctionBase::operator==(ExprTree& tree) --{ -- return 0; --} -- --void FunctionBase::GetReferences(const AttrList *base_attrlist, -- StringList &internal_references, -- StringList &external_references) const --{ -- -- ExprTree *arg; -- -- // These two lines make me shudder. -- // This function is const, but calling Rewind() and Next() -- // on the arguments list makes it non-const. In practice, -- // though, it's really const: we always rewind before we -- // look at the arguments. The problem is that the iterator -- // is part of the List class itself. In order to maintain -- // const-ness of this function, I'm going to take the easy -- // way out and magically turn it mutable, by hiding the -- // fact that it should be const. -- FunctionBase *mutable_this = (FunctionBase *) this; -- mutable_this->arguments->Rewind(); -- -- while (mutable_this->arguments->Next(arg)) { -- arg->GetReferences(base_attrlist, -- internal_references, external_references); -- } -- -- return; --} -- --void --FunctionBase::AppendArgument(ExprTree *argument) --{ -- arguments->Append(argument); -- return; --} -- --void --FunctionBase::EvaluateArgument( -- ExprTree *arg, -- const AttrList *attrlist1, -- const AttrList *attrlist2, -- EvalResult *result) const --{ -- if ( arg ) { -- if (attrlist2 == NULL) { -- // This will let us refer to attributes in a ClassAd, like "MY" -- arg->EvalTree(attrlist1, result); -- } else { -- // This will let us refer to attributes in two ClassAds: like -- // "My" and "Target" -- arg->EvalTree(attrlist1, attrlist2, result); -- } -- } -- return; --} -- --// I added a contructor for this base class to initialize --// unit to something. later we check to see if unit is "k" --// and without the contructor, we're doing that from unitialized --// memory which (belive it!) on HPUX happened to be 'k', and --// really bad things happened! Yes, this bug was a pain --// in the #*&@! to find! -Todd, 7/97 --// and now init sumFlag as well... not sure if it should be --// FALSE or TRUE! but it needs to be initialized -Todd, 9/10 --// and now init evalFlag as well (to detect circular eval'n) -Rajesh --// We no longer initialze sumFlag, because it has been removed. --// It's not used, that's why you couldn't figure out how to initialize --// it, Todd.-Alain 26-Sep-2001 --ExprTree::ExprTree() : unit('\0'), evalFlag(FALSE) --{ -- if (string_space_references == 0) { -- string_space = new StringSpace; -- } -- string_space_references++; -- invisible = false; -- type = LX_UNDEFINED; -- return; --} -- --ExprTree::~ExprTree() --{ -- string_space_references--; -- if (string_space_references == 0) { -- delete string_space; -- string_space = NULL; -- } -- return; --} -- -diff --git a/src/.deprecate_classad.old/attrlist.cpp b/src/.deprecate_classad.old/attrlist.cpp -deleted file mode 100644 -index b6e9a6e..0000000 ---- a/src/.deprecate_classad.old/attrlist.cpp -+++ /dev/null -@@ -1,2608 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --// AttrList.C --// --// Implementation of AttrList classes and AttrListList classes. --// -- --#include "condor_common.h" --#include "condor_debug.h" --#include "condor_ast.h" --#include "parser_internal.h" --#include "condor_attrlist.h" --#include "condor_attributes.h" --#include "iso_dates.h" --#include "condor_xml_classads.h" --#include "condor_string.h" // for strnewp() --#include "my_hostname.h" --#include "HashTable.h" --#include "YourString.h" -- --extern void evalFromEnvironment (const char *, EvalResult *); -- -- --// Chris Torek's world famous hashing function --// Modified to be case-insensitive --static unsigned int torekHash(const YourString &s) { -- unsigned int hash = 0; -- -- const char *p = s.s; -- while (*p) { -- hash = (hash<<5)+hash + (unsigned char)tolower(*p); -- p++; -- } -- -- return hash; --} -- --static const int hash_size = 79; // prime research -- --static const char *SECRET_MARKER = "ZKM"; // "it's a Zecret Klassad, Mon!" --static bool publish_server_time = false; --void AttrList_setPublishServerTime( bool publish ) --{ -- publish_server_time = publish; --} -- -- --/////////////////////////////////////////////////////////////////////////////// --// AttrListElem constructor. --//////////////////////////////////////////////////////////////////////////////// --AttrListElem::AttrListElem(ExprTree* expr) --{ -- tree = expr; -- dirty = false; -- name = ((Variable*)expr->LArg())->Name(); -- next = NULL; --} -- --//////////////////////////////////////////////////////////////////////////////// --// AttrListElem copy constructor. --//////////////////////////////////////////////////////////////////////////////// --AttrListElem::AttrListElem(AttrListElem& oldNode) --{ -- // This old lame Copy business doesn't really make a copy -- // oldNode.tree->Copy(); -- // this->tree = oldNode.tree; -- // So we do the new DeepCopy(): -- this->tree = oldNode.tree->DeepCopy(); -- this->dirty = false; -- this->name = ((Variable*)tree->LArg())->Name(); -- next = NULL; --} -- --//////////////////////////////////////////////////////////////////////////////// --// AttrListAbstract constructor. It is called by its derived classes. --// AttrListAbstract is a purely virtual class, there is no need for a user to --// declare a AttrListAbstract instance. --//////////////////////////////////////////////////////////////////////////////// --AttrListAbstract::AttrListAbstract(int atype) --{ -- this->type = atype; -- this->inList = NULL; -- this->next = NULL; -- this->prev = NULL; --} -- --//////////////////////////////////////////////////////////////////////////////// --// AttrListRep constructor. --//////////////////////////////////////////////////////////////////////////////// --AttrListRep::AttrListRep(AttrList* aList, AttrListList* attrListList) --: AttrListAbstract(ATTRLISTREP) --{ -- this->attrList = aList; -- this->inList = attrListList; -- this->nextRep = (AttrListRep *)aList->next; -- attrList->inList = NULL; -- attrList->next = this; --} -- --//////////////////////////////////////////////////////////////////////////////// --// AttrList class constructor when there is no AttrListList associated with it. --//////////////////////////////////////////////////////////////////////////////// --AttrList::AttrList() : AttrListAbstract(ATTRLISTENTITY) --{ -- exprList = NULL; -- hash = new HashTable(hash_size, torekHash); -- chainedAd = NULL; -- inside_insert = false; -- tail = NULL; -- ptrExpr = NULL; -- ptrName = NULL; -- ptrExprInChain = false; -- ptrNameInChain = false; -- associatedList = NULL; --} -- --//////////////////////////////////////////////////////////////////////////////// --// AttrList class constructor. The parameter indicates that this AttrList has --// an AttrListList associated with it. --//////////////////////////////////////////////////////////////////////////////// --AttrList::AttrList(AttrListList* assocList) : -- AttrListAbstract(ATTRLISTENTITY) --{ -- exprList = NULL; -- hash = new HashTable(hash_size, torekHash); -- chainedAd = NULL; -- inside_insert = false; -- tail = NULL; -- ptrExpr = NULL; -- ptrName = NULL; -- ptrExprInChain = false; -- ptrNameInChain = false; -- this->associatedList = assocList; -- if(associatedList) -- { -- if(!associatedList->associatedAttrLists) -- { -- assocList->associatedAttrLists = new AttrListList; -- } -- assocList->associatedAttrLists->Insert(this); -- } --} -- --// --// Constructor of AttrList class, read from a file. --// The string "delimitor" passed in or EOF delimits the end of a AttrList input. --// The newline character delimits an expression. White spaces before a new --// expression are ignored. --// 1 is passed on to the calling procedure if EOF is reached. Otherwise, 0 --// is passed on. --// --AttrList:: --AttrList(FILE *file, char *delimitor, int &isEOF, int &error, int &empty) -- : AttrListAbstract(ATTRLISTENTITY) --{ -- ExprTree *tree; -- int delimLen = strlen( delimitor ); -- int index; -- MyString line_buffer; -- -- exprList = NULL; -- hash = new HashTable(hash_size, torekHash); -- inside_insert = false; -- chainedAd = NULL; -- associatedList = NULL; -- tail = NULL; -- ptrExpr = NULL; -- ptrName = NULL; -- ptrExprInChain = false; -- ptrNameInChain = false; -- empty = TRUE; -- -- while( 1 ) { -- // get a line from the file -- if ( line_buffer.readLine( file, false ) == false ) { -- error = ( isEOF = feof( file ) ) ? 0 : errno; -- return; -- } -- -- // did we hit the delimitor? -- if ( strncmp( line_buffer.Value(), delimitor, delimLen ) == 0 ) { -- // yes ... stop -- isEOF = feof( file ); -- error = 0; -- return; -- } -- -- // Skip any leading white-space -- index = 0; -- while ( index < line_buffer.Length() && -- ( line_buffer[index] == ' ' || line_buffer[index] == '\t' ) ) { -- index++; -- } -- -- // if the rest of the string is empty, try reading again -- // if it starts with a pound character ("#"), treat as a comment -- if( index == line_buffer.Length() || line_buffer[index] == '\n' || -- line_buffer[index] == '#' ) { -- continue; -- } -- -- // parse the expression in the string -- if( Parse( line_buffer.Value(), tree ) || Insert( tree ) == FALSE ) { -- // print out where we barfed to the log file -- dprintf(D_ALWAYS,"failed to create classad; bad expr = %s\n", -- line_buffer.Value()); -- // read until delimitor or EOF; whichever comes first -- line_buffer = ""; -- while ( strncmp( line_buffer.Value(), delimitor, delimLen ) && -- !feof( file ) ) { -- line_buffer.readLine( file, false ); -- } -- isEOF = feof( file ); -- error = -1; -- return; -- } else { -- empty = FALSE; -- } -- } -- ClearAllDirtyFlags(); -- return; --} -- --#if 0 // don't use CONTEXTs anymore --//////////////////////////////////////////////////////////////////////////////// --// Create a AttrList from a CONTEXT. --//////////////////////////////////////////////////////////////////////////////// -- --int IsOperator(ELEM *elem) --{ -- switch(elem->type) { -- case GETS : -- case LT : -- case LE : -- case GT : -- case GE : -- case EQ : -- case NE : -- case AND : -- case OR : -- case PLUS : -- case MINUS : -- case MUL : -- case DIV : return TRUE; -- default : return FALSE; -- } --} -- --ELEM* Pop(STACK* stack) --{ -- stack->top--; -- return stack->data[stack->top]; --} -- --void Push(STACK* stack, ELEM *elem) --{ -- stack->data[stack->top] = elem; -- stack->top++; --} -- --char *Print_elem(ELEM *elem, char *str) --{ -- char *tmpChar; -- -- switch(elem->type) { -- case GETS : sprintf(str, " = "); -- break; -- case LT : sprintf(str, " < "); -- break; -- case LE : sprintf(str, " <= "); -- break; -- case GT : sprintf(str, " > "); -- break; -- case GE : sprintf(str, " >= "); -- break; -- case EQ : sprintf(str, " == "); -- break; -- case NE : sprintf(str, " != "); -- break; -- case AND : sprintf(str, " && "); -- break; -- case OR : sprintf(str, " || "); -- break; -- case PLUS : sprintf(str, " + "); -- break; -- case MINUS : sprintf(str, " - "); -- break; -- case MUL : sprintf(str, " * "); -- break; -- case DIV : sprintf(str, " / "); -- break; -- case NAME : sprintf(str, "%s", elem->val.string_val); -- break; -- case STRING: -- if(!elem->val.string_val) -- { -- sprintf(str, "(Null)"); -- } -- else -- { -- sprintf(str, "\"%s\"", elem->val.string_val); -- } -- break; -- case FLOAT : sprintf(str, "%f", elem->val.float_val); -- break; -- case INT : sprintf(str, "%d", elem->val.integer_val); -- break; -- case BOOL : sprintf(str, elem->val.integer_val? "TRUE" : "FALSE"); -- break; -- case NOT : sprintf(str, "!"); -- break; -- case EXPRSTRING : sprintf(str, "%s", elem->val.string_val); -- break; -- } -- -- for(tmpChar = str; *tmpChar != '\0'; tmpChar++); -- return tmpChar; --} -- --AttrList::AttrList(CONTEXT* context) : AttrListAbstract(ATTRLISTENTITY) --{ -- STACK stack; -- ELEM* elem, *lElem, *rElem; -- char* tmpExpr; -- char* tmpChar; -- int i, j; -- ExprTree* tmpTree; -- -- stack.top = 0; -- associatedList = NULL; -- tail = NULL; -- ptrExpr = NULL; -- ptrName = NULL; -- ptrExprInChain = false; -- ptrNameInChain = false; -- exprList = NULL; -- hash = new HashTable(hash_size, torekHash); -- chainedAd = NULL; -- inside_insert = false; -- -- for(i = 0; i < context->len; i++) -- { -- for(j = 0; j < (context->data)[i]->len; j++) -- { -- if(((context->data)[i]->data)[j]->type == ENDMARKER) -- { -- elem = Pop(&stack); -- if(Parse(elem->val.string_val, tmpTree) != 0) -- { -- dprintf(D_EXPR, "Can't parse %s\n", elem->val.string_val); -- } -- else -- { -- Insert(tmpTree); -- } -- delete []elem->val.string_val; -- delete elem; -- } -- else if(((context->data)[i]->data)[j]->type == NOT) -- { -- tmpExpr = new char[1000]; -- strcpy(tmpExpr, ""); -- rElem = Pop(&stack); -- strcat(tmpExpr, "(!"); -- tmpChar = tmpExpr + 2; -- Print_elem(rElem, tmpChar); -- strcat(tmpExpr, ")"); -- elem = new ELEM; -- elem->val.string_val = tmpExpr; -- elem->type = EXPRSTRING; -- Push(&stack, elem); -- if(rElem->type == EXPRSTRING) -- { -- delete rElem->val.string_val; -- delete rElem; -- } -- } -- else if(IsOperator(((context->data)[i]->data)[j])) -- { -- tmpExpr = new char[1000]; -- strcpy(tmpExpr, ""); -- rElem = Pop(&stack); -- lElem = Pop(&stack); -- if(((context->data)[i]->data)[j]->type != GETS) -- { -- strcat(tmpExpr, "("); -- tmpChar = tmpExpr + 1; -- } -- else -- tmpChar = tmpExpr; -- tmpChar = Print_elem(lElem, tmpChar); -- tmpChar = Print_elem(((context->data[i]->data)[j]), tmpChar); -- Print_elem(rElem, tmpChar); -- if(((context->data)[i]->data)[j]->type != GETS) -- strcat(tmpExpr, ")"); -- elem = new ELEM; -- elem->val.string_val = tmpExpr; -- elem->type = EXPRSTRING; -- Push(&stack, elem); -- if(rElem->type == EXPRSTRING) -- { -- delete rElem->val.string_val; -- delete rElem; -- } -- if(lElem->type == EXPRSTRING) -- { -- delete lElem->val.string_val; -- delete lElem; -- } -- } else -- Push(&stack, ((context->data)[i]->data)[j]); -- } -- } --} --#endif -- --//////////////////////////////////////////////////////////////////////////////// --// AttrList class copy constructor. --//////////////////////////////////////////////////////////////////////////////// --AttrList::AttrList(AttrList &old) : AttrListAbstract(ATTRLISTENTITY) --{ -- AttrListElem* tmpOld; // working variable -- AttrListElem* tmpThis; // working variable -- -- this->hash = new HashTable(hash_size,torekHash); -- if(old.exprList) { -- // copy all the AttrList elements. -- // As of 14-Sep-2001, we now copy the trees, not just the pointers -- // to the trees. This happens in the copy constructor for AttrListElem -- this->exprList = new AttrListElem(*old.exprList); -- hash->insert(((Variable *)this->exprList->tree->LArg())->Name(), -- this->exprList); -- tmpThis = this->exprList; -- for(tmpOld = old.exprList->next; tmpOld; tmpOld = tmpOld->next) { -- tmpThis->next = new AttrListElem(*tmpOld); -- hash->insert(((Variable *)tmpThis->next->tree->LArg())->Name(), -- tmpThis->next); -- tmpThis = tmpThis->next; -- } -- tmpThis->next = NULL; -- this->tail = tmpThis; -- } -- else { -- this->exprList = NULL; -- this->tail = NULL; -- } -- -- this->chainedAd = old.chainedAd; -- this->inside_insert = false; -- this->ptrExpr = NULL; -- this->ptrName = NULL; -- this->ptrExprInChain = false; -- this->ptrNameInChain = false; -- this->associatedList = old.associatedList; -- if(this->associatedList) { -- this->associatedList->associatedAttrLists->Insert(this); -- } -- return; --} -- --//////////////////////////////////////////////////////////////////////////////// --// AttrList class destructor. --//////////////////////////////////////////////////////////////////////////////// --AttrList::~AttrList() --{ -- // Delete all of the attributes in this list -- Clear(); -- -- // Free memory associated with the hash table -- if ( hash ) { -- delete hash; -- hash = NULL; -- } -- -- // If we're part of an AttrListList (a.k.a. ClassAdList), -- // delete ourselves out of there, too. -- if(associatedList) -- { -- associatedList->associatedAttrLists->Delete(this); -- } --} -- --AttrList& AttrList::operator=(const AttrList& other) --{ -- if (this != &other) { -- // First delete our old stuff. -- Clear(); -- -- if ( !this->hash ) { -- // should not happen, but just in case... -- this->hash = new HashTable(hash_size, torekHash); -- } -- -- if(associatedList) { -- associatedList->associatedAttrLists->Delete(this); -- } -- -- // Then copy over the new stuff -- AttrListElem* tmpOther; // working variable -- AttrListElem* tmpThis; // working variable -- -- if(other.exprList) { -- this->exprList = new AttrListElem(*other.exprList); -- tmpThis = this->exprList; -- hash->insert(((Variable *)tmpThis->tree->LArg())->Name(), -- tmpThis); -- for(tmpOther = other.exprList->next; tmpOther; tmpOther = tmpOther->next) { -- tmpThis->next = new AttrListElem(*tmpOther); -- tmpThis = tmpThis->next; -- hash->insert(((Variable *)tmpThis->tree->LArg())->Name(), -- tmpThis); -- } -- tmpThis->next = NULL; -- this->tail = tmpThis; -- } -- else { -- this->exprList = NULL; -- this->tail = NULL; -- } -- -- this->chainedAd = other.chainedAd; -- this->inside_insert = false; -- this->ptrExpr = NULL; -- this->ptrName = NULL; -- this->ptrExprInChain = false; -- this->ptrNameInChain = false; -- this->associatedList = other.associatedList; -- if (this->associatedList) { -- this->associatedList->associatedAttrLists->Insert(this); -- } -- -- } -- return *this; --} -- -- --//////////////////////////////////////////////////////////////////////////////// --// Insert an expression tree into a AttrList. If the expression is not an --// assignment expression, FALSE is returned. Otherwise, it is inserted at the --// end of the expression list. --//////////////////////////////////////////////////////////////////////////////// --int AttrList::Insert(const char* str, bool check_for_dups) --{ -- ExprTree* tree = NULL; -- int result = FALSE; -- -- if(Parse(str, tree) != 0 || !tree) -- { -- if( tree ) { -- delete tree; -- } -- return FALSE; -- } -- result = Insert(tree, check_for_dups); -- if ( result == FALSE ) { -- delete tree; -- } -- return result; --} -- --int AttrList::Insert(const char *str, ExprTree *expr, bool check_for_dups) --{ -- ExprTree *lhs; -- ExprTree *assign; -- if ( str == NULL || expr == NULL || expr->MyType() == LX_ASSIGN || -- !IsValidAttrName( str ) ) { -- return FALSE; -- } -- if ( ParseClassAdRvalExpr( str, lhs ) != 0 || lhs == NULL ) { -- delete lhs; -- return FALSE; -- } -- assign = new AssignOp( lhs, expr ); -- ASSERT( Insert( assign, check_for_dups ) ); -- return TRUE; --} -- --int AttrList::Insert(ExprTree* expr, bool check_for_dups) --{ -- if(expr == NULL || expr->MyType() != LX_ASSIGN || -- expr->LArg()->MyType() != LX_VARIABLE) -- { -- return FALSE; -- } -- -- inside_insert = true; -- -- if(check_for_dups && Lookup(expr->LArg())) -- { -- Delete(((Variable*)expr->LArg())->Name()); -- } -- -- AttrListElem* newNode = new AttrListElem(expr); -- -- newNode->SetDirty(true); -- -- if(!tail) -- { -- exprList = newNode; -- } -- else -- { -- tail->next = newNode; -- } -- tail = newNode; -- -- inside_insert = false; -- -- hash->insert(((Variable *)newNode->tree->LArg())->Name(), -- newNode); -- return TRUE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// Delete an expression with the name "name" from this AttrList. Return TRUE if --// successful; FALSE if the expression can not be found. --//////////////////////////////////////////////////////////////////////////////// --int AttrList::Delete(const char* name) --{ -- AttrListElem* previous = exprList; -- AttrListElem* cur = exprList; -- int found = FALSE; -- -- hash->remove(name); -- while(cur) -- { -- if(!strcasecmp(name, cur->name)) -- // expression to be deleted is found -- { -- // delete the expression -- if(cur == exprList) -- // the expression to be deleted is at the head of the list -- { -- exprList = exprList->next; -- if(tail == cur) -- { -- tail = NULL; -- } -- } -- else -- { -- previous->next = cur->next; -- if(tail == cur) -- { -- tail = previous; -- } -- } -- -- if(ptrExpr == cur) -- { -- ptrExpr = cur->next; -- } -- -- if(ptrName == cur) -- { -- ptrName = cur->next; -- } -- -- delete cur; -- found = TRUE; -- break; -- } -- else -- // expression to be deleted not found, continue search -- { -- previous = cur; -- cur = cur->next; -- } -- } // end of while loop to search the expression to be deleted -- -- // see this attr exists in our chained -- // ad; if so, must insert the attr into this ad as UNDEFINED. -- if ( chainedAd && !inside_insert) { -- for (cur = chainedAd->exprList; cur; cur = cur->next ) { -- if(!strcasecmp(name, cur->name)) -- // expression to be deleted is found -- { -- AssignExpr(name, 0); // 0 means "UNDEFINED" -- found = TRUE; -- break; -- } -- } -- } -- -- -- return found; --} -- --void AttrList::SetDirtyFlag(const char *name, bool dirty) --{ -- AttrListElem *element; -- -- element = LookupElem(name); -- if (element != NULL) { -- element->SetDirty(dirty); -- } -- return; --} -- --void AttrList::GetDirtyFlag(const char *name, bool *exists, bool *dirty) --{ -- AttrListElem *element; -- bool _exists, _dirty; -- -- element = LookupElem(name); -- if (element == NULL) { -- _exists = false; -- _dirty = false; -- } else { -- _exists = true; -- _dirty = element->IsDirty(); -- } -- -- if (exists) { -- *exists = _exists; -- } -- if (dirty) { -- *dirty = _dirty; -- } -- return; --} -- --/////////////////////////////////////////////////////////////////////////////// --// Reset the dirty flags for each expression tree in the AttrList. --/////////////////////////////////////////////////////////////////////////////// -- --void AttrList::ClearAllDirtyFlags() --{ -- AttrListElem *current; -- -- current = exprList; -- while (current != NULL) { -- current->SetDirty(false); -- current = current->next; -- } -- return; --} -- --void --AttrList::ChainCollapse() --{ -- ExprTree *tmp; -- -- if (!chainedAd) { -- // no chained attributes, we're done -- return; -- } -- -- AttrListElem* chained = chainedAd->exprList; -- -- chainedAd = NULL; // do not delete chainedAd here! -- -- while (chained && (tmp=chained->tree)) { -- // Move the value from our chained ad into our ad ONLY -- // if it does not already exist --- so we do a Lookup() -- // first, and only Insert() if the Lookup fails. -- // This is because we want attributes in our ad to have -- // precedent over the chained (cluster) ad when we collapse. -- if ( !Lookup(tmp->LArg()) ) { -- -- tmp = tmp->DeepCopy(); -- ASSERT(tmp); -- -- Insert(tmp,false); // no need for Insert() to check for dups -- } -- chained = chained->next; -- } --} -- -- --ExprTree* AttrList::NextExpr() --{ -- // After iterating through all the exprs in this ad, -- // get all the exprs in our chained ad as well. -- if (!this->ptrExpr && chainedAd && !ptrExprInChain ) { -- ptrExprInChain = true; -- ptrExpr = chainedAd->exprList; -- } -- if(!this->ptrExpr) -- { -- return NULL; -- } -- else -- { -- ExprTree* tmp = ptrExpr->tree; -- ptrExpr = ptrExpr->next; -- return tmp; -- } --} -- --bool AttrList::NextExpr( const char *&name, ExprTree *&value ) { -- ExprTree *assign = NextExpr(); -- if ( assign ) { -- name = ((Variable *)assign->LArg())->Name(); -- value = assign->RArg(); -- return true; -- } else { -- return false; -- } --} -- --ExprTree* AttrList::NextDirtyExpr() --{ -- ExprTree *expr; -- -- // Note: no need to check chained attrs here, since in normal -- // practice they will never be dirty. -- -- expr = NULL; -- // Loop until we find a dirty attribute -- while (ptrExpr != NULL && !ptrExpr->IsDirty()) { -- ptrExpr = ptrExpr->next; -- } -- // If we found a dirty attribute, pull out its expression tree -- // and set us up for the next call to NextDirtyExpr() -- if (ptrExpr != NULL) { -- expr = ptrExpr->tree; -- ptrExpr = ptrExpr->next; -- } -- return expr; --} -- --bool AttrList::NextDirtyExpr( const char *&name, ExprTree *&value ) { -- ExprTree *assign = NextDirtyExpr(); -- if ( assign ) { -- name = ((Variable *)assign->LArg())->Name(); -- value = assign->RArg(); -- return true; -- } else { -- return false; -- } --} -- --char* AttrList::NextName() --{ -- const char *name; -- -- if( (name=this->NextNameOriginal()) == NULL ) -- { -- return NULL; -- } -- else -- { -- char* tmp = new char[strlen(name) + 1]; -- strcpy(tmp, name); -- return tmp; -- } --} -- --const char* AttrList::NextNameOriginal() --{ -- char *name; -- -- // After iterating through all the names in this ad, -- // get all the names in our chained ad as well. -- if (!this->ptrName && chainedAd && !ptrNameInChain ) { -- ptrNameInChain = true; -- ptrName = chainedAd->exprList; -- } -- if (!this->ptrName) { -- name = NULL; -- } -- else { -- name = ptrName->name; -- ptrName = ptrName->next; -- } -- return name; --} -- --char *AttrList::NextDirtyName() --{ -- char *name; -- -- // Note: no need to check chained attrs here, since in normal -- // practice they will never be dirty. -- -- name = NULL; -- -- // Loop until we find a dirty attribute -- while (ptrName != NULL && !ptrName->IsDirty()) { -- ptrName = ptrName->next; -- } -- // If we found a dirty attribute, pull out its name -- // and set us up for the next call to NextDirtyName() -- if (ptrName != NULL) { -- name = strnewp(ptrName->name); -- ptrName = ptrName->next; -- } -- return name; --} -- --//////////////////////////////////////////////////////////////////////////////// --// Return the named expression without copying it. Return NULL if the named --// expression is not found. --//////////////////////////////////////////////////////////////////////////////// --ExprTree* AttrList::Lookup(char* name) const --{ -- return Lookup ((const char *) name); --} -- --ExprTree* AttrList::LookupExpr(const char* name) const --{ -- ExprTree *expr = Lookup(name); -- if ( expr ) { -- return expr->RArg(); -- } else { -- return NULL; -- } --} -- --ExprTree* AttrList::Lookup(const char* name) const --{ -- AttrListElem* tmpNode = NULL; -- -- ASSERT(hash); -- -- hash->lookup(name, tmpNode); -- if (tmpNode) { -- return tmpNode->tree; -- } -- -- if (chainedAd && !inside_insert) { -- chainedAd->hash->lookup(name, tmpNode); -- if (tmpNode) { -- return tmpNode->tree; -- } -- } -- -- return NULL; --} -- --AttrListElem *AttrList::LookupElem(const char *name) const --{ -- AttrListElem *theElem = NULL; -- -- hash->lookup(name, theElem); -- -- if (theElem) { -- return theElem; -- } -- -- if (chainedAd && !inside_insert) { -- chainedAd->hash->lookup(name, theElem); -- } -- -- return theElem; --} -- --ExprTree* AttrList::Lookup(const ExprTree* attr) const --{ -- return Lookup (((const Variable*)attr)->Name()); --} -- --int AttrList::LookupString (const char *name, char *value) const --{ -- ExprTree *tree, *rhs; -- const char *strVal; -- -- tree = Lookup (name); -- if (tree && (rhs=tree->RArg()) && (rhs->MyType() == LX_STRING) && -- (strVal = ((String *) rhs)->Value()) && strVal) -- { -- strcpy (value, strVal); -- return 1; -- } -- -- return 0; --} -- --int AttrList::LookupString (const char *name, char *value, int max_len) const --{ -- ExprTree *tree, *rhs; -- const char *strVal; -- -- tree = Lookup (name); -- if (tree && (rhs=tree->RArg()) && (rhs->MyType() == LX_STRING) && -- (strVal = ((String *) rhs)->Value()) && strVal) -- { -- strncpy (value, strVal, max_len); -- return 1; -- } -- -- return 0; --} -- --int AttrList::LookupString (const char *name, char **value) const --{ -- ExprTree *tree, *rhs; -- const char *strVal; -- -- tree = Lookup (name); -- if (tree && (rhs=tree->RArg()) && (rhs->MyType() == LX_STRING) && -- (strVal = ((String *) rhs)->Value()) && strVal) -- { -- // Unlike the other lame version of this function call, we -- // ensure that we have sufficient space to actually do this. -- *value = (char *) malloc(strlen(strVal) + 1); -- if (*value != NULL) { -- strcpy(*value, strVal); -- return 1; -- } -- else { -- // We shouldn't ever fail, but what if something gets corrupted -- // and we try to allocate 3billion bytes of storage? -- return 0; -- } -- } -- -- return 0; --} -- --/* This is just a thin wrapper to the mallocing version to simplify --usage. Having client code need to remember to free memory sucks. --Indeed, it's telling that lots of client code just does LookupString on --a fixed length buffer, hoping that it will be big enough. --*/ --int AttrList::LookupString (const char *name, MyString & value) const --{ -- char * results = 0; -- int success = LookupString(name, &results); -- if( success ) value = results; -- free(results); -- return success; --} -- --int AttrList::LookupTime (const char *name, char **value) const --{ -- ExprTree *tree, *rhs; -- const char *strVal; -- -- tree = Lookup (name); -- if (tree && (rhs=tree->RArg()) && (rhs->MyType() == LX_TIME) && -- (strVal = ((String *) rhs)->Value()) && strVal) -- { -- *value = (char *) malloc(strlen(strVal) + 1); -- if (*value != NULL) { -- strcpy(*value, strVal); -- return 1; -- } -- else { -- // We shouldn't ever fail, but what if something gets corrupted -- // and we try to allocate 3billion bytes of storage? -- return 0; -- } -- } -- -- return 0; --} -- --int AttrList::LookupTime(const char *name, struct tm *time, bool *is_utc) const --{ -- ExprTree *tree, *rhs; -- const char *strVal; -- int succeeded; -- -- succeeded = 0; -- if (name != NULL && time != NULL && is_utc != NULL) { -- tree = Lookup (name); -- if (tree && (rhs=tree->RArg()) && (rhs->MyType() == LX_TIME) && -- (strVal = ((String *) rhs)->Value()) && strVal) { -- iso8601_to_time(strVal, time, is_utc); -- succeeded = 1; -- } -- } -- -- return succeeded; --} -- --int AttrList::LookupInteger (const char *name, int &value) const --{ -- ExprTree *tree, *rhs; -- -- tree = Lookup (name); -- if (tree && (rhs=tree->RArg()) && (rhs->MyType() == LX_INTEGER)) -- { -- value = ((Integer *) rhs)->Value(); -- return 1; -- } -- if (tree && (rhs=tree->RArg()) && (rhs->MyType() == LX_BOOL)) -- { -- value = ((ClassadBoolean *) rhs)->Value(); -- return 1; -- } -- -- return 0; --} -- --int AttrList::LookupFloat (const char *name, float &value) const --{ -- ExprTree *tree, *rhs; -- -- tree = Lookup (name); -- if( tree && (rhs=tree->RArg()) ) { -- if( rhs->MyType() == LX_FLOAT ) { -- value = ((Float *) rhs)->Value(); -- return 1; -- } -- if( rhs->MyType() == LX_INTEGER ) { -- value = (float)(((Integer *) rhs)->Value()); -- return 1; -- } -- } -- return 0; --} -- --int AttrList::LookupBool (const char *name, int &value) const --{ -- ExprTree *tree, *rhs; -- -- tree = Lookup (name); -- if (tree && (rhs=tree->RArg()) && (rhs->MyType() == LX_BOOL)) -- { -- value = ((ClassadBoolean *) rhs)->Value(); -- return 1; -- } -- -- return 0; --} -- -- --bool AttrList::LookupBool (const char *name, bool &value) const --{ -- int val; -- if( LookupBool(name, val) ) { -- value = (bool)val; -- return true; -- } -- return false; --} -- -- --int AttrList::EvalString (const char *name, const AttrList *target, char *value) const --{ -- ExprTree *tree; -- EvalResult val; -- -- tree = Lookup(name); -- if(!tree) { -- if (target) { -- tree = target->Lookup(name); -- } else { -- evalFromEnvironment (name, &val); -- if (val.type == LX_STRING && val.s) -- { -- strcpy (value, val.s); -- return 1; -- } -- return 0; -- } -- } -- -- if(tree && tree->EvalTree(this,target,&val) && val.type==LX_STRING && val.s) -- { -- strcpy (value, val.s); -- return 1; -- } -- -- return 0; --} -- --// Unlike the other lame version of this function call, we ensure that --// we allocate the value, to ensure that we have sufficient space. --int AttrList::EvalString (const char *name, const AttrList *target, char **value) const --{ -- ExprTree *tree; -- EvalResult val; -- -- tree = Lookup(name); -- if(!tree) { -- if (target) { -- tree = target->Lookup(name); -- } else { -- evalFromEnvironment (name, &val); -- if (val.type == LX_STRING && val.s) -- { -- *value = (char *) malloc(strlen(val.s) + 1); -- if (*value != NULL) { -- strcpy(*value, val.s); -- return 1; -- } else { -- return 0; -- } -- } -- return 0; -- } -- } -- -- if(tree && tree->EvalTree(this,target,&val) && val.type==LX_STRING && val.s) -- { -- *value = (char *) malloc(strlen(val.s) + 1); -- if (*value != NULL) { -- strcpy(*value, val.s); -- return 1; -- } else { -- return 0; -- } -- } -- -- return 0; --} -- --int AttrList::EvalString (const char *name, const AttrList *target, MyString & value) const --{ -- char * pvalue = NULL; -- int ret = EvalString(name, target, &pvalue); -- if(ret == 0) { return ret; } -- value = pvalue; -- free(pvalue); -- return ret; --} -- --int AttrList::EvalInteger (const char *name, const AttrList *target, int &value) const --{ -- ExprTree *tree; -- EvalResult val; -- -- tree = Lookup(name); -- if(!tree) { -- if (target) { -- tree = target->Lookup(name); -- } else { -- evalFromEnvironment (name, &val); -- if (val.type == LX_INTEGER) -- { -- value = val.i; -- return 1; -- } -- return 0; -- } -- } -- -- if (tree && tree->EvalTree (this, target, &val) && val.type == LX_INTEGER) -- { -- value = val.i; -- return 1; -- } -- -- return 0; --} -- --int AttrList::EvalFloat (const char *name, const AttrList *target, float &value) const --{ -- ExprTree *tree; -- EvalResult val; -- -- tree = Lookup(name); -- -- if(!tree) { -- if (target) { -- tree = target->Lookup(name); -- } else { -- evalFromEnvironment (name, &val); -- if( val.type == LX_FLOAT ) { -- value = val.f; -- return 1; -- } -- if( val.type == LX_INTEGER ) { -- value = (float)val.i; -- return 1; -- } -- return 0; -- } -- } -- -- if( tree && tree->EvalTree (this, target, &val) ) { -- if( val.type == LX_FLOAT ) { -- value = val.f; -- return 1; -- } -- if( val.type == LX_INTEGER ) { -- value = (float)val.i; -- return 1; -- } -- } -- return 0; --} -- --int AttrList::EvalBool (const char *name, const AttrList *target, int &value) const --{ -- ExprTree *tree; -- EvalResult val; -- -- tree = Lookup(name); -- if(!tree) { -- if (target) { -- tree = target->Lookup(name); -- } else { -- evalFromEnvironment (name, &val); -- if (val.type == LX_INTEGER) -- { -- value = (val.i ? 1 : 0); -- return 1; -- } -- return 0; -- } -- } -- -- if (tree && tree->EvalTree (this, target, &val)) -- { -- switch (val.type) -- { -- case LX_INTEGER: value = (val.i ? 1 : 0); break; -- case LX_FLOAT: value = (val.f ? 1 : 0); break; -- -- default: -- return 0; -- } -- return 1; -- } -- -- return 0; --} -- --//////////////////////////////////////////////////////////////////////////////// --// Test to see if the AttrList belongs to a AttrList list. Returns TRUE if it --// does, FALSE if not. --//////////////////////////////////////////////////////////////////////////////// --int AttrList::IsInList(AttrListList* AttrListList) --{ -- AttrListRep* tmp; -- -- if(!this->inList && !this->next) -- { -- // not in any list -- return FALSE; -- } -- else if(this->inList) -- { -- // in one list -- if(this->inList == AttrListList) -- { -- return TRUE; -- } -- else -- { -- return FALSE; -- } -- } -- else -- { -- // in more than one list -- tmp = (AttrListRep *)this->next; -- while(tmp && tmp->inList != AttrListList) -- { -- tmp = tmp->nextRep; -- } -- if(!tmp) -- { -- return FALSE; -- } -- else -- { -- return TRUE; -- } -- } --} -- --//////////////////////////////////////////////////////////////////////////////// --// Print an expression with a certain name into a file. Returns FALSE if the --// pointer to the file or the name is NULL, or the named expression can not be --// found in this AttrList; TRUE otherwise. --//////////////////////////////////////////////////////////////////////////////// --int AttrList::fPrintExpr(FILE* f, char* name) --{ -- if(!f || !name) -- { -- return FALSE; -- } -- -- ExprTree* tmpExpr = Lookup(name); -- char tmpStr[10000] = ""; -- -- if(!tmpExpr) -- // the named expression is not found -- { -- return FALSE; -- } -- -- tmpExpr->PrintToStr(tmpStr); -- fprintf(f, "%s\n", tmpStr); -- return TRUE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// Print an expression with a certain name into a buffer. Returns FALSE if the --// named expression can not be found in this AttrList; TRUE if otherwise. --// The caller should pass the size of the buffer in buffersize. --// If buffer is NULL, then space will be allocated with malloc(), and it needs --// to be free-ed with free() by the user. --//////////////////////////////////////////////////////////////////////////////// --char * --AttrList::sPrintExpr(char *buffer, unsigned int buffersize, const char* name) --{ -- if(!name) -- { -- return NULL; -- } -- -- ExprTree* tmpExpr = Lookup(name); -- MyString tmpStr; -- -- if(!tmpExpr) -- // the named expression is not found -- { -- return NULL; -- } -- -- tmpExpr->PrintToStr(tmpStr); -- if (buffer) { -- strncpy(buffer,tmpStr.Value(),buffersize); -- buffer[buffersize-1] = '\0'; -- // Behavior is undefined if buffer is not big enough. -- // Currently, we return TRUE. -- } else { -- if ( (buffer=strdup(tmpStr.Value())) == NULL ) { -- EXCEPT("Out of memory"); -- } -- } -- -- return buffer; --} -- --//////////////////////////////////////////////////////////////////////////////// --// print the whole AttrList into a file. The expressions are in infix notation. --// Returns FALSE if the file pointer is NULL; TRUE otherwise. --//////////////////////////////////////////////////////////////////////////////// --int AttrList::fPrint(FILE* f,StringList *attr_white_list) --{ -- AttrListElem* tmpElem; -- char *tmpLine; -- -- if(!f) -- { -- return FALSE; -- } -- -- // if this is a chained ad, print out chained attrs first. this is so -- // if this ad is scanned in from a file, the chained attrs will get -- // updated with attrs from this ad in case of duplicates. -- if ( chainedAd ) { -- for(tmpElem = chainedAd->exprList; tmpElem; tmpElem = tmpElem->next) -- { -- tmpLine = NULL; -- if( tmpElem->tree->invisible ) { -- continue; -- } -- if( attr_white_list && !attr_white_list->contains_anycase(((VariableBase *)tmpElem->tree->LArg())->Name()) ) { -- continue; // not in white-list -- } -- tmpElem->tree->PrintToNewStr(&tmpLine); -- if (tmpLine != NULL) { -- fprintf(f, "%s\n", tmpLine); -- free(tmpLine); -- } -- } -- } -- -- for(tmpElem = exprList; tmpElem; tmpElem = tmpElem->next) -- { -- tmpLine = NULL; -- if( tmpElem->tree->invisible ) { -- continue; -- } -- if( attr_white_list && !attr_white_list->contains_anycase(((VariableBase *)tmpElem->tree->LArg())->Name()) ) { -- continue; // not in white-list -- } -- tmpElem->tree->PrintToNewStr(&tmpLine); -- if (tmpLine != NULL) { -- fprintf(f, "%s\n", tmpLine); -- free(tmpLine); -- } -- } -- return TRUE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// print the whole AttrList into a file. The expressions are in infix notation. --// Returns FALSE if the file pointer is NULL; TRUE otherwise. --//////////////////////////////////////////////////////////////////////////////// --int AttrList::sPrint(MyString &output) --{ -- AttrListElem* tmpElem; -- char *tmpLine; -- -- // if this is a chained ad, print out chained attrs first. this is so -- // if this ad is scanned in from a file, the chained attrs will get -- // updated with attrs from this ad in case of duplicates. -- if ( chainedAd ) { -- for(tmpElem = chainedAd->exprList; tmpElem; tmpElem = tmpElem->next) -- { -- tmpLine = NULL; -- if( tmpElem->tree->invisible ) { -- continue; -- } -- tmpElem->tree->PrintToNewStr(&tmpLine); -- if (tmpLine != NULL) { -- output += tmpLine; -- output += '\n'; -- free(tmpLine); -- } -- } -- } -- -- for(tmpElem = exprList; tmpElem; tmpElem = tmpElem->next) -- { -- tmpLine = NULL; -- if( tmpElem->tree->invisible ) { -- continue; -- } -- tmpElem->tree->PrintToNewStr(&tmpLine); -- if (tmpLine != NULL) { -- output += tmpLine; -- output += '\n'; -- free(tmpLine); -- } -- } -- return TRUE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// print the whole AttrList to the given debug level. The expressions --// are in infix notation. --//////////////////////////////////////////////////////////////////////////////// --void --AttrList::dPrint( int level ) --{ -- AttrListElem* tmpElem; -- char *tmpLine; -- int flag = D_NOHEADER | level; -- -- if( !(DebugFlags & level) ) { -- return; -- } -- -- // don't log private stuff into the (probably publicly visible) log file -- SetPrivateAttributesInvisible(true); -- -- // if this is a chained ad, print out chained attrs first. this is so -- // if this ad is scanned in from a file, the chained attrs will get -- // updated with attrs from this ad in case of duplicates. -- if ( chainedAd ) { -- for(tmpElem = chainedAd->exprList; tmpElem; tmpElem = tmpElem->next) -- { -- tmpLine = NULL; -- if( tmpElem->tree->invisible ) { -- continue; -- } -- tmpElem->tree->PrintToNewStr(&tmpLine); -- if (tmpLine != NULL) { -- dprintf( flag, "%s\n", tmpLine); -- free(tmpLine); -- } -- } -- } -- -- for(tmpElem = exprList; tmpElem; tmpElem = tmpElem->next) -- { -- tmpLine = NULL; -- if( tmpElem->tree->invisible ) { -- continue; -- } -- tmpElem->tree->PrintToNewStr(&tmpLine); -- if (tmpLine != NULL) { -- dprintf( flag, "%s\n", tmpLine); -- free(tmpLine); -- } -- } -- -- SetPrivateAttributesInvisible(false); --} -- -- --AttrListList::AttrListList() --{ -- head = NULL; -- tail = NULL; -- ptr = NULL; -- associatedAttrLists = NULL; -- length = 0; --} -- --AttrListList::AttrListList(AttrListList& oldList) --{ -- AttrList* tmpAttrList; -- -- head = NULL; -- tail = NULL; -- ptr = NULL; -- associatedAttrLists = NULL; -- length = 0; -- -- if(oldList.head) -- // the AttrList list to be copied is not empty -- { -- oldList.Open(); -- while((tmpAttrList = oldList.Next())) -- { -- switch(tmpAttrList->Type()) -- { -- case ATTRLISTENTITY : -- -- Insert(new AttrList(*tmpAttrList)); -- break; -- } -- } -- oldList.Close(); -- } --} -- --AttrListList::~AttrListList() --{ -- this->Open(); -- AttrList *tmpAttrList = Next(); -- -- while(tmpAttrList) -- { -- Delete(tmpAttrList); -- tmpAttrList = Next(); -- } -- this->Close(); --} -- --void AttrListList::Open() --{ -- ptr = head; --} -- --void AttrListList::Close() --{ -- ptr = NULL; --} -- --//////////////////////////////////////////////////////////////////////////////// --// Returns the pointer to the AttrList in the list pointed to by "ptr". --//////////////////////////////////////////////////////////////////////////////// --AttrList *AttrListList::Next() --{ -- if(!ptr) -- return NULL; -- -- AttrList *tmpAttrList; -- -- if(ptr->Type() == ATTRLISTENTITY) -- { -- // current AttrList is in one AttrList list -- tmpAttrList = (AttrList *)ptr; -- ptr = ptr->next; -- return tmpAttrList; -- } -- else -- { -- // current AttrList is in more than one AttrList list -- tmpAttrList = (AttrList *)((AttrListRep *)ptr)->attrList; -- ptr = ptr->next; -- return tmpAttrList; -- } --} -- --//////////////////////////////////////////////////////////////////////////////// --// Insert a AttrList or a replication of the AttrList if the AttrList already --// belongs to some other lists at the end of a AttrList list and update the --// aggregate AttrList in that AttrList list. --//////////////////////////////////////////////////////////////////////////////// --void AttrListList::Insert(AttrList* AttrList) --{ -- AttrListRep *rep; -- -- if(AttrList->IsInList(this)) -- // AttrList is already in this AttrList list -- { -- return; -- } -- if(AttrList->inList) -- // AttrList is in one AttrList list -- { -- // AttrList to AttrListRep -- AttrListAbstract *saveNext = AttrList->next; -- AttrListList *tmpList = AttrList->inList; -- AttrList->next = NULL; -- rep = new AttrListRep(AttrList, AttrList->inList); -- rep->next = saveNext; -- if(tmpList->head == (AttrListAbstract *)AttrList) -- { -- // AttrList is the first element in the list -- tmpList->head = rep; -- } -- else -- { -- AttrList->prev->next = rep; -- } -- if(tmpList->tail == (AttrListAbstract *)AttrList) -- { -- // AttrList is the last element in the list -- tmpList->tail = rep; -- } -- else -- { -- rep->next->prev = rep; -- } -- if(tmpList->ptr == AttrList) -- { -- tmpList->ptr = rep; -- } -- AttrList->prev = NULL; -- AttrList->inList = NULL; -- -- // allocate new AttrListRep for this AttrList list -- rep = new AttrListRep(AttrList, this); -- } -- else if(AttrList->next) -- { -- // AttrList is in more than one AttrList lists -- rep = new AttrListRep(AttrList, this); -- } -- else -- { -- // AttrList is not in any AttrList list -- rep = (AttrListRep *)AttrList; -- AttrList->inList = this; -- } -- rep->prev = this->tail; -- rep->next = NULL; -- this->tail = rep; -- if(rep->prev != NULL) -- { -- rep->prev->next = rep; -- } -- else -- { -- this->head = rep; -- } -- -- this->length++; --} -- --//////////////////////////////////////////////////////////////////////////////// --// Assume parameter AttrList is not NULL and it's a real AttrList, not a // --// AttrListRep. This function doesn't do anything if AttrList is not in the // --// AttrList list. // --//////////////////////////////////////////////////////////////////////////////// --int AttrListList::Delete(AttrList* attrList) --{ -- -- // optimization: if attrList is in this list directly -- // (i.e. not as an AttrListRep), then avoid searching -- // through the list -- if( attrList->inList == this ) { -- if( attrList == ptr ) { -- ptr = ptr->next; -- } -- -- if( attrList == head && attrList == tail ) { -- head = tail = NULL; -- } -- else if( attrList == head ) { -- head = head->next; -- if( head ) { -- head->prev = NULL; -- } -- } -- else if( attrList == tail ) { -- tail = attrList->prev; -- if( tail ) { -- tail->next = NULL; -- } -- } -- else { -- attrList->prev->next = attrList->next; -- attrList->next->prev = attrList->prev; -- } -- -- delete attrList; -- this->length--; -- return TRUE; -- } -- -- -- AttrListAbstract* cur; -- AttrListRep* tmpRep; -- -- for(cur = head; cur; cur = cur->next) -- { -- if(cur->Type() == ATTRLISTREP) -- { -- if(((AttrListRep *)cur)->attrList == attrList) -- { -- // this is the AttrList to be deleted -- if(cur == ptr) ptr = ptr->next; -- -- if ( cur != head && cur != tail ) -- { -- cur->prev->next = cur->next; -- cur->next->prev = cur->prev; -- } else { -- if(cur == head) -- { -- // AttrList to be deleted is at the head of the list -- head = head->next; -- if(head) -- { -- head->prev = NULL; -- } -- } -- -- if(cur == tail) -- { -- // AttrList to be deleted is at the tail of the list -- tail = cur->prev; -- if(tail) -- { -- tail->next = NULL; -- } -- } -- } -- -- // delete the rep from the rep list -- tmpRep = (AttrListRep *)((AttrListRep *)cur)->attrList->next; -- if(tmpRep == cur) -- { -- ((AttrListRep *)cur)->attrList->next = ((AttrListRep *)cur)->nextRep; -- if ( ((AttrListRep *)cur)->nextRep == NULL ) { -- // here we know this attrlist now no longer exists in any -- // other attrlistlist. so, since the user has now removed -- // it from all lists, actually delete the ad itself. -- // -Todd Tannenbaum, 9/19/2001 -- AttrList* adToRemove = ((AttrListRep *)cur)->attrList; -- if ( adToRemove ) delete adToRemove; -- } -- -- } -- else -- { -- while(tmpRep->nextRep != cur) -- { -- tmpRep = tmpRep->nextRep; -- } -- tmpRep->nextRep = ((AttrListRep *)cur)->nextRep; -- } -- -- delete cur; -- this->length--; -- break; -- } -- } // end of if a rep is used -- } // end of the loop through the AttrListList -- return TRUE; --} -- --ExprTree* AttrListList::Lookup(const char* name, AttrList*& attrList) --{ -- AttrList* tmpAttrList; -- ExprTree* tmpExpr; -- -- Open(); -- for(tmpAttrList = Next(); tmpAttrList; tmpAttrList = Next()) -- { -- if((tmpExpr = tmpAttrList->Lookup(name))) -- { -- Close(); -- attrList = tmpAttrList; -- return tmpExpr; -- } -- } -- Close(); -- return NULL; --} -- --ExprTree* AttrListList::Lookup(const char* name) --{ -- AttrList* tmpAttrList; -- ExprTree* tmpExpr; -- -- Open(); -- for(tmpAttrList = Next(); tmpAttrList; tmpAttrList = Next()) -- { -- if((tmpExpr = tmpAttrList->Lookup(name))) -- { -- Close(); -- return tmpExpr; -- } -- } -- Close(); -- return NULL; --} -- -- --void AttrListList::fPrintAttrListList(FILE* f, bool use_xml, StringList *attr_white_list) --{ -- AttrList *tmpAttrList; -- ClassAdXMLUnparser unparser; -- MyString xml; -- -- if (use_xml) { -- unparser.SetUseCompactSpacing(false); -- unparser.AddXMLFileHeader(xml); -- printf("%s\n", xml.Value()); -- xml = ""; -- } -- -- Open(); -- for(tmpAttrList = Next(); tmpAttrList; tmpAttrList = Next()) { -- switch(tmpAttrList->Type()) { -- case ATTRLISTENTITY : -- if (use_xml) { -- unparser.Unparse((ClassAd *) tmpAttrList, xml, attr_white_list); -- printf("%s\n", xml.Value()); -- xml = ""; -- } else { -- tmpAttrList->fPrint(f,attr_white_list); -- } -- break; -- } -- fprintf(f, "\n"); -- } -- if (use_xml) { -- unparser.AddXMLFileFooter(xml); -- printf("%s\n", xml.Value()); -- xml = ""; -- } -- Close(); --} -- --// shipping functions for AttrList -- added by Lei Cao --int AttrList::putAttrList(Stream& s) --{ -- AttrListElem* elem; -- int numExprs = 0; -- bool send_server_time = false; -- -- //get the number of expressions -- for(elem = exprList; elem; elem = elem->next) { -- if( elem->tree->invisible ) { -- continue; -- } -- numExprs++; -- } -- -- if ( chainedAd ) { -- // now count up all the chained ad attrs -- for(elem = chainedAd->exprList; elem; elem = elem->next) { -- if( elem->tree->invisible ) { -- continue; -- } -- numExprs++; -- } -- } -- -- if ( publish_server_time ) { -- // add one for the ATTR_SERVER_TIME expr -- numExprs++; -- send_server_time = true; -- } -- -- s.encode(); -- -- if(!s.code(numExprs)) -- return 0; -- -- char *line; -- int pass; -- for( pass=0; pass<2; pass++ ) { -- if( pass==0 ) { -- // copy chained attrs first, so if there are -- // duplicates, the get() method will overide the attrs -- // from the chained ad with attrs from this ad. -- if( !chainedAd ) { -- continue; -- } -- elem = chainedAd->exprList; -- } -- else { -- elem = exprList; -- } -- -- for(; elem; elem = elem->next) { -- if( elem->tree->invisible ) { -- continue; -- } -- line = NULL; -- elem->tree->PrintToNewStr(&line); -- ConvertDefaultIPToSocketIP(elem->name,&line,s); -- -- if( ! s.prepare_crypto_for_secret_is_noop() && -- ClassAdAttributeIsPrivate(elem->name) ) -- { -- s.put(SECRET_MARKER); // tell other side we are sending secret -- s.put_secret(line); // send the secret -- } -- else if(!s.code(line)) { -- free(line); -- return 0; -- } -- free(line); -- } -- } -- -- if ( send_server_time ) { -- // insert in the current time from the server's (schedd) -- // point of view. this is used so condor_q can compute some -- // time values based upon other attribute values without -- // worrying about the clocks being different on the condor_schedd -- // machine -vs- the condor_q machine. -- line = (char *) malloc(strlen(ATTR_SERVER_TIME) -- + 3 // for " = " -- + 12 // for integer -- + 1); // for null termination -- sprintf( line, "%s = %ld", ATTR_SERVER_TIME, (long)time(NULL) ); -- if(!s.code(line)) { -- free(line); -- return 0; -- } -- free(line); -- } -- -- return 1; --} -- -- --void --AttrList::Clear( void ) --{ -- // First, unchain ourselves, if we're a chained classad -- Unchain(); -- -- // Clear out hashtable of attributes. Note we cannot -- // delete the hash table here - we can do that safely -- // only in ~AttrList() [the dtor] since many other -- // methods assume it is never NULL. -- if ( hash ) { -- hash->clear(); -- } -- -- // Now, delete all the attributes in our list -- AttrListElem* tmp; -- for(tmp = exprList; tmp; tmp = exprList) { -- exprList = exprList->next; -- delete tmp; -- } -- exprList = NULL; -- -- tail = NULL; --} -- -- --void AttrList::GetReferences(const char *attribute, -- StringList &internal_references, -- StringList &external_references) const --{ -- ExprTree *tree; -- -- tree = Lookup(attribute); -- if (tree != NULL) { -- tree->GetReferences(this, internal_references, external_references); -- } -- -- return; --} -- --bool AttrList::GetExprReferences(const char *expr, -- StringList &internal_references, -- StringList &external_references) const --{ -- ExprTree *tree = NULL; -- -- // A common case is that the expression is a simple attribute -- // reference. For efficiency, handle that case specially. -- tree = Lookup(expr); -- if (tree != NULL) { -- // Unlike AttrList::GetReferences(), the attribute name -- // passed to this function is added to the list of -- // internal references. -- internal_references.append( expr ); -- tree->GetReferences(this, internal_references, external_references); -- } -- else { -- if( ParseClassAdRvalExpr( expr, tree ) != 0 || tree == NULL ) { -- return false; -- } -- tree->GetReferences(this, internal_references, external_references); -- delete tree; -- } -- return true; --} -- --bool AttrList::IsExternalReference(const char *name, char **simplified_name) const --{ -- // There are two ways to know if this is an internal or external -- // reference. -- // 1. If it is prefixed with MY or has no prefix but refers to an -- // internal variable definition, it's internal. -- // 2. If it is prefixed with TARGET or another non-MY prefix, or if -- // it has no prefix, but there is no other variable it could refer to. -- const char *prefix = name; -- const char *rest = name; -- char *seperator; -- bool is_external; -- -- if (name == NULL) { -- is_external = false; -- } -- -- seperator = (char*)strchr(name,'.'); -- -- // We have a prefix, so we examine it. -- if (seperator) { -- *seperator = '\0'; -- rest = seperator + 1; -- if (!strcasecmp(prefix, "TARGET")) { -- is_external = TRUE; -- } -- else { -- is_external = FALSE; -- } -- } else { -- // No prefix means that we have to see if the name occurs within -- // the attrlist or not. We lookup not only the name. -- if (Lookup(name)) { -- is_external = FALSE; -- } -- else { -- is_external = TRUE; -- } -- } -- -- if (simplified_name != NULL) { -- if (rest) { -- *simplified_name = strdup(rest); -- } else { -- *simplified_name = NULL; -- } -- } -- -- if ( seperator ) { -- *seperator = '.'; -- } -- -- return is_external; --} -- --int --AttrList::initAttrListFromStream(Stream& s) --{ -- char const *line; -- int numExprs; -- int succeeded; -- -- succeeded = 1; -- -- // First, clear our ad so we start with a fresh ClassAd -- Clear(); -- if ( !hash ) { -- // is hash ever NULL? don't think so, but just in case. -- this->hash = new HashTable(hash_size, torekHash); -- } -- -- // Now, read our new set of attributes off the given stream -- s.decode(); -- -- if(!s.code(numExprs)) { -- dprintf(D_FULLDEBUG,"Failed to read ClassAd size.\n"); -- return 0; -- } -- -- char *secret_line = NULL; -- -- for(int i = 0; i < numExprs; i++) { -- -- line = NULL; -- if(!s.get_string_ptr(line) || (line == NULL)) { -- dprintf(D_FULLDEBUG,"Failed to read ClassAd expression.\n"); -- succeeded = 0; -- break; -- } -- -- if( strcmp(line,SECRET_MARKER)==0 ) { -- free(secret_line); -- secret_line = NULL; -- if( !s.get_secret(secret_line) ) { -- dprintf(D_FULLDEBUG,"Failed to read encrypted ClassAd expression.\n"); -- succeeded = 0; -- break; -- } -- line = secret_line; -- } -- -- if (!Insert(line)) { -- // this debug message for tracking down initFromStream() bug -- dprintf(D_FULLDEBUG,"Failed to parse ClassAd expression: '%s'\n", -- line); -- succeeded = 0; -- break; -- } -- } -- free(secret_line); -- -- return succeeded; --} -- --bool --AttrList::initFromString(char const *str,MyString *err_msg) --{ -- bool succeeded = true; -- -- // First, clear our ad so we start with a fresh ClassAd -- Clear(); -- if ( !hash ) { -- // is hash ever NULL? don't think so, but just in case. -- this->hash = new HashTable(hash_size, torekHash); -- } -- -- char *exprbuf = new char[strlen(str)+1]; -- ASSERT( exprbuf ); -- -- while( *str ) { -- while( isspace(*str) ) { -- str++; -- } -- -- size_t len = strcspn(str,"\n"); -- strncpy(exprbuf,str,len); -- exprbuf[len] = '\0'; -- -- if( str[len] == '\n' ) { -- len++; -- } -- str += len; -- -- if (!Insert(exprbuf)) { -- if( err_msg ) { -- err_msg->sprintf("Failed to parse ClassAd expression: %s", -- exprbuf); -- } -- else { -- dprintf(D_ALWAYS,"Failed to parse ClassAd expression : %s\n", -- exprbuf); -- } -- succeeded = false; -- break; -- } -- } -- -- delete [] exprbuf; -- return succeeded; --} -- -- --void AttrList::ChainToAd(AttrList *ad) --{ -- if (!ad) { -- return; -- } -- -- chainedAd = ad; --} -- -- --void --AttrList::Unchain( void ) --{ -- chainedAd = NULL; --} -- --AttrList *AttrList::GetChainedParentAd() --{ -- return chainedAd; --} -- --/* This is used for %s = %s style constructs */ --int AttrList:: --AssignExpr(char const *variable,char const *value) --{ -- ExprTree *tree = NULL; -- ExprTree *lhs = NULL; -- ExprTree *rhs = NULL; -- -- -- if ( ParseClassAdRvalExpr( variable, lhs ) != 0 || lhs == NULL ) { -- delete lhs; -- return FALSE; -- } -- if ( !value ) { -- rhs = new Undefined(); -- } else { -- if ( ParseClassAdRvalExpr( value, rhs ) != 0 || rhs == NULL ) { -- delete lhs; -- delete rhs; -- return FALSE; -- } -- } -- tree = new AssignOp( lhs, rhs ); -- if ( Insert( tree ) == FALSE ) { -- delete tree; -- return FALSE; -- } -- return TRUE; --} -- --char const * --AttrList::EscapeStringValue(char const *val,MyString &buf) { -- if( !val || !strchr(val,'"') ) { -- return val; -- } -- buf = val; -- buf.replaceString("\"","\\\""); -- return buf.Value(); --} -- --/* This is used for %s = "%s" style constructs */ --int AttrList:: --Assign(char const *variable, MyString const &value) --{ -- return Assign(variable,value.Value()); --} -- --/* This is used for %s = "%s" style constructs */ --int AttrList:: --Assign(char const *variable,char const *value) --{ -- ExprTree *tree = NULL; -- ExprTree *lhs = NULL; -- ExprTree *rhs = NULL; -- -- if ( ParseClassAdRvalExpr( variable, lhs ) != 0 || lhs == NULL ) { -- delete lhs; -- return FALSE; -- } -- if ( !value ) { -- rhs = new Undefined(); -- } else { -- /* I apologize for this casting away of const. It's required by -- * String's use of StringSpace. Nothing will modify the string, -- * so this is safe to do, though it's ugly. -- */ -- rhs = new String( (char *)value ); -- } -- tree = new AssignOp( lhs, rhs ); -- if ( Insert( tree ) == FALSE ) { -- delete tree; -- return FALSE; -- } -- return TRUE; --} -- --int AttrList:: --Assign(char const *variable,int value) --{ -- ExprTree *tree = NULL; -- ExprTree *lhs = NULL; -- ExprTree *rhs = NULL; -- -- if ( ParseClassAdRvalExpr( variable, lhs ) != 0 || lhs == NULL ) { -- delete lhs; -- return FALSE; -- } -- rhs = new Integer( value ); -- tree = new AssignOp( lhs, rhs ); -- if ( Insert( tree ) == FALSE ) { -- delete tree; -- return FALSE; -- } -- return TRUE; --} -- --int AttrList:: --Assign(char const *variable,unsigned int value) --{ -- MyString buf; -- if (!IsValidAttrName(variable)) { -- return FALSE; -- } -- -- buf.sprintf("%s = %u",variable,value); -- return Insert(buf.Value()); --} -- --int AttrList:: --Assign(char const *variable,long value) --{ -- MyString buf; -- if (!IsValidAttrName(variable)) { -- return FALSE; -- } -- -- buf.sprintf("%s = %ld",variable,value); -- return Insert(buf.Value()); --} -- --int AttrList:: --Assign(char const *variable,unsigned long value) --{ -- MyString buf; -- if (!IsValidAttrName(variable)) { -- return FALSE; -- } -- -- buf.sprintf("%s = %lu",variable,value); -- return Insert(buf.Value()); --} -- --int AttrList:: --Assign(char const *variable,float value) --{ -- ExprTree *tree = NULL; -- ExprTree *lhs = NULL; -- ExprTree *rhs = NULL; -- -- if ( ParseClassAdRvalExpr( variable, lhs ) != 0 || lhs == NULL ) { -- delete lhs; -- return FALSE; -- } -- rhs = new Float( value ); -- tree = new AssignOp( lhs, rhs ); -- if ( Insert( tree ) == FALSE ) { -- delete tree; -- return FALSE; -- } -- return TRUE; --} --int AttrList:: --Assign(char const *variable,double value) --{ -- ExprTree *tree = NULL; -- ExprTree *lhs = NULL; -- ExprTree *rhs = NULL; -- -- if ( ParseClassAdRvalExpr( variable, lhs ) != 0 || lhs == NULL ) { -- delete lhs; -- return FALSE; -- } -- rhs = new Float( value ); -- tree = new AssignOp( lhs, rhs ); -- if ( Insert( tree ) == FALSE ) { -- delete tree; -- return FALSE; -- } -- return TRUE; --} --int AttrList:: --Assign(char const *variable,bool value) --{ -- ExprTree *tree = NULL; -- ExprTree *lhs = NULL; -- ExprTree *rhs = NULL; -- -- if ( ParseClassAdRvalExpr( variable, lhs ) != 0 || lhs == NULL ) { -- delete lhs; -- return FALSE; -- } -- rhs = new ClassadBoolean( value ? 1 : 0 ); -- tree = new AssignOp( lhs, rhs ); -- if ( Insert( tree ) == FALSE ) { -- delete tree; -- return FALSE; -- } -- return TRUE; --} -- --bool AttrList::SetInvisible(char const *name,bool invisible) --{ -- ExprTree *tree = Lookup(name); -- if( tree ) { -- bool old_state = tree->invisible; -- tree->invisible = invisible; -- tree->RArg()->invisible = invisible; -- return old_state; -- } -- return invisible; --} -- --bool AttrList::GetInvisible(char const *name) --{ -- ExprTree *tree = Lookup(name); -- if( tree ) { -- return tree->invisible; -- } -- return false; --} -- --bool AttrList::ClassAdAttributeIsPrivate( char const *name ) --{ -- // keep this in sync with SetPrivateAttributesInvisible() -- if( strcasecmp(name,ATTR_CLAIM_ID) == 0 ) { -- // This attribute contains the secret capability cookie -- return true; -- } -- if( strcasecmp(name,ATTR_CAPABILITY) == 0 ) { -- // This attribute contains the secret capability cookie -- return true; -- } -- if( strcasecmp(name,ATTR_CLAIM_IDS) == 0 ) { -- // This attribute contains secret capability cookies -- return true; -- } -- if( strcasecmp(name,ATTR_TRANSFER_KEY) == 0 ) { -- // This attribute contains the secret file transfer cookie -- return true; -- } -- return false; --} -- --void AttrList::SetPrivateAttributesInvisible(bool make_invisible) --{ -- // keep this in sync with ClassAdAttributeIsPrivate() -- SetInvisible(ATTR_CLAIM_ID,make_invisible); -- SetInvisible(ATTR_CLAIM_IDS,make_invisible); -- SetInvisible(ATTR_CAPABILITY,make_invisible); -- SetInvisible(ATTR_TRANSFER_KEY,make_invisible); --} -- --// Decides if a string is a valid attribute name, the LHS --// of an expression. As per the manual, valid names: --// --// Attribute names are sequences of alphabetic characters, digits and --// underscores, and may not begin with a digit -- --/* static */ bool --AttrList::IsValidAttrName(const char *name) { -- // NULL pointer certainly false -- if (!name) { -- return false; -- } -- -- // Must start with alpha or _ -- if (!isalpha(*name) && *name != '_') { -- return false; -- } -- -- name++; -- -- // subsequent letters must be alphanum or _ -- while (*name) { -- if (!isalnum(*name) && *name != '_') { -- return false; -- } -- name++; -- } -- -- return true; --} -- --// Determine if a value is valid to be written to the log. The value --// is a RHS of an expression. According to LogSetAttribute::WriteBody, --// the only invalid character is a '\n'. --bool --AttrList::IsValidAttrValue(const char *value) { -- // NULL value is not invalid, may translate to UNDEFINED. -- if (!value) { -- return true; -- } -- -- // According to LogSetAttribute::WriteBody, the only invalid -- // character for a value is '\n'. -- while (*value) { -- if (((*value) == '\n') || -- ((*value) == '\r')) { -- return false; -- } -- value++; -- } -- -- return true; --} -- --void --AttrList::CopyAttribute(char const *target_attr, AttrList *source_ad ) --{ -- CopyAttribute(target_attr,target_attr,source_ad); --} -- --void --AttrList::CopyAttribute(char const *target_attr, char const *source_attr, AttrList *source_ad ) --{ -- ASSERT( target_attr ); -- ASSERT( source_attr ); -- if( !source_ad ) { -- source_ad = this; -- } -- -- ExprTree *e = source_ad->Lookup(source_attr); -- if (e && e->MyType() == LX_ASSIGN && e->RArg()) { -- ExprTree *lhs = new Variable((char *)target_attr); -- ExprTree *rhs = e->RArg()->DeepCopy(); -- ASSERT( lhs && rhs ); -- ExprTree *assign = new AssignOp(lhs,rhs); -- ASSERT( assign ); -- -- this->Insert(assign); -- } else { -- this->Delete(target_attr); -- } --} -diff --git a/src/.deprecate_classad.old/buildtable.cpp b/src/.deprecate_classad.old/buildtable.cpp -deleted file mode 100644 -index 3deac54..0000000 ---- a/src/.deprecate_classad.old/buildtable.cpp -+++ /dev/null -@@ -1,73 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --/* -- * Abstract data type for StatTable, which is a data structure which holds -- * statistical information about a pool of machines. -- */ --#include "condor_common.h" --#include "condor_exprtype.h" --#include "condor_ast.h" --#include "condor_buildtable.h" -- --#define NextSpace(str) while(*str != ' ') str++; -- --int VarTypeTable::FindType(char *var) --{ -- VTableEntry *tmpEntry; -- -- for(tmpEntry = table; tmpEntry; tmpEntry = tmpEntry->next) -- if(!strcmp(var, tmpEntry->MyName())) -- return tmpEntry->MyType(); -- -- return VTAB_FIXED; --} -- --void VarTypeTable::AddEntry(char *var, int type) --{ -- VTableEntry *newEntry = new VTableEntry(var, type); -- -- newEntry->next = table; -- table = newEntry; --} -- --void VarTypeTable::PrintTable(FILE *fd) --{ -- VTableEntry *tmpEntry = table; -- char *tmp; -- -- for( ; tmpEntry; tmpEntry = tmpEntry->next) { -- if(tmpEntry->MyType() == RANGE) -- fprintf(fd, "%s RANGE\n", tmpEntry->MyName()); -- else -- fprintf(fd, "%s FIXED\n", tmpEntry->MyName()); -- } --} -- --void BuildVarTypeTable(FILE *f, VarTypeTable *table) --{ -- char name[10000]; -- char type[10000]; -- -- while(fscanf(f, "%s%s", name, type) != EOF) -- if(!strcmp(type, "RANGE") || !strcmp(type, "range")) -- table->AddEntry(name, RANGE); -- else -- table->AddEntry(name, VTAB_FIXED); --} -diff --git a/src/.deprecate_classad.old/classad.cpp b/src/.deprecate_classad.old/classad.cpp -deleted file mode 100644 -index d7c6065..0000000 ---- a/src/.deprecate_classad.old/classad.cpp -+++ /dev/null -@@ -1,784 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --// AttrList.C --// --// Implementation of AttrList classes and AttrListList classes. --// -- --#include "condor_common.h" -- --# include "condor_debug.h" --# include "condor_ast.h" --# include "condor_registration.h" --# include "condor_attrlist.h" --# include "condor_attributes.h" --# include "condor_classad.h" --# include "condor_adtypes.h" --# include "MyString.h" --# include "stream.h" --# include "condor_xml_classads.h" -- --static Registration regi; // this is the registration for -- // the AttrList type names. It -- // should be defined in the calling -- // procedure. -- --static SortFunctionType SortSmallerThan; --static void* SortInfo; --static const char *empty_string = ""; -- --// useful when debugging (std* are macros) --FILE *__stdin__ = stdin; --FILE *__stdout__ = stdout; --FILE *__stderr__ = stderr; -- -- --// --// AdType Constructor. --// --AdType::AdType(const char *tempName) --{ -- if(tempName == NULL) -- { // if empty. -- name = new char[strlen("") + 1]; -- if(!name) -- { -- EXCEPT("Out of memory!"); -- } -- strcpy(name, ""); -- number = -1; -- } -- else -- { -- name = new char[strlen(tempName) + 1]; -- if(!name) -- { -- EXCEPT("Warning : you ran out of memory -- quitting !"); -- } -- strcpy(name, tempName); -- number = regi.RegisterType(tempName); -- } --} -- --// --// AdType Destructor. --// --AdType::~AdType() --{ -- if(name) -- { -- delete []name; -- } --} -- --// --// ClassAd constructors --// --ClassAd::ClassAd() : AttrList() --{ -- myType = NULL; -- targetType = NULL; --} -- --ClassAd:: --ClassAd(FILE* f, char* d, int& i, int &err, int &empty) -- : AttrList(f, d, i, err, empty) --{ -- myType = NULL; -- targetType = NULL; -- -- updateBoundVariables(); --} -- --void --ClassAd::updateBoundVariables() { -- ExprTree *tree; -- EvalResult *val; -- -- val = new EvalResult; -- if(val == NULL) -- { -- EXCEPT("Warning : you ran out of space -- quitting !"); -- } -- -- // Make a parse tree that contains the variable MyType -- ParseClassAdRvalExpr("MyType", tree); -- // Evaluate this variable within the classad, to see if it -- // is defined. -- tree->EvalTree(this, val); -- -- if( myType ) { -- delete myType; -- myType = NULL; -- } -- -- // If it's not defined, we set the type to be blank -- if(!val || val->type!=LX_STRING) -- { -- myType = new AdType(); // undefined type. -- if(myType == NULL) -- { -- EXCEPT("Warning : you ran out of space"); -- } -- } -- // otherwise it was defined, so we'll set the type to be what the -- // creator of the classad wants. Note that later on, we'll delete -- // the type from the attribute list. ('Delete("MyType")') -- else -- { -- myType = new AdType(val->s); -- if(myType == NULL) -- { -- EXCEPT("Warning : you ran out of space"); -- } -- } -- delete tree; -- // I just added the next two lines: we were leaking memory -- // because EvalResult may contain a string result that isn't -- // properly deleted if we don't call the destructor. Therefore, -- // I delete and recreate the EvalResult. --alain 23-Sep-2001 -- delete val; -- val = new EvalResult; -- -- // Make a parse tree that contains the variable TargetType -- ParseClassAdRvalExpr("TargetType", tree); -- // Evaluate this variable within the classad, to see if it -- // is defined. -- tree->EvalTree(this, val); -- -- if( targetType ) { -- delete targetType; -- targetType = NULL; -- } -- -- // If it's not defined, we set the type to be blank -- if(!val || val->type!=LX_STRING) -- { -- targetType = new AdType(); // undefined type. -- if(targetType == NULL) -- { -- EXCEPT("Warning : you ran out of space"); -- } -- } -- // otherwise it was defined, so we'll set the type to be what the -- // creator of the classad wants. Note that later on, we'll delete -- // the type from the attribute list. ('Delete("TargetType")') -- else -- { -- targetType = new AdType(val->s); -- if(targetType == NULL) -- { -- EXCEPT("Warning : you ran out of space"); -- } -- } -- delete tree; -- -- if(val) -- { -- delete val; -- } -- -- // We no longer remove MyType and TargetType from the -- // attrlist, so they can be used in places such as -- // COLLECTOR_REQUIREMENTS. Just beware that these values -- // should only be updated via the ClassAd::SetXXX() functions. -- SetInvisible("MyType"); -- SetInvisible("TargetType"); --} -- --ClassAd::ClassAd(const ClassAd& old) : AttrList((AttrList&) old) --{ -- myType = NULL; -- targetType = NULL; -- -- if(old.myType) -- { -- this->myType = new AdType(old.myType->name); -- if(this->myType == NULL) -- { -- EXCEPT("Warning : you ran out of meomory"); -- } -- } -- if(old.targetType) -- { -- this->targetType = new AdType(old.targetType->name); -- if(this->targetType == NULL) -- { -- EXCEPT("Warning : you ran out of meomory"); -- } -- } --} -- --ClassAd::~ClassAd() --{ -- if(associatedList) -- { -- associatedList->associatedAttrLists->Delete(this); -- } -- if(myType) -- { -- delete myType; -- } -- if(targetType) -- { -- delete targetType; -- } --} -- --ClassAd& ClassAd::operator=(const ClassAd& other) --{ -- if (this != &other) { -- // First, let the base class do its magic. -- AttrList::operator=(other); -- -- // Clean up memory that we're going to be copying over. -- if (myType != NULL) { -- delete myType; -- myType = NULL; -- } -- if (targetType != NULL) { -- delete targetType; -- targetType = NULL; -- } -- -- if (other.myType) { -- myType = new AdType(other.myType->name); -- if (myType == NULL) { -- EXCEPT("Warning : you ran out of meomory"); -- } -- } -- if(other.targetType) { -- targetType = new AdType(other.targetType->name); -- if (targetType == NULL) { -- EXCEPT("Warning : you ran out of meomory"); -- } -- } -- } -- return *this; --} -- --// --// This member function of class AttrList sets myType name. --// --void ClassAd::SetMyTypeName(const char *tempName) --{ -- if(!tempName) -- { -- if(myType) -- { -- delete myType; -- } -- myType = NULL; -- return; -- } -- if(myType) -- { -- delete myType; -- } -- myType = new AdType(tempName); -- if(!myType) -- { -- EXCEPT("Warning : you ran out of memory -- quitting !"); -- } -- // Also set the corresponding attribute in the attrlist. -- Assign("MyType",tempName); -- SetInvisible("MyType"); --} -- --// --// This member function of class AttrList returns myType name. --// --const char *ClassAd::GetMyTypeName() const --{ -- if(!myType) -- { -- return empty_string; -- } -- else -- { -- return myType->name; -- } --} -- --// --// This member function of class AttrList sets targetType name. --// --void ClassAd::SetTargetTypeName(const char *tempName) --{ -- if(!tempName) -- { -- if(targetType) -- { -- delete targetType; -- } -- targetType = NULL; -- return; -- } -- if(targetType) -- { -- delete targetType; -- } -- targetType = new AdType(tempName); -- if(!targetType) -- { -- EXCEPT("Warning : you ran out of memory -- quitting !"); -- } -- // Store the value in the attrlist too. -- Assign("TargetType",tempName); -- SetInvisible("TargetType"); --} -- --// --// This member function of class AttrList returns targetType name. --// --const char *ClassAd::GetTargetTypeName() const --{ -- if(!targetType) -- { -- return empty_string; -- } -- else -- { -- return targetType->name; -- } --} -- --// --// This member function of class AttrList returns myType number. --// --int ClassAd::GetMyTypeNumber() const --{ -- if(!myType) -- { -- return -1; // undefined type. -- } -- else -- { -- return myType->number; -- } --} -- --// --// This member function of class AttrList returns targetType number. --// --int ClassAd::GetTargetTypeNumber() const --{ -- if(!targetType) -- { -- return -1; // undefined type. -- } -- else -- { -- return targetType->number; -- } --} -- -- --int ClassAd::fPrintAsXML(FILE* f) --{ -- if(!f) -- { -- return FALSE; -- } -- -- MyString out; -- sPrintAsXML(out); -- fprintf(f, "%s", out.Value()); -- return TRUE; --} -- -- --//////////////////////////////////////////////////////////////////////////////// --// print the whole ClassAd into a file. The expressions are in infix notation. --// Returns FALSE if the file pointer is NULL; TRUE otherwise. --//////////////////////////////////////////////////////////////////////////////// --int ClassAd::fPrint(FILE* f) --{ -- if(!f) -- { -- return FALSE; -- } -- -- fprintf(f, "MyType = "); -- fprintf(f, "%c", '"'); -- if(GetMyTypeName()) -- { -- fprintf(f, "%s", GetMyTypeName()); -- } -- fprintf(f, "%c\n", '"'); -- fprintf(f, "TargetType = "); -- fprintf(f, "%c", '"'); -- if(GetMyTypeName()) -- { -- fprintf(f, "%s", GetTargetTypeName()); -- } -- fprintf(f, "%c\n", '"'); -- -- return AttrList::fPrint(f); --} -- --int ClassAd::sPrintAsXML(MyString &output,StringList *attr_white_list) --{ -- ClassAdXMLUnparser unparser; -- MyString xml; -- unparser.SetUseCompactSpacing(false); -- unparser.Unparse(this, xml, attr_white_list); -- output += xml; -- return TRUE; --} -- --//////////////////////////////////////////////////////////////////////////////// --// Append a ClassAd to a string. --//////////////////////////////////////////////////////////////////////////////// --int ClassAd::sPrint(MyString &output) --{ -- output += "MyType = \""; -- if(GetMyTypeName()) -- { -- output += GetMyTypeName(); -- } -- output += "\"\nTargetType = \""; -- if(GetMyTypeName()) -- { -- output += GetTargetTypeName(); -- } -- output += "\"\n"; -- -- return AttrList::sPrint(output); --} -- --//////////////////////////////////////////////////////////////////////////////// --// print the whole ClassAd to the given debug level. The expressions --// are in infix notation. --//////////////////////////////////////////////////////////////////////////////// --void --ClassAd::dPrint(int level) --{ -- const char* foo; -- int flag = D_NOHEADER | level; -- foo = GetMyTypeName(); -- if( foo ) { -- dprintf( flag, "MyType = \"%s\"\n", foo ); -- } else { -- dprintf( flag, "MyType = \"\"\n" ); -- } -- -- foo = GetTargetTypeName(); -- if( foo ) { -- dprintf( flag, "TargetType = \"%s\"\n", foo ); -- } else { -- dprintf( flag, "TargetType = \"\"\n" ); -- } -- -- AttrList::dPrint( level ); --} -- -- --// shipping functions for ClassAd -- added by Lei Cao -- --int ClassAd::put(Stream& s) --{ -- -- // first send over all the attributes -- if ( !AttrList::putAttrList(s) ) { -- return 0; -- } -- -- // send the types; if a type does not exist, send "(unknown type)" instead -- { -- char *adType = "(unknown type)"; -- if(myType && myType->name) -- { -- if (!s.code(myType->name)) -- return 0; -- } -- else -- if (!s.code (adType)) -- return 0; -- -- if(targetType && targetType->name) -- { -- if(!s.code(targetType->name)) -- return 0; -- } -- else -- if (!s.code(adType)) -- return 0; -- } -- -- -- return 1; --} -- -- --void --ClassAd::Clear( void ) --{ -- // First, clear out everything in our AttrList -- AttrList::Clear(); -- -- // Now, clear out our Type fields, since those are specific to -- // ClassAd and aren't handled by AttrList::Clear(). -- if( myType ) { -- delete myType; -- myType = NULL; -- } -- if( targetType ) { -- delete targetType; -- targetType = NULL; -- } --} -- --bool --ClassAd::initFromString(char const *str,MyString *err_msg) --{ -- if( !AttrList::initFromString(str,err_msg) ) { -- return false; -- } -- -- updateBoundVariables(); -- return true; // is this correct? --} -- -- --int --ClassAd::initFromStream(Stream& s) --{ -- char *name = NULL; -- -- // First, initialize ourselves from the stream. This will -- // delete any existing attributes in the list... -- if ( !AttrList::initAttrListFromStream(s) ) { -- return 0; -- } -- -- // Now, if there's also type info on the wire, read that, -- // too. -- if(!s.code(name)) { -- dprintf(D_FULLDEBUG,"Failed to read ClassAd type.\n"); -- return 0; -- } -- SetMyTypeName(name); -- if ( name != NULL ) { -- free(name); -- name = NULL; -- } -- -- if(!s.code(name)) { -- dprintf(D_FULLDEBUG,"Failed to read ClassAd target type.\n"); -- return 0; -- } -- SetTargetTypeName(name); -- if ( name != NULL ) { -- free(name); -- name = NULL; -- } -- -- return 1; --} -- -- --ClassAd* ClassAdList::Lookup(const char* name) --{ -- AttrList* list; -- -- ((AttrListList*)this)->Lookup(name, list); -- return (ClassAd*)list; --} -- --void ClassAdList:: --Sort(int(*SmallerThan)(AttrList*, AttrList*, void*), void* info) --{ --/* -- dprintf(D_ALWAYS,"head=%08x , tail=%08x\n",head,tail); -- int count=1; -- for (AttrListAbstract* xx=head; xx; xx=xx->next, count++ ) { -- dprintf(D_ALWAYS, "%02d: prev=%08x , cur=%08x , next=%08x\n",count,xx->prev,xx,xx->next); -- } --*/ -- -- Sort(SmallerThan, info, head); -- --/* -- dprintf(D_ALWAYS,"head=%08x , tail=%08x\n",head,tail); -- count=1; -- for (AttrListAbstract* xx=head; xx; xx=xx->next, count++ ) { -- dprintf(D_ALWAYS, "%02d: prev=%08x , cur=%08x , next=%08x\n",count,xx->prev,xx,xx->next); -- } --*/ -- --} -- --int ClassAdList:: --SortCompare(const void* v1, const void* v2) --{ -- AttrListAbstract** a1 = (AttrListAbstract**)v1; -- AttrListAbstract** b1 = (AttrListAbstract**)v2; -- AttrListAbstract *abstract_ad1 = *a1; -- AttrListAbstract *abstract_ad2 = *b1; -- AttrList* a; -- AttrList* b; -- -- // Convert AttrListAbstracts to AttrList -- if ( abstract_ad1->Type() == ATTRLISTENTITY ) { -- // this represents an AttrList in one AttrListList -- a = (AttrList *)abstract_ad1; -- } else { -- // this represents an AttrList in multiple AttrListLists -- // thus, it is an AttrListRep not an AttrList -- a = (AttrList *)((AttrListRep *)abstract_ad1)->GetOrigAttrList(); -- } -- -- if ( abstract_ad2->Type() == ATTRLISTENTITY ) { -- // this represents an AttrList in one AttrListList -- b = (AttrList *)abstract_ad2; -- } else { -- // this represents an AttrList in multiple AttrListLists -- // thus, it is an AttrListRep not an AttrList -- b = (AttrList *)((AttrListRep *)abstract_ad2)->GetOrigAttrList(); -- } -- // The user supplied SortSmallerThan() func returns a 1 -- // if a is smaller than b, and that is _all_ we know about -- // SortSmallerThan(). Some tools implement a SortSmallerThan() -- // that returns a -1 on error, some just return a 0 on error, -- // it is chaos. Just chaos I tell you. _SO_ we only check for -- // a "1" if it is smaller than, and do not assume anything else. -- // qsort() wants a -1 for smaller. -- if ( SortSmallerThan(a,b,SortInfo) == 1 ) { -- // here we know that a is less than b -- return -1; -- } else { -- // So, now we know that a is not smaller than b, but -- // we still need to figure out if a is equal to b or not. -- // Do this by calling the user supplied compare function -- // again and ask if b is smaller than a. -- if ( SortSmallerThan(b,a,SortInfo) == 1 ) { -- // now we know that a is greater than b -- return 1; -- } else { -- // here we know a is not smaller than b, and b is not -- // smaller than a. so they must be equal. -- return 0; -- } -- } --} -- --void ClassAdList:: --Sort( SortFunctionType UserSmallerThan, void* UserInfo, -- AttrListAbstract*& listHead) --{ -- AttrListAbstract* ad; -- int i; -- int len = MyLength(); -- -- if ( len < 2 ) { -- // the list is either empty or has only one element, -- // thus it is already sorted. -- return; -- } -- -- // what we have is a linked list we want to sort quickly. -- // so we stash pointers to all the elements into an array and qsort. -- // then we fixup all the head/tail/next/prev pointers. -- -- // so first create our array -- AttrListAbstract** array = new AttrListAbstract*[len]; -- ad = listHead; -- i = 0; -- while (ad) { -- array[i++] = ad; -- ad = ad->next; -- } -- ASSERT(i == len); -- -- // now sort it. Note: since we must use static members, Sort() is -- // _NOT_ thread safe!!! -- SortSmallerThan = UserSmallerThan; -- SortInfo = UserInfo; -- qsort(array,len,sizeof(AttrListAbstract*),SortCompare); -- -- // and finally fixup the order of the double linked list -- listHead = ad = array[0]; -- ad->prev = NULL; -- for (i=1;inext = array[i]; -- array[i]->prev = ad; -- ad = array[i]; -- } -- tail = ad; -- tail->next = NULL; -- -- // and delete our array -- delete [] array; --} -- --ClassAd* ClassAd::FindNext() --{ -- return (ClassAd*)next; --} -- --// --// This function tests whether two ClassAds match mutually. --// -- --// Parsing a classad from a string is slow. Really slow. We match --// ads frequently, so cache the "MY.Requirements" tree so we only --// need to parse it once. -- --ExprTree *reqsTree = 0; -- --bool IsAMatch(ClassAd *ad1, ClassAd *ad2) --{ -- return IsAHalfMatch(ad1, ad2) && IsAHalfMatch(ad2, ad1); --} -- --bool IsAHalfMatch(ClassAd *my, ClassAd *target) --{ -- EvalResult *val; -- -- if( (target->GetMyTypeNumber()!=my->GetTargetTypeNumber()) && -- strcasecmp(my->GetTargetTypeName(),ANY_ADTYPE) ) -- { -- return false; -- } -- -- if ((val = new EvalResult) == NULL) -- { -- EXCEPT("Out of memory -- quitting"); -- } -- -- if (reqsTree == 0) ParseClassAdRvalExpr ("MY.Requirements", reqsTree); -- reqsTree -> EvalTree (my, target, val); -- if (!val || val->type != LX_INTEGER) -- { -- delete val; -- return false; -- } -- else -- if (!val->i) -- { -- delete val; -- return false; -- } -- -- delete val; -- return true; --} -- -diff --git a/src/.deprecate_classad.old/classad_condor_config b/src/.deprecate_classad.old/classad_condor_config -deleted file mode 100644 -index f74ab0e..0000000 ---- a/src/.deprecate_classad.old/classad_condor_config -+++ /dev/null -@@ -1,8 +0,0 @@ --# If you want to test ClassAd functions, you'll need this --# condor config file, and you'll need CONDOR_CONFIG to point at it. --# You'll also want to edit it. LOG seems to be required. The other --# two should point at this directory. Make sure to do 'make shared' to --# get the shared library --LOG = blah --CLASSAD_LIB_PATH = /scratch/roy/v67/src/condor_classad/libshared.so --CLASSAD_SCRIPT_DIRECTORY = /scratch/roy/v67/src/condor_classad -diff --git a/src/.deprecate_classad.old/classad_list.cpp b/src/.deprecate_classad.old/classad_list.cpp -deleted file mode 100644 -index f3dad80..0000000 ---- a/src/.deprecate_classad.old/classad_list.cpp -+++ /dev/null -@@ -1,75 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- -- --#include "condor_common.h" --#include "condor_debug.h" --#include "condor_classad.h" -- --static bool _evalBool(ClassAd *ad, ExprTree *tree) --{ -- EvalResult result; -- char * constraint = NULL; -- -- // Evaluate constraint with ad in the target scope so that constraints -- // have the same semantics as the collector queries. --RR -- if (!tree->EvalTree(NULL, ad, &result)) { -- tree->PrintToNewStr(&constraint); -- if (constraint) { -- dprintf(D_ALWAYS, "can't evaluate constraint: %s\n", constraint); -- free(constraint); -- constraint = NULL; -- } -- return false; -- } -- if (result.type == LX_INTEGER) { -- return (bool)result.i; // Nominal exit point -- } -- -- tree->PrintToNewStr(&constraint); -- if (constraint) { -- dprintf(D_ALWAYS, "constraint (%s) does not evaluate to bool\n", -- constraint); -- free(constraint); -- constraint = NULL; -- } -- return false; --} -- --// Count ads in list that meet constraint. --int ClassAdList:: --Count( ExprTree *constraint ) --{ -- ClassAd *ad = NULL; -- int matchCount = 0; -- -- // Check for null constraint. -- if ( constraint == NULL ) { -- return 0; -- } -- -- Rewind(); -- while( (ad = Next() ) ) { -- if ( _evalBool( ad, constraint) ) { -- matchCount++; -- } -- } -- return matchCount; --} -- -diff --git a/src/.deprecate_classad.old/classad_shared.h b/src/.deprecate_classad.old/classad_shared.h -deleted file mode 100644 -index 95be8b5..0000000 ---- a/src/.deprecate_classad.old/classad_shared.h -+++ /dev/null -@@ -1,47 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --extern "C" --{ -- -- enum ClassAdSharedValueType -- { -- ClassAdSharedType_Integer, -- ClassAdSharedType_Float, -- ClassAdSharedType_String, -- ClassAdSharedType_Undefined, -- ClassAdSharedType_Error -- }; -- -- struct ClassAdSharedValue -- { -- ClassAdSharedValueType type; -- union -- { -- int integer; -- float real; -- char *text; // Callee should allocate memory for this using new -- }; -- }; -- -- typedef void(*ClassAdSharedFunction)(const int number_of_arguments, -- const ClassAdSharedValue *arguments, -- ClassAdSharedValue *result); -- --} -diff --git a/src/.deprecate_classad.old/classad_util.cpp b/src/.deprecate_classad.old/classad_util.cpp -deleted file mode 100644 -index d748abf..0000000 ---- a/src/.deprecate_classad.old/classad_util.cpp -+++ /dev/null -@@ -1,131 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#include "condor_common.h" --#include "condor_debug.h" --#include "condor_classad.h" --#include "condor_classad_util.h" --#include "condor_adtypes.h" --#include "MyString.h" -- --bool EvalBool(AttrList* ad, ExprTree *tree) --{ -- EvalResult result; -- -- // Evaluate constraint with ad in the target scope so that constraints -- // have the same semantics as the collector queries. --RR -- if (!tree->EvalTree(NULL, ad, &result)) { -- return false; -- } -- -- if (result.type == LX_INTEGER) { -- return (bool)result.i; -- } -- -- return false; --} -- --bool EvalBool(ClassAd *ad, const char *constraint) --{ -- static ExprTree *tree = NULL; -- static char * saved_constraint = NULL; -- EvalResult result; -- bool constraint_changed = true; -- -- if ( saved_constraint ) { -- if ( strcmp(saved_constraint,constraint) == 0 ) { -- constraint_changed = false; -- } -- } -- -- if ( constraint_changed ) { -- // constraint has changed, or saved_constraint is NULL -- if ( saved_constraint ) { -- free(saved_constraint); -- saved_constraint = NULL; -- } -- if ( tree ) { -- delete tree; -- tree = NULL; -- } -- if (ParseClassAdRvalExpr(constraint, tree) != 0) { -- dprintf(D_ALWAYS, -- "can't parse constraint: %s\n", constraint); -- return false; -- } -- saved_constraint = strdup(constraint); -- } -- -- // Evaluate constraint with ad in the target scope so that constraints -- // have the same semantics as the collector queries. --RR -- if (!tree->EvalTree(NULL, ad, &result)) { -- dprintf(D_ALWAYS, "can't evaluate constraint: %s\n", constraint); -- return false; -- } -- if (result.type == LX_INTEGER) { -- return (bool)result.i; -- } -- dprintf(D_ALWAYS, "constraint (%s) does not evaluate to bool\n", -- constraint); -- return false; --} -- --bool --ClassAdsAreSame( ClassAd* ad1, ClassAd* ad2, StringList* ignored_attrs, -- bool verbose ) --{ -- ExprTree *ad1_expr, *ad2_expr; -- const char* attr_name; -- ad2->ResetExpr(); -- bool found_diff = false; -- while( ad2->NextExpr(attr_name, ad2_expr) && ! found_diff ) { -- if( ignored_attrs && ignored_attrs->contains_anycase(attr_name) ) { -- if( verbose ) { -- dprintf( D_FULLDEBUG, "ClassAdsAreSame(): skipping \"%s\"\n", -- attr_name ); -- } -- continue; -- } -- ad1_expr = ad1->LookupExpr( attr_name ); -- if( ! ad1_expr ) { -- // no value for this in ad1, the ad2 value is -- // certainly different -- if( verbose ) { -- dprintf( D_FULLDEBUG, "ClassAdsAreSame(): " -- "ad2 contains %s and ad1 does not\n", attr_name ); -- } -- found_diff = true; -- break; -- } -- if( *ad1_expr == *ad2_expr ) { -- if( verbose ) { -- dprintf( D_FULLDEBUG, "ClassAdsAreSame(): value of %s in " -- "ad1 matches value in ad2\n", attr_name ); -- } -- } else { -- if( verbose ) { -- dprintf( D_FULLDEBUG, "ClassAdsAreSame(): value of %s in " -- "ad1 is different than in ad2\n", attr_name ); -- } -- found_diff = true; -- break; -- } -- } -- return ! found_diff; --} -diff --git a/src/.deprecate_classad.old/environment.cpp b/src/.deprecate_classad.old/environment.cpp -deleted file mode 100644 -index e5f5818..0000000 ---- a/src/.deprecate_classad.old/environment.cpp -+++ /dev/null -@@ -1,43 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#include "condor_common.h" --#include "condor_ast.h" -- --void --evalFromEnvironment (const char *name, EvalResult *val) --{ -- // Use strcasecmp comparison since ClassAd attribute -- // names are supposed to be case-insensitive. -- if (strcasecmp (name, "CurrentTime") == 0) -- { -- time_t now = time (NULL); -- if (now == (time_t) -1) -- { -- val->type = LX_ERROR; -- return; -- } -- val->type = LX_INTEGER; -- val->i = (int) now; -- return; -- } -- -- val->type = LX_UNDEFINED; -- return; --} -diff --git a/src/.deprecate_classad.old/evaluateOperators.cpp b/src/.deprecate_classad.old/evaluateOperators.cpp -deleted file mode 100644 -index 9d3d043..0000000 ---- a/src/.deprecate_classad.old/evaluateOperators.cpp -+++ /dev/null -@@ -1,169 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#include "condor_common.h" --#include "condor_classad.h" --#include "operators.h" -- --static void EvalResultToValue( EvalResult &, Value & ); --static OpKind LexemeTypeToOpKind( LexemeType ); --static void ValueToEvalResult( Value&, EvalResult& ); -- --int BinaryOpBase:: --_EvalTree( const AttrList *myScope, EvalResult *result ) --{ -- return( this->EvalTree( myScope, NULL, result ) ); --} -- -- --int BinaryOpBase:: --_EvalTree( const AttrList *myScope, const AttrList *targetScope, EvalResult *result ) --{ -- EvalResult lArgResult, rArgResult; -- Value lValue, rValue, resultValue; -- OpKind op; -- -- // translate from the lexer's name for the operation to a reasonable operation name -- op = LexemeTypeToOpKind( MyType() ); -- -- lArgResult.debug = rArgResult.debug = result->debug; -- -- // evaluate the left side -- if( lArg ) lArg->EvalTree( myScope, targetScope, &lArgResult ); -- EvalResultToValue( lArgResult, lValue ); -- -- if (!operateShortCircuit(op, lValue, resultValue)) { -- -- // Evaluating just the left side was insufficient, so -- // we now evaluate the right-hand side. -- if( rArg ) rArg->EvalTree( myScope, targetScope, &rArgResult ); -- EvalResultToValue( rArgResult, rValue ); -- -- // convert overloaded subtraction operator to unary minus -- if( op == SUBTRACTION_OP && lArg == NULL ) { -- operate( UNARY_MINUS_OP, rValue, resultValue ); -- } else -- // convert overloaded addition operator to parenthesis operator -- if( op == ADDITION_OP && lArg == NULL ) { -- resultValue = rValue; -- } else -- if( op == TERNARY_OP ) { -- // operator was assignment operator -- resultValue = rValue; -- } else { -- // use evaluation function -- operate( op, lValue, rValue, resultValue ); -- } -- } -- -- // translate from new types/values to old types/values -- ValueToEvalResult( resultValue, (*result) ); -- -- // this version of evaluation never fails -- return TRUE; --} -- -- --static void --EvalResultToValue( EvalResult &er, Value &v ) --{ -- switch( er.type ) -- { -- case LX_INTEGER: -- v.setIntegerValue( er.i ); -- break; -- -- case LX_FLOAT: -- v.setRealValue( er.f ); -- break; -- -- case LX_STRING: -- v.setStringValue( er.s ); -- break; -- -- case LX_UNDEFINED: -- v.setUndefinedValue(); -- break; -- -- case LX_ERROR: -- default: -- v.setErrorValue(); -- break; -- } --} -- -- --static OpKind --LexemeTypeToOpKind( LexemeType lx ) --{ -- switch( lx ) -- { -- // Ugly hack. Since new classads do not have an "assignment operator", -- // we use the TERNARY_OP to signal this condition. --RR -- case LX_ASSIGN: return TERNARY_OP; -- -- case LX_AND: return LOGICAL_AND_OP; -- case LX_OR: return LOGICAL_OR_OP; -- case LX_EQ: return EQUAL_OP; -- case LX_NEQ: return NOT_EQUAL_OP; -- case LX_LT: return LESS_THAN_OP; -- case LX_LE: return LESS_OR_EQUAL_OP; -- case LX_GT: return GREATER_THAN_OP; -- case LX_GE: return GREATER_OR_EQUAL_OP; -- case LX_ADD: return ADDITION_OP; -- case LX_SUB: return SUBTRACTION_OP; -- case LX_MULT: return MULTIPLICATION_OP; -- case LX_DIV: return DIVISION_OP; -- case LX_META_EQ:return META_EQUAL_OP; -- case LX_META_NEQ:return META_NOT_EQUAL_OP; -- -- default: return __NO_OP__; -- } -- -- return __NO_OP__; --} -- -- --static void --ValueToEvalResult( Value &v, EvalResult &er ) --{ -- int i; -- double d; -- char *c; -- -- if( v.isUndefinedValue() ) { -- er.type = LX_UNDEFINED; -- } else -- if( v.isErrorValue() ) { -- er.type = LX_ERROR; -- } else -- if( v.isIntegerValue(i) ) { -- er.type = LX_INTEGER; -- er.i = i; -- } else -- if( v.isRealValue(d) ) { -- er.type = LX_FLOAT; -- er.f = (float) d; -- } else -- if( v.isStringValue(c) ) { -- er.type = LX_STRING; -- er.s = new char[strlen(c)+1]; -- strcpy( er.s, c ); -- } --} -diff --git a/src/.deprecate_classad.old/inputformat b/src/.deprecate_classad.old/inputformat -deleted file mode 100644 -index 4e89d63..0000000 ---- a/src/.deprecate_classad.old/inputformat -+++ /dev/null -@@ -1,38 +0,0 @@ --The current covention is as follows : -- -- (1) Input format -- -- (a) If read from a file, a user-specified string (if any) or EOF delimits --a classad instance input; The newline character delimits an expression; White --spaces before a new expression are ignored. -- delimitor string should be on a seperate line. -- 1 is passed on to the calling procedure if EOF is reached. Otherwise, --0 is passed on. -- -- (b) If read from a string, a user-specified character or the end --of string delimits a expression; end of string delimits a classad input; -- -- In both cases, empty expressions are simply ignored, no parse error. -- -- (2) In the "Requirment" field, every variable has a prefix "MY." or --"TARGET.". -- -- (3) There should be "MyType" and "TargetType" in the input. If a type is --missing, the name field of it will assign "" and the number field will be --assigned -1. -- -- (4) Requirement appears in the file. -- -- (5) With a registration class implemented, each type has an associated unique --integer value. As mentioned above, for an undefined type, this number is -1. --But this is an internal thing. A user only doesn't need to be aware of this --registration class whether he is using the type number or not. -- -- -- -- -- -- -- -- -- -diff --git a/src/.deprecate_classad.old/operators.cpp b/src/.deprecate_classad.old/operators.cpp -deleted file mode 100644 -index b830e15..0000000 ---- a/src/.deprecate_classad.old/operators.cpp -+++ /dev/null -@@ -1,833 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#include "condor_common.h" --#include "condor_debug.h" --#include "operators.h" -- --static void _doOperation (OpKind,Value&,Value&,Value&,bool,bool,bool,Value&); --static void doComparison (OpKind, Value&, Value&, Value&); --static void doArithmetic (OpKind, Value&, Value&, Value&); --static bool doLogicalShortCircuit (OpKind op, Value &v1, Value &result); --static void doLogical (OpKind, Value&, Value&, Value&); --static void doBitwise (OpKind, Value&, Value&, Value&); --static void doRealArithmetic(OpKind, Value&, Value&, Value&); --static void compareStrings (OpKind, Value&, Value&, Value&, bool case_sensitive); --static void compareReals (OpKind, Value&, Value&, Value&); --static void compareIntegers (OpKind, Value&, Value&, Value&); --static ValueType coerceToNumber(Value&, Value&); -- -- --const char *opString[] = --{ -- "", // no-op -- -- "<", // comparisons -- "<=", -- "!=", -- "==", -- "=?=", -- "=!=", -- ">=", -- ">", -- -- "+", // arithmetic -- "-", -- "+", -- "-", -- "*", -- "/", -- "%", -- -- "!", // logical -- "||", -- "&&", -- -- "~", // bitwise -- "|", -- "^", -- "&", -- "<<", -- ">>>", -- ">>", -- -- "()", //misc --- no "single token" representation -- "?:" --}; -- -- --void --operate (OpKind op, Value &op1, Value &result) --{ -- Value dummy; -- -- _doOperation (op, op1, dummy, dummy, true, false, false, result); --} -- --void --operate (OpKind op, Value &op1, Value &op2, Value &result) --{ -- Value dummy; -- -- _doOperation (op, op1, op2, dummy, true, true, false, result); --} -- --bool --operateShortCircuit (OpKind op, Value &op1, Value &result) --{ -- bool did_short_circuit; -- if (op == LOGICAL_OR_OP || op == LOGICAL_AND_OP) -- { -- did_short_circuit = doLogicalShortCircuit(op, op1, result); -- } -- else -- { -- did_short_circuit = false; -- } -- return did_short_circuit; --} -- -- --static void --_doOperation (OpKind op, Value &val1, Value &val2, Value &val3, bool valid1, -- bool valid2, bool valid3, Value &result) --{ -- ValueType vt1, vt2, vt3; -- -- // get the types of the values -- vt1 = val1.getType (); -- vt2 = val2.getType (); -- vt3 = val3.getType (); -- -- // take care of the easy cases -- if (op == __NO_OP__ || op == PARENTHESES_OP) -- { -- result = val1; -- return; -- } -- else -- if (op == UNARY_PLUS_OP) -- { -- if (vt1 != INTEGER_VALUE && vt1 != REAL_VALUE) -- result.setErrorValue(); -- else -- result = val1; -- return; -- } -- -- // test for cases when evaluation is strict w.r.t. "error" and "undefined" -- if (op != META_EQUAL_OP && op != META_NOT_EQUAL_OP && -- op != LOGICAL_OR_OP && op != LOGICAL_AND_OP && -- op != TERNARY_OP) -- { -- // check for error values -- if (valid1 && vt1==ERROR_VALUE || -- valid2 && vt2==ERROR_VALUE || -- valid3 && vt3==ERROR_VALUE) -- { -- result.setErrorValue (); -- return; -- } -- -- // check for undefined values -- if (valid1 && vt1==UNDEFINED_VALUE || -- valid2 && vt2==UNDEFINED_VALUE || -- valid3 && vt3==UNDEFINED_VALUE) -- { -- result.setUndefinedValue(); -- return; -- } -- } -- -- // comparison operations (binary) -- if (op >= __COMPARISON_START__ && op <= __COMPARISON_END__) -- { -- doComparison (op, val1, val2, result); -- return; -- } -- -- // arithmetic operations (binary, one unary) -- if (op >= __ARITHMETIC_START__ && op <= __ARITHMETIC_END__) -- { -- doArithmetic (op, val1, val2, result); -- return; -- } -- -- // logical operators (binary, one unary) -- if (op >= __LOGIC_START__ && op <= __LOGIC_END__) -- { -- doLogical (op, val1, val2, result); -- return; -- } -- -- // bitwise operators (binary, one unary) -- if (op >= __BITWISE_START__ && op <= __BITWISE_END__) -- { -- doBitwise (op, val1, val2, result); -- return; -- } -- -- // misc. -- ternary op -- if (op == TERNARY_OP) -- { -- int i; -- double r; -- -- // if the selector expression is error, propagate it -- if (vt1==ERROR_VALUE) -- { -- result.setErrorValue(); -- return; -- } -- -- // if the selector is a string or UNDEFINED, the value of the -- // expression is undefined -- if (vt1==STRING_VALUE || vt1==UNDEFINED_VALUE) -- { -- result.setUndefinedValue(); -- return; -- } -- -- // val1 is either a real or an integer -- if ((val1.isIntegerValue(i)&&(i!=0)) || (val1.isRealValue(r)&&(r!=0))) -- result = val2; -- else -- result = val3; -- -- return; -- } -- -- // should not reach here -- EXCEPT ("Should not get here"); --} -- -- --static void --doComparison (OpKind op, Value &v1, Value &v2, Value &result) --{ -- ValueType vt1, vt2, coerceResult; -- bool case_sensitive = false; -- -- // do numerical type promotions --- other types/values are unchanged -- coerceResult = coerceToNumber (v1, v2); -- vt1 = v1.getType(); -- vt2 = v2.getType(); -- -- // perform comparison for =?= ; true iff same types and same values -- if (op == META_EQUAL_OP) -- { -- if (vt1 != vt2) -- { -- result.setIntegerValue (0); -- return; -- } -- -- // undefined or error -- if (vt1 == UNDEFINED_VALUE || vt1 == ERROR_VALUE) -- { -- result.setIntegerValue (1); -- return; -- } -- -- // if not the above cases, =?= is just like ==, but -- // case-sensitive for strings -- op = EQUAL_OP; -- case_sensitive = true; -- } -- // perform comparison for =!= ; negation of =?= -- if (op == META_NOT_EQUAL_OP) -- { -- if (vt1 != vt2) -- { -- result.setIntegerValue (1); -- return; -- } -- -- // undefined or error -- if (vt1 == UNDEFINED_VALUE || vt1 == ERROR_VALUE || -- vt2 == UNDEFINED_VALUE || vt2 == ERROR_VALUE) -- { -- result.setIntegerValue (0); -- return; -- } -- -- // if not the above cases, =!= is just like !=, but -- // case-sensitive for strings -- op = NOT_EQUAL_OP; -- case_sensitive = true; -- } -- -- switch (coerceResult) -- { -- // at least one of v1, v2 is a string -- case STRING_VALUE: -- // check if both are strings -- if (vt1 != STRING_VALUE || vt2 != STRING_VALUE) -- { -- // comparison between strings and non-exceptional non-string -- // values is an error -- result.setErrorValue(); -- return; -- } -- compareStrings (op, v1, v2, result, case_sensitive); -- return; -- -- case INTEGER_VALUE: -- compareIntegers (op, v1, v2, result); -- return; -- -- case REAL_VALUE: -- compareReals (op, v1, v2, result); -- return; -- -- default: -- // should not get here -- EXCEPT ("Should not get here"); -- return; -- } --} -- -- --static void --doArithmetic (OpKind op, Value &v1, Value &v2, Value &result) --{ -- int i1, i2; -- double r1; -- char *s; -- -- // ensure the operands are not strings -- if (v1.isStringValue (s) || v2.isStringValue (s)) -- { -- result.setErrorValue (); -- return; -- } -- -- // take care of the one unary arithmetic operator -- if (op == UNARY_MINUS_OP) -- { -- if (v1.isIntegerValue (i1)) -- { -- result.setIntegerValue (-i1); -- return; -- } -- else -- if (v1.isRealValue (r1)) -- { -- result.setRealValue (-r1); -- return; -- } -- -- // v1 is either UNDEFINED or ERROR ... the result is the same as v1 -- result = v1; -- return; -- } -- -- // ensure none of the operands are strings -- switch (coerceToNumber (v1, v2)) -- { -- case INTEGER_VALUE: -- v1.isIntegerValue (i1); -- v2.isIntegerValue (i2); -- switch (op) -- { -- case ADDITION_OP: result.setIntegerValue(i1+i2); return; -- case SUBTRACTION_OP: result.setIntegerValue(i1-i2); return; -- case MULTIPLICATION_OP: result.setIntegerValue(i1*i2); return; -- case DIVISION_OP: -- if (i2 != 0) -- result.setIntegerValue(i1/i2); -- else -- result.setErrorValue (); -- return; -- case MODULUS_OP: -- if (i2 != 0) -- result.setIntegerValue(i1%i2); -- else -- result.setErrorValue (); -- return; -- -- default: -- // should not reach here -- EXCEPT ("Should not get here"); -- return; -- } -- -- case REAL_VALUE: -- doRealArithmetic (op, v1, v2, result); -- return; -- -- default: -- // should not get here -- EXCEPT ("Should not get here"); -- } -- -- return; --} -- --static bool --doLogicalShortCircuit (OpKind op, Value &v1, Value &result) --{ -- int i1; -- double r1; -- ValueType vt1 = v1.getType(); -- bool did_short_circuit; -- -- did_short_circuit = false; -- v1.isIntegerValue (i1); -- v1.isRealValue (r1); -- -- if (op == LOGICAL_OR_OP) -- { -- // no logic on strings --- a string is equivalent to the ERROR -- // value. But due to the logic in doLogical, we can't short-circuit -- // on it, because "somestring" || 3 would evaluate to 1. Stupid -- // old ClassAds. -- if (vt1 == STRING_VALUE) -- { -- did_short_circuit = false; -- } -- else -- if ((vt1 == INTEGER_VALUE && i1 != 0) || (vt1 == REAL_VALUE && r1 != 0)) -- { -- result.setIntegerValue(1); -- did_short_circuit = true; -- } -- // We don't short-circuit on error because according to the -- // stupid semantics of old ClassAds, error || 3 is 1. (See -- // doLogical.) Ditto for undefined, but that's actually good. -- else -- { -- did_short_circuit = false; -- } -- } -- else -- if (op == LOGICAL_AND_OP) -- { -- // no logic on strings --- a string is equivalent to the ERROR -- // value. -- if (vt1 == STRING_VALUE) -- { -- result.setErrorValue(); -- did_short_circuit = true; -- } -- else -- if ((vt1 == INTEGER_VALUE && i1 == 0) || (vt1==REAL_VALUE && r1 == 0)) -- { -- result.setIntegerValue(0); -- did_short_circuit = true; -- } -- else -- if (vt1 == ERROR_VALUE) -- { -- result.setErrorValue(); -- did_short_circuit = true; -- } -- else -- if (vt1 == UNDEFINED_VALUE) -- { -- result.setUndefinedValue(); -- did_short_circuit = true; -- } -- else -- { -- did_short_circuit = false; -- } -- } -- -- // done -- return did_short_circuit; --} -- --static void --doLogical (OpKind op, Value &v1, Value &v2, Value &result) --{ -- int i1, i2; -- double r1, r2; -- ValueType vt1 = v1.getType(); -- ValueType vt2 = v2.getType(); -- -- // stash i1, i2; r1 and r2 --- some of them will be invalid -- v1.isIntegerValue (i1); -- v1.isRealValue (r1); -- v2.isIntegerValue (i2); -- v2.isRealValue (r2); -- -- // no logic on strings --- a string is equivalent to the ERROR value -- if (vt1==STRING_VALUE) vt1 = ERROR_VALUE; -- if (vt2==STRING_VALUE) vt2 = ERROR_VALUE; -- -- // handle unary operator -- if (op == LOGICAL_NOT_OP) -- { -- if (vt1 == INTEGER_VALUE) -- result.setIntegerValue(!i1); -- else -- if (vt1 == REAL_VALUE) -- result.setIntegerValue((int)(!r1)); -- else -- { -- // either undefined or error -- result = v1; -- } -- -- return; -- } -- -- // logic with UNDEFINED and ERROR -- if (op == LOGICAL_OR_OP) -- { -- // short circuiting case ... -- if ((vt1==INTEGER_VALUE && i1) || (vt1==REAL_VALUE && r1)) -- result.setIntegerValue(1); -- else -- // v1 is not true --- check v2 -- if ((vt2==INTEGER_VALUE && i2) || (vt2==REAL_VALUE && r2)) -- result.setIntegerValue(1); -- else -- // v1 is not true and v2 is not true; if either of them is ERROR, -- // the result of the computation is ERROR -- if (vt1==ERROR_VALUE || vt2==ERROR_VALUE) -- result.setErrorValue(); -- else -- // if either of them is UNDEFINED, the result is UNDEFINED -- if (vt1==UNDEFINED_VALUE || vt2==UNDEFINED_VALUE) -- result.setUndefinedValue(); -- else -- // must be false -- result.setIntegerValue(0); -- } -- else -- if (op == LOGICAL_AND_OP) -- { -- // short circuiting case ... -- if ((vt1==INTEGER_VALUE && !i1) || (vt1==REAL_VALUE && !r1)) -- result.setIntegerValue(0); -- else -- // v1 is not false --- check v2 -- if ((vt2==INTEGER_VALUE && !i2) || (vt2==REAL_VALUE && !r2)) -- result.setIntegerValue(0); -- else -- // v1 is not false and v2 is not false; if either of them is ERROR, -- // the result of the computation is ERROR -- if (vt1==ERROR_VALUE || vt2==ERROR_VALUE) result.setErrorValue(); -- else -- // if either of them is UNDEFINED, the result is UNDEFINED -- if (vt1==UNDEFINED_VALUE || vt2==UNDEFINED_VALUE) -- result.setUndefinedValue(); -- else -- // must be true -- result.setIntegerValue(1); -- } -- -- // done -- return; --} -- -- -- --static void --doBitwise (OpKind op, Value &v1, Value &v2, Value &result) --{ -- int i1, i2; -- int signMask = ~INT_MAX; // 1 at the position of the sign bit -- int val; -- -- // bitwise operations are defined only on integers -- if (op == BITWISE_NOT_OP) -- { -- if (!v1.isIntegerValue(i1)) -- { -- // make sure that ERROR is propagated -- if (v1.isErrorValue()) -- result.setErrorValue(); -- else -- result.setUndefinedValue(); -- return; -- } -- } -- else -- if (!v1.isIntegerValue(i1) || !v2.isIntegerValue(i2)) -- { -- // make sure that errors are propagated -- if (v1.isErrorValue() || v2.isErrorValue()) -- { -- result.setErrorValue(); -- return; -- } -- -- result.setUndefinedValue(); -- return; -- } -- -- switch (op) -- { -- case BITWISE_NOT_OP: result.setIntegerValue(~i1); return; -- case BITWISE_OR_OP: result.setIntegerValue(i1|i2); return; -- case BITWISE_AND_OP: result.setIntegerValue(i1&i2); return; -- case BITWISE_XOR_OP: result.setIntegerValue(i1^i2); return; -- case LEFT_SHIFT_OP: result.setIntegerValue(i1<= 0) -- { -- // sign bit is not on; >> will work fine -- result.setIntegerValue (i1 >> i2); -- return; -- } -- else -- { -- // sign bit is on -- val = i1 >> 1; // shift right 1; the sign bit *may* be on -- val &= (~signMask); // clear the sign bit for sure -- val >>= (i2 - 1); // shift remaining number of positions -- result.setIntegerValue (val); -- return; -- } -- // will not reach here -- return; -- -- case ARITH_RIGHT_SHIFT_OP: -- if (i1 >= 0) -- { -- // sign bit is off; >> will work fine -- result.setIntegerValue (i1 >> i2); -- return; -- } -- else -- { -- // sign bit is on; >> *may* not set the sign -- val = i1; -- for (int i = 0; i < i2; i++) -- val = (val >> 1) | signMask; // make sure that it does -- result.setIntegerValue (val); -- return; -- } -- // will not reach here -- return; -- -- default: -- // should not get here -- EXCEPT ("Should not get here"); -- } --} -- -- --static volatile bool ClassAdExprFPE = false; --#ifndef WIN32 --void ClassAd_SIGFPE_handler (int) { ClassAdExprFPE = true; } --#endif -- --static void --doRealArithmetic (OpKind op, Value &v1, Value &v2, Value &result) --{ -- double r1, r2; -- double comp; -- -- // we want to prevent FPE and set the ERROR value on the result; on Unix -- // trap sigfpe and set the ClassAdExprFPE flag to true; on NT check the -- // result against HUGE_VAL. check errno for EDOM and ERANGE for kicks. -- -- v1.isRealValue (r1); -- v2.isRealValue (r2); -- --#ifndef WIN32 -- struct sigaction sa1, sa2; -- sa1.sa_handler = ClassAd_SIGFPE_handler; -- sigemptyset (&(sa1.sa_mask)); -- sa1.sa_flags = 0; -- if (sigaction (SIGFPE, &sa1, &sa2)) -- { -- dprintf (D_ALWAYS, -- "Warning! ClassAd: Failed sigaction for SIGFPE (errno=%d)\n", -- errno); -- } --#endif -- -- ClassAdExprFPE = false; -- errno = 0; -- switch (op) -- { -- case ADDITION_OP: comp = r1+r2; break; -- case SUBTRACTION_OP: comp = r1-r2; break; -- case MULTIPLICATION_OP: comp = r1*r2; break; -- case DIVISION_OP: comp = r1/r2; break; -- case MODULUS_OP: errno = EDOM; break; -- -- default: -- // should not reach here -- EXCEPT ("Should not get here"); -- return; -- } -- -- // check if anything bad happened -- if (ClassAdExprFPE==true || errno==EDOM || errno==ERANGE) { -- result.setErrorValue (); --#ifdef WIN32 -- } else if (comp==HUGE_VAL) { -- result.setErrorValue (); --#endif -- } else { -- result.setRealValue (comp); -- } -- -- // restore the state --#ifndef WIN32 -- if (sigaction (SIGFPE, &sa2, &sa1)) -- { -- dprintf (D_ALWAYS, -- "Warning! ClassAd: Failed sigaction for SIGFPE (errno=%d)\n", -- errno); -- } --#endif --} -- -- --static void --compareStrings (OpKind op, Value &v1, Value &v2, Value &result, bool case_sensitive) --{ -- char *s1, *s2; -- int cmp; -- -- v1.isStringValue (s1); -- v2.isStringValue (s2); -- -- result.setIntegerValue (0); -- if (case_sensitive) { -- cmp = strcmp(s1, s2); -- } else { -- cmp = strcasecmp(s1, s2); -- } -- if (cmp < 0) -- { -- // s1 < s2 -- if (op == LESS_THAN_OP || -- op == LESS_OR_EQUAL_OP || -- op == NOT_EQUAL_OP) -- { -- result.setIntegerValue (1); -- } -- } -- else -- if (cmp == 0) -- { -- // s1 == s2 -- if (op == LESS_OR_EQUAL_OP || -- op == EQUAL_OP || -- op == GREATER_OR_EQUAL_OP) -- { -- result.setIntegerValue (1); -- } -- } -- else -- { -- // s1 > s2 -- if (op == GREATER_THAN_OP || -- op == GREATER_OR_EQUAL_OP || -- op == NOT_EQUAL_OP) -- { -- result.setIntegerValue (1); -- } -- } --} -- -- --static void --compareIntegers (OpKind op, Value &v1, Value &v2, Value &result) --{ -- int i1, i2, compResult; -- -- v1.isIntegerValue (i1); -- v2.isIntegerValue (i2); -- -- switch (op) -- { -- case LESS_THAN_OP: compResult = (i1 < i2); break; -- case LESS_OR_EQUAL_OP: compResult = (i1 <= i2); break; -- case EQUAL_OP: compResult = (i1 == i2); break; -- case NOT_EQUAL_OP: compResult = (i1 != i2); break; -- case GREATER_THAN_OP: compResult = (i1 > i2); break; -- case GREATER_OR_EQUAL_OP: compResult = (i1 >= i2); break; -- default: -- // should not get here -- EXCEPT ("Should not get here"); -- return; -- } -- -- result.setIntegerValue (compResult); --} -- -- --static void --compareReals (OpKind op, Value &v1, Value &v2, Value &result) --{ -- double r1, r2; -- int compResult; -- -- v1.isRealValue (r1); -- v2.isRealValue (r2); -- -- switch (op) -- { -- case LESS_THAN_OP: compResult = (r1 < r2); break; -- case LESS_OR_EQUAL_OP: compResult = (r1 <= r2); break; -- case EQUAL_OP: compResult = (r1 == r2); break; -- case NOT_EQUAL_OP: compResult = (r1 != r2); break; -- case GREATER_THAN_OP: compResult = (r1 > r2); break; -- case GREATER_OR_EQUAL_OP: compResult = (r1 >= r2); break; -- default: -- // should not get here -- EXCEPT ("Should not get here"); -- return; -- } -- -- result.setIntegerValue (compResult); --} -- -- --// This function performs type promotions so that both v1 and v2 are of the --// same numerical type: (v1 and v2 are not ERROR or UNDEFINED) --// + if either of v1 or v2 are strings return STRING_VALUE --// + if both v1 and v2 are numbers and of the same type, return type --// + if v1 is an int and v2 is a real, convert v1 to real; return REAL_VALUE --// + if v1 is a real and v2 is an int, convert v2 to real; return REAL_VALUE --static ValueType --coerceToNumber (Value &v1, Value &v2) --{ -- char *s; -- int i; -- double r; -- -- // either of v1, v2 not numerical? -- if (v1.isStringValue (s) || v2.isStringValue (s)) return STRING_VALUE; -- if (v1.isUndefinedValue() || v2.isUndefinedValue()) return UNDEFINED_VALUE; -- if (v1.isErrorValue () || v2.isErrorValue ()) return ERROR_VALUE; -- -- // both v1 and v2 of same numerical type -- if (v1.isIntegerValue(i) && v2.isIntegerValue(i)) return INTEGER_VALUE; -- if (v1.isRealValue(r) && v2.isRealValue(r)) return REAL_VALUE; -- -- // type promotions required -- if (v1.isIntegerValue(i) && v2.isRealValue(r)) -- v1.setRealValue ((double)i); -- else -- if (v1.isRealValue(r) && v2.isIntegerValue(i)) -- v2.setRealValue ((double)i); -- -- return REAL_VALUE; --} -diff --git a/src/.deprecate_classad.old/operators.h b/src/.deprecate_classad.old/operators.h -deleted file mode 100644 -index 3a7cec0..0000000 ---- a/src/.deprecate_classad.old/operators.h -+++ /dev/null -@@ -1,86 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#ifndef __OPERATORS_H__ --#define __OPERATORS_H__ -- --#include "value.h" -- --// kinds of operators --enum OpKind --{ -- __NO_OP__, // convenience -- -- __FIRST_OP__, -- -- __COMPARISON_START__ = __FIRST_OP__, -- LESS_THAN_OP = __COMPARISON_START__, -- LESS_OR_EQUAL_OP, // (comparison) -- NOT_EQUAL_OP, // (comparison) -- EQUAL_OP, // (comparison) -- META_EQUAL_OP, // (comparison) -- META_NOT_EQUAL_OP, // (comparison) -- GREATER_OR_EQUAL_OP, // (comparison) -- GREATER_THAN_OP, // (comparison) -- __COMPARISON_END__ = GREATER_THAN_OP, -- -- __ARITHMETIC_START__, -- UNARY_PLUS_OP = __ARITHMETIC_START__, -- UNARY_MINUS_OP, // (arithmetic) -- ADDITION_OP, // (arithmetic) -- SUBTRACTION_OP, // (arithmetic) -- MULTIPLICATION_OP, // (arithmetic) -- DIVISION_OP, // (arithmetic) -- MODULUS_OP, // (arithmetic) -- __ARITHMETIC_END__ = MODULUS_OP, -- -- __LOGIC_START__, -- LOGICAL_NOT_OP = __LOGIC_START__, -- LOGICAL_OR_OP, // (logical) -- LOGICAL_AND_OP, // (logical) -- __LOGIC_END__ = LOGICAL_AND_OP, -- -- __BITWISE_START__, -- BITWISE_NOT_OP = __BITWISE_START__, -- BITWISE_OR_OP, // (bitwise) -- BITWISE_XOR_OP, // (bitwise) -- BITWISE_AND_OP, // (bitwise) -- LEFT_SHIFT_OP, // (bitwise) -- LOGICAL_RIGHT_SHIFT_OP, // (bitwise) -- unsigned shift -- ARITH_RIGHT_SHIFT_OP, // (bitwise) -- signed shift -- __BITWISE_END__ = ARITH_RIGHT_SHIFT_OP, -- -- __MISC_START__, -- PARENTHESES_OP = __MISC_START__, -- TERNARY_OP, // (misc) -- __MISC_END__ = TERNARY_OP, -- -- __LAST_OP__ = __MISC_END__ --}; -- -- --// table of string representations of operators; indexed by OpKind --extern const char *opString[]; -- --// public access to operation function --void operate (OpKind, Value &, Value &); --bool operateShortCircuit (OpKind, Value &, Value &); --void operate (OpKind, Value &, Value &, Value &); -- --#endif//__OPERATORS_H__ -diff --git a/src/.deprecate_classad.old/parser.cpp b/src/.deprecate_classad.old/parser.cpp -deleted file mode 100644 -index 3d24ff2..0000000 ---- a/src/.deprecate_classad.old/parser.cpp -+++ /dev/null -@@ -1,759 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --//****************************************************************************** --// parser.c --// --// Converts a string expression into an expression tree. The following function --// is implemented: --// --// int Parse(const char*, ExprTree*&) --// --//****************************************************************************** --#include "condor_common.h" --#include "condor_exprtype.h" --#include "condor_ast.h" --#include "condor_scanner.h" --#include "condor_string.h" -- --Token &nextToken() --{ -- static Token next_token; -- return next_token; --} -- --static int alreadyRead; -- --int ParseExpr(const char *& s, ExprTree*&, int&); -- --//////////////////////////////////////////////////////////////////////////////// --// ReadToken() reads in a token to the global variable for parse_... functions --// to use. Once a token is read by this function, it can not be looked at again. --//////////////////////////////////////////////////////////////////////////////// --Token* --ReadToken(const char *& s) --{ -- if(alreadyRead == TRUE) -- { -- nextToken().reset(); -- Scanner(s, nextToken()); -- } -- alreadyRead = TRUE; -- return(&nextToken()); --} -- --//////////////////////////////////////////////////////////////////////////////// --// LookToken 'look at' a token without 'read' it, so that the next token that's --// read in is the same token. A token can be looked at for many times. --//////////////////////////////////////////////////////////////////////////////// --Token* --LookToken(const char *& s) --{ -- if(alreadyRead == TRUE) -- { -- nextToken().reset(); -- Scanner(s, nextToken()); -- } -- alreadyRead = FALSE; -- return(&nextToken()); --} -- -- --//////////////////////////////////////////////////////////////////////////////// --// Match() reads in a token, see if its type matches the argument t. If it does, --// then return TRUE; Otherwise return FALSE. --//////////////////////////////////////////////////////////////////////////////// --int --Match(LexemeType t, const char *& s, int& count) --{ -- Token* token; -- -- token = ReadToken(s); -- count = count + token->length; -- if(t == token->type) -- { -- nextToken().reset(); -- return TRUE; -- } -- nextToken().reset(); -- return FALSE; --} -- --/////////////////////////////////////////////////////////////////////////////// --// intermediate parse functions. --/////////////////////////////////////////////////////////////////////////////// -- --int --ParseFunction(char *functionName, const char *& s, ExprTree*& newTree, int& count) --{ -- int parse_succeeded; -- Token *t; -- Function *function; -- newTree = new Function(functionName); -- -- function = (Function *) newTree; -- -- t = ReadToken(s); // That's the right paren -- count += t->length; -- -- parse_succeeded = FALSE; -- -- t = LookToken(s); -- if (t->type == LX_RPAREN) { -- ReadToken(s); -- } else { -- while (1) { -- ExprTree *argument; -- if (ParseExpr(s, argument, count)) { -- function->AppendArgument(argument); -- -- Token *next_token; -- -- next_token = LookToken(s); -- if (next_token->type == LX_RPAREN) { -- ReadToken(s); -- count += next_token->length; -- parse_succeeded = TRUE; -- break; -- } else if (next_token->type==LX_COMMA || -- next_token->type==LX_SEMICOLON) -- { -- ReadToken(s); -- count += next_token->length; -- continue; -- } else { -- parse_succeeded = FALSE; -- break; -- } -- } else { -- parse_succeeded = FALSE; -- break; -- } -- } -- } -- -- return parse_succeeded; --} -- --int --ParseFactor(const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t = LookToken(s); // next token -- ExprTree *expr = NULL; -- -- switch(t->type) -- { -- case LX_VARIABLE : -- -- t = ReadToken(s); -- -- newTree = new Variable(t->strVal); -- count = count + t->length; -- -- { -- Token *next_token; -- -- next_token = LookToken(s); -- if (next_token->type == LX_LPAREN) { -- // Oops, we didn't really want a variable -- char *function_name; -- function_name = strnewp(((Variable *)newTree)->Name()); -- delete newTree; -- newTree = NULL; -- ParseFunction(function_name, s, newTree, count); -- delete [] function_name; -- break; -- } -- } -- break; -- -- case LX_UNDEFINED: -- -- t = ReadToken(s); -- newTree = new Undefined(); -- count = count + t->length; -- break; -- -- case LX_ERROR: -- -- t = ReadToken(s); -- newTree = new Error(); -- count = count + t->length; -- break; -- -- case LX_INTEGER : -- -- t = ReadToken(s); -- newTree = new Integer(t->intVal); -- count = count + t->length; -- break; -- -- case LX_FLOAT : -- -- t = ReadToken(s); -- newTree = new Float(t->floatVal); -- count = count + t->length; -- break; -- -- case LX_STRING : -- -- t = ReadToken(s); -- newTree = new String(t->strVal); -- count = count + t->length; -- break; -- -- case LX_TIME: -- t = ReadToken(s); -- newTree = new ISOTime(t->strVal); -- count = count + t->length; -- break; -- -- case LX_BOOL : -- -- t = ReadToken(s); -- newTree = new ClassadBoolean(t->intVal); -- count = count + t->length; -- break; -- -- case LX_LPAREN : -- -- Match(LX_LPAREN, s, count); -- if(ParseExpr(s, newTree, count)) { -- if(!Match(LX_RPAREN, s, count)) { -- return FALSE; -- } else { -- // parsed parenthesised expr correctly -- ExprTree *ptree = newTree; -- newTree = new AddOp( NULL, ptree ); -- } -- } else { -- return FALSE; -- } -- return TRUE; -- -- case LX_SUB : // unary minus -- -- Match(LX_SUB, s, count); -- if(ParseExpr(s, expr, count)) -- { -- if( expr->MyType() == LX_INTEGER ) { -- newTree = new Integer( - ((IntegerBase*)expr)->Value() ); -- delete expr; -- return TRUE; -- } else if( expr->MyType() == LX_FLOAT ) { -- newTree = new Float( - ((FloatBase*)expr)->Value() ); -- delete expr; -- return TRUE; -- } -- newTree = new SubOp(NULL, expr); -- return TRUE; -- } -- else -- { -- return FALSE; -- } -- break; -- -- default : -- -- // I don't know if this is correct, but this is way it was. -- // --Rajesh -- newTree = new Error; -- return FALSE; -- } -- -- return TRUE; --} -- --int --ParseX4(ExprTree* lArg, const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t = LookToken(s); // next token -- ExprTree* subTree = NULL; -- ExprTree* rArg = NULL; -- -- switch(t->type) -- { -- case LX_MULT: -- -- Match(LX_MULT, s, count); -- if(ParseFactor(s, rArg, count)) -- { -- subTree = new MultOp(lArg, rArg); -- } -- else -- { -- newTree = new MultOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- case LX_DIV : -- -- Match(LX_DIV, s, count); -- if(ParseFactor(s, rArg, count)) -- { -- subTree = new DivOp(lArg, rArg); -- } -- else -- { -- newTree = new DivOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- default : -- -- newTree = lArg; -- return TRUE; -- } -- -- return ParseX4(subTree, s, newTree, count); --} -- --int --ParseMultOp(const char *& s, ExprTree*& newTree, int& count) --{ -- ExprTree* lArg = NULL; -- -- if(ParseFactor(s, lArg, count)) -- { -- return ParseX4(lArg, s, newTree, count); -- } -- newTree = lArg; -- return FALSE; --} -- --int --ParseX3(ExprTree* lArg, const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t = LookToken(s); -- ExprTree* subTree = NULL; -- ExprTree* rArg = NULL; -- -- switch(t->type) -- { -- case LX_ADD : -- -- Match(LX_ADD, s, count); -- if(ParseMultOp(s, rArg, count)) -- { -- subTree = new AddOp(lArg, rArg); -- } -- else -- { -- newTree = new AddOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- case LX_SUB : -- -- Match(LX_SUB, s, count); -- if(ParseMultOp(s, rArg, count)) -- { -- subTree = new SubOp(lArg, rArg); -- } -- else -- { -- newTree = new SubOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- default : -- -- newTree = lArg; -- return TRUE; -- } -- -- return ParseX3(subTree, s, newTree, count); --} -- --int --ParseAddOp(const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t; -- ExprTree* lArg = NULL; -- char* tmp; -- -- if(ParseMultOp(s, lArg, count)) -- { -- return ParseX3(lArg, s, newTree, count); -- } -- newTree = lArg; -- return FALSE; -- -- /* Jim Pruyne added this code in 1996, but it never -- executed due to the return above. Let's just -- be honest and comment it all out. -- t = LookToken(s); -- if(t->type == LX_VARIABLE) -- { -- tmp = t->strVal; -- if(!strcmp(tmp, "K") || !strcmp(tmp, "k")) -- { -- ReadToken(s); -- newTree->unit = 'k'; -- } -- if(!strcmp(tmp, "M") || !strcmp(tmp, "m")) -- { -- ReadToken(s); -- } -- } -- -- return TRUE; -- */ --} -- --int --ParseX2p5(ExprTree* lArg, const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t = LookToken(s); -- ExprTree* subTree = NULL; -- ExprTree* rArg = NULL; -- -- switch(t->type) { -- case LX_LT: -- Match(LX_LT, s, count); -- if(ParseAddOp(s, rArg, count)) { -- subTree = new LtOp(lArg, rArg); -- } else { -- newTree = new LtOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- case LX_LE : -- Match(LX_LE, s, count); -- if(ParseAddOp(s, rArg, count)) { -- subTree = new LeOp(lArg, rArg); -- } else { -- newTree = new LeOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- case LX_GT: -- Match(LX_GT, s, count); -- if(ParseAddOp(s, rArg, count)) { -- subTree = new GtOp(lArg, rArg); -- } else { -- newTree = new GtOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- case LX_GE : -- Match(LX_GE, s, count); -- if(ParseAddOp(s, rArg, count)) { -- subTree = new GeOp(lArg, rArg); -- } else { -- newTree = new GeOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- default : -- newTree = lArg; -- return TRUE; -- } -- -- return ParseX2p5(subTree, s, newTree, count); --} -- -- --int --ParseEqualityOp(const char *& s, ExprTree*& newTree, int& count) --{ -- ExprTree* lArg = NULL; -- -- if(ParseAddOp(s, lArg, count)) { -- return ParseX2p5(lArg, s, newTree, count); -- } -- newTree = lArg; -- return FALSE; --} -- -- --int --ParseX2(ExprTree* lArg, const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t = LookToken(s); -- ExprTree* subTree = NULL; -- ExprTree* rArg = NULL; -- -- switch(t->type) { -- case LX_META_EQ : -- Match(LX_META_EQ, s, count); -- if(ParseEqualityOp(s, rArg, count)) { -- subTree = new MetaEqOp(lArg, rArg); -- } else { -- newTree = new MetaEqOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- case LX_META_NEQ : -- Match(LX_META_NEQ, s, count); -- if(ParseEqualityOp(s, rArg, count)) { -- subTree = new MetaNeqOp(lArg, rArg); -- } else { -- newTree = new MetaNeqOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- case LX_EQ : -- Match(LX_EQ, s, count); -- if(ParseEqualityOp(s, rArg, count)) { -- subTree = new EqOp(lArg, rArg); -- } else { -- newTree = new EqOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- case LX_NEQ : -- Match(LX_NEQ, s, count); -- if(ParseEqualityOp(s, rArg, count)) { -- subTree = new NeqOp(lArg, rArg); -- } else { -- newTree = new NeqOp(lArg, rArg); -- return FALSE; -- } -- break; -- -- default : -- newTree = lArg; -- return TRUE; -- } -- -- return ParseX2(subTree, s, newTree, count); --} -- -- --int --ParseSimpleExpr(const char *& s, ExprTree*& newTree, int& count) --{ -- ExprTree* lArg = NULL; -- -- if(ParseEqualityOp(s, lArg, count)) { -- return ParseX2(lArg, s, newTree, count); -- } -- newTree = lArg; -- return FALSE; --} -- -- --int --ParseX1p5(ExprTree* lArg, const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t = LookToken(s); -- ExprTree* subTree = NULL; -- ExprTree* rArg = NULL; -- -- if( t->type == LX_AND ) { -- Match(LX_AND, s, count); -- if(ParseSimpleExpr(s, rArg, count)) { -- subTree = new AndOp(lArg, rArg); -- } else { -- newTree = new AndOp(lArg, rArg); -- return FALSE; -- } -- } else { -- newTree = lArg; -- return TRUE; -- } -- -- return ParseX1p5(subTree, s, newTree, count); --} -- -- --int --ParseAndExpr(const char *& s, ExprTree*& newTree, int& count) --{ -- ExprTree* lArg = NULL; -- -- if(ParseSimpleExpr(s, lArg, count)) { -- return ParseX1p5(lArg, s, newTree, count); -- } -- newTree = lArg; -- return FALSE; --} -- -- --int --ParseX1(ExprTree* lArg, const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t = LookToken(s); -- ExprTree* subTree = NULL; -- ExprTree* rArg = NULL; -- -- if( t->type == LX_OR ) { -- Match(LX_OR, s, count); -- if(ParseAndExpr(s, rArg, count)) { -- subTree = new OrOp(lArg, rArg); -- } else { -- newTree = new OrOp(lArg, rArg); -- return FALSE; -- } -- } else { -- newTree = lArg; -- return TRUE; -- } -- -- return ParseX1(subTree, s, newTree, count); --} -- --int --ParseExpr(const char *& s, ExprTree*& newTree, int& count) --{ -- ExprTree* lArg = NULL; -- -- if(ParseAndExpr(s, lArg, count)) { -- return ParseX1(lArg, s, newTree, count); -- } -- newTree = lArg; -- return FALSE; --} -- --int --ParseClassAdRvalExpr(const char* s, ExprTree*& tree, int *pos) --{ -- int count; -- int rc = 0; -- -- tree = NULL; -- -- count = 0; -- alreadyRead = TRUE; -- if(ParseExpr(s, tree, count) && LookToken(s)->type == LX_EOF) -- { -- count = 0; -- } else if (tree != NULL) { -- delete tree; -- tree = NULL; -- rc = 1; -- } -- nextToken().reset(); -- if ( pos ) { -- *pos = count; -- } -- return rc; --} -- --int --ParseAssignExpr(const char *& s, ExprTree*& newTree, int& count) --{ -- Token* t; -- ExprTree* lArg = NULL; -- ExprTree* rArg = NULL; -- -- if(ParseExpr(s, lArg, count) && lArg->MyType() == LX_VARIABLE) -- { -- t = LookToken(s); -- if(t->type == LX_ASSIGN) -- { -- Match(LX_ASSIGN, s, count); -- if(ParseExpr(s, rArg, count)) -- { -- newTree = new AssignOp(lArg, rArg); -- t = LookToken(s); -- if(t->type == LX_EOF) -- { -- return TRUE; -- } -- return FALSE; -- } -- else -- { -- newTree = new AssignOp(lArg, rArg); -- return FALSE; -- } -- } -- } -- newTree = lArg; -- return FALSE; --} -- --int --Parse(const char* s, ExprTree*& tree, int *pos) --{ -- int count; -- int rc = 0; -- -- tree = NULL; -- -- count = 0; -- alreadyRead = TRUE; -- if(ParseAssignExpr(s, tree, count)) -- { -- count = 0; -- } else if (tree != NULL) { -- delete tree; -- tree = NULL; -- rc = 1; -- } -- nextToken().reset(); -- if ( pos ) { -- *pos = count; -- } -- return rc; --} -- --int Parse(const char* s, MyString& name, ExprTree*& tree, int *pos) --{ -- int count = 0; -- int rc = 1; -- -- tree = NULL; -- -- count = 0; -- alreadyRead = TRUE; -- -- Token* t; -- ExprTree* lArg = NULL; -- ExprTree* rArg = NULL; -- -- if(ParseExpr(s, lArg, count) && lArg->MyType() == LX_VARIABLE) { -- t = LookToken(s); -- if(t->type == LX_ASSIGN) { -- Match(LX_ASSIGN, s, count); -- if(ParseExpr(s, rArg, count)) { -- t = LookToken(s); -- if(t->type == LX_EOF) { -- name = ((Variable *)lArg)->Name(); -- tree = rArg; -- rArg = NULL; -- rc = 0; -- count = 0; -- } -- } -- } -- } -- delete lArg; -- delete rArg; -- -- nextToken().reset(); -- if ( pos ) { -- *pos = count; -- } -- return rc; --} -diff --git a/src/.deprecate_classad.old/parser_internal.h b/src/.deprecate_classad.old/parser_internal.h -deleted file mode 100644 -index 7556875..0000000 ---- a/src/.deprecate_classad.old/parser_internal.h -+++ /dev/null -@@ -1,43 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --//****************************************************************************** --// parser.h --// --// Parse() converts a string expression into an expression tree. If an error --// is encountered, the partially parsed tree is preserved and the number of --// characters parsed is returned; Otherwise 0 is returned. --// --//****************************************************************************** -- --#ifndef _PARSER_INTERNAL_H --#define _PARSER_INTERVAL_H -- --#include "condor_ast.h" -- --// This is an internal-only parsing function. -- --// Parse an assignment expression, i.e. variable = expression --// On success, 0 is returned and tree is set to the resulting ExprTree. --// On failure, non-0 is returned, tree is set to NULL, and if pos is --// non-NULL, the location it points to is set to the position at which --// the error occurred. --int Parse(const char*s, ExprTree*&tree, int *pos = NULL); -- --#endif -diff --git a/src/.deprecate_classad.old/registration.cpp b/src/.deprecate_classad.old/registration.cpp -deleted file mode 100644 -index 0eff014..0000000 ---- a/src/.deprecate_classad.old/registration.cpp -+++ /dev/null -@@ -1,124 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --// --// registration.C : --// --// implementation file for the Registration class. --// --// Written by Wei Chen & Taxiao Wang, Fall 1995 --// -- --#include "condor_common.h" --#include "condor_registration.h" --#include "condor_debug.h" -- --// --// Constructor of the Registration class. --// --Registration::Registration(int size) --{ -- regiTableSize = size; -- regiNumber = 0; -- regiTable = new char*[size]; -- if(regiTable == NULL) -- { -- EXCEPT("Warning : you ran out of memory -- quitting !"); -- } -- for(int i=0; i < size; i++) -- { -- regiTable[i] = NULL; -- } --} -- --// --// Destructor of Registration class. --// --Registration::~Registration() --{ -- for(int i=0; i= regiTableSize) -- { // table is full, reallocation -- int i; -- int tempSize = 2 * regiTableSize; // necessary. -- char **tmp = NULL; -- -- /* This code mimics a realloc, but for new'ed memory */ -- -- /* make a new array of the desired size */ -- tmp = new char*[tempSize]; -- if(tmp == NULL) { -- EXCEPT("Registration::RegisterType(): out of memory!"); -- } -- -- /* copy the known bits over */ -- for(i=0; ikeyword, keyword->keyword_length) -- && !isalpha(*(input + keyword->keyword_length)) -- && !isdigit(*(input + keyword->keyword_length)) -- && *(input + keyword->keyword_length) != '_') { -- -- input += keyword->keyword_length; -- token.length += keyword->keyword_length; -- token.type = keyword->type; -- token.intVal = keyword->int_value; -- -- is_keyword = true; -- break; -- } -- } -- return is_keyword; --} -- --static void scan_variable( -- const char *&input, -- Token &token) --{ -- int variable_length; -- const char *s; -- -- variable_length = 0; -- s = input; -- -- // First, we count how many characters the variable is. -- while (isalnum(*s) || *s == '_' || *s == '.') { -- variable_length++; -- s++; -- } -- -- // Then we make sure we have space to store it. -- if (variable_length > token.strValLength) { -- free(token.strVal); -- token.strVal = (char *) malloc(variable_length + 1); -- token.strValLength = variable_length; -- } -- -- // Finally, we copy the variable. -- strncpy(token.strVal, input, variable_length); -- token.strVal[variable_length] = 0; -- -- input += variable_length; -- token.length += variable_length; -- token.type = LX_VARIABLE; -- -- //token.isString = TRUE; -- return; --} -- --static void scan_number( -- const char *&input, -- Token &token) --{ -- const char *digit_text; -- -- digit_text = input; -- -- // Count how long the number is -- while(isdigit(*digit_text)) { -- digit_text++; -- token.length++; -- } -- -- // Check if it's a floating point value -- if(*digit_text == '.') { -- token.length++; -- -- // It is a float, so count the fractional digits as well. -- for(digit_text++; isdigit(*digit_text); digit_text++) { -- token.length++; -- } -- -- // Convert the float -- token.floatVal = (float) strtod(input, (char **)&input); -- token.type = LX_FLOAT; -- } else { -- // It's just a plain integer -- token.intVal = strtol(input, (char **)&input, 10); -- token.type = LX_INTEGER; -- } -- return; --} -- --static void scan_string( -- const char *&input, -- Token &token) --{ -- -- int string_length; -- const char *s; -- -- // skip the initial quote mark -- input++; -- token.length++; -- -- s = input; -- string_length = 0; -- -- // First count the length of the string. -- while (*s != '"' && *s != '\0') { -- // These quoting rules are basically wrong. -- // However, they are required for backwards compatibility. -- // A quote may be escaped with a backslash. -- // Backslash does not escape any other character. -- // Exception: \" at the end of a string or a line is a backslash, not a quote. -- if(*s == '\\' && *(s+1) == '"' && *(s+2) != '\0' && *(s+2) != '\n' && *(s+2) != '\r' ) { -- s++; -- if(!*s) break; -- } -- s++; -- string_length++; -- } -- -- // Check if the string is not properly terminated with a quote mark. -- if (*s == '\0') { -- token.type = LX_ERROR; -- token.length = 0; -- } else { -- // Make sure we have space to store the string. -- if (string_length > token.strValLength) { -- free(token.strVal); -- token.strVal = (char *) malloc(string_length + 1); -- token.strValLength = string_length; -- } -- -- // Copy the string. Because of escaped quotes, we have to -- // copy the string without the benefit of strncpy -- char *dest; -- dest = token.strVal; -- while(*input != '"' && *input != '\0') -- { -- // See explanation above. -- if(*input == '\\' && *(input+1) == '"' && *(input+2) != '\0' && *(input+2) != '\n' && *(input+2) != '\r' ) { -- input++; -- token.length++; -- } -- *dest = *input; -- input++; -- dest++; -- token.length++; -- } -- -- token.strVal[string_length] = 0; -- -- // Update our tracking. -- input++; // for the final quote -- token.length++; // for the final quote -- token.type = LX_STRING; -- } -- return; --} -- --// We can time, which is just a string. --static void scan_time( -- const char *&input, -- Token &token) --{ -- int string_length; -- const char *s; -- -- // skip the initial quote mark -- input++; -- token.length++; -- -- s = input; -- string_length = 0; -- -- // First count the length of the string. -- while (*s != '\'' && *s != '\0') { -- s++; -- string_length++; -- } -- -- // Check if the string is not properly terminated with a quote mark. -- if (*s == '\0') { -- token.type = LX_ERROR; -- token.length = 0; -- } else { -- // Make sure we have space to store the string. -- if (string_length > token.strValLength) { -- free(token.strVal); -- token.strVal = (char *) malloc(string_length + 1); -- token.strValLength = string_length; -- } -- -- // Copy the string. -- char *dest; -- dest = token.strVal; -- while(*input != '\'' && *input != '\0') -- { -- *dest = *input; -- input++; -- dest++; -- token.length++; -- } -- -- token.strVal[string_length] = 0; -- -- // Update our tracking. -- input++; // for the final quote -- token.length++; // for the final quote -- token.type = LX_TIME; -- } -- return; --} -- --static void scan_operator( -- const char *&input, -- Token &token) --{ -- switch(*input) { -- case '(': -- token.type = LX_LPAREN; -- input = input + 1; -- token.length++; -- break; -- -- case ')': -- token.type = LX_RPAREN; -- input = input + 1; -- token.length++; -- break; -- -- case '+': -- token.type = LX_ADD; -- input = input + 1; -- token.length++; -- break; -- -- case '-': -- token.type = LX_SUB; -- input = input + 1; -- token.length++; -- break; -- -- case '*': -- token.type = LX_MULT; -- input = input + 1; -- token.length++; -- break; -- -- case '/': -- token.type = LX_DIV; -- input = input + 1; -- token.length++; -- break; -- -- case '<': -- input = input + 1; -- token.length++; -- if(*input == '=') { -- input = input + 1; -- token.length++; -- token.type = LX_LE; -- } else { -- token.type = LX_LT; -- } -- break; -- -- case '>': -- input = input + 1; -- token.length++; -- if(*input == '=') { -- input = input + 1; -- token.length++; -- token.type = LX_GE; -- } else { -- token.type = LX_GT; -- } -- break; -- -- case '&': -- input = input + 1; -- token.length++; -- if(*input == '&') { -- token.type = LX_AND; -- input = input + 1; -- token.length++; -- } else { -- token.type = LX_ERROR; -- } -- break; -- -- case '|': -- input = input + 1; -- token.length++; -- if(*input == '|') { -- token.type = LX_OR; -- input = input + 1; -- } else { -- token.type = LX_ERROR; -- } -- break; -- -- case '\0': -- case '\n': -- token.type = LX_EOF; -- break; -- -- case '!': -- input = input + 1; -- token.length++; -- if(*input == '=') { -- token.type = LX_NEQ; -- input = input + 1; -- token.length++; -- } else { -- token.type = LX_ERROR; -- } -- break; -- -- case '=': -- input = input + 1; -- token.length++; -- if(*input == '=') { -- token.type = LX_EQ; -- input = input + 1; -- token.length++; -- } else if (*input == '?' && *(input+1) == '=') { -- token.type = LX_META_EQ; -- input = input + 2; -- token.length += 2; -- } else if (*input == '!' && *(input+1) == '=') { -- token.type = LX_META_NEQ; -- input = input + 2; -- token.length += 2; -- } else { -- token.type = LX_ASSIGN; -- } -- break; -- -- case '$': -- token.type = LX_MACRO; -- input = input + 1; -- token.length++; -- break; -- -- case ',': -- token.type = LX_COMMA; -- input = input + 1; -- token.length++; -- break; -- -- case ';': -- token.type = LX_SEMICOLON; -- input = input + 1; -- token.length++; -- break; -- -- default: -- token.type = LX_ERROR; -- break; -- } -- return; --} -- --#else /* USE_NEW_SCANNER is not defined */ --void Scanner(const char *& s, Token& t) --{ -- char str[MAXVARNAME]; -- char *tmp; // working variables -- -- // skip white space -- t.length = 0; -- while(isspace(*s)) -- { -- s = s + 1; -- t.length++; -- } -- -- tmp = str; -- -- if(isalpha(*s) || *s == '_' || *s=='.' ) -- { -- // first check for keywords -- -- switch (*s) { -- -- case 'e': -- case 'E': -- if(!strncasecmp(s, "ERROR", 5) && !isalpha(*(s+5)) && *(s+5) != '_') -- { -- s = s + 5; -- t.length = t.length + 5; -- t.type = LX_ERROR; -- return; -- } -- break; -- -- case 'u': -- case 'U': -- if(!strncasecmp(s, "UNDEFINED", 9) && !isalpha(*(s+9)) && *(s+9) != '_') -- { -- s = s + 9; -- t.length = t.length + 9; -- t.type = LX_UNDEFINED; -- return; -- } -- break; -- -- case 'T': -- case 't': -- if(!strncasecmp(s, "TRUE", 4) && !isalpha(*(s+4)) && *(s+4) != '_') -- // TRUE -- { -- s = s + 4; -- t.length = t.length + 4; -- t.intVal = 1; -- t.type = LX_BOOL; -- return; -- } -- if(!strncasecmp(s, "T", 1) && !isalpha(*(s+1)) && *(s+1) != '_') -- // also TRUE -- { -- s = s + 1; -- t.length = t.length + 1; -- t.intVal = 1; -- t.type = LX_BOOL; -- return; -- } -- break; -- -- case 'f': -- case 'F': -- if(!strncasecmp(s, "FALSE", 5) && !isalpha(*(s+5)) && *(s+5) != '_') -- // FALSE -- { -- s = s + 5; -- t.length = t.length + 5; -- t.intVal = 0; -- t.type = LX_BOOL; -- return; -- } -- if(!strncasecmp(s, "F", 1) && !isalpha(*(s+1)) && *(s+1) != '_') -- // also FALSE -- { -- s = s + 1; -- t.length = t.length + 1; -- t.intVal = 0; -- t.type = LX_BOOL; -- return; -- } -- break; -- } // end of switch on first letter -- -- // read in the rest of the variable. -- while(isalnum(*s) || *s == '_' || *s == '.' ) -- { -- *tmp = *s; -- s++; -- tmp++; -- t.length++; -- } -- *tmp = '\0'; -- strcpy(t.strVal, str); -- t.type = LX_VARIABLE; -- t.isString = TRUE; -- return; -- } -- -- if(isdigit(*s)) -- // token is an integer or a floating point number -- { -- // count the length of the number -- tmp = s; -- while(isdigit(*tmp)) -- { -- tmp++; -- t.length++; -- } -- if(*tmp == '.') -- // token is a floating point number -- { -- t.length++; -- for(tmp++; isdigit(*tmp); tmp++) t.length++; -- t.floatVal = (float)strtod(s, &s); -- t.type = LX_FLOAT; -- } -- else -- // token is an integer number -- { -- t.intVal = strtol(s, &s, 10); -- t.type = LX_INTEGER; -- } -- return; -- } -- -- if(*s == '"') -- // token is a string -- { -- s++; -- char tmp2[ATTRLIST_MAX_EXPRESSION]; -- tmp = tmp2; -- t.length++; -- while(*s != '"' && *s != '\0') -- { -- // note: short-circuit evaluation will prevent SEGV if we're -- // at the end of the string in below conditional. -- // make certain s+2 != \0 so that on NT we can have strings -- // that are pathnames that end with a '\'. -- if(*s == '\\' && *(s+1) == '"' && *(s+2) != '\0') -- { -- s++; -- t.length++; -- } -- *tmp = *s; -- s++; -- tmp++; -- t.length++; -- } -- if(*s == '\0') -- { -- t.type = LX_ERROR; -- t.length = 0; -- return; -- } -- s++; -- t.length++; -- *tmp = '\0'; -- strcpy(t.strVal, tmp2); -- t.type = LX_STRING; -- t.isString = TRUE; -- return; -- } -- -- // token is an operator or a unit -- switch(*s) -- { -- case '(': t.type = LX_LPAREN; -- s = s + 1; -- t.length++; -- break; -- -- case ')': t.type = LX_RPAREN; -- s = s + 1; -- t.length++; -- break; -- -- case '+': t.type = LX_ADD; -- s = s + 1; -- t.length++; -- break; -- -- case '-': t.type = LX_SUB; -- s = s + 1; -- t.length++; -- break; -- -- case '*': t.type = LX_MULT; -- s = s + 1; -- t.length++; -- break; -- -- case '/': t.type = LX_DIV; -- s = s + 1; -- t.length++; -- break; -- -- case '<': s = s + 1; -- t.length++; -- if(*s == '=') -- { -- s = s + 1; -- t.length++; -- t.type = LX_LE; -- } -- else -- { -- t.type = LX_LT; -- } -- break; -- -- case '>': s = s + 1; -- t.length++; -- if(*s == '=') -- { -- s = s + 1; -- t.length++; -- t.type = LX_GE; -- } -- else -- { -- t.type = LX_GT; -- } -- break; -- -- case '&': s = s + 1; -- t.length++; -- if(*s == '&') -- { -- t.type = LX_AND; -- s = s + 1; -- t.length++; -- } -- else -- { -- t.type = LX_ERROR; -- } -- break; -- -- case '|': s = s + 1; -- t.length++; -- if(*s == '|') -- { -- t.type = LX_OR; -- s = s + 1; -- } -- else -- { -- t.type = LX_ERROR; -- } -- break; -- -- case '\0': -- case '\n': t.type = LX_EOF; -- break; -- -- case '!': s = s + 1; -- t.length++; -- if(*s == '=') -- { -- t.type = LX_NEQ; -- s = s + 1; -- t.length++; -- } -- else -- { -- t.type = LX_ERROR; -- } -- break; -- -- case '=': s = s + 1; -- t.length++; -- if(*s == '=') -- { -- t.type = LX_EQ; -- s = s + 1; -- t.length++; -- } -- else -- if (*s == '?' && *(s+1) == '=') -- { -- t.type = LX_META_EQ; -- s = s + 2; -- t.length += 2; -- } -- else -- if (*s == '!' && *(s+1) == '=') -- { -- t.type = LX_META_NEQ; -- s = s + 2; -- t.length += 2; -- } -- else -- { -- t.type = LX_ASSIGN; -- } -- break; -- -- case '$': t.type = LX_MACRO; -- s = s + 1; -- t.length++; -- break; -- -- default: t.type = LX_ERROR; -- break; -- } --} --#endif /* USE_EXTENSIBLE_ARRAY is not defined */ -diff --git a/src/.deprecate_classad.old/scriptfloat b/src/.deprecate_classad.old/scriptfloat -deleted file mode 100755 -index db1f562..0000000 ---- a/src/.deprecate_classad.old/scriptfloat -+++ /dev/null -@@ -1,21 +0,0 @@ --#!/bin/sh --##************************************************************** --## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, --## University of Wisconsin-Madison, WI. --## --## Licensed under the Apache License, Version 2.0 (the "License"); you --## may not use this file except in compliance with the License. You may --## obtain a copy of the License at --## --## http://www.apache.org/licenses/LICENSE-2.0 --## --## Unless required by applicable law or agreed to in writing, software --## distributed under the License is distributed on an "AS IS" BASIS, --## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --## See the License for the specific language governing permissions and --## limitations under the License. --## --##************************************************************** -- --echo 1.2 -diff --git a/src/.deprecate_classad.old/scriptinteger b/src/.deprecate_classad.old/scriptinteger -deleted file mode 100755 -index 56d75d7..0000000 ---- a/src/.deprecate_classad.old/scriptinteger -+++ /dev/null -@@ -1,21 +0,0 @@ --#!/bin/sh --##************************************************************** --## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, --## University of Wisconsin-Madison, WI. --## --## Licensed under the Apache License, Version 2.0 (the "License"); you --## may not use this file except in compliance with the License. You may --## obtain a copy of the License at --## --## http://www.apache.org/licenses/LICENSE-2.0 --## --## Unless required by applicable law or agreed to in writing, software --## distributed under the License is distributed on an "AS IS" BASIS, --## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --## See the License for the specific language governing permissions and --## limitations under the License. --## --##************************************************************** -- --echo 10 -diff --git a/src/.deprecate_classad.old/scriptstring b/src/.deprecate_classad.old/scriptstring -deleted file mode 100755 -index 1a60f48..0000000 ---- a/src/.deprecate_classad.old/scriptstring -+++ /dev/null -@@ -1,21 +0,0 @@ --#!/bin/sh --##************************************************************** --## --## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, --## University of Wisconsin-Madison, WI. --## --## Licensed under the Apache License, Version 2.0 (the "License"); you --## may not use this file except in compliance with the License. You may --## obtain a copy of the License at --## --## http://www.apache.org/licenses/LICENSE-2.0 --## --## Unless required by applicable law or agreed to in writing, software --## distributed under the License is distributed on an "AS IS" BASIS, --## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --## See the License for the specific language governing permissions and --## limitations under the License. --## --##************************************************************** -- --echo One day we will have new ClassAds. -diff --git a/src/.deprecate_classad.old/shared.cpp b/src/.deprecate_classad.old/shared.cpp -deleted file mode 100644 -index 6b3eb18..0000000 ---- a/src/.deprecate_classad.old/shared.cpp -+++ /dev/null -@@ -1,86 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#include --#include --#include -- --#include "classad_shared.h" -- --extern "C" --{ -- -- void sharedstring(const int number_of_arguments, -- const ClassAdSharedValue *arguments, -- ClassAdSharedValue *result) -- { -- char *value = new char[128]; -- -- strcpy(value, "Alain is a doofus"); -- -- result->type = ClassAdSharedType_String; -- result->text = value; -- -- return; -- } -- -- void sharedfloat(const int number_of_arguments, -- const ClassAdSharedValue *arguments, -- ClassAdSharedValue *result) -- { -- if (number_of_arguments != 1 -- || arguments == NULL -- || result == NULL -- || (arguments[0].type != ClassAdSharedType_Integer -- && arguments[0].type != ClassAdSharedType_Float)) { -- result->type = ClassAdSharedType_Error; -- } else { -- if (arguments[0].type == ClassAdSharedType_Integer) { -- result->real = (float) (arguments[0].integer * arguments[0].integer); -- } else { -- result->real = (float) (arguments[0].real * arguments[0].real); -- } -- result->type = ClassAdSharedType_Float; -- -- } -- return; -- } -- -- void sharedinteger(const int number_of_arguments, -- const ClassAdSharedValue *arguments, -- ClassAdSharedValue *result) -- { -- if (number_of_arguments != 1 -- || arguments == NULL -- || result == NULL -- || (arguments[0].type != ClassAdSharedType_Integer -- && arguments[0].type != ClassAdSharedType_Float)) { -- result->type = ClassAdSharedType_Error; -- } else { -- if (arguments[0].type == ClassAdSharedType_Integer) { -- result->integer = (int) (arguments[0].integer * arguments[0].integer); -- } else { -- result->integer = (int) (arguments[0].real * arguments[0].real); -- } -- result->type = ClassAdSharedType_Integer; -- } -- return; -- } -- --} -diff --git a/src/.deprecate_classad.old/test.cpp b/src/.deprecate_classad.old/test.cpp -deleted file mode 100644 -index 846a9fc..0000000 ---- a/src/.deprecate_classad.old/test.cpp -+++ /dev/null -@@ -1,51 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#include "condor_common.h" --#include "condor_classad.h" --#include "condor_config.h" -- --ClassAd a; --ClassAd b; -- --extern "C" int SetSyscalls() { return 0; } -- --int main (void) --{ -- EvalResult r; -- ExprTree *t; -- char buffer[1024]; -- char buf[2048]; -- -- config(); -- while( strcmp( gets( buffer ) , "done" ) != 0 ) { -- buf[0] = '\0'; -- if (ParseClassAdRvalExpr (buffer, t)) { -- cerr << "Parse error" << endl; -- exit( 1 ); -- } -- t->PrintToStr( buf ); -- puts( buf ); -- t->EvalTree((ClassAd*)NULL,(ClassAd*)NULL,&r); -- r.fPrintResult(stdout); -- printf("\n"); -- } -- -- return 0; --} -diff --git a/src/.deprecate_classad.old/test_classads.cpp b/src/.deprecate_classad.old/test_classads.cpp -deleted file mode 100644 -index 41d5d3f..0000000 ---- a/src/.deprecate_classad.old/test_classads.cpp -+++ /dev/null -@@ -1,4722 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- -- --#include "condor_common.h" --#include "condor_classad.h" --#include "condor_xml_classads.h" --#include "stringSpace.h" --#include "condor_scanner.h" --#include "iso_dates.h" --#define HAVE_DLOPEN 1 --#ifdef HAVE_DLOPEN // Used to be CLASSAD_FUNCTIONS --#include "condor_config.h" --#endif -- --/*---------------------------------------------------------- -- * -- * Global Variables -- * -- *----------------------------------------------------------*/ -- --#define LARGE_NUMBER_OF_CLASSADS 10000 -- --extern StringSpace classad_string_space; // for debugging only! -- --#define NUMBER_OF_CLASSAD_STRINGS (sizeof(classad_strings)/sizeof(char *)) --char *classad_strings[] = --{ --#ifdef HAVE_DLOPEN -- "A = 1\n B=2\n C = 3\n D='2001-04-05T12:14:15'\n G=GetTime(1)\n H=foo(1)", --#else -- "A = 1\n B=2\n C = 3\n D='2001-04-05T12:14:15'\n E=TRUE", --#endif -- "A = 0.7\n B=2\n C = 3\n D = \"alain\"\n MyType=\"foo\"\n TargetType=\"blah\"", -- -- "Rank = (Memory >= 50)", -- -- "Env = \"CPUTYPE=i86pc;GROUP=unknown;LM_LICENSE_FILE=/p/multifacet/" -- "projects/simics/dist10/v9-sol7-gcc/sys/flexlm/license.dat;" -- "SIMICS_HOME=.;SIMICS_EXTRA_LIB=./modules;PYTHONPATH=./modules;" -- "MACHTYPE=i386;SHELL=/bin/tcsh;PATH=/s/std/bin:/usr/afsws/bin:" -- "/usr/ccs/bin:/usr/ucb:/bin:/usr/bin:/usr/X11R6/bin:/unsup/condor/bin:.\"", -- -- "MyType=\"Job\"\n TargetType=\"Machine\"\n Owner = \"alain\"\n Requirements = (TARGET.Memory > 50)", -- "MyType=\"Machine\"\n TargetType=\"Job\"\n Memory = 100\n Requirements = (TARGET.owner == \"alain\")", -- "MyType=\"Machine\"\n TargetType=\"Job\"\n Memory = 40\n Requirements = (TARGET.owner == \"alain\")", -- "MyType=\"Machine\"\n TargetType=\"Job\"\n Memory = 100\n Requirements = (TARGET.owner != \"alain\")", -- -- // A classad to test PrintToNewStr()--we need to ensure everything -- // we can print is properly accounted for. -- "Requirements = (a > 3) && (b >= 1.3) && (c < MY.rank) && ((d <= TARGET.RANK) " -- "|| (g == \"alain\") || (g != \"roy\") || (h =?= 5) || (i =!= 6)) " -- "&& ((a + b) < (c-d)) && ((e * f) > (g / h)) && x == false && y == true " -- "&& z == f && j == t", -- -- /* Some classads to test GetReferences() -- * The first one is simple, but we can also check that things aren't listed twice. */ -- "Memory = 60\n Disk = 40\n OS = Linux\n X = 4\n Requirements = ((ImageSize > Memory) " -- "&& (AvailableDisk > Disk) && (AvailableDisk > Memory) && (ImageSize > Disk)) " -- "&& foo(X; XX)", -- /* The second one is to test MY and TARGET. */ -- "Memory = 60\n Disk = 40\n OS = Linux\n Requirements = ((TARGET.ImageSize > MY.Memory) " -- "&& (AvailableDisk > Disk) && (TARGET.AvailableDisk > MY.Memory) && (TARGET.ImageSize > MY.Disk)) " -- "&& foo(TARGET.X; TARGET.XX)", -- -- /* Test case sensitivity */ -- "DoesMatch = \"Bone Machine\" == \"bone machine\" && \"a\" =?= \"a\" && \"a\" =!= \"A\"\n" -- "DoesntMatch = \"a\" =?= \"A\"", -- -- /* Test XML preservation of spaces */ -- "A = \"\"\n B=\" \"" --}; -- --/*---------------------------------------------------------- -- * -- * Private Datatypes -- * -- *----------------------------------------------------------*/ --struct parameters --{ -- bool verbose; -- bool test_scanner; -- bool test_copy_constructor; -- bool test_assignment; -- bool test_classads; -- bool test_references; -- bool test_xml; -- bool test_dirty; -- bool test_functions; -- bool test_random; --}; -- --class TestResults --{ --public: -- TestResults() -- { -- number_of_tests = 0; -- number_of_tests_passed = 0; -- number_of_tests_failed = 0; -- return; -- }; -- -- ~TestResults() -- { -- return; -- } -- -- void AddResult(bool passed) -- { -- number_of_tests++; -- if (passed) { -- number_of_tests_passed++; -- } else { -- number_of_tests_failed++; -- } -- return; -- } -- -- int GetNumberFailed(void) -- { -- return(number_of_tests_failed); -- } -- -- void PrintResults(void) -- { -- printf("%d of %d tests passed.\n", number_of_tests_passed, number_of_tests); -- return; -- } -- --private: -- int number_of_tests; -- int number_of_tests_passed; -- int number_of_tests_failed; --}; -- --/*---------------------------------------------------------- -- * -- * Private Functions -- * -- *----------------------------------------------------------*/ --static void parse_command_line(int argc, char **argv, -- struct parameters *parameters); --void test_scanner(TestResults *results); --void test_token_text(const Token *token, char *text, int line_number, -- TestResults *test_results); --void test_token_type(const Token *token, int token_type, int line_number, -- TestResults *test_results); --void test_token_integer(const Token *token, int integer, -- int line_number, TestResults *test_results); --void test_integer_value(ClassAd *classad, const char *attribute_name, -- int expected_value,int line_number, TestResults *results); --void test_eval_bool(ClassAd *classad, const char *attribute_name, -- int expected_value, int line_number, TestResults *results); --void test_eval_error(ClassAd *classad, const char *attribute_name, -- int line_number, TestResults *results); --void test_token_float(const Token *token, float number, -- int line_number, TestResults *test_results); --void test_string_value(ClassAd *classad, const char *attribute_name, -- const char *expected_value, int line_number, -- TestResults *results); --void test_time_string_value(ClassAd *classad, const char *attribute_name, -- const char *expected_value, int line_number, -- TestResults *results); --void test_time_value(ClassAd *classad, const char *attribute_name, -- const struct tm &expected_time, int line_number, -- TestResults *results); --void test_mytype(ClassAd *classad, const char *expected_value, -- int line_number, TestResults *results); --void test_targettype(ClassAd *classad, const char *expected_value, -- int line_number, TestResults *results); --void test_ads_match(ClassAd *classad_1, ClassAd *classad_2, -- int line_number, TestResults *results); --void test_ads_dont_match(ClassAd *classad_1, ClassAd *classad_2, -- int line_number, TestResults *results); --void test_printed_version(ClassAd *classad, const char *attribute_name, -- char *expected_string, int line_number, TestResults *results); --void test_in_references(char *name, StringList &references, -- int line_number, TestResults *results); --void test_not_in_references(char *name, StringList &references, -- int line_number, TestResults *results); --void test_dirty_attribute( -- TestResults *results); --#ifdef HAVE_DLOPEN --static void test_functions( TestResults *results); --static void test_function_int( TestResults *results); --static void test_function_real( TestResults *results); --static void test_function_ifthenelse( TestResults *results); --static void test_function_stringlists( TestResults *results); --static void test_function_stringlists_regexpmember( TestResults *results); --static void test_function_string( TestResults *results); --static void test_function_strcat( TestResults *results); --static void test_function_floor( TestResults *results); --static void test_function_ceiling( TestResults *results); --static void test_function_round( TestResults *results); --static void test_function_random( TestResults *results); --static void test_function_isstring( TestResults *results); --static void test_function_isundefined( TestResults *results); --static void test_function_iserror( TestResults *results); --static void test_function_isinteger( TestResults *results); --static void test_function_isreal( TestResults *results); --static void test_function_isboolean( TestResults *results); --static void test_function_substr( TestResults *results); --static void test_function_formattime( TestResults *results); --static void test_function_strcmp( TestResults *results); --static void test_function_attrnm( TestResults *results); --static void test_function_regexp( TestResults *results); --static void test_function_XXX( TestResults *results);/*sample*/ --static bool test_floats_close( float one, float two, float diff = .0001); --#endif --void print_truncated_string(const char *s, int max_characters); --static void make_big_string(int length, char **string, -- char **quoted_string); --void test_random(TestResults *results); --void test_equality(TestResults *results); --void test_operators(TestResults *results); --void test_scoping(TestResults *results); --void test_debug_function_run(bool expect_run, int line_number, TestResults *results); -- --int --main( -- int argc, -- char **argv) --{ -- ClassAd **classads; -- struct parameters parameters; -- TestResults test_results; -- int classad_index = 0; -- parse_command_line(argc, argv, ¶meters); -- -- if (parameters.verbose) { -- printf("sizeof(ClassAd) = %d\n", sizeof(ClassAd)); -- printf("sizeof(AttrListElem) = %d\n", sizeof(AttrListElem)); -- printf("sizeof(ExprTree) = %d\n", sizeof(ExprTree)); -- printf("We have %d classads.\n", NUMBER_OF_CLASSAD_STRINGS); -- } -- -- if (parameters.test_scanner) { -- printf("Testing classad scanner...\n"); -- test_scanner(&test_results); -- } -- -- classads = new ClassAd *[NUMBER_OF_CLASSAD_STRINGS]; -- -- printf("\nCreating ClassAds...\n"); -- if (parameters.test_copy_constructor) { -- printf("(Will test copy constructor at the same time.)\n"); -- } -- else if (parameters.test_assignment) { -- printf("(Will test assignment at the same time.)\n"); -- } -- for ( classad_index = 0; -- classad_index < (int) NUMBER_OF_CLASSAD_STRINGS; -- classad_index++) { -- ClassAd *original, *duplicate; -- -- printf("%s\n", classad_strings[classad_index]); -- -- original = new ClassAd; -- original->initFromString(classad_strings[classad_index], NULL); -- classads[classad_index] = original; -- -- if (parameters.test_copy_constructor) { -- duplicate = new ClassAd(*original); -- delete original; -- classads[classad_index] = duplicate; -- } -- else if (parameters.test_assignment) { -- duplicate = new ClassAd; -- duplicate->initFromString("A = 1\n MyType=\"x\"\n TargetType=\"y\"", -- NULL); -- *duplicate = *original; -- delete original; -- classads[classad_index] = duplicate; -- } -- -- if (parameters.verbose) { -- printf("ClassAd %d:\n", classad_index); -- classads[classad_index]->fPrint(stdout); -- printf("\n"); -- } -- } -- -- if (parameters.test_xml) { -- printf("Testing XML...\n"); -- for ( int classad_index = 0; -- classad_index < (int) NUMBER_OF_CLASSAD_STRINGS; -- classad_index++) { -- ClassAdXMLUnparser unparser; -- ClassAdXMLParser parser; -- ClassAd *after_classad; -- MyString xml, before_classad_string, after_classad_string; -- -- // 1) Print each ClassAd to a string. -- // 2) Convert it to XML and back and -- // 3) see if the string is the same. -- classads[classad_index]->sPrint(before_classad_string); -- -- unparser.SetUseCompactSpacing(false); -- unparser.Unparse(classads[classad_index], xml); -- if (parameters.verbose) { -- printf("Classad %d in XML:\n%s", classad_index, xml.Value()); -- } -- after_classad = parser.ParseClassAd(xml.Value()); -- -- after_classad->sPrint(after_classad_string); -- if (strcmp(before_classad_string.Value(), after_classad_string.Value()) != 0) { -- printf("Failed: XML Parse and UnParse for classad %d\n", classad_index); -- printf("---- Original ClassAd:\n%s\n", before_classad_string.Value()); -- printf("---- After ClassAd:\n%s\n", after_classad_string.Value()); -- printf("---- Intermediate XML:\n%s\n", xml.Value()); -- test_results.AddResult(false); -- } else { -- printf("Passed: XML Parse and Unparse for classad %d\n\n", classad_index); -- test_results.AddResult(true); -- } -- delete after_classad; -- } -- } -- -- if (parameters.test_classads) { -- -- printf("\nTesting ClassAds...\n"); -- -- test_integer_value(classads[0], "A", 1, __LINE__, &test_results); -- test_integer_value(classads[0], "B", 2, __LINE__, &test_results); -- test_integer_value(classads[0], "C", 3, __LINE__, &test_results); -- test_mytype(classads[0], "", __LINE__, &test_results); -- test_targettype(classads[0], "", __LINE__, &test_results); -- test_time_string_value(classads[0], "D", "2001-04-05T12:14:15", -- __LINE__, &test_results); -- { -- struct tm time; -- time.tm_year = 101; // year 2001 -- time.tm_mon = 03; // that's april, not march. -- time.tm_mday = 05; -- time.tm_hour = 12; -- time.tm_min = 14; -- time.tm_sec = 15; -- test_time_value(classads[0], "D", time, __LINE__, &test_results); -- } -- -- test_string_value(classads[1], "D", "alain", __LINE__, &test_results); -- test_mytype(classads[1], "foo", __LINE__, &test_results); -- test_targettype(classads[1], "blah", __LINE__, &test_results); -- -- test_ads_match(classads[4], classads[5], __LINE__, &test_results); -- test_ads_match(classads[5], classads[4], __LINE__, &test_results); -- test_ads_dont_match(classads[4], classads[6], __LINE__, &test_results); -- test_ads_dont_match(classads[6], classads[4], __LINE__, &test_results); -- test_ads_dont_match(classads[4], classads[7], __LINE__, &test_results); -- test_ads_dont_match(classads[7], classads[4], __LINE__, &test_results); -- -- // Here we test that we can scan large inputs and everything works. -- char *variable, *string, *expression; -- -- make_big_string(15000, &variable, NULL); -- make_big_string(25000, &string, NULL); -- expression = (char *) malloc(50000); -- sprintf(expression, "%s = \"%s\"", variable, string); -- -- classads[0]->Insert(expression); -- -- test_string_value(classads[0], variable, string, __LINE__, &test_results); -- -- test_printed_version(classads[2], "Rank", classad_strings[2], -- __LINE__, &test_results); -- test_printed_version(classads[3], "Env", classad_strings[3], -- __LINE__, &test_results); -- test_printed_version(classads[8], "Requirements", -- "Requirements = (a > 3) && (b >= 1.300000) && (c < MY.rank) && ((d <= TARGET.RANK) " -- "|| (g == \"alain\") || (g != \"roy\") || (h =?= 5) || (i =!= 6)) " -- "&& ((a + b) < (c - d)) && ((e * FALSE) > (g / h)) && x == FALSE && y == TRUE " -- "&& z == FALSE && j == TRUE", -- __LINE__, &test_results); -- -- ClassAd *big_classad = new ClassAd; -- big_classad->initFromString(expression, NULL); -- test_printed_version(big_classad, variable, expression, __LINE__, &test_results); -- delete big_classad; -- free(variable); -- free(expression); -- free(string); -- -- /* Test case insensitivity */ -- test_eval_bool(classads[11], "DoesMatch", 1, __LINE__, &test_results); -- test_eval_bool(classads[11], "DoesntMatch", 0, __LINE__, &test_results); -- -- /* Test that reading from a FILE works */ -- FILE *classad_file; -- ClassAd *classad_from_file; -- classad_file = safe_fopen_wrapper("classad_file", "w"); -- classads[1]->fPrint(classad_file); -- fprintf(classad_file, "***\n"); -- fclose(classad_file); -- -- int iseof, error, empty; -- classad_file = safe_fopen_wrapper("classad_file", "r"); -- classad_from_file = new ClassAd(classad_file, "***", iseof, error, empty); -- fclose(classad_file); -- test_integer_value(classad_from_file, "B", 2, __LINE__, &test_results); -- test_integer_value(classad_from_file, "C", 3, __LINE__, &test_results); -- test_string_value(classad_from_file, "D", "alain", __LINE__, &test_results); -- delete classad_from_file; -- } -- -- if (parameters.test_references) { -- printf("\nTesting References...\n"); -- StringList *internal_references; -- StringList *external_references; -- -- internal_references = new StringList; -- external_references = new StringList; -- -- classads[9]->GetReferences("Requirements", *internal_references, -- *external_references); -- test_in_references("Memory", *internal_references, __LINE__, &test_results); -- test_in_references("Disk", *internal_references, __LINE__, &test_results); -- test_in_references("ImageSize", *external_references, __LINE__, &test_results); -- test_in_references("AvailableDisk", *external_references, __LINE__, &test_results); -- test_in_references("XX", *external_references, __LINE__, &test_results); -- -- test_not_in_references("Memory", *external_references, __LINE__, &test_results); -- test_not_in_references("Disk", *external_references, __LINE__, &test_results); -- test_not_in_references("ImageSize", *internal_references, __LINE__, &test_results); -- test_not_in_references("AvailableDisk", *internal_references, __LINE__, &test_results); -- test_not_in_references("Linux", *internal_references, __LINE__, &test_results); -- test_not_in_references("Linux", *external_references, __LINE__, &test_results); -- test_not_in_references("X", *external_references, __LINE__, &test_results); -- delete internal_references; -- delete external_references; -- -- internal_references = new StringList; -- external_references = new StringList; -- -- classads[10]->GetReferences("Requirements", *internal_references, -- *external_references); -- test_in_references("Memory", *internal_references, __LINE__, &test_results); -- test_in_references("Disk", *internal_references, __LINE__, &test_results); -- test_in_references("ImageSize", *external_references, __LINE__, &test_results); -- test_in_references("AvailableDisk", *external_references, __LINE__, &test_results); -- test_in_references("X", *external_references, __LINE__, &test_results); -- test_in_references("XX", *external_references, __LINE__, &test_results); -- -- test_not_in_references("Memory", *external_references, __LINE__, &test_results); -- test_not_in_references("Disk", *external_references, __LINE__, &test_results); -- test_not_in_references("ImageSize", *internal_references, __LINE__, &test_results); -- test_not_in_references("AvailableDisk", *internal_references, __LINE__, &test_results); -- test_not_in_references("Linux", *internal_references, __LINE__, &test_results); -- test_not_in_references("Linux", *external_references, __LINE__, &test_results); -- -- delete internal_references; -- delete external_references; -- } -- -- if (parameters.test_dirty) { -- test_dirty_attribute(&test_results); -- } -- --#ifdef HAVE_DLOPEN -- if (parameters.test_functions) { -- test_functions(&test_results); -- } --//#else -- -- if (parameters.test_random) { -- test_random(&test_results); -- } -- -- test_operators(&test_results); -- test_scoping(&test_results); -- test_equality(&test_results); -- -- //ClassAd *many_ads[LARGE_NUMBER_OF_CLASSADS]; -- /* -- for (int i = 0; i < LARGE_NUMBER_OF_CLASSADS; i++) { -- many_ads[i] = new ClassAd(classad_strings[2], ','); -- //print_memory_usage(); -- } -- system("ps -v"); -- */ -- -- test_results.PrintResults(); -- //classad_string_space.dump(); -- --#endif -- // Clean up when we're done. -- for ( classad_index = 0; -- classad_index < (int) NUMBER_OF_CLASSAD_STRINGS; -- classad_index++) { -- delete classads[classad_index]; -- } -- delete [] classads; -- -- return(test_results.GetNumberFailed()); --} -- --/*************************************************************** -- * -- * Function: parse_command_line -- * Purpose: Read the command line arguments and fill in -- * the parameters structure to reflect them. -- * -- ***************************************************************/ --static void --parse_command_line( -- int argc, -- char **argv, -- struct parameters *parameters) --{ -- int argument_index; -- bool dump_usage; -- -- dump_usage = false; -- -- parameters->verbose = false; -- parameters->test_scanner = false; -- parameters->test_copy_constructor = false; -- parameters->test_assignment = false; -- parameters->test_classads = false; -- parameters->test_references = false; -- parameters->test_xml = false; -- parameters->test_dirty = false; -- parameters->test_functions = false; -- parameters->test_random = false; -- argument_index = 1; -- -- while (argument_index < argc) { -- if (!strcmp(argv[argument_index], "-v") -- || !strcmp(argv[argument_index], "-verbose")) { -- parameters->verbose = !parameters->verbose; -- } else if (!strcmp(argv[argument_index], "-h") -- || !strcmp(argv[argument_index], "-help") -- || !strcmp(argv[argument_index], "-?")) { -- dump_usage = true; -- } else if (!strcmp(argv[argument_index], "-a") -- || !strcmp(argv[argument_index], "-all")) { -- parameters->test_scanner = true; -- if (!parameters->test_assignment) { -- parameters->test_copy_constructor = true; -- } -- parameters->test_classads = true; -- parameters->test_references = true; -- parameters->test_xml = true; -- parameters->test_dirty = true; -- parameters->test_functions = true; -- parameters->test_random = true; -- } else if (!strcmp(argv[argument_index], "-s") -- || !strcmp(argv[argument_index], "-scanner")) { -- parameters->test_scanner = true; -- } else if (!strcmp(argv[argument_index], "-c") -- || !strcmp(argv[argument_index], "-classads")) { -- parameters->test_classads = true; -- } else if (!strcmp(argv[argument_index], "-r") -- || !strcmp(argv[argument_index], "-references")) { -- parameters->test_references = true; -- } else if (!strcmp(argv[argument_index], "-C") -- || !strcmp(argv[argument_index], "-copy")) { -- parameters->test_copy_constructor = true; -- parameters->test_assignment = false; -- } else if (!strcmp(argv[argument_index], "-A") -- || !strcmp(argv[argument_index], "-assignment")) { -- parameters->test_assignment = true; -- parameters->test_copy_constructor = false; -- } else if (!strcmp(argv[argument_index], "-x") -- || !strcmp(argv[argument_index], "-xml")) { -- parameters->test_xml = true; -- } else if (!strcmp(argv[argument_index], "-d") -- || !strcmp(argv[argument_index], "-dirty")) { -- parameters->test_dirty = true; -- } else if (!strcmp(argv[argument_index], "-f") -- || !strcmp(argv[argument_index], "-functions")) { -- parameters->test_functions = true; -- } else if (!strcmp(argv[argument_index], "-random")) { -- parameters->test_random = true; -- } else { -- fprintf(stderr, "Unknown argument: %s\n", -- argv[argument_index]); -- dump_usage = true; -- -- } -- argument_index++; -- } -- -- parameters->test_functions = true; -- -- if (dump_usage) { -- fprintf(stderr, "Usage: test_classads [-v | -verbose] " -- "[-h | -help| -?]\n"); -- fprintf(stderr, " [-v | -verbose] Print oodles of info.\n"); -- fprintf(stderr, " [-h | -help | -?] Print this message.\n"); -- exit(1); -- } -- -- if ( parameters->test_scanner == false -- && parameters->test_copy_constructor == false -- && parameters->test_assignment == false -- && parameters->test_classads == false -- && parameters->test_references == false -- && parameters->test_dirty == false) { -- parameters->test_scanner = true; -- parameters->test_copy_constructor = true; -- parameters->test_classads = true; -- parameters->test_references = true; -- parameters->test_dirty = true; -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_scanner -- * Purpose: Test the classad scanner: that's the bit that -- * walks through the input character by character and -- * tokenizes it: it's a lexer. -- * -- ***************************************************************/ --void --test_scanner( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- Token token; -- char *input = "Rank = ((Owner == \"Alain\") || (Memory < 500)) 5.4 '2001-10-10'"; -- const char *current; -- -- current = input; -- -- Scanner(current, token); -- -- // Rank -- test_token_type(&token, LX_VARIABLE, __LINE__, results); -- test_token_text(&token, "Rank", __LINE__, results); -- Scanner(current, token); -- -- // = -- test_token_type(&token, LX_ASSIGN, __LINE__, results); -- Scanner(current, token); -- -- // (( -- test_token_type(&token, LX_LPAREN, __LINE__, results); -- Scanner(current, token); -- test_token_type(&token, LX_LPAREN, __LINE__, results); -- Scanner(current, token); -- -- // Owner -- test_token_type(&token, LX_VARIABLE, __LINE__, results); -- test_token_text(&token, "Owner", __LINE__, results); -- Scanner(current, token); -- -- // == -- test_token_type(&token, LX_EQ, __LINE__, results); -- Scanner(current, token); -- -- // "Alain" -- test_token_type(&token, LX_STRING, __LINE__, results); -- test_token_text(&token, "Alain", __LINE__, results); -- Scanner(current, token); -- -- // ) -- test_token_type(&token, LX_RPAREN, __LINE__, results); -- Scanner(current, token); -- -- // || -- test_token_type(&token, LX_OR, __LINE__, results); -- Scanner(current, token); -- -- // ( -- test_token_type(&token, LX_LPAREN, __LINE__, results); -- Scanner(current, token); -- -- // Memory -- test_token_type(&token, LX_VARIABLE, __LINE__, results); -- test_token_text(&token, "Memory", __LINE__, results); -- Scanner(current, token); -- -- // LT -- test_token_type(&token, LX_LT, __LINE__, results); -- Scanner(current, token); -- -- // 500 -- test_token_type(&token, LX_INTEGER, __LINE__, results); -- test_token_integer(&token, 500, __LINE__, results); -- Scanner(current, token); -- -- // )) -- test_token_type(&token, LX_RPAREN, __LINE__, results); -- Scanner(current, token); -- test_token_type(&token, LX_RPAREN, __LINE__, results); -- Scanner(current, token); -- -- test_token_type(&token, LX_FLOAT, __LINE__, results); -- test_token_float(&token, 5.4, __LINE__, results); -- Scanner(current, token); -- -- test_token_type(&token, LX_TIME, __LINE__, results); -- test_token_text(&token, "2001-10-10", __LINE__, results); -- Scanner(current, token); -- -- // end -- test_token_type(&token, LX_EOF, __LINE__, results); -- -- // Test some big strings. -- char *big_string, *quoted_big_string; -- const char *scanner_text; -- -- make_big_string(30000, &big_string, "ed_big_string); -- scanner_text = quoted_big_string; -- Scanner(scanner_text, token); -- test_token_type(&token, LX_STRING, __LINE__, results); -- test_token_text(&token, big_string, __LINE__, results); -- -- scanner_text = big_string; -- Scanner(scanner_text, token); -- test_token_type(&token, LX_VARIABLE, __LINE__, results); -- test_token_text(&token, big_string, __LINE__, results); -- -- free(big_string); -- free(quoted_big_string); -- -- return; --} -- --/*************************************************************** -- * -- * Function: test_token_type -- * Purpose: Used by test_scanner(). Given a token, make sure -- * it's the type we expect. -- * -- ***************************************************************/ --void --test_token_type( -- const Token *token, // IN: The token we're examining -- int token_type, // IN: The token type we expect -- int line_number, // IN: The line number to print -- TestResults *test_results) // OUT: Modified to reflect result of test --{ -- if (token->type == token_type) { -- printf("Passed: token_type == %d in line %d\n", -- token_type, line_number); -- test_results->AddResult(true); -- } else { -- printf("Failed: token_type == %d, not %d in line %d\n", -- token->type, token_type, line_number); -- test_results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_token_text -- * Purpose: Used by test_scanner(). Given a token, make sure it -- * has the text we expect. -- * -- ***************************************************************/ --void --test_token_text( -- const Token *token, // IN: The token we're examining -- char *text, // IN: The text we expect -- int line_number, // IN: The line number to print -- TestResults *test_results) // OUT: Modified to reflect result of test --{ -- if (!strcmp(token->strVal, text)) { -- printf("Passed: token_text == \""); -- print_truncated_string(text, 40); -- printf("\" in line %d\n", line_number); -- test_results->AddResult(true); -- } else { -- printf("Failed: token_text == \""); -- print_truncated_string(token->strVal, 30); -- printf("\" not \""); -- print_truncated_string(text, 30); -- printf("\" in line %d\n", line_number); -- test_results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_token_integer -- * Purpose: Given a token, make sure its integer value is as -- * we expect. Used by test_scanner(). -- * -- ***************************************************************/ --void --test_token_integer( -- const Token *token, // IN: The token we're examining -- int integer, // IN: The integer we're expecting. -- int line_number, // IN: The line number to print -- TestResults *test_results) // OUT: Modified to reflect result of test --{ -- if (token->intVal == integer) { -- printf("Passed: token value == %d in line %d\n", -- integer, line_number); -- test_results->AddResult(true); -- } else { -- printf("Failed: token value == %d, not %d in line %d\n", -- token->intVal, integer, line_number); -- test_results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_token_float -- * Purpose: Given a token, make sure its floating-point value -- * is as we expect. Used by test_scanner(). -- * -- ***************************************************************/ --void --test_token_float( -- const Token *token, // IN: The token we're examining -- float number, // IN: The float we're expecting -- int line_number, // IN: The line number to print -- TestResults *test_results) // OUT: Modified to reflect result of test --{ -- if (token->floatVal == number) { -- printf("Passed: token value == %g in line %d\n", -- number, line_number); -- test_results->AddResult(true); -- } else { -- printf("Failed: token value == %g, not %g in line %d\n", -- token->floatVal, number, line_number); -- test_results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_integer_value -- * Purpose: Given a classad and an attribute within the classad, -- * test that the attribute has the integer value we -- * expect. -- * -- ***************************************************************/ --void --test_integer_value( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *attribute_name, // IN: The attribute we're examining -- int expected_value, // IN: The integer we're expecting -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int actual_value; -- int found_integer; -- -- found_integer = classad->LookupInteger(attribute_name, actual_value); -- if (expected_value == actual_value) { -- printf("Passed: %s is %d in line %d\n", -- attribute_name, expected_value, line_number); -- results->AddResult(true); -- } else if (!found_integer) { -- printf("Failed: Attribute \"%s\" is not found.\n", attribute_name); -- results->AddResult(false); -- } else { -- printf("Failed: %s is %d not %d in line %d\n", -- attribute_name, actual_value, expected_value, line_number); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_eval_bool -- * Purpose: Given a classad and an attribute within the classad, -- * test that the attribute evaluates to the boolean we -- * expect -- * -- ***************************************************************/ --void --test_eval_bool( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *attribute_name, // IN: The attribute we're examining -- int expected_value, // IN: The integer we're expecting -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int actual_value; -- int found_bool; -- -- found_bool = classad->EvalBool(attribute_name, NULL, actual_value); -- if (expected_value == actual_value) { -- printf("Passed: %s is %d in line %d\n", -- attribute_name, expected_value, line_number); -- results->AddResult(true); -- } else if (!found_bool) { -- printf("Failed: Attribute \"%s\" is not found.\n", attribute_name); -- results->AddResult(false); -- } else { -- printf("Failed: %s is %d not %d in line %d\n", -- attribute_name, actual_value, expected_value, line_number); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_eval_error -- * Purpose: Given a classad and an attribute within the classad, -- * test that the attribute evaluates an error -- * -- ***************************************************************/ --void --test_eval_error( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *attribute_name, // IN: The attribute we're examining -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int is_error; -- ExprTree *tree; -- EvalResult val; -- -- tree = classad->LookupExpr(attribute_name); -- if(!tree) { -- is_error = false; -- } else if (tree->EvalTree(classad, NULL, &val) && val.type == LX_ERROR) { -- is_error = true; -- } else { -- is_error = false; -- } -- if (is_error) { -- printf("Passed: Found expected error in line %d\n", line_number); -- results->AddResult(true); -- } else { -- printf("Failed: Did not find error in line %d\n", line_number); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_string_value -- * Purpose: Given a classad, test that an attribute within the -- * classad has the string value we expect. -- * -- ***************************************************************/ --void --test_string_value( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *attribute_name, // IN: The attribute we're examining -- const char *expected_value, // IN: The string we're expecting -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int found_string; -- char *actual_value=NULL; -- -- found_string = classad->LookupString(attribute_name, &actual_value); -- if (found_string && !strcmp(expected_value, actual_value)) { -- printf("Passed: "); -- print_truncated_string(attribute_name, 40); -- printf(" is \""); -- print_truncated_string(expected_value, 40); -- printf(" \" in line %d\n", line_number); -- results->AddResult(true); -- } else if (!found_string) { -- printf("Failed: Attribute \"%s\" is not found.\n", attribute_name); -- results->AddResult(false); -- } else { -- printf("Failed: "); -- print_truncated_string(attribute_name, 40); -- printf(" is: "); -- print_truncated_string(actual_value, 30); -- printf("\" not \""); -- print_truncated_string(expected_value, 30); -- printf("\" in line %d\n", line_number); -- results->AddResult(false); -- } -- if (actual_value != NULL){ -- free(actual_value); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_time_string_value -- * Purpose: Given a classad, test that an attribute within the -- * classad has the time string we expect. -- * -- ***************************************************************/ --void --test_time_string_value( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *attribute_name, // IN: The attribute we're examining -- const char *expected_value, // IN: The string we're expecting -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int found_string; -- char *actual_value; -- -- found_string = classad->LookupTime(attribute_name, &actual_value); -- if (found_string && !strcmp(expected_value, actual_value)) { -- printf("Passed: "); -- print_truncated_string(attribute_name, 40); -- printf(" is \""); -- print_truncated_string(expected_value, 40); -- printf("\" in line %d\n", line_number); -- results->AddResult(true); -- } else if (!found_string) { -- printf("Failed: Attribute \"%s\" is not found.\n", attribute_name); -- results->AddResult(false); -- } else { -- printf("Failed: "); -- print_truncated_string(attribute_name, 40); -- printf(" is: "); -- print_truncated_string(actual_value, 30); -- printf("\" not \""); -- print_truncated_string(expected_value, 30); -- printf("\" in line %d\n", line_number); -- results->AddResult(false); -- } -- free(actual_value); -- return; --} -- --/*************************************************************** -- * -- * Function: test_time_value -- * Purpose: Given a classad, test that an attribute within the -- * classad has the time we expect. -- * -- ***************************************************************/ --void --test_time_value( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *attribute_name, // IN: The attribute we're examining -- const struct tm &expected_time, // IN: The string we're expecting -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int found_time; -- struct tm actual_time; -- bool is_utc; -- -- found_time = classad->LookupTime(attribute_name, &actual_time, &is_utc); -- if (found_time -- && actual_time.tm_year == expected_time.tm_year -- && actual_time.tm_mon == expected_time.tm_mon -- && actual_time.tm_mday == expected_time.tm_mday -- && actual_time.tm_hour == expected_time.tm_hour -- && actual_time.tm_min == expected_time.tm_min -- && actual_time.tm_sec == expected_time.tm_sec) { -- printf("Passed: "); -- print_truncated_string(attribute_name, 40); -- printf(" has correct time in line %d\n", line_number); -- results->AddResult(true); -- } else if (!found_time) { -- printf("Failed: Attribute \"%s\" is not found.\n", attribute_name); -- results->AddResult(false); -- } else { -- char *t1, *t2; -- bool is_utc; -- t1 = time_to_iso8601(actual_time, ISO8601_ExtendedFormat, -- ISO8601_DateAndTime, &is_utc); -- t2 = time_to_iso8601(expected_time, ISO8601_ExtendedFormat, -- ISO8601_DateAndTime, &is_utc); -- printf("Failed: "); -- print_truncated_string(attribute_name, 40); -- printf(" is: "); -- print_truncated_string(t1, 30); -- printf("\" not \""); -- print_truncated_string(t2, 30); -- printf("\" in line %d\n", line_number); -- results->AddResult(false); -- free(t1); -- free(t2); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_mytype -- * Purpose: Given a classad, make sure that the type (mytype) -- * is what we expect it to be. -- * -- ***************************************************************/ --void --test_mytype( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *expected_value, // IN: The type we're expecting. -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- static const char *actual_value; -- -- actual_value = classad->GetMyTypeName(); -- if (!strcmp(expected_value, actual_value)) { -- printf("Passed: MyType is \""); -- print_truncated_string(expected_value, 40); -- printf("\" in line %d\n", line_number); -- results->AddResult(true); -- } else { -- printf("Failed: MyType is \""); -- print_truncated_string(actual_value, 30); -- printf("\" not \""); -- print_truncated_string(expected_value, 30); -- printf("\" in line %d\n", line_number); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_targettype -- * Purpose: Given a classad, test that the target type is what -- * we expect it to be. -- * -- ***************************************************************/ --void --test_targettype( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *expected_value, // IN: The targettype we're expecting -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- static const char *actual_value; -- -- actual_value = classad->GetTargetTypeName(); -- if (!strcmp(expected_value, actual_value)) { -- printf("Passed: TargetType is \""); -- print_truncated_string(expected_value, 40); -- printf("\" in line %d\n", line_number); -- results->AddResult(true); -- } else { -- printf("Failed: TargetType is \""); -- print_truncated_string(actual_value, 30); -- printf("\" not \""); -- print_truncated_string(expected_value, 30); -- printf("\" in line %d\n", line_number); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_ads_match -- * Purpose: Verify that two class ads match, as we expect. -- * -- ***************************************************************/ --void --test_ads_match( -- ClassAd *classad_1, // IN: One of the class ads -- ClassAd *classad_2, // IN: The other the class ads -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- if (IsAMatch(classad_1, classad_2)) { -- printf("Passed: classads match in line %d.\n", line_number); -- results->AddResult(true); -- } else { -- printf("Failed: classads don't match in line %d.\n", line_number); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_ads_dont_match -- * Purpose: Given two class ads, ensure that they don't match. -- * -- ***************************************************************/ --void --test_ads_dont_match( -- ClassAd *classad_1, // IN: One of the class ads -- ClassAd *classad_2, // IN: The other the class ads -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- if (!IsAMatch(classad_1, classad_2)) { -- printf("Passed: classads don't match in line %d.\n", line_number); -- results->AddResult(true); -- } else { -- printf("Failed: classads match in line %d.\n", line_number); -- results->AddResult(false); -- } -- return; --} -- --void --test_printed_version( -- ClassAd *classad, // IN: The ClassAd we're examining -- const char *attribute_name, // IN: The attribute we're examining -- char *expected_string, // IN: The string we're expecting -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- MyString printed_version; -- ExprTree *tree; -- -- tree = classad->LookupExpr(attribute_name); -- printed_version.sprintf( "%s = %s", attribute_name, ExprTreeToString( tree ) ); -- -- if (!strcmp(expected_string, printed_version.Value())) { -- printf("Passed: "); -- print_truncated_string(attribute_name, 40); -- printf(" prints correctly in line %d.\n", line_number); -- results->AddResult(true); -- } else { -- printf("Failed: "); -- print_truncated_string(attribute_name, 40); -- printf(" does not print correctly in line %d.\n", line_number); -- printf("Printed as: %s\n", printed_version.Value()); -- printf("Expected : %s\n", expected_string); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_not_references -- * Purpose: Test if the name (reference) is found in the -- * list of refrences. -- * -- ***************************************************************/ --void --test_in_references( -- char *name, // IN: What to look for -- StringList &references, // IN: References to examine -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char *reference; -- bool is_in_references = false; -- -- references.rewind(); -- while ((reference = references.next()) != NULL) { -- if (!strcmp(reference, name)) { -- is_in_references = true; -- break; -- } -- } -- if (is_in_references) { -- printf("Passed: %s is in references in line %d.\n", -- name, line_number); -- results->AddResult(true); -- } -- else { -- printf("Failed: %s is not in references in line %d.\n", -- name, line_number); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_not_in_references -- * Purpose: Test if the name (reference) is not found in the -- * list of refrences. -- * -- ***************************************************************/ --void --test_not_in_references( -- char *name, // IN: What to look for -- StringList &references, // IN: References to examine -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char *reference; -- bool is_in_references = false; -- -- references.rewind(); -- while ((reference = references.next()) != NULL) { -- if (!strcmp(reference, name)) { -- is_in_references = true; -- break; -- } -- } -- if (!is_in_references) { -- printf("Passed: %s is not in references in line %d.\n", -- name, line_number); -- results->AddResult(true); -- } -- else { -- printf("Failed: %s is in references in line %d.\n", -- name, line_number); -- results->AddResult(false); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_dirty_attribute -- * Purpose: Test if dirty attributes (attributes modified after -- * the creation of the ClassAd) are properly maintained. -- * -- ***************************************************************/ --void --test_dirty_attribute( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- ClassAd *classad; -- char *name; -- -- classad = new ClassAd; -- classad->initFromString("A = 1\nB = 2", NULL); -- classad->ClearAllDirtyFlags(); -- -- // First of all, we should have zero dirty attributes. -- classad->ResetName(); -- name = classad->NextDirtyName(); -- if (name) { -- delete [] name; -- printf("Failed: new ClassAd has dirty attributes in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Passed: new ClassAd is clean in line %d\n", __LINE__); -- results->AddResult(true); -- } -- -- // Add an attribute -- classad->Insert("C = 3"); -- -- // Now we should have exactly one dirty attribute, C. -- classad->ResetName(); -- name = classad->NextDirtyName(); -- if (!name) { -- printf("Failed: C isn't dirty in line %d\n", __LINE__); -- results->AddResult(false); -- } else if (strcmp(name, "C")) { -- printf("Failed: %s is dirty, not C in line %d\n", name, __LINE__); -- results->AddResult(false); -- delete [] name; -- } else { -- printf("Passed: C is dirty in line %d\n", __LINE__); -- results->AddResult(true); -- delete [] name; -- } -- name = classad->NextDirtyName(); -- if (name) { -- printf("Failed: more than one dirty attribute in line %d\n", __LINE__); -- results->AddResult(false); -- delete [] name; -- } else { -- printf("Passed: not more than one dirty attribute in line %d\n", __LINE__); -- results->AddResult(true); -- } -- -- // Add an attribute -- classad->Insert("D = 4"); -- -- // Now we should have two dirty attributes, C & D -- classad->ResetName(); -- name = classad->NextDirtyName(); -- if (!name) { -- printf("Failed: C isn't dirty in line %d\n", __LINE__); -- results->AddResult(false); -- } else if (strcmp(name, "C")) { -- printf("Failed: %s is dirty, not C in line %d\n", name, __LINE__); -- results->AddResult(false); -- delete [] name; -- } else { -- printf("Passed: C is dirty in line %d\n", __LINE__); -- results->AddResult(true); -- delete [] name; -- } -- name = classad->NextDirtyName(); -- if (!name) { -- printf("Failed: D isn't dirty in line %d\n", __LINE__); -- results->AddResult(false); -- } else if (strcmp(name, "D")) { -- printf("Failed: %s is dirty, not D in line %d\n", name, __LINE__); -- results->AddResult(false); -- delete [] name; -- } else { -- printf("Passed: D is dirty in line %d\n", __LINE__); -- results->AddResult(true); -- delete [] name; -- } -- name = classad->NextDirtyName(); -- if (name) { -- printf("Failed: more than two dirty attributes in line %d\n", __LINE__); -- results->AddResult(false); -- delete [] name; -- } else { -- printf("Passed: not more than two dirty attributes in line %d\n", __LINE__); -- results->AddResult(true); -- } -- -- // Clear the dirty flags, and there should be no dirty attributes -- classad->ClearAllDirtyFlags(); -- classad->ResetName(); -- name = classad->NextDirtyName(); -- if (name) { -- delete [] name; -- printf("Failed: ClassAd has dirty attributes in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Passed: new ClassAd is clean in line %d\n", __LINE__); -- results->AddResult(true); -- } -- -- // Now make A dirty, and B dirty then clean, and we should have -- // just A dirty. -- classad->SetDirtyFlag("A", true); -- classad->SetDirtyFlag("B", true); -- classad->SetDirtyFlag("B", false); -- -- classad->ResetName(); -- name = classad->NextDirtyName(); -- if (!name) { -- printf("Failed: A isn't dirty in line %d\n", __LINE__); -- results->AddResult(false); -- } else if (strcmp(name, "A")) { -- printf("Failed: %s is dirty, not A in line %d\n", name, __LINE__); -- results->AddResult(false); -- delete [] name; -- } else { -- printf("Passed: A is dirty in line %d\n", __LINE__); -- results->AddResult(true); -- delete [] name; -- } -- name = classad->NextDirtyName(); -- if (name) { -- printf("Failed: more than one dirty attribute in line %d\n", __LINE__); -- results->AddResult(false); -- delete [] name; -- } else { -- printf("Passed: not more than one dirty attribute in line %d\n", __LINE__); -- results->AddResult(true); -- } -- -- // We should also be able to test it with GetDirtyFlag() -- bool exists, dirty; -- classad->GetDirtyFlag("A", &exists, &dirty); -- if (!exists) { -- printf("Failed: A doesn't exist in line %d\n", __LINE__); -- results->AddResult(false); -- } else if (!dirty) { -- printf("Failed: A isn't dirty in line %d\n", __LINE__); -- results->AddResult(false); -- } else { -- printf("Passed: A is dirty in line %d\n", __LINE__); -- results->AddResult(true); -- } -- -- classad->GetDirtyFlag("B", &exists, &dirty); -- if (!exists) { -- printf("Failed: B doesn't exist in line %d\n", __LINE__); -- results->AddResult(false); -- } else if (dirty) { -- printf("Failed: B is dirty in line %d\n", __LINE__); -- results->AddResult(false); -- } else { -- printf("Passed: B is not dirty in line %d\n", __LINE__); -- results->AddResult(true); -- } -- -- classad->GetDirtyFlag("Unknown", &exists, NULL); -- if (exists) { -- printf("Failed: 'Unknown' should not exist in line %d\n", __LINE__); -- results->AddResult(false); -- } else { -- printf("Passed: 'Unknown' doesn't exist in line %d\n", __LINE__); -- } -- -- -- delete classad; -- -- return; --} -- --#ifdef HAVE_DLOPEN --static void test_functions( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- int integer; -- float real; -- -- char classad_string[] = -- /* batch 1 testing of functions */ -- "D0=GetTime()\n" -- "D1=Time()\n" -- -- "D2=Interval(60)\n" -- "D3=Interval(3600)\n" -- "D4=Interval(86400)\n" -- -- "E=sharedstring()\n" -- "G=sharedinteger(2)\n" -- "H=sharedfloat(3.14)\n" -- -- "L=toupper(\"AbCdEfg\")\n" -- "M=toLower(\"ABCdeFg\")\n" -- -- "N0=size(\"ABC\")\n" -- "N1=size(\"\")\n" -- "N2=size(foo)\n" -- "E0=isError(N2)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for functions in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for functions in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalInteger("D0", NULL, integer)) { -- printf("Passed: Evaluating gettime function gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating gettime function in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("D1", NULL, integer)) { -- printf("Passed: Evaluating time function gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating time function in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("D2", NULL, big_string)&& -- (strcmp(" 0+00:01:00",big_string) == 0)) { -- printf("Passed: Evaluating interval(60) function gives: '%s' in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating interval(60) wanted 0+00:01:00 got <<%s>>in line %d\n", -- big_string,__LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("D3", NULL, big_string)&& -- (strcmp(" 0+01:00:00",big_string) == 0)) { -- printf("Passed: Evaluating interval(3600) function gives: '%s' in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating interval(3600) in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("D4", NULL, big_string)&& -- (strcmp(" 1+00:00:00",big_string) == 0)) { -- printf("Passed: Evaluating interval(86400) function gives: '%s' in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating interval(86400) in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- -- /* -- ** turn off shared values till testing concerns are met -- ** -- if (classad->EvalString("E", NULL, big_string)) { -- printf("Passed: Evaluating sharedstring function gives: '%s' in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating foo sharedstring in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("G", NULL, integer)) { -- printf("Passed: Evaluating sharedinteger gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating sharedinteger in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("H", NULL, real)) { -- printf("Passed: Evaluating sharedfloat gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating sharedfloat in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- */ -- -- if (classad->EvalString("L", NULL, big_string) && -- (strcmp(big_string, "ABCDEFG") == 0)) { -- printf("Passed: Evaluating toupper gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating toupper gave %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("M", NULL, big_string) && -- (strcmp(big_string, "abcdefg") == 0)) { -- printf("Passed: Evaluating tolower gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating tolower gave %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("N0", NULL, integer) && (integer == 3)) { -- printf("Passed: Evaluating size gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating size gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("N1", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating size gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating size gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E0", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating size(foo) ): %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating size(foo) ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- test_function_isstring(results); -- test_function_isundefined(results); -- test_function_iserror(results); -- test_function_isinteger(results); -- test_function_isreal(results); -- test_function_isboolean(results); -- -- test_function_int(results); -- test_function_real(results); -- test_function_string(results); -- test_function_stringlists(results); -- -- test_function_floor(results); -- test_function_ceiling(results); -- test_function_round(results); -- test_function_random(results); -- -- test_function_ifthenelse(results); -- -- test_function_strcat(results); -- test_function_substr(results); -- test_function_formattime(results); -- test_function_strcmp(results); -- test_function_attrnm(results); -- test_function_regexp(results); -- test_function_stringlists_regexpmember(results); -- delete classad; -- } -- return; --} -- --static void test_function_int( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC0=int(-3)\n" -- "BC1=int(3.4)\n" -- "BC2=int(-3.4)\n" -- "BC3=int(\"-3.4\")\n" -- "BC4=int(true)\n" -- "BC5=int(t)\n" -- "BC6=int(false)\n" -- "BC7=int(f)\n" -- "BC8=int(\"this is not a number\")\n" -- "BC9=isError(BC8)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function int() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function int()>> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("BC9", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating isError(BC9) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isError(BC9) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC8", NULL, integer) && (integer == 0)) { -- printf("Failed: Evaluating int(weirdstring) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } else { -- printf("Passed: Evaluating int(weirdstring) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } -- -- if (classad->EvalInteger("BC7", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating int(f) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating int(f) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC6", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating int(false) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating int(false) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC5", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating int(t) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating int(t) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC4", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating int(true) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating int(true) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC3", NULL, integer) && (integer == -3)) { -- printf("Passed: Evaluating int('-3.4') gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating int('-3.4') gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC2", NULL, integer) && (integer == -3)) { -- printf("Passed: Evaluating int(-3.4) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating int(-3.4) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC1", NULL, integer) && (integer == 3)) { -- printf("Passed: Evaluating int(3.4) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating int(3.4) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC0", NULL, integer) && (integer == -3)) { -- printf("Passed: Evaluating int(-3) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating int(-3) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_ifthenelse( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- int integer; -- -- char classad_string[] = -- "BB=2\n" -- "BC=10\n" -- //BD is undefined..... -- "BB2=ifThenElse(BB > 5, \"big\",\"small\")\n" -- "BB3=ifThenElse(BC > 5, \"big\",\"small\")\n" -- "BB4=ifThenElse(BD > 5, \"big\",\"small\")\n" -- "BB5=isUndefined(BB4)\n" -- "BB6=ifThenElse(4 / \"hello\", \"big\",\"small\")\n" -- "BB7=ifThenElse(\"big\",\"small\")\n" -- "E0=isError(BB6)\n" -- "E1=isError(BB7)\n" -- "BB8=ifThenElse(BB > 5, 4 / 0,\"small\")\n" -- "BB9=ifThenElse(BC > 5, \"big\", 4 / 0)\n" -- "BB10=ifThenElse(0.0, \"then\", \"else\")\n" -- "BB11=ifThenElse(1.0, \"then\", \"else\")\n" -- "BB12=ifThenElse(3.7, \"then\", \"else\")\n" -- "BB13=ifThenElse(\"\", \"then\", \"else\")\n" -- "E2=isError(BB13)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function ifthenelse() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function ifthenelse() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalString("BB2", NULL, big_string) && -- (strcmp(big_string, "small") == 0)) { -- printf("Passed: Evaluating ifThenElse : %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("BB3", NULL, big_string) && -- (strcmp(big_string, "big") == 0)) { -- printf("Passed: Evaluating ifThenElse : %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BB5", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating ifThenElse isUndefined(BB5) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse isUndefined(BB5) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E0", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating ifThenElse conditional error (BB6) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse conditional error (BB6) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E1", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating ifThenElse missing arg(BB7) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse missing arg(BB7) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("BB8", NULL, big_string) && -- (strcmp(big_string, "small") == 0)) { -- printf("Passed: Evaluating ifThenElse : %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("BB9", NULL, big_string) && -- (strcmp(big_string, "big") == 0)) { -- printf("Passed: Evaluating ifThenElse : %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("BB10", NULL, big_string) && -- (strcmp(big_string, "else") == 0)) { -- printf("Passed: Evaluating ifThenElse <0.0 evaluates to false yielding else result>: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse <0.0 evaluates to false yielding else result> %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("BB11", NULL, big_string) && -- (strcmp(big_string, "then") == 0)) { -- printf("Passed: Evaluating ifThenElse <1.0 evaluates to true yielding then result>: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse <1.0 evaluates to true yielding then result> %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("BB12", NULL, big_string) && -- (strcmp(big_string, "then") == 0)) { -- printf("Passed: Evaluating ifThenElse <3.7 evaluates to true yielding then result>: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse <3.7 evaluates to true yielding then result> %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E2", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating ifThenElse expression a string : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ifThenElse expression a string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_stringlists( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- float real; -- -- char classad_string[] = -- "O0=stringlistsize(\"A ,0 ,C\")\n" -- "O1=stringlistsize(\"\")\n" -- "O2=stringlistsize(\"A;B;C;D;E\",\";\")\n" -- "O3=isError(stringlistsize(\"A;B;C;D;E\",true))\n" -- "O4=isError(stringlistsize(true,\"A;B;C;D;E\"))\n" -- "O5=stringlistsize(\"A B C,D\")\n" -- "O6=stringlistsize(\"A B C,,,,,D\")\n" -- "O7=stringlistsize(\"A B C ; D\",\";\")\n" -- "O8=stringlistsize(\"A B C;D\",\" ; \")\n" -- "O9=stringlistsize(\"A +B;C$D\",\"$;+\")\n" -- -- "P0=stringlistsum(\"1,2,3\")\n" -- "P1=stringlistsum(\"\")\n" -- "P2=stringlistsum(\"1;2;3\",\";\")\n" -- "P3=isError(stringlistsum(\"1;2;3\",true))\n" -- "P4=isError(stringlistsum(true,\"1;2;3\"))\n" -- "P5=isError(stringlistsum(\"this, list, bad\"))\n" -- "P6=stringlistsum(\"1,2.0,3\")\n" -- -- "Q0=stringlistmin(\"-1,2,-3\")\n" -- "Q1=isUndefined(stringlistmin(\"\"))\n" -- "Q2=stringlistmin(\"1;2;3\",\";\")\n" -- "Q3=isError(stringlistmin(\"1;2;3\",true))\n" -- "Q4=isError(stringlistmin(true,\"1;2;3\"))\n" -- "Q5=isError(stringlistmin(\"this, list, bad\"))\n" -- "Q6=isError(stringlistmin(\"1;A;3\",\";\"))\n" -- "Q7=stringlistmin(\"1,-2.0,3\")\n" -- -- "R0=stringlistmax(\"1 , 4.5, -5\")\n" -- "R1=isUndefined(stringlistmax(\"\"))\n" -- "R2=stringlistmax(\"1;2;3\",\";\")\n" -- "R3=isError(stringlistmax(\"1;2;3\",true))\n" -- "R4=isError(stringlistmax(true,\"1;2;3\"))\n" -- "R5=isError(stringlistmax(\"this, list, bad\"))\n" -- "R6=isError(stringlistmax(\"1;A;3\",\";\"))\n" -- "R7=stringlistmax(\"1,-2.0,3.0\")\n" -- -- "S0=stringlistavg(\"10, 20, 30, 40\")\n" -- "S1=stringlistavg(\"\")\n" -- "S2=stringlistavg(\"1;2;3\",\";\")\n" -- "S3=isError(stringlistavg(\"1;2;3\",true))\n" -- "S4=isError(stringlistavg(true,\"1;2;3\"))\n" -- "S5=isError(stringlistavg(\"this, list, bad\"))\n" -- "S6=isError(stringlistavg(\"1;A;3\",\";\"))\n" -- "S7=stringlistavg(\"1,-2.0,3.0\")\n" -- -- "U0=stringlistmember(\"green\", \"red, blue, green\")\n" -- "U1=stringlistmember(\"green\",\"\")\n" -- "U2=stringlistmember(\"green\", \"red; blue; green\",\";\")\n" -- "U3=isError(stringlistmember(\"green\",\"1;2;3\",true))\n" -- "U4=isError(stringlistmember(\"green\",true,\";\"))\n" -- "U5=isError(stringlistmember(true,\"green\",\";\"))\n" -- "U6=isError(stringlistmember(\"this, list, bad\"))\n" -- "U7=isError(stringlistmember(\"1;A;3\",\";\"))\n" -- "U8=stringlistmember(\"-2.9\",\"1,-2.0,3.0\")\n" -- -- "U=stringlistmember(\"green\", \"red, blue, green\")\n" -- "V=stringlistimember(\"ReD\", \"RED, BLUE, GREEN\")\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function stringlists() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function stringlists() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalInteger("O0", NULL, integer) && (integer == 3)) { -- printf("Passed: Evaluating stringlistsize gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("O1", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating stringlistsize gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("O2", NULL, integer) && (integer == 5)) { -- printf("Passed: Evaluating stringlistsize gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("O3", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistsize expected error arg 2 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize Got error arg 2 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("O4", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistsize expected error arg 1 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("O5", NULL, integer) ) { -- printf("Passed: Evaluating stringlistsize gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("O6", NULL, integer) ) { -- printf("Passed: Evaluating stringlistsize gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("O7", NULL, integer) ) { -- printf("Passed: Evaluating stringlistsize gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("O8", NULL, integer) ) { -- printf("Passed: Evaluating stringlistsize gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("O9", NULL, integer) ) { -- printf("Passed: Evaluating stringlistsize gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsize Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- if (classad->EvalInteger("P0", NULL, integer) && (integer == 6)) { -- printf("Passed: Evaluating stringlistsum gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsum gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("P1", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating stringlistsum gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsum gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("P2", NULL, integer) && (integer == 6)) { -- printf("Passed: Evaluating stringlistsum gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsum gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("P3", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistsum expected error arg 2 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsum Got error arg 2 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("P4", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistsum expected error arg 1 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsum Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("P5", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistsum expected error list not all numbers: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsum Got error list not all numbers %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("P6", NULL, real) && (real == 6.0)) { -- printf("Passed: Evaluating stringlistsum gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistsum gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("Q0", NULL, integer) && (integer == -3)) { -- printf("Passed: Evaluating stringlistmin gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmin gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("Q1", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmin expected UNDEFINED for empty list: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmin expected UNDEFINED for empty list %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("Q2", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmin gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmin gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("Q3", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmin expected error arg 2 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmin Got error arg 2 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("Q4", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmin expected error arg 1 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmin Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("Q5", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmin expected error list not all numbers: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmin Got error list not all numbers %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("Q6", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmin expected error list not all numbers: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmin Got error list not all numbers %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("Q7", NULL, real) && (real == -2.0)) { -- printf("Passed: Evaluating stringlistmin gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("R0", NULL, real) && (real == 4.5)) { -- printf("Passed: Evaluating stringlistmax gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("R1", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmax expected UNDEFINED for empty list: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax expected UNDEFINED for empty list %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("R2", NULL, integer) && (integer == 3)) { -- printf("Passed: Evaluating stringlistmax gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("R3", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmax expected error arg 2 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax Got error arg 2 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("R4", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmax expected error arg 1 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("R5", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmax expected error list not all numbers: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax Got error list not all numbers %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("R6", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmax expected error list not all numbers: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax Got error list not all numbers %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("R7", NULL, real) && (real == 3.0)) { -- printf("Passed: Evaluating stringlistmax gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmax gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("S0", NULL, real) && (real == 25.0)) { -- printf("Passed: Evaluating stringlistavg gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistavg gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("S1", NULL, real) && (real == 0.0)) { -- printf("Passed: Evaluating stringlistavg gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistavg gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("S2", NULL, real) && (real == 2.0)) { -- printf("Passed: Evaluating stringlistavg gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistavg gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("S3", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistavg expected error arg 2 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistavg Got error arg 2 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("S4", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistavg expected error arg 1 not string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistavg Got error arg 1 not string %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("S5", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistavg expected error list not all numbers: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistavg Got error list not all numbers %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("S6", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistavg expected error list not all numbers: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistavg Got error list not all numbers %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("S7", NULL, real) && (real > 0.6)) { -- printf("Passed: Evaluating stringlistavg gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistavg gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("U", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistmember gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistmember gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("V", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlistimember gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlistimember gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_real( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- float real; -- -- char classad_string[] = -- "BC0=real(-3)\n" -- "BC1=real(3.4)\n" -- "BC2=real(-3.4)\n" -- "BC3=real(\"-3.4\")\n" -- "BC4=real(true)\n" -- "BC5=real(t)\n" -- "BC6=real(false)\n" -- "BC7=real(f)\n" -- "BC8=real(\"this is not a number\")\n" -- "BC9=isError(BC8)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function real() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function real() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("BC9", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating isError(BC9) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isError(BC9) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC8", NULL, real) && -- test_floats_close(real, 0.0)) { -- printf("Failed: Evaluating real(weirdstring) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } else { -- printf("Passed: Evaluating real(weirdstring) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } -- -- if (classad->EvalFloat("BC7", NULL, real) && -- test_floats_close(real, 0.0)) { -- printf("Passed: Evaluating real(f) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating real(f) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC6", NULL, real) && -- test_floats_close(real, 0.0)) { -- printf("Passed: Evaluating real(false) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating real(false) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC5", NULL, real) && -- test_floats_close(real, 1.0)) { -- printf("Passed: Evaluating real(t) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating real(t) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC4", NULL, real) && -- test_floats_close(real, 1.0)) { -- printf("Passed: Evaluating real(true) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating real(true) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC3", NULL, real) && -- test_floats_close(real, -3.4 )) { -- printf("Passed: Evaluating real('-3.4') gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating real('-3.4') gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC2", NULL, real) && -- test_floats_close(real, -3.4)) { -- printf("Passed: Evaluating real(-3.4) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating real(-3.4) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC1", NULL, real) && -- test_floats_close(real, 3.400000)) { -- printf("Passed: Evaluating real(3.4) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating real(3.4) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC0", NULL, real) && -- test_floats_close(real, -3.0)) { -- printf("Passed: Evaluating real(-3) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating real(-3) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_string( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- int integer; -- -- char classad_string[] = -- "BC0=string(\"-3\")\n" -- "BC1=string(123)\n" -- "E0=isError(BC1)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function string() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function string() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalString("BC0", NULL, big_string)) { -- printf("Passed: Evaluating string function gives: '%s' in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating for string in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("BC1", NULL, big_string)) { -- printf("Passed: Evaluating integer passed in to string: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: missed bad string passed in : %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- delete classad; -- } -- return; --} -- --static void test_function_strcat( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- -- char classad_string[] = -- "BC0=strcat(\"-3\",\"3\")\n" -- "BC1=strcat(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function strcat() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function strcat() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalString("BC0", NULL, big_string) && (strcmp("-33",big_string) == 0)) { -- printf("Passed: Evaluating string function gives: '%s' in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating for strcat<<%s>> in line %d\n", -- big_string,__LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("BC1", NULL, big_string) && (strcmp("abcdefg",big_string) == 0)) { -- printf("Passed: Evaluating string function gives: '%s' in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating for strcat<<%s>> in line %d\n", -- big_string,__LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_floor( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC0=floor(\"-3\")\n" -- "BC1=floor(\"-3.4\")\n" -- "BC2=floor(\"3\")\n" -- "BC3=floor(5)\n" -- "BC4=floor(5.2)\n" -- // error test ?????? -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function floor() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function floor() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalInteger("BC0", NULL, integer) && (integer == -3)) { -- printf("Passed: Evaluating floor gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating floor gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC1", NULL, integer) && (integer == -4)) { -- printf("Passed: Evaluating floor gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating floor gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC2", NULL, integer) && (integer == 3)) { -- printf("Passed: Evaluating floor gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating floor gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC3", NULL, integer) && (integer == 5)) { -- printf("Passed: Evaluating floor gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating floor gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC4", NULL, integer) && (integer == 5)) { -- printf("Passed: Evaluating floor gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating floor gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_ceiling( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC0=ceiling(\"-3\")\n" -- "BC1=ceiling(\"-3.4\")\n" -- "BC2=ceiling(\"3\")\n" -- "BC3=ceiling(5)\n" -- "BC4=ceiling(5.2)\n" -- // error test ?????? -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function ceiling() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function ceiling() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalInteger("BC0", NULL, integer) && (integer == -3)) { -- printf("Passed: Evaluating ceiling gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ceiling gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC1", NULL, integer) && (integer == -3)) { -- printf("Passed: Evaluating ceiling gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ceiling gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC2", NULL, integer) && (integer == 3)) { -- printf("Passed: Evaluating ceiling gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ceiling gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC3", NULL, integer) && (integer == 5)) { -- printf("Passed: Evaluating ceiling gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ceiling gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC4", NULL, integer) && (integer == 6)) { -- printf("Passed: Evaluating ceiling gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating ceiling gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_round( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC0=round(\"-3\")\n" -- "BC1=round(\"-3.5\")\n" -- "BC2=round(\"3\")\n" -- "BC3=round(5.5)\n" -- "BC4=round(5.2)\n" -- // error test ?????? -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function round() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function round() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalInteger("BC4", NULL, integer) && (integer == 5)) { -- printf("Passed: Evaluating round gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating round gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC3", NULL, integer) && (integer == 6)) { -- printf("Passed: Evaluating round gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating round gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC2", NULL, integer) && (integer == 3)) { -- printf("Passed: Evaluating round gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating round gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC1", NULL, integer) && (integer == -4)) { -- printf("Passed: Evaluating round gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating round gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC0", NULL, integer) && (integer == -3)) { -- printf("Passed: Evaluating round gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating round gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_random( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- float real; -- -- char classad_string[] = -- "BC1=random(5)\n" -- "BC2=random()\n" -- "BC3=random(3.5)\n" -- "BC4=random(\"-3.5\")\n" -- "BC5=random(\"-3.5\")\n" -- "BC6=random(\"-3.5\")\n" -- "BC7=random(\"3\")\n" -- "BC8=random(5.5)\n" -- "BC9=random(5.2)\n" -- // error testn test_function_iserror -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function random() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function random() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalFloat("BC3", NULL, real) -- && (real > 0) && (real < 3.5)) { -- printf("Passed: Evaluating random(3.5) gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating random(3.5) gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalFloat("BC2", NULL, real) -- && (real > 0) && (real < 1)) { -- printf("Passed: Evaluating random() gives: %f in line %d\n", -- real, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating random() gave %f in line %d\n", -- real, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("BC1", NULL, integer) -- && (integer >= 0) && (integer < 5)) { -- printf("Passed: Evaluating random(5) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating random(5) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_isstring( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC3=isString(\"abc\")\n" -- "BC0=isString(strcat(\"-3\",\"3\"))\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function isString() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function isString() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("BC3", NULL, integer)) { -- printf("Passed: Evaluating isString \"abc\": %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isString \"abc\" : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC0", NULL, integer)) { -- printf("Passed: Evaluating isString strcat(\"-3\",\"3\"): %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isString strcat(\"-3\",\"3\"): %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_isundefined( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BB=2\n" -- "BC=10\n" -- //"BD=undefined:" -- "BB0=isUndefined(BD)\n" -- "BB1=isUndefined(BC)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function isundefined() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function isundefined() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("BB0", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating isUndefined(BB0) returned true(1) when it should : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isUndefined(BB0) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BB1", NULL, integer) && -- (integer == 0)) { -- printf("Passed: Evaluating isUndefined(BB1) return false(0) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isUndefined(BB1) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_iserror( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC0=isError(random(\"-3\"))\n" -- "BC1=isError(int(\"this is not an int\"))\n" -- "BC2=isError(real(\"this is not a float\"))\n" -- "BC3=isError(floor(\"this is not a float\"))\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function iserror() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function iserror() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("BC0", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating isError(random(BC0)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isError(random(BC0)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC1", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating isError(int(non nummeric string)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isError(int(non nummeric string)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC2", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating isError(real(non nummeric string)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isError(real(non nummeric string)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC3", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating isError(floor(non nummeric string)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isError(floor(non nummeric string)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_isinteger( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC1=isInteger(-3.4 )\n" -- "BC2=isInteger(-3)\n" -- "BC3=isInteger(\"-3\")\n" -- "BC4=isInteger( 3.4 )\n" -- "BC5=isInteger( int(3.4) )\n" -- "BC6=isInteger(int(\"-3\"))\n" -- "BC7=isInteger(3)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function isinteger() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function isinteger() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("BC1", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating isInteger( -3.4 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isInteger( -3.4 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC2", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isInteger( -3 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isInteger( -3 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC3", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating isInteger(\"-3\" ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isInteger(\"-3\") : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC4", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating isInteger(3.4) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isInteger(3.4) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC5", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isInteger( int(3.4) ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isInteger( int(3.4) ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC6", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isInteger( int(\"-3\") ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isInteger(int(\"-3\")) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC7", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isInteger( 3 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isInteger( 3 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_isreal( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC1=isReal(-3.4 )\n" -- "BC2=isReal(-3)\n" -- "BC3=isReal(\"-3\")\n" -- "BC4=isReal( 3.4 )\n" -- "BC5=isReal( real(3) )\n" -- "BC6=isReal(real(\"-3\"))\n" -- "BC7=isReal(3)\n" -- "BC8=isReal(3,1)\n" -- "BC9=isError(BC8)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function isreal() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function isreal() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("BC1", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isReal( -3.4 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isReal( -3.4 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC2", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating isReal( -3 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isReal( -3 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC3", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating isReal(\"-3\" ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isReal(\"-3\") : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC4", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isReal(3.4) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isReal(3.4) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC5", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isReal( real(3) ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isReal( real(3) ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC6", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isReal( real(\"-3\") ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isReal(real(\"-3\")) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC7", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating isReal( 3 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isReal( 3 ) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("BC9", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isReal( x,y) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isReal( x,y) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_isboolean( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "BC1=isBoolean(isReal(-3.4 ))\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function isboolean() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function isboolean() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("BC1", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating isBoolean(isReal( 3.4)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating isBolean(isReal( 3.4)) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- -- --static void test_function_formattime( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- char i0[1024]; -- int integer; -- -- char classad_string[] = -- "I0=formattime()\n" -- "I1=formattime(CurrentTime)\n" -- "I2=formattime(CurrentTime,\"%c\")\n" -- "I3=formattime(1174737600,\"%m/%d/%y\")\n" -- "I4=formattime(-231)\n" -- "I5=formattime(1174694400,1174694400)\n" -- "E0=isError(I4)\n" -- "E1=isError(I5)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function formattime() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function formattime() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalString("I0", NULL, i0)) { -- printf("Passed: Evaluating formattime() gives: %s in line %d\n", -- i0, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating formattime() gives: %s in line %d\n", -- i0, __LINE__); -- results->AddResult(false); -- } -- -- int retry_count = 0; -- first_retry: -- if (classad->EvalString("I1", NULL, big_string) && -- (strcmp(big_string, i0) == 0)) { -- printf("Passed: Evaluating formattime(CurrentTime) gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- retry_count++; -- if (retry_count < 10) { -- classad->EvalString("I0", NULL, i0); -- goto first_retry; -- } -- printf("Failed: Evaluating formattime(CurrentTime) gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- retry_count = 0; -- second_retry: -- if (classad->EvalString("I2", NULL, big_string) && -- (strcmp(big_string, i0) == 0)) { -- printf("Passed: Evaluating formattime(CurrentTime,\"%%c\") gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- retry_count++; -- if (retry_count < 10) { -- classad->EvalString("I0", NULL, i0); -- goto second_retry; -- } -- printf("Failed: Evaluating formattime(CurrentTime,\"%%c\") gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("I3", NULL, big_string) && -- (strcmp(big_string, "03/24/07") == 0)) { -- printf("Passed: Evaluating formattime(1174737600,\"%%m/%%d/%%y\") gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating formattime(1174737600,\"%%m/%%d/%%y\") gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- -- -- if (classad->EvalBool("E0", NULL, integer) && (integer == 1)) { -- printf("Passed: Caught error from a negative time : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: did not catch error from a negative time : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E1", NULL, integer) && (integer == 1)) { -- printf("Passed: Bad string caught : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Bad string missed : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- -- --static void test_function_substr( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- int integer; -- -- char classad_string[] = -- "I0=substr(\"abcdefg\", 3)\n" -- "I1=substr(\"abcdefg\", 3, 2)\n" -- "I2=substr(\"abcdefg\", -2, 1)\n" -- "I3=substr(\"abcdefg\", 3, -1)\n" -- "I4=substr(\"abcdefg\", 3, -9)\n" -- "I5=substr(\"abcdefg\", 3.3, -9)\n" -- "I6=substr(foo, 3, -9)\n" -- "E0=isError(I5)\n" -- "E1=isError(I6)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function substr() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function substr() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalString("I0", NULL, big_string) && -- (strcmp(big_string, "defg") == 0)) { -- printf("Passed: Evaluating substr(\"abcdefg\", 3) gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating substr substr(\"abcdefg\", 3) %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("I1", NULL, big_string) && -- (strcmp(big_string, "de") == 0)) { -- printf("Passed: Evaluating substr(\"abcdefg\", 3, 2) gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating substr substr(\"abcdefg\", 3, 2) %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("I2", NULL, big_string) && -- (strcmp(big_string, "f") == 0)) { -- printf("Passed: Evaluating substr(\"abcdefg\", -2, 1) gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating substr substr(\"abcdefg\", -2, 1) %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("I3", NULL, big_string) && -- (strcmp(big_string, "def") == 0)) { -- printf("Passed: Evaluating substr(\"abcdefg\", 3, -1) gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating substr substr(\"abcdefg\", 3, -1) %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("I4", NULL, big_string) && -- (strcmp(big_string, "") == 0)) { -- printf("Passed: Evaluating substr(\"abcdefg\", 3, -9) gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating substr substr(\"abcdefg\", 3, -9) %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E0", NULL, integer) && (integer == 1)) { -- printf("Passed: Caught error from a float for the offset) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: did not catch error from a float for the offset) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E1", NULL, integer) && (integer == 1)) { -- printf("Passed: Bad string caught) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Bad string missed) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_strcmp( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- int integer; -- -- char classad_string[] = -- "J0=strcmp(\"ABCDEFgxx\"; \"ABCDEFg\")\n" -- "J1=strcmp(\"BBBBBBBxx\"; \"CCCCCCC\")\n" -- "J2=strcmp(\"AbAbAbAb\"; \"AbAbAbAb\")\n" -- "J3=strcmp(1+1; \"2\")\n" -- "J4=strcmp(\"2\"; 1+1)\n" -- "K0=stricmp(\"ABCDEFg\"; \"abcdefg\")\n" -- "K1=stricmp(\"ffgghh\"; \"aabbcc\")\n" -- "K2=stricmp(\"aBabcd\"; \"ffgghh\")\n" -- "K3=stricmp(1+1; \"2\")\n" -- "K4=stricmp(\"2\"; 1+1)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function strcmp() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function strcmp() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalInteger("J0", NULL, integer) && (integer > 0)) { -- printf("Passed: Evaluating strcmp(\"ABCDEFgxx\"; \"ABCDEFg\") gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating strcmp(\"ABCDEFgxx\"; \"ABCDEFg\") gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("J1", NULL, integer) && (integer < 0)) { -- printf("Passed: Evaluating strcmp(\"BBBBBBBxx\"; \"CCCCCCC\") gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating strcmp(\"BBBBBBBxx\"; \"CCCCCCC\") gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("J2", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating strcmp(\"AbAbAbAb\"; \"AbAbAbAb\") gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating strcmp(\"AbAbAbAb\"; \"AbAbAbAb\") gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("K0", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating stricmp(\"ABCDEFg\"; \"abcdefg\") gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stricmp(\"ABCDEFg\"; \"abcdefg\") gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("K1", NULL, integer) && (integer > 0)) { -- printf("Passed: Evaluating stricmp(\"ffgghh\"; \"aabbcc\") gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stricmp(\"ffgghh\"; \"aabbcc\") gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("K2", NULL, integer) && (integer < 0)) { -- printf("Passed: Evaluating stricmp(\"aBabcd\"; \"ffgghh\") gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stricmp(\"aBabcd\"; \"ffgghh\") gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("K3", NULL, integer) && (integer == 0)) { -- printf("Passed: stricmp Converted int first arg to string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: stricmp did not convert int first arg to expected string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("K4", NULL, integer) && (integer == 0)) { -- printf("Passed: stricmp Converted int second arg to string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: stricmp did not convert int second arg to expected string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("J3", NULL, integer) && (integer == 0)) { -- printf("Passed: strcmp Converted int first arg to string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: strcmp did not convert int first arg to expected string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalInteger("J4", NULL, integer) && (integer == 0)) { -- printf("Passed: strcmp Converted int second arg to string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: strcmp did not convert int second arg to expected string) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_attrnm( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- int integer; -- float real; -- bool found_bool; -- -- char classad_string[] = -- "T012=t\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function attrnm() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function attrnm() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- delete classad; -- } -- return; --} -- --static void test_function_regexp( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- int integer; -- float real; -- bool found_bool; -- -- char classad_string[] = -- "W0=regexp(\"[Mm]atcH.i\", \"thisisamatchlist\", \"i\")\n" -- "W1=regexp(20, \"thisisamatchlist\", \"i\")\n" -- "E1=isError(W1)\n" -- "W2=regexp(\"[Mm]atcH.i\", 20, \"i\")\n" -- "E2=isError(W2)\n" -- "W3=regexp(\"[Mm]atcH.i\", \"thisisamatchlist\", 20)\n" -- "E3=isError(W3)\n" -- "W4=regexp(\"[Mm]atcH.i\", \"thisisalist\", \"i\")\n" -- "W5=regexp(\"[Mm]atcH.i\", \"thisisamatchlist\")\n" -- "W6=regexp(\"([Mm]+[Nn]+)\", \"aaaaaaaaaabbbmmmmmNNNNNN\", \"i\")\n" -- -- "X0=regexps(\"([Mm]at)c(h).i\", \"thisisamatchlist\", \"one is \\1 two is \\2\")\n" -- "X1=regexps(\"([Mm]at)c(h).i\", \"thisisamatchlist\", \"one is \\1 two is \\2\",\"i\")\n" -- "X2=regexps(20 , \"thisisamatchlist\", \"one is \\1 two is \\2\",\"i\")\n" -- "E4=isError(X2)\n" -- "X3=regexps(\"([Mm]at)c(h).i\", 20 , \"one is \\1 two is \\2\",\"i\")\n" -- "E5=isError(X3)\n" -- "X4=regexps(\"([Mm]at)c(h).i\", \"thisisamatchlist\", 20 ,\"i\")\n" -- "E6=isError(X4)\n" -- "X5=regexps(\"([Mm]at)c(h).i\", \"thisisamatchlist\", \"one is \\1 two is \\2\",20)\n" -- "E7=isError(X5)\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function regexp() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function regexp() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("W0", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating regexp match gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexp match gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E1", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating regexp pattern arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexp pattern arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E2", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating regexp target arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexp target arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E3", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating regexp optional option arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexp optional option arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("W4", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating regexp not a match gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexp not a match gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("W5", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating regexp not a match(case sensitive) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexp not a match(case sensitive) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("W6", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating regexp match gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexp match gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("X0", NULL, big_string) || -- strcmp(big_string, "one is mat two is h")) { -- printf("Passed: Evaluating regexps gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexps gave %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalString("X1", NULL, big_string) || -- strcmp(big_string, "one is mat two is h")) { -- printf("Passed: Evaluating regexps gives: %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexps gave %s in line %d\n", -- big_string, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E4", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating regexps pattern arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexps pattern arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E5", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating regexps target arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexps target arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E6", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating regexps return arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexps return arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E7", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating regexps optional option arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating regexps optional option arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_stringlists_regexpmember( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- int integer; -- float real; -- bool found_bool; -- -- char classad_string[] = -- "U0=stringlist_regexpMember(\"green\", \"red, blue, green\")\n" -- "U1=stringlist_regexpMember(\"green\", \"red; blue; green\",\"; \")\n" -- "U2=stringlist_regexpMember(\"([e]+)\", \"red, blue, green\")\n" -- "U3=stringlist_regexpMember(\"([p]+)\", \"red, blue, green\")\n" -- "W0=stringlist_regexpMember(\"[Mm]atcH.i\", \"thisisamatchlist\", \" ,\", \"i\")\n" -- "W1=stringlist_regexpMember(20, \"thisisamatchlist\", \"i\")\n" -- "E1=isError(W1)\n" -- "W2=stringlist_regexpMember(\"[Mm]atcH.i\", 20, \"i\")\n" -- "E2=isError(W2)\n" -- "W3=stringlist_regexpMember(\"[Mm]atcH.i\", \"thisisamatchlist\", 20)\n" -- "E3=isError(W3)\n" -- "W7=stringlist_regexpMember(\"[Mm]atcH.i\", \"thisisamatchlist\", \" ,\", 20)\n" -- "E4=isError(W7)\n" -- "W4=stringlist_regexpMember(\"[Mm]atcH.i\", \"thisisalist\", \" ,\", \"i\")\n" -- "W5=stringlist_regexpMember(\"[Mm]atcH.i\", \"thisisamatchlist\")\n" -- "W6=stringlist_regexpMember(\"([Mm]+[Nn]+)\", \"aaaaaaaaaabbbmmmmmNNNNNN\", \" ,\", \"i\")\n" -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function stringlists_regexpmember() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function stringlists_regexpmember() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- -- if (classad->EvalBool("U0", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember matching green : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember failed matching green: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("U1", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember matching green(delimiter change) : %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember failed matching green(delimiter change): %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("U2", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember matching multiple hits in stringlist: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember failed matching multiple hits in stringlist: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("U3", NULL, integer) && -- (integer == 0)) { -- printf("Passed: Evaluating stringlist_regexpMember multiple stringlist misses: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember multiple stringlist misses: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("W0", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember match gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember match gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E1", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember pattern arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember pattern arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E2", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember target arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember target arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E3", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember optional delimiter not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember optional delimiter not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("E4", NULL, integer) && -- (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember optional option arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember optional option arg not a string: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("W4", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating stringlist_regexpMember not a match gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember not a match gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("W5", NULL, integer) && (integer == 0)) { -- printf("Passed: Evaluating stringlist_regexpMember not a match(case sensitive) gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember not a match(case sensitive) gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- if (classad->EvalBool("W6", NULL, integer) && (integer == 1)) { -- printf("Passed: Evaluating stringlist_regexpMember match gives: %d in line %d\n", -- integer, __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Evaluating stringlist_regexpMember match gave %d in line %d\n", -- integer, __LINE__); -- results->AddResult(false); -- } -- -- delete classad; -- } -- return; --} -- --static void test_function_XXX( -- TestResults *results) // OUT: Modified to reflect result of test --{ -- char big_string[1024]; -- int integer; -- float real; -- bool found_bool; -- -- char classad_string[] = -- ""; -- -- ClassAd *classad; -- -- config(0); -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- if (classad == NULL) { -- printf("Can't parse ClassAd for function XXX() in line %d\n", -- __LINE__); -- results->AddResult(false); -- } else { -- printf("Parsed ClassAd for << function XXX() >> in line %d\n", -- __LINE__); -- results->AddResult(true); -- delete classad; -- } -- return; --} -- --static bool test_floats_close( float one, float two, float diff) --{ -- float ftmp = abs(one) - abs(two); -- if(abs(ftmp) <= diff) { -- return(true); -- } else { -- return(true); -- } --} --#endif -- --/*************************************************************** -- * -- * Function: print_truncated_string -- * Purpose: Make sure that a string prints out with no more than -- * the given number of characters. If the string is -- * too long, we put an ellipsis at the end. -- * -- ***************************************************************/ --void --print_truncated_string( -- const char *s, // IN: The string to print -- int max_characters) // IN: The maximum number of characters to print --{ -- int length; -- -- if (max_characters < 1) { -- max_characters = 1; -- } -- -- length = strlen(s); -- if (length > max_characters) { -- if (max_characters > 3) { -- printf("%.*s...", max_characters - 3, s); -- } -- else { -- printf("%.*s", max_characters, s); -- } -- } -- else { -- printf("%s", s); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: make_big_string -- * Purpose: create a string of a given length, and fill it with -- * random stuff. If quoted_string is not NULL, we make it -- * a copy of the big string, except with quotes around it. -- * -- ***************************************************************/ --static void --make_big_string( -- int length, // IN: The desired length -- char **string, // OUT: the big random string -- char **quoted_string) // OUT: the string in quotes --{ -- *string = (char *) malloc(length + 1); -- -- for (int i = 0; i < length; i++) { -- (*string)[i] = (rand() % 26) + 97; -- } -- (*string)[length] = 0; -- -- if (quoted_string != NULL) { -- *quoted_string = (char *) malloc(length + 3); -- sprintf(*quoted_string, "\"%s\"", *string); -- } -- return; --} -- --/*************************************************************** -- * -- * Function: test_random -- * Purpose: Test the random() function in ClassAds. Our testing -- * is a bit wonky: since we are getting random numbers, -- * we can't be sure our tests will work, but chances -- * are good. :) -- * -- ***************************************************************/ --void test_random( -- TestResults *results) --{ -- char *classad_string = "R1 = random()\nR2 = random(10)"; -- int base_r1, r1; -- int r2; -- bool have_different_numbers; -- bool numbers_in_range; -- int i; -- -- ClassAd *classad; -- -- classad = new ClassAd; -- classad->initFromString(classad_string, NULL); -- -- // First we check that random gives us different numbers -- have_different_numbers = false; -- classad->EvalInteger("R1", NULL, base_r1); -- for ( i = 0; i < 10; i++) { -- classad->EvalInteger("R1", NULL, r1); -- if (r1 != base_r1) { -- have_different_numbers = true; -- break; -- } -- } -- -- // Then we check that random gives numbers in the correct range -- numbers_in_range = true; -- for ( i = 0; i < 10; i++) { -- classad->EvalInteger("R2", NULL, r2); -- if (r2 < 0 || r2 >= 10) { -- numbers_in_range = false; -- break; -- } -- } -- -- if (have_different_numbers) { -- printf("Passed: Random generates a variety of numbers in line %d\n", -- __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: Random does not generate a variety of numbers in line %d\n", -- __LINE__); -- results->AddResult(false); -- } -- -- if (numbers_in_range) { -- printf("Passed: Random generates numbers in correct range in %d\n", -- __LINE__); -- results->AddResult(true); -- } else { -- printf("Passed: Random does not generate numbers in correct range in %d\n", -- __LINE__); -- results->AddResult(false); -- } -- delete classad; -- return; --} -- --void test_equality(TestResults *results) --{ -- ExprTree *e1, *e2, *e3; -- MyString n1, n2, n3; -- const char *s1 = "Foo = 3"; -- const char *s3 = "Bar = 5"; -- -- Parse(s1, n1, e1); -- Parse(s1, n2, e2); -- Parse(s3, n3, e3); -- -- if ((*e1) == (*e2) && n1 == n2) { -- printf("Passed: operator== detects equality in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: operator== does not detect equality in line %d\n", __LINE__); -- results->AddResult(false); -- } -- -- if ((*e1) == (*e3) || n1 == n3) { -- printf("Failed: operator== does not detect inequality in line %d\n", __LINE__); -- results->AddResult(false); -- } else { -- printf("Passed: operator== detects inequality in line %d\n", __LINE__); -- results->AddResult(true); -- } -- return; --} -- --// I wrote this function to ensure that short-circuiting --// in ClassAds works correctly, and to ensure that when --// I added short-circuiting, I didn't break normal evaluation --void test_operators(TestResults *results) --{ -- extern bool classad_debug_function_run; -- char *classad_string = -- // Test short-circuiting with logical OR -- "A = TRUE || _debug_function_()\n " -- "B = 1 || _debug_function_()\n " -- "C = 1.2 || _debug_function_()\n " -- // Test no short-circuiting with logical OR -- "D = \"foo\" || _debug_function_()\n " -- "E = FALSE || _debug_function_()\n " -- "G = 0 || _debug_function_()\n " -- "H = 0.0 || _debug_function_()\n " -- // Test short-circuiting with logical AND -- "I = FALSE && _debug_function_()\n " -- "J = 0 && _debug_function_()\n " -- "K = 0.0 && _debug_function_()\n " -- "L = \"foo\" && _debug_function_()\n " -- // Test no short-circuiting with logical AND -- "M = TRUE && _debug_function_()\n " -- "N = 1 && _debug_function_()\n " -- "O = 1.2 && _debug_function_() "; -- ClassAd *c = new ClassAd; -- c->initFromString(classad_string, NULL); -- -- // Test short-circuiting with logical OR -- classad_debug_function_run = false; -- test_eval_bool(c, "A", 1, __LINE__, results); -- test_debug_function_run(false, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "B", 1, __LINE__, results); -- test_debug_function_run(false, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "C", 1, __LINE__, results); -- test_debug_function_run(false, __LINE__, results); -- -- // Test no short-circuiting with logical OR -- classad_debug_function_run = false; -- test_eval_bool(c, "D", 1, __LINE__, results); -- test_debug_function_run(true, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "E", 1, __LINE__, results); -- test_debug_function_run(true, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "G", 1, __LINE__, results); -- test_debug_function_run(true, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "H", 1, __LINE__, results); -- test_debug_function_run(true, __LINE__, results); -- -- // Test short-circuiting with logical AND -- classad_debug_function_run = false; -- test_eval_bool(c, "I", 0, __LINE__, results); -- test_debug_function_run(false, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "J", 0, __LINE__, results); -- test_debug_function_run(false, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "K", 0, __LINE__, results); -- test_debug_function_run(false, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_error(c, "L", __LINE__, results); -- test_debug_function_run(false, __LINE__, results); -- -- // Test no short-circuiting with logical AND -- classad_debug_function_run = false; -- test_eval_bool(c, "M", 1, __LINE__, results); -- test_debug_function_run(true, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "N", 1, __LINE__, results); -- test_debug_function_run(true, __LINE__, results); -- -- classad_debug_function_run = false; -- test_eval_bool(c, "O", 1, __LINE__, results); -- test_debug_function_run(true, __LINE__, results); -- --} -- --/*************************************************************** -- * -- * Function: test_scoping -- * Purpose: Make sure that when someone specified MY. or TARGET., -- * it only looks there. From 6.3.something through -- * 6.7.17, MY and TARGET provided a search order, not -- * a scope. -- * -- ***************************************************************/ --void --test_scoping(TestResults *results) --{ -- char *ad1_string = "A = MY.X\n B = TARGET.X\n C=MY.Y\n D = TARGET.Y\n E = Y\n G=MY.Z\n H=TARGET.Z\n J=TARGET.K\n L=5\n X = 1\n Z=4"; -- char *ad2_string = "X = 2\n Y = 3\n K=TARGET.L"; -- int value; -- ClassAd *ad1 = new ClassAd; -- ad1->initFromString(ad1_string, NULL); -- ClassAd *ad2 = new ClassAd; -- ad2->initFromString(ad2_string, NULL); -- -- if (ad1->EvalInteger("A", ad2, value) && value == 1) { -- printf("Passed: eval of A is good in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: eval of A is bad in line %d\n", __LINE__); -- } -- -- if (ad1->EvalInteger("B", ad2, value) && value == 2) { -- printf("Passed: eval of B is good in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: eval of B is bad in line %d\n", __LINE__); -- } -- -- if (!ad1->EvalInteger("C", ad2, value)) { -- printf("Passed: eval of C is good in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: eval of C is bad in line %d\n", __LINE__); -- } -- -- if (ad1->EvalInteger("D", ad2, value) && value == 3) { -- printf("Passed: eval of D is good in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: eval of D is bad in line %d\n", __LINE__); -- } -- -- if (ad1->EvalInteger("E", ad2, value) && value == 3) { -- printf("Passed: eval of E is good in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: eval of E is bad in line %d\n", __LINE__); -- } -- -- if (ad1->EvalInteger("G", ad2, value) && value == 4) { -- printf("Passed: eval of G is good in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: eval of G is bad in line %d\n", __LINE__); -- } -- -- if (!ad1->EvalInteger("H", ad2, value)) { -- printf("Passed: eval of H is good in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: eval of H is bad in line %d\n", __LINE__); -- } -- -- if (ad1->EvalInteger("J", ad2, value) && value == 5) { -- printf("Passed: eval of J is good in line %d\n", __LINE__); -- results->AddResult(true); -- } else { -- printf("Failed: eval of J is bad in line %d\n", __LINE__); -- } --} -- --/*************************************************************** -- * -- * Function: test_eval_error -- * Purpose: Given a classad and an attribute within the classad, -- * test that the attribute evaluates an error -- * -- ***************************************************************/ --void --test_debug_function_run( -- bool expect_run, // IN: Do we expect that it ran? -- int line_number, // IN: The line number to print -- TestResults *results) // OUT: Modified to reflect result of test --{ -- extern bool classad_debug_function_run; -- if (expect_run) { -- if (classad_debug_function_run) { -- printf("Passed: ClassAd debug function ran as expected in line %d\n", -- line_number); -- results->AddResult(true); -- } else { -- printf("Failed: ClassAd debug function did not run, but was expected to in line %d\n", -- line_number); -- results->AddResult(false); -- } -- } else { -- if (!classad_debug_function_run) { -- printf("Passed: ClassAd debug function did not run, and was not expected to in line %d.\n", -- line_number); -- results->AddResult(true); -- } else { -- printf("Failed: ClassAd debug function run when it was not expected to in line %d.\n", -- line_number); -- results->AddResult(false); -- } -- } -- -- return; --} -diff --git a/src/.deprecate_classad.old/value.cpp b/src/.deprecate_classad.old/value.cpp -deleted file mode 100644 -index 1fdeec8..0000000 ---- a/src/.deprecate_classad.old/value.cpp -+++ /dev/null -@@ -1,132 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#include "condor_common.h" --#include "value.h" -- -- --Value:: --Value() --{ -- valueType = UNDEFINED_VALUE; -- integerValue = 0; -- realValue = 0.0; -- strValue = NULL; --} -- -- --Value:: --~Value() --{ --} -- -- --const Value& Value:: --operator=( const Value& val ) --{ -- valueType = val.valueType; -- integerValue = val.integerValue; -- realValue = val.realValue; -- strValue = val.strValue; -- return( *this ); --} -- -- --void Value:: --clear() --{ -- valueType = UNDEFINED_VALUE; --} -- -- --bool Value:: --isNumber (int &i) --{ -- switch (valueType) -- { -- case INTEGER_VALUE: -- i = integerValue; -- return true; -- -- case REAL_VALUE: -- i = (int) realValue; // truncation -- return true; -- -- default: -- return false; -- } --} -- -- --bool Value:: --isNumber (double &r) --{ -- switch (valueType) -- { -- case INTEGER_VALUE: -- r = (double) integerValue; -- return true; -- -- case REAL_VALUE: -- r = realValue; -- return true; -- -- default: -- return false; -- } --} -- -- --void Value:: --setRealValue (double r) --{ -- clear(); -- valueType=REAL_VALUE; -- realValue = r; --} -- --void Value:: --setIntegerValue (int i) --{ -- clear(); -- valueType=INTEGER_VALUE; -- integerValue = i; --} -- --void Value:: --setUndefinedValue (void) --{ -- clear(); -- valueType=UNDEFINED_VALUE; --} -- --void Value:: --setErrorValue (void) --{ -- clear(); -- valueType=ERROR_VALUE; --} -- --void Value:: --setStringValue(char *s) --{ -- clear(); -- valueType = STRING_VALUE; -- strValue = s; --} -diff --git a/src/.deprecate_classad.old/value.h b/src/.deprecate_classad.old/value.h -deleted file mode 100644 -index f01a1b5..0000000 ---- a/src/.deprecate_classad.old/value.h -+++ /dev/null -@@ -1,111 +0,0 @@ --/*************************************************************** -- * -- * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -- * University of Wisconsin-Madison, WI. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); you -- * may not use this file except in compliance with the License. You may -- * obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- * -- ***************************************************************/ -- --#ifndef __VALUES_H__ --#define __VALUES_H__ -- --#include "condor_common.h" -- --// the various types of values --enum ValueType --{ -- UNDEFINED_VALUE, -- ERROR_VALUE, -- INTEGER_VALUE, -- REAL_VALUE, -- STRING_VALUE, --}; -- --class Value; -- --// the Value object --class Value --{ -- public: -- // ctor/dtor -- Value(); -- ~Value(); -- -- // modifiers -- void clear(void); -- void setRealValue (double r); -- void setIntegerValue (int i); -- void setUndefinedValue(void); -- void setErrorValue (void); -- void setStringValue (char *s); -- -- // accessors -- inline bool isIntegerValue (int &i); -- inline bool isRealValue (double &r); -- inline bool isStringValue (char *&s); -- inline bool isUndefinedValue(void) ; -- inline bool isErrorValue (void); -- inline ValueType getType () { return valueType; } -- -- bool isNumber (int &); -- bool isNumber (double &); -- -- // operators -- const Value &operator= (const Value &); -- -- private: -- ValueType valueType; // the type of the value -- int integerValue; // the value itself -- double realValue; -- char *strValue; --}; -- -- -- --// implementations of the inlined functions --inline bool Value:: --isIntegerValue (int &i) --{ -- i = integerValue; -- return (valueType == INTEGER_VALUE); --} -- --inline bool Value:: --isRealValue (double &r) --{ -- r = realValue; -- return (valueType == REAL_VALUE); --} -- -- --inline bool Value:: --isStringValue(char *&s) --{ -- s = strValue; -- return (valueType == STRING_VALUE); --} -- --inline bool Value:: --isUndefinedValue (void) --{ -- return (valueType == UNDEFINED_VALUE); --} -- --inline bool Value:: --isErrorValue(void) --{ -- return (valueType == ERROR_VALUE); --} -- --#endif//__VALUES_H__ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index f212773..44a8535 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -33,15 +33,10 @@ if (BUILD_TESTS AND NOT WINDOWS) - endif() - - if (WANT_FULL_DEPLOYMENT) -- install ( FILES condor_includes/condor_ast.h -- condor_includes/condor_astbase.h -- condor_includes/condor_attrlist.h -- condor_includes/condor_classad.h -+ install ( FILES condor_includes/condor_classad.h - condor_includes/condor_constants.h -- condor_includes/condor_exprtype.h - condor_includes/condor_header_features.h -- condor_includes/condor_parser.h - condor_includes/file_lock.h - condor_utils/iso_dates.h - DESTINATION ${C_INCLUDE}) --endif(WANT_FULL_DEPLOYMENT) -\ No newline at end of file -+endif(WANT_FULL_DEPLOYMENT) -diff --git a/src/ccb/ccb_listener.cpp b/src/ccb/ccb_listener.cpp -index 72e7d18..101cd78 100644 ---- a/src/ccb/ccb_listener.cpp -+++ b/src/ccb/ccb_listener.cpp -@@ -145,6 +145,10 @@ CCBListener::SendMsgToCCB(ClassAd &msg,bool blocking) - } - else if( !m_waiting_for_connect ) { - m_sock = ccb.makeConnectedSocket(Stream::reli_sock, CCB_TIMEOUT, 0, NULL, true /*nonblocking*/ ); -+ if( !m_sock ) { -+ Disconnected(); -+ return false; -+ } - m_waiting_for_connect = true; - incRefCount(); // do not let ourselves be deleted until called back - ccb.startCommand_nonblocking( cmd, m_sock, CCB_TIMEOUT, NULL, CCBListener::CCBConnectCallback, this, NULL, false, USE_TMP_SEC_SESSION ); -diff --git a/src/classad/CHANGELOG b/src/classad/CHANGELOG -index e577a9e..f36b747 100644 ---- a/src/classad/CHANGELOG -+++ b/src/classad/CHANGELOG -@@ -1,4 +1,4 @@ --Changes for version 1.0.10 (Released ????-??-??) -+Changes for version 1.0.10 (Released 2011-04-08) - * Fix infinite loop and bad iterator comparison in FunctionCall::SameAs(). - * Fix memory leak in FunctionCall::eval(). - * Fix ClassAd::GetInternalReferences() and ClassAd::GetExternalReferences() -diff --git a/src/classad/CMakeLists.txt b/src/classad/CMakeLists.txt -index 293ecf4..2b2061e 100644 ---- a/src/classad/CMakeLists.txt -+++ b/src/classad/CMakeLists.txt -@@ -15,51 +15,107 @@ - # limitations under the License. - # - ############################################################### -+include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - --add_definitions(-DCLASSAD_DISTRIBUTION -DWANT_CLASSAD_NAMESPACE=1 -DDISABLE_DLOPEN_CHECK ) -+##################################################################### -+## set var using master config -+add_definitions(-DCLASSAD_DISTRIBUTION -DWANT_CLASSAD_NAMESPACE=1 ) - - # disable PCRE build unless dep added to externals. - if(PCRE_FOUND) -+ include_directories(${PCRE_INCLUDE}) - add_definitions(-DUSE_PCRE -DHAVE_PCRE_H) - else() - add_definitions(-DUSE_POSIX_REGEX) - endif(PCRE_FOUND) - --# in order to update configure -+if (HAVE_DLOPEN) -+ add_definitions(-DHAVE_DLOPEN) -+endif() -+ -+if (HAVE_DLFCN_H) -+ add_definitions(-DHAVE_DLFCN_H) -+endif() -+ -+if (HAVE_LIBDL) -+ set (DL_FOUND -ldl) -+endif (HAVE_LIBDL) -+ -+## -+##################################################################### -+ -+##################################################################### -+# treat like an external for others to use -+condor_pre_external( CLASSADS classads-1.0.10 "lib;include" "alwaysbuild") -+##################################################################### -+ - if (NOT WINDOWS) - -- # because of the external dependencies on classads we need to be careful to make it look like a normal install -- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/classad DESTINATION ${EXTERNAL_STAGE}/include ) -+ condor_selective_glob("attrrefs.*;classad.*;collection.*;collectionBase.*;debug.*;exprList.*;exprTree.*;fnCall.*;indexfile.*;lexer.*;lexerSource.*;literals.*;matchClassad.*;operators.*;query.*;sink.*;source.*;transaction.*;util.*;value.*;view.*;xmlLexer.*;xmlSink.*;xmlSource.*;cclassad.*;common.*" ClassadSrcs) -+ add_library( classads STATIC ${ClassadSrcs} ) # the one which all of condor depends upon - -- if (WANT_FULL_DEPLOYMENT) -- install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/classad DESTINATION ${C_INCLUDE} ) -+ if (LINUX) -+ add_library( classad SHARED ${ClassadSrcs} ) # for distribution at this point may swap to depend at a future date. -+ set_target_properties( classad PROPERTIES VERSION 1.1.0 SOVERSION 1 ) -+ install( TARGETS classad DESTINATION ${C_LIB} ) - endif() - -- condor_selective_glob("attrrefs.*;classad.*;collection.*;collectionBase.*;debug.*;exprList.*;exprTree.*;fnCall.*;indexfile.*;lexer.*;lexerSource.*;literals.*;matchClassad.*;operators.*;query.*;sink.*;source.*;transaction.*;util.*;value.*;view.*;xmlLexer.*;xmlSink.*;xmlSource.*;cclassad.*;common.*" ClassadSrcs) -+ ###### change here if you want to link condor to the shared version -+ set (CLASSADS_FOUND classads) - -- add_library( classads STATIC ${ClassadSrcs} ) -- set_target_properties( classads -- PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${EXTERNAL_STAGE}/lib -- LIBRARY_OUTPUT_DIRECTORY ${EXTERNAL_STAGE}/lib -- RUNTIME_OUTPUT_DIRECTORY ${EXTERNAL_STAGE}/lib -- OUTPUT_NAME classad_ns) -+ ###### Test executables -+ condor_exe_test( classad_unit_tester "classad_unit_tester.cpp" "${CLASSADS_FOUND};${PCRE_FOUND};${DL_FOUND}") -+ condor_exe( classad_functional_tester "classad_functional_tester.cpp" ${C_BIN} "${CLASSADS_FOUND};${PCRE_FOUND};${DL_FOUND}" OFF) -+ condor_exe( classad_version "classad_version.cpp" ${C_BIN} "${CLASSADS_FOUND};${PCRE_FOUND};${DL_FOUND}" OFF) -+ -+ ###### Install elements with our distribution -+ install( TARGETS classads DESTINATION ${C_LIB} ) -+ install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/classad DESTINATION ${C_INCLUDE} ) - --else() -- -- # I should probably just add all and subtract tests. -+else() -+ # windows specific configuration. - condor_selective_glob("attrrefs.cpp;common.cpp;collection*;fnCall.cpp;expr*;indexfile*;lexer*;literals.cpp;matchClassad.cpp;classad.cpp;debug.cpp;operators.cpp;util.cpp;value.cpp;query.cpp;sink.cpp;source.cpp;transaction.cpp;view.cpp;xml*" ClassadSrcs) - add_library( classads STATIC ${ClassadSrcs} ) -- set_property( TARGET classads PROPERTY FOLDER "libraries" ) -+ set (CLASSADS_FOUND classads) - - endif() - --set( CLASSADS_FOUND classads ) -+condor_post_external( ${CLASSADS_FOUND} include OFF ) - -+# standard output message used to slog users. -+message (STATUS "configured (CLASSADS_FOUND= ${CLASSADS_FOUND})") -+ -+# finally add dependencies if there are any - if (NOT PROPER) -- add_dependencies( classads pcre ) -+ -+ if(PCRE_REF) -+ add_dependencies( ${CLASSADS_FOUND} ${PCRE_REF} ) -+ endif() -+ -+ if (NOT WINDOWS) -+ ############################################################################## -+ # the only reason this exists is b/c our externals depend on it -+ # (blahp & creame) -+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/classad DESTINATION ${CLASSADS_INSTALL_LOC}/include ) -+ set_target_properties( classads -+ PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CLASSADS_INSTALL_LOC}/lib -+ LIBRARY_OUTPUT_DIRECTORY ${CLASSADS_INSTALL_LOC}/lib -+ RUNTIME_OUTPUT_DIRECTORY ${CLASSADS_INSTALL_LOC}/lib -+ OUTPUT_NAME classad) -+ -+ add_custom_command (OUTPUT ${CLASSADS_INSTALL_LOC}/lib/libpcre.a -+ COMMAND cp -+ ARGS -f ${PCRE_FOUND} ${CLASSADS_INSTALL_LOC}/lib) -+ -+ add_custom_target( pcre_coinstall ALL DEPENDS ${CLASSADS_INSTALL_LOC}/lib/libpcre.a ) -+ -+ if (PCRE_REF) -+ add_dependencies( pcre_coinstall ${PCRE_REF} ) -+ endif() -+ -+ add_dependencies( ${CLASSADS_FOUND} pcre_coinstall ) -+ -+ endif() -+ - endif(NOT PROPER) - --message (STATUS "external configured (CLASSADS_FOUND=${CLASSADS_FOUND})") --set( CLASSADS_FOUND ${CLASSADS_FOUND} PARENT_SCOPE ) --set( HAVE_EXT_CLASSADS ON PARENT_SCOPE ) --append_var (CONDOR_EXTERNALS classads) -diff --git a/src/classad/Doxyfile b/src/classad/Doxyfile -index 7d61a84..df632c4 100644 ---- a/src/classad/Doxyfile -+++ b/src/classad/Doxyfile -@@ -31,7 +31,7 @@ PROJECT_NAME = ClassAds - # This could be handy for archiving the generated documentation or - # if some version control system is used. - --PROJECT_NUMBER = 1.0.9 -+PROJECT_NUMBER = 1.0.10 - - # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) - # base path where the generated documentation will be put. -diff --git a/src/classad/Makefile.am.m4 b/src/classad/Makefile.am.m4 -index 03121c8..b85cb17 100644 ---- a/src/classad/Makefile.am.m4 -+++ b/src/classad/Makefile.am.m4 -@@ -152,8 +152,8 @@ libclassad_la_SOURCES = \ - sink.cpp source.cpp transaction.cpp util.cpp value.cpp view.cpp xmlLexer.cpp \ - xmlSink.cpp xmlSource.cpp cclassad.cpp $(_libclassad_la_SOURCES) - --libclassad_la_LDFLAGS = -version-info 1:0:1 --libclassad_ns_la_LDFLAGS = -version-info 1:0:1 -+libclassad_la_LDFLAGS = -version-info 1:2:0 -+libclassad_ns_la_LDFLAGS = -version-info 1:2:0 - - MF_IF_NAMESPACE([libclassad_ns_la_SOURCES = $(libclassad_la_SOURCES) - libclassad_ns_la_CXXFLAGS = $(NAMESPACE)]) -diff --git a/src/classad/README b/src/classad/README -index bce8cd7..0e81df6 100644 ---- a/src/classad/README -+++ b/src/classad/README -@@ -1,4 +1,4 @@ --This is version 1.0.9 of the Condor Classad library, released on 2010-08-23. -+This is version 1.0.10 of the Condor Classad library, released on 2011-04-08. - - ===== What is it? ===== - -diff --git a/src/classad/README.packaging b/src/classad/README.packaging -index 7e107a7..9dd1c91 100644 ---- a/src/classad/README.packaging -+++ b/src/classad/README.packaging -@@ -15,11 +15,15 @@ Update the shared library version number in src/classad/Makefile.am.m4. - Look for these two lines: - libclassad_la_LDFLAGS = -version-info 1:0:0 - libclassad_ns_la_LDFLAGS = -version-info 1:0:0 --If the ABI has changed, you should increment the first number and set the --second and third ones to zero. If the ABI hasn't changed, then increment --the second or third number. See -+ -+If the ABI has changed (such that programs linked against an older -+version won't work with the new version), you should increment the first -+number and set the second and third ones to zero. If the ABI has only been -+expanded (new symbols added), increment the first and third numbers, and -+set the second one to zero. If the ABI hasn't changed, then increment the -+second number. See - http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN135 --for examples of things that will change the ABI. -+for examples of things that will change the ABI incompatibly. - This ABI compliance checker program may be useful: - http://ispras.linuxfoundation.org/index.php/ABI_compliance_checker - -diff --git a/src/classad/TAGS b/src/classad/TAGS -index 659cb34..a0db662 100644 ---- a/src/classad/TAGS -+++ b/src/classad/TAGS -@@ -14,3 +14,4 @@ classads_1_0_6 - classads_1_0_7 - classads_1_0_8 - classads_1_0_9 -+classads_1_0_10 -diff --git a/src/classad/classad.cpp b/src/classad/classad.cpp -index dfb0435..f78ecc7 100644 ---- a/src/classad/classad.cpp -+++ b/src/classad/classad.cpp -@@ -44,13 +44,13 @@ void ClassAdLibraryVersion(int &major, int &minor, int &patch) - { - major = 1; - minor = 0; -- patch = 9; -+ patch = 10; - return; - } - - void ClassAdLibraryVersion(string &version_string) - { -- version_string = "1.0.9"; -+ version_string = "1.0.10"; - return; - } - -@@ -968,7 +968,15 @@ _GetExternalReferences( const ExprTree *expr, ClassAd *ad, - refs.insert( fullName ); - return true; - } else { -- return( _GetExternalReferences( tree, ad, state, refs, fullNames )); -+ if( state.depth_remaining <= 0 ) { -+ return false; -+ } -+ state.depth_remaining--; -+ -+ bool ret = _GetExternalReferences( tree, ad, state, refs, fullNames ); -+ -+ state.depth_remaining++; -+ return ret; - } - } - // otherwise, if the tree didn't evaluate to a classad, -@@ -992,7 +1000,15 @@ _GetExternalReferences( const ExprTree *expr, ClassAd *ad, - - case EVAL_OK: { - // attr is internal; find external refs in result -- bool rval=_GetExternalReferences(result,ad,state,refs,fullNames); -+ if( state.depth_remaining <= 0 ) { -+ state.curAd = curAd; -+ return false; -+ } -+ state.depth_remaining--; -+ -+ bool rval=_GetExternalReferences(result,ad,state,refs,fullNames); -+ -+ state.depth_remaining++; - state.curAd = curAd; - return( rval ); - } -@@ -1043,7 +1059,15 @@ _GetExternalReferences( const ExprTree *expr, ClassAd *ad, - - ((const ClassAd*)expr)->GetComponents( attrs ); - for( itr = attrs.begin( ); itr != attrs.end( ); itr++ ) { -- if( !_GetExternalReferences( itr->second, ad, state, refs, fullNames )) { -+ if( state.depth_remaining <= 0 ) { -+ return false; -+ } -+ state.depth_remaining--; -+ -+ bool ret = _GetExternalReferences( itr->second, ad, state, refs, fullNames ); -+ -+ state.depth_remaining++; -+ if( !ret ) { - return( false ); - } - } -@@ -1058,7 +1082,15 @@ _GetExternalReferences( const ExprTree *expr, ClassAd *ad, - - ((const ExprList*)expr)->GetComponents( exprs ); - for( itr = exprs.begin( ); itr != exprs.end( ); itr++ ) { -- if( !_GetExternalReferences( *itr, ad, state, refs, fullNames ) ) { -+ if( state.depth_remaining <= 0 ) { -+ return false; -+ } -+ state.depth_remaining--; -+ -+ bool ret = _GetExternalReferences( *itr, ad, state, refs, fullNames ); -+ -+ state.depth_remaining++; -+ if( !ret ) { - return( false ); - } - } -@@ -1342,7 +1374,15 @@ _GetInternalReferences( const ExprTree *expr, ClassAd *ad, - case EVAL_OK: { - //whoo, it's internal. - refs.insert(attr); -+ if( state.depth_remaining <= 0 ) { -+ state.curAd = curAd; -+ return false; -+ } -+ state.depth_remaining--; -+ - bool rval =_GetInternalReferences(result, ad, state, refs, fullNames); -+ -+ state.depth_remaining++; - //TODO: Does this actually matter? - state.curAd = curAd; - return rval; -@@ -1405,7 +1445,15 @@ _GetInternalReferences( const ExprTree *expr, ClassAd *ad, - - ((const ClassAd*)expr)->GetComponents(attrs); - for(itr = attrs.begin(); itr != attrs.end(); itr++){ -- if( !_GetInternalReferences(itr->second, ad, state, refs, fullNames)) { -+ if( state.depth_remaining <= 0 ) { -+ return false; -+ } -+ state.depth_remaining--; -+ -+ bool ret = _GetInternalReferences(itr->second, ad, state, refs, fullNames); -+ -+ state.depth_remaining++; -+ if( !ret ) { - return false; - } - } -@@ -1420,7 +1468,15 @@ _GetInternalReferences( const ExprTree *expr, ClassAd *ad, - - ((const ExprList*)expr)->GetComponents(exprs); - for(itr = exprs.begin(); itr != exprs.end(); itr++){ -- if( !_GetInternalReferences(*itr, ad, state, refs, fullNames) ) { -+ if( state.depth_remaining <= 0 ) { -+ return false; -+ } -+ state.depth_remaining--; -+ -+ bool ret = _GetInternalReferences(*itr, ad, state, refs, fullNames); -+ -+ state.depth_remaining++; -+ if( !ret ) { - return false; - } - } -diff --git a/src/classad/classad/common.h b/src/classad/classad/common.h -index f62a65c..660558b 100644 ---- a/src/classad/classad/common.h -+++ b/src/classad/classad/common.h -@@ -48,6 +48,10 @@ - #define _STLP_NEW_PLATFORM_SDK - #define _STLP_NO_OWN_IOSTREAMS 1 - -+// Disable warnings about calling posix functions like open() -+// instead of _open() -+#define _CRT_NONSTDC_NO_WARNINGS -+ - // Disable warnings about possible loss of data, since "we know what - // we are doing" and fixing them correctly would require too much - // time from one of us. (Maybe this should be a student exercise.) -@@ -71,6 +75,7 @@ - - - #ifdef WIN32 -+ - // special definitions we need for Windows - #ifndef DLL_IMPORT_MAGIC - #define DLL_IMPORT_MAGIC __declspec(dllimport) -@@ -79,9 +84,6 @@ - #include - #include - #define fsync _commit --#ifndef open --#define open _open --#endif - #define strcasecmp _stricmp - #ifndef rint - #define rint(num) floor(num + .5) -@@ -89,9 +91,7 @@ - #define isnan _isnan - // isinf() defined in util.h - --#ifdef WIN32 - #include --#endif - - #define snprintf _snprintf - -@@ -102,6 +102,7 @@ - #pragma warning( disable : 4800 ) - // Disable warnings about truncated debug identifiers - #pragma warning( disable : 4786 ) -+ - #endif // WIN32 - - -diff --git a/src/classad/classad/exprTree.h b/src/classad/classad/exprTree.h -index aa0c1d6..36fe0e7 100644 ---- a/src/classad/classad/exprTree.h -+++ b/src/classad/classad/exprTree.h -@@ -47,6 +47,7 @@ class EvalState { - const ClassAd *curAd; - - bool flattenAndInline; // NAC -+ bool debug; - - // Cache_to_free are the things in the cache that must be - // freed when this gets deleted. The problem is that we put -@@ -66,6 +67,7 @@ class EvalState { - class ExprTree - { - public: -+ static void *debug_print(const char *message); - /// The kinds of nodes in expression trees - enum NodeKind { - /// Literal node (string, integer, real, boolean, undefined, error) -@@ -136,6 +138,7 @@ class ExprTree - virtual bool SameAs(const ExprTree *tree) const = 0; - - protected: -+ void debug_format_value(Value &value) const; - ExprTree (); - - /** Fill in this ExprTree with the contents of the other ExprTree. -diff --git a/src/classad/classad/fnCall.h b/src/classad/classad/fnCall.h -index 52a4574..e72a41c 100644 ---- a/src/classad/classad/fnCall.h -+++ b/src/classad/classad/fnCall.h -@@ -203,6 +203,7 @@ class FunctionCall : public ExprTree - - static bool eval( const char* name,const ArgumentList &argList,EvalState &state,Value &result ); - -+ static bool debug( const char* name,const ArgumentList &argList,EvalState &state,Value &result ); - //static bool doReal(const char*,const ArgumentList&,EvalState&,Value&); - }; - -diff --git a/src/classad/classad_functional_tester.cpp b/src/classad/classad_functional_tester.cpp -index 12305cf..84d7cb6 100644 ---- a/src/classad/classad_functional_tester.cpp -+++ b/src/classad/classad_functional_tester.cpp -@@ -21,7 +21,6 @@ - #include "classad/classad_distribution.h" - #include "classad/lexerSource.h" - #include "classad/xmlSink.h" --#undef open // we don't want the open method of basic_ofstream to end up being called _open... - #include - #include - #include -diff --git a/src/classad/do_packaging b/src/classad/do_packaging -index 197ec6b..531c7dd 100755 ---- a/src/classad/do_packaging -+++ b/src/classad/do_packaging -@@ -1,6 +1,6 @@ - #!/bin/sh - --DIST_VERSION=1.0.9 -+DIST_VERSION=1.0.10 - DISTRIBUTION_DIR=classads-${DIST_VERSION} - - EXCLUDE_LIST="do_packaging CMakeLists.txt README.packaging TAGS TODO man_cache_test.cpp test_classads.cpp" -diff --git a/src/classad/exprTree.cpp b/src/classad/exprTree.cpp -index b359842..74efabc 100644 ---- a/src/classad/exprTree.cpp -+++ b/src/classad/exprTree.cpp -@@ -30,6 +30,84 @@ extern int exprHash( const ExprTree* const&, int ); - - static const int MAX_CLASSAD_RECURSION = 1000; - -+void *ExprTree::debug_print(const char *message) { -+/* need to call the callback here instead -+ FILE *file = fopen("debug.out", "a"); -+ if(file) { -+ fprintf(file, "%s\n", message); -+ fclose(file); -+ } -+*/ -+ return NULL; -+} -+ -+void ExprTree::debug_format_value(Value &value) const { -+ bool boolValue = false; -+ int intValue = 0; -+ double doubleValue = 0; -+ string stringValue = ""; -+ -+ PrettyPrint unp; -+ string buffer; -+ unp.Unparse( buffer, this ); -+ -+ std::string result("Classad debug: "); -+ result += buffer; -+ result += " --> "; -+ -+ switch(value.GetType()) { -+ case Value::NULL_VALUE: -+ result += "NULL\n"; -+ break; -+ case Value::ERROR_VALUE: -+ result += "ERROR\n"; -+ break; -+ case Value::UNDEFINED_VALUE: -+ result += "UNDEFINED\n"; -+ break; -+ case Value::BOOLEAN_VALUE: -+ if(value.IsBooleanValue(boolValue)) -+ result += boolValue ? "TRUE\n" : "FALSE\n"; -+ break; -+ case Value::INTEGER_VALUE: -+ if(value.IsIntegerValue(intValue)) { -+ char buf[12]; -+ sprintf(buf, "%d", intValue); -+ result += buf; -+ result += "\n"; -+ } -+ break; -+ -+ case Value::REAL_VALUE: -+ if(value.IsRealValue(doubleValue)) { -+ char buf[24]; -+ sprintf(buf, "%g", doubleValue); -+ result += buf; -+ result += "\n"; -+ } -+ break; -+ case Value::RELATIVE_TIME_VALUE: -+ result += "RELATIVE TIME\n"; -+ break; -+ case Value::ABSOLUTE_TIME_VALUE: -+ result += "ABSOLUTE TIME\n"; -+ break; -+ case Value::STRING_VALUE: -+ if(value.IsStringValue(stringValue)) { -+ result += stringValue; -+ result += "\n"; -+ } -+ break; -+ case Value::CLASSAD_VALUE: -+ result += "CLASSAD\n"; -+ break; -+ case Value::LIST_VALUE: -+ result += "LIST\n"; -+ break; -+ } -+ debug_print(result.c_str()); -+} -+ - ExprTree:: - ExprTree () - { -@@ -55,13 +133,29 @@ CopyFrom(const ExprTree &tree) - bool ExprTree:: - Evaluate (EvalState &state, Value &val) const - { -- return( _Evaluate( state, val ) ); -+ bool eval = _Evaluate( state, val ); -+ -+ if(state.debug && GetKind() != ExprTree::LITERAL_NODE && -+ GetKind() != ExprTree::OP_NODE) -+ { -+ debug_format_value(val); -+ } -+ -+ return eval; - } - - bool ExprTree:: - Evaluate( EvalState &state, Value &val, ExprTree *&sig ) const - { -- return( _Evaluate( state, val, sig ) ); -+ bool eval = _Evaluate( state, val, sig ); -+ -+ if(state.debug && GetKind() != ExprTree::LITERAL_NODE && -+ GetKind() != ExprTree::OP_NODE) -+ { -+ debug_format_value(val); -+ } -+ -+ return eval; - } - - -@@ -146,6 +240,7 @@ EvalState( ) - - depth_remaining = MAX_CLASSAD_RECURSION; - flattenAndInline = false; // NAC -+ debug = false; - } - - EvalState:: -diff --git a/src/classad/fnCall.cpp b/src/classad/fnCall.cpp -index 9de6be5..5029505 100644 ---- a/src/classad/fnCall.cpp -+++ b/src/classad/fnCall.cpp -@@ -61,6 +61,8 @@ static void relTimeToClassAd( - double rsecs, ClassAd * &splitClassAd); - static void make_formatted_time( - const struct tm &time_components, string &format, Value &result); -+static bool -+stringListsIntersect(const char*,const ArgumentList &argList,EvalState &state,Value &result); - - // start up with an argument list of size 4 - FunctionCall:: -@@ -163,6 +165,12 @@ FunctionCall( ) - functionTable["interval" ] = (void*)interval; - functionTable["eval"] = (void*)eval; - -+ // string list functions: -+ // Note that many other string list functions are defined -+ // externally in the Condor classad compatibility layer. -+ functionTable["stringListsIntersect" ] = (void*)stringListsIntersect; -+ functionTable["debug" ] = (void*)debug; -+ - initialized = true; - } - } -@@ -2312,6 +2320,31 @@ interval( const char* /* name */,const ArgumentList &argList,EvalState &state, - return true; - } - -+bool FunctionCall:: -+debug( const char* name,const ArgumentList &argList,EvalState &state, -+ Value &result ) -+{ -+ Value arg; -+ -+ // takes exactly one argument -+ if( argList.size() != 1 ) { -+ result.SetErrorValue( ); -+ return( true ); -+ } -+ -+ state.debug = true; -+ -+ if( !argList[0]->Evaluate( state, arg ) ) { -+ result.SetErrorValue( ); -+ return( false ); -+ } -+ state.debug = false; -+ result = arg; -+ argList[0]->debug_format_value(result); -+ debug_print("\n"); -+ return true; -+} -+ - #if defined USE_POSIX_REGEX || defined USE_PCRE - static bool regexp_helper(const char *pattern, const char *target, - const char *replace, -@@ -2856,4 +2889,130 @@ make_formatted_time(const struct tm &time_components, string &format, - return; - } - -+static void -+split_string_list(char const *str,char const *delim,vector< string > &list) -+{ -+ if( !delim || !delim[0] ) { -+ delim = " ,"; -+ } -+ if( !str ) { -+ return; -+ } -+ string item; -+ while( *str ) { -+ size_t len = strcspn(str,delim); -+ if( len > 0 ) { -+ item.assign(str,len); -+ list.push_back(item); -+ str += len; -+ } -+ if( *str ) { -+ str++; -+ } -+ } -+} -+ -+static void -+split_string_set(char const *str,char const *delim,set< string > &string_set) -+{ -+ if( !delim || !delim[0] ) { -+ delim = " ,"; -+ } -+ if( !str ) { -+ return; -+ } -+ set::value_type item; -+ while( *str ) { -+ size_t len = strcspn(str,delim); -+ if( len > 0 ) { -+ item.assign(str,len); -+ string_set.insert(item); -+ str += len; -+ } -+ if( *str ) { -+ str++; -+ } -+ } -+} -+ -+static bool -+stringListsIntersect(const char*,const ArgumentList &argList,EvalState &state,Value &result) -+{ -+ Value arg0, arg1, arg2; -+ bool have_delimiter; -+ string str0,str1,delimiter_string; -+ -+ // need two or three arguments: pattern, list, optional settings -+ if( argList.size() != 2 && argList.size() != 3) { -+ result.SetErrorValue( ); -+ return true; -+ } -+ if (argList.size() == 2) { -+ have_delimiter = false; -+ } else { -+ have_delimiter = true; -+ } -+ -+ // Evaluate args -+ if( !argList[0]->Evaluate( state, arg0 ) || -+ !argList[1]->Evaluate( state, arg1 ) ) { -+ result.SetErrorValue( ); -+ return true; -+ } -+ if( have_delimiter && !argList[2]->Evaluate( state, arg2 ) ) { -+ result.SetErrorValue( ); -+ return true; -+ } -+ -+ // if either arg is error, the result is error -+ if( arg0.IsErrorValue( ) || arg1.IsErrorValue( ) ) { -+ result.SetErrorValue( ); -+ return true; -+ } -+ if( have_delimiter && arg2.IsErrorValue( ) ) { -+ result.SetErrorValue( ); -+ return true; -+ } -+ -+ // if either arg is undefined, the result is undefined -+ if( arg0.IsUndefinedValue( ) || arg1.IsUndefinedValue( ) ) { -+ result.SetUndefinedValue( ); -+ return true; -+ } -+ if( have_delimiter && arg2.IsUndefinedValue( ) ) { -+ result.SetUndefinedValue( ); -+ return true; -+ } else if ( have_delimiter && !arg2.IsStringValue( delimiter_string ) ) { -+ result.SetErrorValue( ); -+ return true; -+ } -+ -+ // if the arguments are not of the correct types, the result -+ // is an error -+ if( !arg0.IsStringValue( str0 ) || !arg1.IsStringValue( str1 ) ) { -+ result.SetErrorValue( ); -+ return true; -+ } -+ result.SetBooleanValue(false); -+ -+ vector< string > list0; -+ set< string > set1; -+ -+ split_string_list(str0.c_str(),delimiter_string.c_str(),list0); -+ split_string_set(str1.c_str(),delimiter_string.c_str(),set1); -+ -+ vector< string >::iterator it; -+ for(it = list0.begin(); -+ it != list0.end(); -+ it++) -+ { -+ if( set1.count(*it) ) { -+ result.SetBooleanValue(true); -+ break; -+ } -+ } -+ -+ return true; -+} -+ - END_NAMESPACE // classad -diff --git a/src/classad/functional_tests.txt b/src/classad/functional_tests.txt -index 38c0bb5..e587c24 100644 ---- a/src/classad/functional_tests.txt -+++ b/src/classad/functional_tests.txt -@@ -343,3 +343,13 @@ echo Testing characters with negative ascii values - # the following used to not even parse on some systems - same "–", "–" - -+echo Testing stringListsIntersect() -+same true, stringListsIntersect("one,two","two,three") -+same false, stringListsIntersect("one,two","three,four") -+same false, stringListsIntersect("one,two","three,four",";") -+same true, stringListsIntersect("one,two","one") -+same true, stringListsIntersect("one, two","two, three") -+same true, stringListsIntersect("one,two","two,three",",") -+same true, stringListsIntersect("one;two","two;three",";") -+same undefined, stringListsIntersect("one,two",undefined) -+same undefined, stringListsIntersect(undefined,"one,two" ) -diff --git a/src/classad/lexerSource.cpp b/src/classad/lexerSource.cpp -index bb08f9e..1cbc450 100644 ---- a/src/classad/lexerSource.cpp -+++ b/src/classad/lexerSource.cpp -@@ -112,7 +112,7 @@ InputStreamLexerSource::ReadCharacter(void) - char real_character; - int character; - -- if (_stream != NULL && !_stream->eof()) { -+ if (_stream != NULL && _stream->good()) { - _stream->get(real_character); - character = (unsigned char)real_character; - } else { -diff --git a/src/classad/util.cpp b/src/classad/util.cpp -index 2e06049..7f1f981 100644 ---- a/src/classad/util.cpp -+++ b/src/classad/util.cpp -@@ -200,7 +200,7 @@ void convert_escapes(string &text, bool &validStr) - sscanf(octal, "%o", &number); - new_char = number; - } else { -- new_char = text[source]; -+ number = new_char = text[source]; - } - if(number == 0) { // "\\0" is an invalid substring within a string literal - validStr = false; -diff --git a/src/classad_analysis/analysis.cpp b/src/classad_analysis/analysis.cpp -index 0b1f78a..dd57268 100644 ---- a/src/classad_analysis/analysis.cpp -+++ b/src/classad_analysis/analysis.cpp -@@ -26,7 +26,7 @@ - #include "list.h" - #include "simplelist.h" - #include "extArray.h" --#include "condor_classad_util.h" -+#include "condor_classad.h" - - #include - #include -diff --git a/src/classad_analysis/boolExpr.cpp b/src/classad_analysis/boolExpr.cpp -index e08ecb4..fc4332b 100644 ---- a/src/classad_analysis/boolExpr.cpp -+++ b/src/classad_analysis/boolExpr.cpp -@@ -67,7 +67,9 @@ ExprToMultiProfile( classad::ExprTree *expr, MultiProfile *&mp ) - - kind = currentTree->GetKind( ); - -- if( kind == classad::ExprTree::ATTRREF_NODE ) { -+ if( kind == classad::ExprTree::ATTRREF_NODE || -+ kind == classad::ExprTree::FN_CALL_NODE ) -+ { - atLeftMostProfile = true; - continue; - } -@@ -172,7 +174,9 @@ ExprToProfile( classad::ExprTree *expr, Profile *&p ) - - kind = currentTree->GetKind( ); - -- if( kind == classad::ExprTree::ATTRREF_NODE ) { -+ if( kind == classad::ExprTree::ATTRREF_NODE || -+ kind == classad::ExprTree::FN_CALL_NODE ) -+ { - atLeftMostCondition = true; - continue; - } -@@ -269,6 +273,14 @@ ExprToCondition( classad::ExprTree *expr, Condition *&c ) - return true; - } - -+ if( kind == classad::ExprTree::FN_CALL_NODE ) { -+ if( !c->InitComplex( expr->Copy( ) ) ) { -+ cerr << "error: problem with Condition::InitComplex" << endl; -+ return false; -+ } -+ return true; -+ } -+ - if( kind != classad::ExprTree::OP_NODE ) { - cerr << "error: no operator/attribute found" << endl; - // error: no operator/attribute found; -diff --git a/src/condor_amazon/amazongahp_common.cpp b/src/condor_amazon/amazongahp_common.cpp -index 81fc903..3b10220 100644 ---- a/src/condor_amazon/amazongahp_common.cpp -+++ b/src/condor_amazon/amazongahp_common.cpp -@@ -34,14 +34,12 @@ static SimpleList amazon_gahp_commands; - - static FILE *gahp_log_file = stderr; - --// This variable is defined in dprintf.c --extern FILE *DebugFP; - - bool set_gahp_log_file(const char* logfile) - { -+ - static bool done_init = false; - -- DebugFP = stderr; - Termlog = 1; - - if( !done_init ) { -@@ -69,9 +67,9 @@ bool set_gahp_log_file(const char* logfile) - } - - gahp_log_file = fp; -- DebugFP = fp; - - //DebugLock = ; -+ - return true; - } - -diff --git a/src/condor_amazon/io_loop_pthread.cpp b/src/condor_amazon/io_loop_pthread.cpp -index e5eb01f..35c179a 100644 ---- a/src/condor_amazon/io_loop_pthread.cpp -+++ b/src/condor_amazon/io_loop_pthread.cpp -@@ -77,7 +77,7 @@ static void io_process_exit(int exit_num) - void - usage() - { -- dprintf( D_ALWAYS, "Usage: amazon_gahp -f logfile -d debuglevel -w min_worker_nums -m max_worker_nums\n"); -+ dprintf( D_ALWAYS, "Usage: amazon_gahp -d debuglevel -w min_worker_nums -m max_worker_nums\n"); - exit(1); - } - -diff --git a/src/condor_birdwatcher/CMakeLists.txt b/src/condor_birdwatcher/CMakeLists.txt -index 1c3a59e..362622a 100644 ---- a/src/condor_birdwatcher/CMakeLists.txt -+++ b/src/condor_birdwatcher/CMakeLists.txt -@@ -20,7 +20,7 @@ if (WINDOWS AND NOT WIN_EXEC_NODE_ONLY) - - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS") - -- file( GLOB BWSrcs *.cpp *.h *.rc res/*) -+ file( GLOB BWSrcs *.cpp *.h *.rc *.rc2 res/*) - - condor_exe( condor_birdwatcher "${BWSrcs}" ${C_SBIN} "" OFF) - -diff --git a/src/condor_birdwatcher/birdwatcher.rc b/src/condor_birdwatcher/birdwatcher.rc -index b7d55ba..f559363 100755 ---- a/src/condor_birdwatcher/birdwatcher.rc -+++ b/src/condor_birdwatcher/birdwatcher.rc -@@ -7,14 +7,16 @@ - // - // Generated from the TEXTINCLUDE 2 resource. - // --#include "winres.h" -+#include "windows.h" - - ///////////////////////////////////////////////////////////////////////////// - #undef APSTUDIO_READONLY_SYMBOLS - - ///////////////////////////////////////////////////////////////////////////// - // English (U.S.) resources -- -+#ifndef IDC_STATIC -+#define IDC_STATIC (-1) -+#endif - #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) - #ifdef _WIN32 - LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -@@ -34,12 +36,6 @@ END - - 2 TEXTINCLUDE - BEGIN -- "#include ""winres.h""\r\n" -- "\0" --END -- --3 TEXTINCLUDE --BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" -diff --git a/src/condor_c-gahp/cgahp_common.cpp b/src/condor_c-gahp/cgahp_common.cpp -index b9f9c46..a13430f 100644 ---- a/src/condor_c-gahp/cgahp_common.cpp -+++ b/src/condor_c-gahp/cgahp_common.cpp -@@ -36,6 +36,8 @@ parse_gahp_command (const char* raw, Gahp_Args* args) { - int len=strlen(raw); - - char * buff = (char*)malloc(len+1); -+ ASSERT(buff); -+ - int buff_len = 0; - - for (int i = 0; i - - class CondorFileInfo; - class CondorFilePointer; - -+ - /** - This class multiplexes number of UNIX file system calls. - The fd's used to index this table are "virtual file descriptors", -diff --git a/src/condor_ckpt/image.cpp b/src/condor_ckpt/image.cpp -index c7cc873..c052193 100644 ---- a/src/condor_ckpt/image.cpp -+++ b/src/condor_ckpt/image.cpp -@@ -32,6 +32,19 @@ - #include "subsystem_info.h" - #include "gtodc.h" - -+#if defined(COMPRESS_CKPT) -+/* This structure represents an alternate heap, controlled by a specially -+ created malloc, and used by zlib for the checkpoint compression feature. -+*/ -+struct alternate_memory_heap { -+ void *begin; -+ void *corestart; -+ void **coreend; -+ void **segend; -+ int pagesize; -+}; -+#endif -+ - extern int _condor_in_file_stream; - - const int KILO = 1024; -@@ -49,6 +62,8 @@ extern "C" void _condor_restore_sigstates(); - #if defined(COMPRESS_CKPT) - #include "zlib.h" - extern "C" { -+ void display_alternate_memory_heap(int dlevel); -+ int condor_malloc_getpagesize(void); // in malloc-condor.c - int condor_malloc_init_size(); - void condor_malloc_init(void *start); - char *condor_malloc(size_t); -@@ -85,6 +100,7 @@ extern "C" void _install_signal_handler( int sig, SIG_HANDLER handler ); - extern "C" int open_ckpt_file( const char *name, int flags, size_t n_bytes ); - extern "C" int get_ckpt_mode( int sig ); - extern "C" int get_ckpt_speed( ); -+static void sleep_syscall(int seconds); - - Image MyImage; - static jmp_buf Env; -@@ -98,6 +114,13 @@ unsigned int _condor_numrestarts = 0; - int condor_compress_ckpt = 1; // compression off(0) or on(1) - int condor_slow_ckpt = 0; - -+#if defined(COMPRESS_CKPT) -+// There is only ONE alternate heap. This global variable gets saved and -+// restored across checkpoints. This means that the mmap'ed heap during -+// checkpoint will be known to be put into the right place upon restore. -+static struct alternate_memory_heap amh = { NULL, NULL, NULL, NULL, -1 }; -+#endif -+ - /* these are the remote system calls we use in this file */ - extern "C" int REMOTE_CONDOR_send_rusage(struct rusage *use_p); - -@@ -148,71 +171,225 @@ void *condor_map_seg(void *base, size_t size) - return base; - } - -+void display_alternate_memory_heap(int dlevel) -+{ -+ dprintf(dlevel, -+ "Alternate Memory Heap: {begin=%p, corestart=%p, coreend=%p, segend=%p, *coreend=%p, *segend=%p, pagesize=%d}\n", -+ amh.begin, amh.corestart, amh.coreend, amh.segend, -+ amh.coreend!=NULL?*amh.coreend:NULL, -+ amh.segend!=NULL?*amh.segend:NULL, -+ amh.pagesize); -+} -+ - // TODO: deallocate segments on negative incr - void *condor_morecore(int incr) - { -- // begin points to the start of our heap segment -- // corestart points to the start of the allocated portion of the segment -- // *coreend points to the end of the allocated portion of the segment -- // *segend points to the end of our allocated segment -- // coreend and segend are stored at the start of the segment because -+ // amh.begin points to the start of our heap segment -+ // amh.corestart points to the start of the allocated portion of the segment -+ // *amh.coreend points to the end of the allocated portion of the segment -+ // *amh.segend points to the end of our allocated segment -+ // amh.coreend and segend are stored at the start of the segment because - // we don't want them to be overwritten on a restart -- static void *begin = NULL, *corestart = NULL, -- **coreend = NULL, **segend = NULL; -- static int pagesize = -1; - -- if (pagesize == -1) { -- pagesize = getpagesize(); -+ if (amh.pagesize == -1) { -+ // This is the page size of the alternate heap allocator, NOT the -+ // regular allocator used by the application. The two allocators -+ // can sometimes have different sizes and we don't want to confuse -+ // the two. -+ amh.pagesize = condor_malloc_getpagesize(); - } -- -- if (begin == NULL) { -- begin = MyImage.FindAltHeap(); -+ -+ if (amh.begin == NULL) { -+ amh.begin = MyImage.FindAltHeap(); - int malloc_static_data = condor_malloc_init_size(); - int segincr = - (((incr+malloc_static_data+ -- (2*sizeof(void *)))/pagesize)+1)*pagesize; -- begin = condor_map_seg(begin, segincr); -- corestart = (void *) ( -- (int)begin+(int)(2*sizeof(void *))+(int)malloc_static_data ); -- condor_malloc_init((void *)((int)begin+(int)(2*sizeof(void *)))); -- coreend = (void **)begin; -- segend = (void **)((int)begin+(int)sizeof(void *)); -- *segend = (void *)((int)begin+(int)segincr); -- *coreend = (void *)((int)corestart+(int)incr); -- return corestart; -+ (2*sizeof(void *)))/amh.pagesize)+1)*amh.pagesize; -+ amh.begin = condor_map_seg(amh.begin, segincr); -+ amh.corestart = (void *) ( -+ (int)amh.begin+(int)(2*sizeof(void *))+(int)malloc_static_data ); -+ condor_malloc_init((void *)((int)amh.begin+(int)(2*sizeof(void *)))); -+ amh.coreend = (void **)amh.begin; -+ amh.segend = (void **)((int)amh.begin+(int)sizeof(void *)); -+ *amh.segend = (void *)((int)amh.begin+(int)segincr); -+ *amh.coreend = (void *)((int)amh.corestart+(int)incr); -+ return amh.corestart; - } else if (incr == 0) { -- return *coreend; -+ return *amh.coreend; - } else { -- void *old_break = *coreend; -- *coreend = (void *)((int)*coreend + (int)incr); -- if (*coreend > *segend) { -- int segincr = (int)((((int)*coreend-(int)*segend)/(int)pagesize)+1)*(int)pagesize; -- if ((int)*coreend+(int)segincr-(int)begin > ALT_HEAP_SIZE) { -+ void *old_break = *amh.coreend; -+ *amh.coreend = (void *)((int)*amh.coreend + (int)incr); -+ if (*amh.coreend > *amh.segend) { -+ int segincr = (int)((((int)*amh.coreend-(int)*amh.segend)/(int)amh.pagesize)+1)*(int)amh.pagesize; -+ if ((int)*amh.coreend+(int)segincr-(int)amh.begin > ALT_HEAP_SIZE) { - dprintf(D_ALWAYS, - "fatal error: exceeded ALT_HEAP_SIZE of %d bytes!\n", - ALT_HEAP_SIZE); - Suicide(); - } -- if (condor_map_seg(*segend, segincr) != *segend) { -+ if (condor_map_seg(*amh.segend, segincr) != *amh.segend) { - dprintf(D_ALWAYS, "failed to allocate contiguous segments in " - "condor_morecore!\n"); - Suicide(); - } -- *segend = (void *)((int)*segend + (int)segincr); -+ *amh.segend = (void *)((int)*amh.segend + (int)segincr); - } - return old_break; - } - } - - void * --zalloc(voidpf opaque, uInt items, uInt size) -+zalloc(voidpf /* opaque */, uInt items, uInt size) - { -- return condor_malloc(items*size); -+ uInt total_size = 0; -+ void *chunk = NULL; -+ void *chunk_start = NULL; -+ void *chunk_end = NULL; -+ -+ // Get the requested memory from the alternate heap. This may initialize -+ // the alternate heap based upon condor_morecore(). -+ total_size = items * size; -+ chunk = condor_malloc(total_size); -+ -+ // some useful pointers for later checks and messages. -+ chunk_start = chunk; -+ chunk_end = (char*)chunk + total_size; -+ -+ // Check to make sure alternate heap was and still is initialized. -+ if (amh.begin == NULL || -+ amh.corestart == NULL || -+ amh.coreend == NULL || -+ *amh.coreend == NULL || -+ amh.segend == NULL || -+ *amh.segend == NULL || -+ amh.pagesize != condor_malloc_getpagesize()) -+ { -+ dprintf(D_ALWAYS, -+ "ERROR: The alternate heap has not been initialized properly. " -+ "Please check to see that MORECORE had been defined properly " -+ "when compiling malloc-condor.c. Committing Suicide()!\n"); -+ display_alternate_memory_heap(D_ALWAYS); -+ Suicide(); -+ } -+ -+ // Check to see that the memory we got back from the allocator is -+ // _completely contained_ in the alternate heap. We do this because if -+ // somehow condor_malloc() actually called sbrk() instead of -+ // condor_morecore(), we'd silently corrupt the checkpoint image and -+ // subsequent checkpoint. We take great care to examine how it fails -+ // since that can lead to insight into what is going wrong. -+ -+ // Check if chunk starts before the alt heap and ends after the alt heap -+ if (chunk_start < amh.corestart && chunk_end >= *amh.coreend) -+ { -+ dprintf(D_ALWAYS, -+ "ERROR: Alternate heap allocator allocated chunk " -+ "[start=%p, end=%p, size=%d bytes] " -+ "which _completely_ overlaps the alternate heap boundaries " -+ "of [%p, %p]. " -+ "Check to see if MORECORE is defined properly when " -+ "compiling malloc-condor.c! Commiting Suicide()!\n", -+ chunk_start, chunk_end, total_size, -+ amh.corestart, amh.coreend!=NULL?*amh.coreend:NULL); -+ display_alternate_memory_heap(D_ALWAYS); -+ Suicide(); -+ } -+ -+ // Check if the entire chunk is below the alternate heap. -+ if (chunk_end < amh.corestart) { -+ dprintf(D_ALWAYS, -+ "ERROR: Alternate heap allocator allocated chunk " -+ "[start=%p, end=%p, size=%d bytes] " -+ "which is below the valid alternate heap boundaries of [%p, %p]. " -+ "Check to see if MORECORE is defined properly when " -+ "compiling malloc-condor.c! Commiting Suicide()!\n", -+ chunk_start, chunk_end, total_size, -+ amh.corestart, amh.coreend!=NULL?*amh.coreend:NULL); -+ display_alternate_memory_heap(D_ALWAYS); -+ Suicide(); -+ } -+ -+ // Check if the entire chunk is above the alternate heap. -+ if (chunk_start > *amh.coreend) { -+ dprintf(D_ALWAYS, -+ "ERROR: Alternate heap allocator allocated chunk " -+ "[start=%p, end=%p, size=%d bytes] " -+ "which is above the valid alternate heap boundaries of [%p, %p]. " -+ "Check to see if MORECORE is defined properly when " -+ "compiling malloc-condor.c! Commiting Suicide()!\n", -+ chunk_start, chunk_end, total_size, -+ amh.corestart, amh.coreend!=NULL?*amh.coreend:NULL); -+ display_alternate_memory_heap(D_ALWAYS); -+ Suicide(); -+ } -+ -+ // Check if the chunk overlaps the lower boundary of the alt heap. -+ if (chunk_start < amh.corestart && chunk_end >= amh.corestart) -+ { -+ dprintf(D_ALWAYS, -+ "ERROR: Alternate heap allocator allocated chunk " -+ "[start=%p, end=%p, size=%d bytes] " -+ "which overlaps the start alternate heap boundaries of [%p, %p]. " -+ "Check to see if MORECORE is defined properly when " -+ "compiling malloc-condor.c! Commiting Suicide()!\n", -+ chunk_start, chunk_end, total_size, -+ amh.corestart, amh.coreend!=NULL?*amh.coreend:NULL); -+ display_alternate_memory_heap(D_ALWAYS); -+ Suicide(); -+ } -+ -+ // Check if the chunk overlaps the upper boundary of the alt heap. -+ if (chunk_start >= amh.corestart && -+ chunk_start < *amh.coreend && -+ chunk_end >= *amh.coreend) -+ { -+ dprintf(D_ALWAYS, -+ "ERROR: Alternate heap allocator allocated chunk " -+ "[start=%p, end=%p, size=%d bytes] " -+ "which overlaps the end alternate heap boundaries of [%p, %p]. " -+ "compiling malloc-condor.c! Commiting Suicide()!\n", -+ chunk_start, chunk_end, total_size, -+ amh.corestart, amh.coreend!=NULL?*amh.coreend:NULL); -+ display_alternate_memory_heap(D_ALWAYS); -+ Suicide(); -+ } -+ -+ // If we passed the validation gauntlet, we're good to go! -+ return chunk; - } - - void --zfree(voidpf opaque, voidpf address) -+zfree(voidpf /* opaque */ , voidpf address) - { -+ // Check to see that the pointer we are about to free actually exists IN -+ // the alternate heap. We do this because if somehow we pass pointers from -+ // the real malloc heap to here, we could silently corrupt or segfault in -+ // either heap. -+ -+ if (address < amh.corestart) { -+ dprintf(D_ALWAYS, -+ "ERROR: Alternate heap allocator asked to free a pointer %p from " -+ "below the alternate heap! Check to see if MORECORE is defined " -+ "properly when compiling malloc-condor.c! Also check that a real " -+ "heap pointer isn't being passed to the alternate heap free " -+ "function! Commiting Suicide()!\n", -+ address); -+ display_alternate_memory_heap(D_ALWAYS); -+ Suicide(); -+ } -+ -+ if (address >= *amh.coreend) { -+ dprintf(D_ALWAYS, -+ "ERROR: Alternate heap allocator asked to free a pointer %p from " -+ "above the alternate heap! Check to see if MORECORE is defined " -+ "properly when compiling malloc-condor.c! Also check that a real " -+ "heap pointer isn't being passed to the alternate heap free " -+ "function! Commiting Suicide()!\n", -+ address); -+ display_alternate_memory_heap(D_ALWAYS); -+ Suicide(); -+ } -+ - condor_free(address); - } - #endif -@@ -932,7 +1109,7 @@ Image::Write( const char *ckpt_file ) - { - int file_d; - int scm; -- char tmp_name[ _POSIX_PATH_MAX ]; -+ char tmp_name[ PATH_MAX ]; - - if( ckpt_file == 0 ) { - ckpt_file = file_name; -@@ -1871,6 +2048,33 @@ void ckpt_and_exit__() - - } /* end of extern "C" */ - -+/* this bypasses our need for libc */ -+void sleep_syscall(int seconds) -+{ -+ -+#if defined(SYS_sleep) -+ SYSCALL(SYS_sleep, seconds); -+#elif defined(SYS__newselect) -+ struct timeval t; -+ t.tv_sec = seconds; -+ t.tv_usec = 0; -+ SYSCALL(SYS__newselect, 0, NULL, NULL, NULL, &t); -+#elif defined(SYS_select) -+ struct timeval t; -+ t.tv_sec = seconds; -+ t.tv_usec = 0; -+ SYSCALL(SYS_select, 0, NULL, NULL, NULL, &t); -+#elif defined(SYS_nanosleep) -+ struct timespec t; -+ t.tv_sec = seconds; -+ t.tv_nsec = 0; -+ SYSCALL(SYS_nanosleep, &t, NULL); -+#else -+#error "Please port me! I need a sleep system call." -+#endif -+ -+} -+ - /* - Arrange to terminate abnormally with the given signal. Note: the - expectation is that the signal is one whose default action terminates -@@ -1918,26 +2122,7 @@ terminate_with_sig( int sig ) - // our debug message doesn't arrive at the shadow, we won't know why - // the job died. Note that we don't necessarily have access to any - // libc functions here, so we must use SYSCALL(SYS_something, ...). --#if defined(SYS_sleep) -- SYSCALL(SYS_sleep, 1); --#elif defined(SYS__newselect) -- struct timeval t; -- t.tv_sec = 1; -- t.tv_usec = 0; -- SYSCALL(SYS__newselect, 0, NULL, NULL, NULL, &t); --#elif defined(SYS_select) -- struct timeval t; -- t.tv_sec = 1; -- t.tv_usec = 0; -- SYSCALL(SYS_select, 0, NULL, NULL, NULL, &t); --#elif defined(SYS_nanosleep) -- struct timespec t; -- t.tv_sec = 1; -- t.tv_nsec = 0; -- SYSCALL(SYS_nanosleep, &t, NULL); --#else --#error "Please port me! I need a sleep system call." --#endif -+ sleep_syscall(1); - - if( SYSCALL(SYS_kill, my_pid, sig) < 0 ) { - EXCEPT( "kill" ); -diff --git a/src/condor_ckpt/malloc-condor.c b/src/condor_ckpt/malloc-condor.c -index 946617c..973eac2 100644 ---- a/src/condor_ckpt/malloc-condor.c -+++ b/src/condor_ckpt/malloc-condor.c -@@ -17,15 +17,47 @@ - * - ***************************************************************/ - -+/* This file sets up some definitions in order to create a private malloc -+ implementation suitable for use by the checkpointing library to make a -+ private heap. This is *not* the malloc called by ordinary user code. -+ Its use is primarily by zlib when it compressed/uncompresses checkpoints. -+ The privacy is enforced at the symbol namespace level via the -+ MALLOC_SYMBOL #define that is part of the malloc.c interface. -+*/ -+ -+ -+/* First we check to make sure we're being compiled properly. -+ Traditionally, you can use the values: -+ -DMORECORE=condor_morecore -+ -DHAVE_MMAP=0 -+ -Dmalloc_getpagesize=8192 -+ -+ The first states to use the function condor_morecore() instead of sbrk(). -+ The second states that MORECORE should *always* be called instead of mmap(). -+ The third dictates how big the pages are wrt to the allocator. -+*/ -+#if !defined(MORECORE) || !defined(HAVE_MMAP) || !defined(malloc_getpagesize) -+#error You should be defining MORECORE, HAVE_MMAP, and malloc_getpagesize on the compilation line for this file! -+#endif - --/* --This file sets up some definitions in order --to create a private malloc implementation suitable --for use by the checkpointing library to make --a private heap. This is *not* the malloc called --by ordinary user code. -+/* give a prototype of the morecore function for the allocator */ -+extern void* MORECORE(int); -+ -+/* We use this function to figure out whatever the pagesize was that we told -+ the allocator to use. This allows up to later compute the correct size -+ of our alternate heap. The prototype is in image.cpp. - */ -+int condor_malloc_getpagesize(void) -+{ -+ return malloc_getpagesize; -+} - -+/* Change all usual malloc calls to be prefixed with condor_. The ckpt -+ library uses this new interface when performing compressed checkpoints. -+*/ - #define MALLOC_SYMBOL(x) condor_##x - - #include "malloc.c" -+ -+ -+ -diff --git a/src/condor_ckpt/zimage.cpp b/src/condor_ckpt/zimage.cpp -new file mode 100644 -index 0000000..5dede3c ---- /dev/null -+++ b/src/condor_ckpt/zimage.cpp -@@ -0,0 +1,22 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, -+ * University of Wisconsin-Madison, WI. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#define COMPRESS_CKPT -+ -+#include "image.cpp" -diff --git a/src/condor_ckpt_server/xfer_summary.cpp b/src/condor_ckpt_server/xfer_summary.cpp -index 23ef813..1877b9b 100644 ---- a/src/condor_ckpt_server/xfer_summary.cpp -+++ b/src/condor_ckpt_server/xfer_summary.cpp -@@ -33,11 +33,6 @@ - #include "condor_getcwd.h" - - --extern "C" { -- char* getwd( char* ); --} -- -- - - XferSummary::XferSummary() - { -diff --git a/src/condor_collector.V6/collector.cpp b/src/condor_collector.V6/collector.cpp -index 3c70b99..d78255a 100644 ---- a/src/condor_collector.V6/collector.cpp -+++ b/src/condor_collector.V6/collector.cpp -@@ -19,8 +19,6 @@ - - #include "condor_common.h" - #include "condor_classad.h" --#include "condor_classad_util.h" --#include "condor_parser.h" - #include "condor_status.h" - #include "condor_debug.h" - #include "condor_config.h" -@@ -57,6 +55,9 @@ - - #include "ccb_server.h" - -+using std::vector; -+using std::string; -+ - //---------------------------------------------------------------- - - extern "C" char* CondorVersion( void ); -@@ -67,9 +68,8 @@ CollectorEngine CollectorDaemon::collector( &collectorStats ); - int CollectorDaemon::ClientTimeout; - int CollectorDaemon::QueryTimeout; - char* CollectorDaemon::CollectorName; --Daemon* CollectorDaemon::View_Collector; --Sock* CollectorDaemon::view_sock; - Timeslice CollectorDaemon::view_sock_timeslice; -+vector CollectorDaemon::vc_list; - - ClassAd* CollectorDaemon::__query__; - int CollectorDaemon::__numAds__; -@@ -130,9 +130,7 @@ void CollectorDaemon::Init() - // read in various parameters from condor_config - CollectorName=NULL; - ad=NULL; -- View_Collector=NULL; - viewCollectorTypes = NULL; -- view_sock=NULL; - UpdateTimerId=-1; - updateCollectors = NULL; - updateRemoteCollector = NULL; -@@ -652,11 +650,9 @@ int CollectorDaemon::receive_invalidation(Service* /*s*/, - forward_classad_to_view_collector(command, - ATTR_TARGET_TYPE, - &cad); -- } else -- if(View_Collector && ((command == INVALIDATE_STARTD_ADS) || -- (command == INVALIDATE_SUBMITTOR_ADS)) ) { -- send_classad_to_sock(command, View_Collector, &cad); -- } -+ } else if ((command == INVALIDATE_STARTD_ADS) || (command == INVALIDATE_SUBMITTOR_ADS)) { -+ send_classad_to_sock(command, &cad); -+ } - - if( sock->type() == Stream::reli_sock ) { - // stash this socket for future updates... -@@ -721,11 +717,9 @@ int CollectorDaemon::receive_update(Service* /*s*/, int command, Stream* sock) - forward_classad_to_view_collector(command, - ATTR_MY_TYPE, - cad); -- } else -- if(View_Collector && ((command == UPDATE_STARTD_AD) || -- (command == UPDATE_SUBMITTOR_AD)) ) { -- send_classad_to_sock(command, View_Collector, cad); -- } -+ } else if ((command == UPDATE_STARTD_AD) || (command == UPDATE_SUBMITTOR_AD)) { -+ send_classad_to_sock(command, cad); -+ } - - if( sock->type() == Stream::reli_sock ) { - // stash this socket for future updates... -@@ -854,9 +848,8 @@ int CollectorDaemon::receive_update_expect_ack( Service* /*s*/, - forward_classad_to_view_collector(command, - ATTR_MY_TYPE, - cad); -- } else -- if( View_Collector && UPDATE_STARTD_AD_WITH_ACK == command ) { -- send_classad_to_sock ( command, View_Collector, cad ); -+ } else if (UPDATE_STARTD_AD_WITH_ACK == command) { -+ send_classad_to_sock(command, cad); - } - - // let daemon core clean up the socket -@@ -1249,47 +1242,52 @@ void CollectorDaemon::Config() - - // if we're not the View Collector, let's set something up to forward - // all of our ads to the view collector. -- if(View_Collector) { -- delete View_Collector; -+ for (vector::iterator e(vc_list.begin()); e != vc_list.end(); ++e) { -+ delete e->collector; -+ delete e->sock; - } -- -- if(view_sock) { -- delete view_sock; -- } -+ vc_list.clear(); - - tmp = param("CONDOR_VIEW_HOST"); -- if(tmp) { -- View_Collector = new DCCollector( tmp ); -- Sinful view_addr( View_Collector->addr() ); -- Sinful my_addr( daemonCore->publicNetworkIpAddr() ); -- -- if( my_addr.addressPointsToMe( view_addr ) ) -- { -- // Do not forward to myself. -- dprintf(D_ALWAYS, "Not forwarding to View Server %s, because that's me!\n", tmp); -- delete View_Collector; -- View_Collector = NULL; -- } -- else { -- dprintf(D_ALWAYS, "Will forward ads on to View Server %s\n", tmp); -- } -- free(tmp); -- if(View_Collector) { -- if( View_Collector->hasUDPCommandPort() ) { -- view_sock = new SafeSock(); -- } -- else { -- view_sock = new ReliSock(); -- } -- // protect against frequent time-consuming reconnect attempts -- view_sock_timeslice.setTimeslice(0.05); -- view_sock_timeslice.setMaxInterval(1200); -- } -+ if (tmp) { -+ StringList cvh(tmp); -+ free(tmp); -+ cvh.rewind(); -+ while (char* vhost = cvh.next()) { -+ Daemon* vhd = new DCCollector(vhost); -+ Sinful view_addr( vhd->addr() ); -+ Sinful my_addr( daemonCore->publicNetworkIpAddr() ); -+ -+ if (my_addr.addressPointsToMe(view_addr)) { -+ dprintf(D_ALWAYS, "Not forwarding to View Server %s - self referential\n", vhost); -+ delete vhd; -+ continue; -+ } -+ dprintf(D_ALWAYS, "Will forward ads on to View Server %s\n", vhost); -+ -+ Sock* vhsock = NULL; -+ if (vhd->hasUDPCommandPort()) { -+ vhsock = new SafeSock(); -+ } else { -+ vhsock = new ReliSock(); -+ } -+ -+ vc_list.push_back(vc_entry()); -+ vc_list.back().name = vhost; -+ vc_list.back().collector = vhd; -+ vc_list.back().sock = vhsock; -+ } -+ } -+ -+ if (!vc_list.empty()) { -+ // protect against frequent time-consuming reconnect attempts -+ view_sock_timeslice.setTimeslice(0.05); -+ view_sock_timeslice.setMaxInterval(1200); - } - - if (viewCollectorTypes) delete viewCollectorTypes; - viewCollectorTypes = NULL; -- if (View_Collector) { -+ if (!vc_list.empty()) { - tmp = param("CONDOR_VIEW_CLASSAD_TYPES"); - if (tmp) { - viewCollectorTypes = new StringList(tmp); -@@ -1480,10 +1478,10 @@ CollectorDaemon::forward_classad_to_view_collector(int cmd, - const char *filterAttr, - ClassAd *ad) - { -- if (!View_Collector) return; -+ if (vc_list.empty()) return; - - if (!filterAttr) { -- send_classad_to_sock(cmd, View_Collector, ad); -+ send_classad_to_sock(cmd, ad); - return; - } - -@@ -1496,102 +1494,93 @@ CollectorDaemon::forward_classad_to_view_collector(int cmd, - if (viewCollectorTypes->contains_anycase(type.c_str())) { - dprintf(D_ALWAYS, "Forwarding ad: type=%s command=%s\n", - type.c_str(), getCommandString(cmd)); -- send_classad_to_sock(cmd, View_Collector, ad); -+ send_classad_to_sock(cmd, ad); - } - } - --void --CollectorDaemon::send_classad_to_sock(int cmd, Daemon * d, ClassAd* theAd) --{ -- // view_sock is static -- if(!view_sock) { -- dprintf(D_ALWAYS, "Trying to forward ad on, but no connection to View " -- "Collector!\n"); -- return; -- } -- if(!theAd) { -- dprintf(D_ALWAYS, "Trying to forward ad on, but ad is NULL!!!\n"); -- return; -- } -- bool raw_command = false; -- if( !view_sock->is_connected() ) { -- // We must have gotten disconnected. (Or this is the 1st time.) -- -- // In case we keep getting disconnected or fail to connect, -- // and each connection attempt takes a long time, restrict -- // what fraction of our time we spend trying to reconnect. -- -- char const *desc = d->idStr() ? d->idStr() : "(null)"; -- if( view_sock_timeslice.isTimeToRun() ) { -- dprintf(D_ALWAYS,"Connecting to CONDOR_VIEW_HOST %s\n", desc ); -- -- view_sock_timeslice.setStartTimeNow(); -- d->connectSock(view_sock,20); -- view_sock_timeslice.setFinishTimeNow(); -- -- if( !view_sock->is_connected() ) { -- dprintf(D_ALWAYS,"Failed to connect to CONDOR_VIEW_HOST %s " -- " so not forwarding ad.\n", -- desc ); -- return; -- } -- } -- else { -- dprintf(D_FULLDEBUG,"Skipping forwarding of ad to CONDOR_VIEW_HOST %s, because reconnect is delayed for %us.\n", desc, view_sock_timeslice.getTimeToNextRun()); -- return; -- } - -- } -- else if( view_sock->type() == Stream::reli_sock ) { -- // we already did the security handshake the last time -- // we sent a command on this socket, so just send a -- // raw command this time to avoid reauthenticating -- raw_command = true; -- } -+void CollectorDaemon::send_classad_to_sock(int cmd, ClassAd* theAd) { -+ if (vc_list.empty()) return; - -- if (! d->startCommand(cmd, view_sock, 20, NULL, NULL, raw_command)) { -- dprintf( D_ALWAYS, "Can't send command %d to View Collector\n", cmd); -- view_sock->end_of_message(); -- view_sock->close(); -+ if (!theAd) { -+ dprintf(D_ALWAYS, "Trying to forward ad on, but ad is NULL\n"); - return; - } - -- if( theAd ) { -- if( ! theAd->put( *view_sock ) ) { -- dprintf( D_ALWAYS, "Can't forward classad to View Collector\n"); -+ for (vector::iterator e(vc_list.begin()); e != vc_list.end(); ++e) { -+ Daemon* view_coll = e->collector; -+ Sock* view_sock = e->sock; -+ const char* view_name = e->name.c_str(); -+ -+ bool raw_command = false; -+ if (!view_sock->is_connected()) { -+ // We must have gotten disconnected. (Or this is the 1st time.) -+ // In case we keep getting disconnected or fail to connect, -+ // and each connection attempt takes a long time, restrict -+ // what fraction of our time we spend trying to reconnect. -+ if (view_sock_timeslice.isTimeToRun()) { -+ dprintf(D_ALWAYS,"Connecting to CONDOR_VIEW_HOST %s\n", view_name); -+ -+ view_sock_timeslice.setStartTimeNow(); -+ view_coll->connectSock(view_sock,20); -+ view_sock_timeslice.setFinishTimeNow(); -+ -+ if (!view_sock->is_connected()) { -+ dprintf(D_ALWAYS,"Failed to connect to CONDOR_VIEW_HOST %s so not forwarding ad.\n", view_name); -+ continue; -+ } -+ } else { -+ dprintf(D_FULLDEBUG,"Skipping forwarding of ad to CONDOR_VIEW_HOST %s, because reconnect is delayed for %us.\n", view_name, view_sock_timeslice.getTimeToNextRun()); -+ continue; -+ } -+ } else if (view_sock->type() == Stream::reli_sock) { -+ // we already did the security handshake the last time -+ // we sent a command on this socket, so just send a -+ // raw command this time to avoid reauthenticating -+ raw_command = true; -+ } -+ -+ if (! view_coll->startCommand(cmd, view_sock, 20, NULL, NULL, raw_command)) { -+ dprintf( D_ALWAYS, "Can't send command %d to View Collector %s\n", cmd, view_name); - view_sock->end_of_message(); -- view_sock->close(); -- return; -+ view_sock->close(); -+ continue; - } -- } - -- if( cmd == UPDATE_STARTD_AD ) { -- // Forward the startd private ad as well. This allows the -- // target collector to act as an aggregator for multiple collectors -- // that balance the load of authenticating connections from -- // the rest of the pool. -- -- AdNameHashKey hk; -- ClassAd *pvt_ad; -- -- ASSERT( makeStartdAdHashKey (hk, theAd, NULL) ); -- pvt_ad = collector.lookup(STARTD_PVT_AD,hk); -- if( pvt_ad ) { -- if( ! pvt_ad->put( *view_sock ) ) { -- dprintf( D_ALWAYS, "Can't forward startd private classad to View Collector\n"); -- view_sock->end_of_message(); -- view_sock->close(); -- return; -- } -- } -- } -+ if (theAd) { -+ if (!theAd->put(*view_sock)) { -+ dprintf( D_ALWAYS, "Can't forward classad to View Collector %s\n", view_name); -+ view_sock->end_of_message(); -+ view_sock->close(); -+ continue; -+ } -+ } - -- if( ! view_sock->end_of_message() ) { -- dprintf( D_ALWAYS, "Can't send end_of_message to View Collector\n"); -- view_sock->close(); -- return; -+ if (cmd == UPDATE_STARTD_AD) { -+ // Forward the startd private ad as well. This allows the -+ // target collector to act as an aggregator for multiple collectors -+ // that balance the load of authenticating connections from -+ // the rest of the pool. -+ AdNameHashKey hk; -+ ClassAd *pvt_ad; -+ ASSERT( makeStartdAdHashKey (hk, theAd, NULL) ); -+ pvt_ad = collector.lookup(STARTD_PVT_AD,hk); -+ if (pvt_ad) { -+ if (!pvt_ad->put(*view_sock)) { -+ dprintf( D_ALWAYS, "Can't forward startd private classad to View Collector %s\n", view_name); -+ view_sock->end_of_message(); -+ view_sock->close(); -+ continue; -+ } -+ } -+ } -+ -+ if (!view_sock->end_of_message()) { -+ dprintf(D_ALWAYS, "Can't send end_of_message to View Collector %s\n", view_name); -+ view_sock->close(); -+ continue; -+ } - } -- return; - } - - // Collector stats on universes -diff --git a/src/condor_collector.V6/collector.h b/src/condor_collector.V6/collector.h -index 3c56d68..9aad465 100644 ---- a/src/condor_collector.V6/collector.h -+++ b/src/condor_collector.V6/collector.h -@@ -20,6 +20,8 @@ - #ifndef _COLLECTOR_DAEMON_H_ - #define _COLLECTOR_DAEMON_H_ - -+#include -+ - #include "condor_classad.h" - #include "condor_commands.h" - #include "totals.h" -@@ -121,18 +123,23 @@ public: - static void sendCollectorAd(); - - static void forward_classad_to_view_collector(int cmd, const char *filterAttr, ClassAd *ad); -- static void send_classad_to_sock( int cmd, Daemon * d, ClassAd* theAd); -+ static void send_classad_to_sock(int cmd, ClassAd* theAd); - - // A get method to support SOAP - static CollectorEngine & getCollector( void ) { return collector; }; - --protected: -+ // data pertaining to each view collector entry -+ struct vc_entry { -+ std::string name; -+ Daemon* collector; -+ Sock* sock; -+ }; - -+protected: - static CollectorStats collectorStats; - static CollectorEngine collector; -- static Daemon* View_Collector; -- static Sock* view_sock; - static Timeslice view_sock_timeslice; -+ static std::vector vc_list; - - static int ClientTimeout; - static int QueryTimeout; -diff --git a/src/condor_collector.V6/collector_engine.cpp b/src/condor_collector.V6/collector_engine.cpp -index 02e288c..896b379 100644 ---- a/src/condor_collector.V6/collector_engine.cpp -+++ b/src/condor_collector.V6/collector_engine.cpp -@@ -24,7 +24,6 @@ extern "C" void event_mgr (void); - //------------------------------------------------------------- - - #include "condor_classad.h" --#include "condor_parser.h" - #include "condor_debug.h" - #include "condor_config.h" - #include "condor_network.h" -diff --git a/src/condor_contrib/aviary/CMakeLists.txt b/src/condor_contrib/aviary/CMakeLists.txt -new file mode 100644 -index 0000000..71baf72 ---- /dev/null -+++ b/src/condor_contrib/aviary/CMakeLists.txt -@@ -0,0 +1,28 @@ -+ ############################################################### -+ # -+ # Copyright (C) 2009-2011, Red Hat, Inc. -+ # -+ # Licensed under the Apache License, Version 2.0 (the "License"); you -+ # may not use this file except in compliance with the License. You may -+ # obtain a copy of the License at -+ # -+ # http://www.apache.org/licenses/LICENSE-2.0 -+ # -+ # Unless required by applicable law or agreed to in writing, software -+ # distributed under the License is distributed on an "AS IS" BASIS, -+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ # See the License for the specific language governing permissions and -+ # limitations under the License. -+ # -+ ############################################################### -+ -+if (LINUX) -+ option(WITH_AVIARY "Support for aviary SOAP plugins" ON) -+endif() -+ -+if ( WITH_AVIARY AND HAVE_EXT_WSO2 ) -+ -+ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/include ${WSO2_INCLUDES}) -+ add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/src ) -+ -+endif() -\ No newline at end of file -diff --git a/src/condor_contrib/aviary/README b/src/condor_contrib/aviary/README -new file mode 100644 -index 0000000..400943b ---- /dev/null -+++ b/src/condor_contrib/aviary/README -@@ -0,0 +1,2 @@ -+Aviary - Simplified RPC Interface for Condor -+-------------------------------------------- -diff --git a/src/condor_contrib/aviary/author.txt b/src/condor_contrib/aviary/author.txt -new file mode 100644 -index 0000000..7b62f15 ---- /dev/null -+++ b/src/condor_contrib/aviary/author.txt -@@ -0,0 +1,3 @@ -+author: Peter MacKinnon -+organization: Red Hat Inc. -+e-mail: pmackinn@redhat.com -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ArchType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ArchType.cpp -new file mode 100644 -index 0000000..fd8176c ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ArchType.cpp -@@ -0,0 +1,354 @@ -+ -+ -+ /** -+ * ArchType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_ArchType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the ArchType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::ArchType::ArchType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_ArchType; -+ -+ isValidArchType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ArchType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::ArchType::ArchType(std::string arg_ArchType) -+ { -+ -+ qname = NULL; -+ -+ property_ArchType; -+ -+ isValidArchType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ArchType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_ArchType = arg_ArchType; -+ -+ } -+ AviaryCommon::ArchType::~ArchType() -+ { -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ ArchType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setArchType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::ArchType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element ArchType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::ArchType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::ArchType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::ArchType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_ArchType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_ArchType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::ArchType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ArchType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ArchType::getProperty1() -+ { -+ return getArchType(); -+ } -+ -+ /** -+ * getter for ArchType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ArchType::getArchType() -+ { -+ return property_ArchType; -+ } -+ -+ /** -+ * setter for ArchType -+ */ -+ bool WSF_CALL -+ AviaryCommon::ArchType::setArchType( -+ const std::string arg_ArchType) -+ { -+ -+ -+ if(isValidArchType && -+ arg_ArchType == property_ArchType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_ArchType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ArchType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetArchType(); -+ -+ -+ property_ArchType = std::string(arg_ArchType.c_str()); -+ isValidArchType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for ArchType. -+ */ -+ ADBArchTypeEnum WSF_CALL -+ AviaryCommon::ArchType::getArchTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_ArchType.c_str(), "INTEL") == 0) -+ return ArchType_INTEL; -+ -+ if (axutil_strcmp(property_ArchType.c_str(), "X86_64") == 0) -+ return ArchType_X86_64; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBArchTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for ArchType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::ArchType::setArchTypeEnum(const ADBArchTypeEnum arg_ArchType) -+ { -+ -+ -+ -+ resetArchType(); -+ -+ -+ switch (arg_ArchType) -+ { -+ -+ case ArchType_INTEL : -+ property_ArchType = ("INTEL"); -+ break; -+ -+ case ArchType_X86_64 : -+ property_ArchType = ("X86_64"); -+ break; -+ -+ -+ default: -+ isValidArchType = false; -+ property_ArchType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting ArchType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_ArchType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidArchType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for ArchType -+ */ -+ bool WSF_CALL -+ AviaryCommon::ArchType::resetArchType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidArchType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ArchType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ArchType::isArchTypeNil() -+ { -+ return !isValidArchType; -+ } -+ -+ /** -+ * Set ArchType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ArchType::setArchTypeNil() -+ { -+ return resetArchType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Attribute.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Attribute.cpp -new file mode 100644 -index 0000000..17298ef ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Attribute.cpp -@@ -0,0 +1,1022 @@ -+ -+ -+ /** -+ * Attribute.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_Attribute.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = Attribute -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::Attribute::Attribute() -+ { -+ -+ -+ property_Name; -+ -+ isValidName = false; -+ -+ property_Type = NULL; -+ -+ isValidType = false; -+ -+ property_Value; -+ -+ isValidValue = false; -+ -+ } -+ -+ AviaryCommon::Attribute::Attribute(std::string arg_Name,AviaryCommon::AttributeType* arg_Type,std::string arg_Value) -+ { -+ -+ property_Name; -+ -+ isValidName = true; -+ -+ property_Type = NULL; -+ -+ isValidType = true; -+ -+ property_Value; -+ -+ isValidValue = true; -+ -+ property_Name = arg_Name; -+ -+ property_Type = arg_Type; -+ -+ property_Value = arg_Value; -+ -+ } -+ AviaryCommon::Attribute::~Attribute() -+ { -+ if (property_Type) delete property_Type; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::Attribute::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building name element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "name", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("name", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("name", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setName(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element name"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setName(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for name "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element name missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building type element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "type", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("type", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("type", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::AttributeType* element = new AviaryCommon::AttributeType(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element type"); -+ } -+ else -+ { -+ status = setType(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for type "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element type missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building value element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "value", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("value", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("value", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setValue(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element value"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setValue(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for value "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element value missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::Attribute::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::Attribute::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::Attribute::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t *text_value_1; -+ axis2_char_t *text_value_1_temp; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_3; -+ axis2_char_t *text_value_3_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidName) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property name"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("name"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("name"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing name element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sname>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_1 = (axis2_char_t*)property_Name.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_1_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_1, true); -+ if (text_value_1_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_1_temp, axutil_strlen(text_value_1_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_1_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_1, axutil_strlen(text_value_1)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidType) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property type"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("type"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("type"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing type element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%stype", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Type->serialize(current_node, parent_element, -+ property_Type->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidValue) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property value"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("value"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("value"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing value element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%svalue>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_3 = (axis2_char_t*)property_Value.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_3_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_3, true); -+ if (text_value_3_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3_temp, axutil_strlen(text_value_3_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_3_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for name by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::Attribute::getProperty1() -+ { -+ return getName(); -+ } -+ -+ /** -+ * getter for name. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::Attribute::getName() -+ { -+ return property_Name; -+ } -+ -+ /** -+ * setter for name -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::setName( -+ const std::string arg_Name) -+ { -+ -+ -+ if(isValidName && -+ arg_Name == property_Name) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Name.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"name is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetName(); -+ -+ -+ property_Name = std::string(arg_Name.c_str()); -+ isValidName = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for name -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::resetName() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidName = false; -+ return true; -+ } -+ -+ /** -+ * Check whether name is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::isNameNil() -+ { -+ return !isValidName; -+ } -+ -+ /** -+ * Set name to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::setNameNil() -+ { -+ return resetName(); -+ } -+ -+ -+ -+ /** -+ * Getter for type by Property Number 2 -+ */ -+ AviaryCommon::AttributeType* WSF_CALL -+ AviaryCommon::Attribute::getProperty2() -+ { -+ return getType(); -+ } -+ -+ /** -+ * getter for type. -+ */ -+ AviaryCommon::AttributeType* WSF_CALL -+ AviaryCommon::Attribute::getType() -+ { -+ return property_Type; -+ } -+ -+ /** -+ * setter for type -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::setType( -+ AviaryCommon::AttributeType* arg_Type) -+ { -+ -+ -+ if(isValidType && -+ arg_Type == property_Type) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Type) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"type is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetType(); -+ -+ -+ if(NULL == arg_Type) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Type = arg_Type; -+ isValidType = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for type -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::resetType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Type != NULL) -+ { -+ -+ -+ delete property_Type; -+ -+ -+ } -+ -+ -+ -+ -+ isValidType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether type is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::isTypeNil() -+ { -+ return !isValidType; -+ } -+ -+ /** -+ * Set type to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::setTypeNil() -+ { -+ return resetType(); -+ } -+ -+ -+ -+ /** -+ * Getter for value by Property Number 3 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::Attribute::getProperty3() -+ { -+ return getValue(); -+ } -+ -+ /** -+ * getter for value. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::Attribute::getValue() -+ { -+ return property_Value; -+ } -+ -+ /** -+ * setter for value -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::setValue( -+ const std::string arg_Value) -+ { -+ -+ -+ if(isValidValue && -+ arg_Value == property_Value) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Value.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"value is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetValue(); -+ -+ -+ property_Value = std::string(arg_Value.c_str()); -+ isValidValue = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for value -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::resetValue() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidValue = false; -+ return true; -+ } -+ -+ /** -+ * Check whether value is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::isValueNil() -+ { -+ return !isValidValue; -+ } -+ -+ /** -+ * Set value to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attribute::setValueNil() -+ { -+ return resetValue(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_AttributeType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_AttributeType.cpp -new file mode 100644 -index 0000000..c0b36d0 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_AttributeType.cpp -@@ -0,0 +1,389 @@ -+ -+ -+ /** -+ * AttributeType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_AttributeType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the AttributeType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::AttributeType::AttributeType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_AttributeType; -+ -+ isValidAttributeType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "AttributeType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::AttributeType::AttributeType(std::string arg_AttributeType) -+ { -+ -+ qname = NULL; -+ -+ property_AttributeType; -+ -+ isValidAttributeType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "AttributeType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_AttributeType = arg_AttributeType; -+ -+ } -+ AviaryCommon::AttributeType::~AttributeType() -+ { -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ AttributeType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setAttributeType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::AttributeType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element AttributeType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::AttributeType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::AttributeType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::AttributeType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_AttributeType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_AttributeType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::AttributeType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for AttributeType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::AttributeType::getProperty1() -+ { -+ return getAttributeType(); -+ } -+ -+ /** -+ * getter for AttributeType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::AttributeType::getAttributeType() -+ { -+ return property_AttributeType; -+ } -+ -+ /** -+ * setter for AttributeType -+ */ -+ bool WSF_CALL -+ AviaryCommon::AttributeType::setAttributeType( -+ const std::string arg_AttributeType) -+ { -+ -+ -+ if(isValidAttributeType && -+ arg_AttributeType == property_AttributeType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_AttributeType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"AttributeType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetAttributeType(); -+ -+ -+ property_AttributeType = std::string(arg_AttributeType.c_str()); -+ isValidAttributeType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for AttributeType. -+ */ -+ ADBAttributeTypeEnum WSF_CALL -+ AviaryCommon::AttributeType::getAttributeTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_AttributeType.c_str(), "INTEGER") == 0) -+ return AttributeType_INTEGER; -+ -+ if (axutil_strcmp(property_AttributeType.c_str(), "FLOAT") == 0) -+ return AttributeType_FLOAT; -+ -+ if (axutil_strcmp(property_AttributeType.c_str(), "STRING") == 0) -+ return AttributeType_STRING; -+ -+ if (axutil_strcmp(property_AttributeType.c_str(), "EXPRESSION") == 0) -+ return AttributeType_EXPRESSION; -+ -+ if (axutil_strcmp(property_AttributeType.c_str(), "BOOLEAN") == 0) -+ return AttributeType_BOOLEAN; -+ -+ if (axutil_strcmp(property_AttributeType.c_str(), "UNDEFINED") == 0) -+ return AttributeType_UNDEFINED; -+ -+ if (axutil_strcmp(property_AttributeType.c_str(), "ERROR") == 0) -+ return AttributeType_ERROR; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBAttributeTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for AttributeType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::AttributeType::setAttributeTypeEnum(const ADBAttributeTypeEnum arg_AttributeType) -+ { -+ -+ -+ -+ resetAttributeType(); -+ -+ -+ switch (arg_AttributeType) -+ { -+ -+ case AttributeType_INTEGER : -+ property_AttributeType = ("INTEGER"); -+ break; -+ -+ case AttributeType_FLOAT : -+ property_AttributeType = ("FLOAT"); -+ break; -+ -+ case AttributeType_STRING : -+ property_AttributeType = ("STRING"); -+ break; -+ -+ case AttributeType_EXPRESSION : -+ property_AttributeType = ("EXPRESSION"); -+ break; -+ -+ case AttributeType_BOOLEAN : -+ property_AttributeType = ("BOOLEAN"); -+ break; -+ -+ case AttributeType_UNDEFINED : -+ property_AttributeType = ("UNDEFINED"); -+ break; -+ -+ case AttributeType_ERROR : -+ property_AttributeType = ("ERROR"); -+ break; -+ -+ -+ default: -+ isValidAttributeType = false; -+ property_AttributeType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting AttributeType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_AttributeType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidAttributeType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for AttributeType -+ */ -+ bool WSF_CALL -+ AviaryCommon::AttributeType::resetAttributeType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidAttributeType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether AttributeType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::AttributeType::isAttributeTypeNil() -+ { -+ return !isValidAttributeType; -+ } -+ -+ /** -+ * Set AttributeType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::AttributeType::setAttributeTypeNil() -+ { -+ return resetAttributeType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Attributes.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Attributes.cpp -new file mode 100644 -index 0000000..35ab792 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Attributes.cpp -@@ -0,0 +1,738 @@ -+ -+ -+ /** -+ * Attributes.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_Attributes.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = Attributes -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::Attributes::Attributes() -+ { -+ -+ -+ property_Attrs = NULL; -+ -+ isValidAttrs = false; -+ -+ } -+ -+ AviaryCommon::Attributes::Attributes(std::vector* arg_Attrs) -+ { -+ -+ property_Attrs = NULL; -+ -+ isValidAttrs = true; -+ -+ property_Attrs = arg_Attrs; -+ -+ } -+ AviaryCommon::Attributes::~Attributes() -+ { -+ if (property_Attrs) { -+ while(!property_Attrs->empty()) delete property_Attrs->back(), property_Attrs->pop_back(); -+ delete property_Attrs; -+ } -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::Attributes::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ { -+ /* -+ * building Attrs array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building attrs element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "attrs", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("attrs", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::Attribute* element = new AviaryCommon::Attribute(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element attrs "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for attrs "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"attrs (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setAttrs(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::Attributes::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::Attributes::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::Attributes::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidAttrs) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("attrs"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("attrs"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Attrs array -+ */ -+ if (property_Attrs != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sattrs", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Attrs->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::Attribute* element = (*property_Attrs)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing attrs element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for attrs by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryCommon::Attributes::getProperty1() -+ { -+ return getAttrs(); -+ } -+ -+ /** -+ * getter for attrs. -+ */ -+ std::vector* WSF_CALL -+ AviaryCommon::Attributes::getAttrs() -+ { -+ return property_Attrs; -+ } -+ -+ /** -+ * setter for attrs -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::setAttrs( -+ std::vector* arg_Attrs) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidAttrs && -+ arg_Attrs == property_Attrs) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Attrs->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"attrs has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Attrs)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetAttrs(); -+ -+ -+ if(NULL == arg_Attrs) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Attrs = arg_Attrs; -+ if(non_nil_exists) -+ { -+ isValidAttrs = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of attrs. -+ */ -+ AviaryCommon::Attribute* WSF_CALL -+ AviaryCommon::Attributes::getAttrsAt(int i) -+ { -+ AviaryCommon::Attribute* ret_val; -+ if(property_Attrs == NULL) -+ { -+ return (AviaryCommon::Attribute*)0; -+ } -+ ret_val = (*property_Attrs)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of attrs. -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::setAttrsAt(int i, -+ AviaryCommon::Attribute* arg_Attrs) -+ { -+ AviaryCommon::Attribute* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidAttrs && -+ property_Attrs && -+ -+ arg_Attrs == (*property_Attrs)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Attrs == NULL) -+ { -+ property_Attrs = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Attrs)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidAttrs = true; -+ (*property_Attrs)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Attrs)[i] = arg_Attrs; -+ -+ -+ isValidAttrs = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to attrs. -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::addAttrs( -+ AviaryCommon::Attribute* arg_Attrs) -+ { -+ -+ -+ if( NULL == arg_Attrs -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Attrs == NULL) -+ { -+ property_Attrs = new std::vector(); -+ } -+ -+ property_Attrs->push_back(arg_Attrs); -+ -+ isValidAttrs = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the attrs array. -+ */ -+ int WSF_CALL -+ AviaryCommon::Attributes::sizeofAttrs() -+ { -+ -+ if(property_Attrs == NULL) -+ { -+ return 0; -+ } -+ return property_Attrs->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::removeAttrsAt(int i) -+ { -+ return setAttrsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for attrs -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::resetAttrs() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Attrs != NULL) -+ { -+ std::vector::iterator it = property_Attrs->begin(); -+ for( ; it < property_Attrs->end() ; ++it) -+ { -+ AviaryCommon::Attribute* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Attrs) -+ delete property_Attrs; -+ -+ isValidAttrs = false; -+ return true; -+ } -+ -+ /** -+ * Check whether attrs is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::isAttrsNil() -+ { -+ return !isValidAttrs; -+ } -+ -+ /** -+ * Set attrs to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::setAttrsNil() -+ { -+ return resetAttrs(); -+ } -+ -+ -+ /** -+ * Check whether attrs is nill at i -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::isAttrsNilAt(int i) -+ { -+ return (isValidAttrs == false || -+ NULL == property_Attrs || -+ NULL == (*property_Attrs)[i]); -+ } -+ -+ /** -+ * Set attrs to nil at i -+ */ -+ bool WSF_CALL -+ AviaryCommon::Attributes::setAttrsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Attrs == NULL || -+ isValidAttrs == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Attrs->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Attrs)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of attrs is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Attrs == NULL) -+ { -+ isValidAttrs = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::Attribute* element = (*property_Attrs)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidAttrs = false; -+ (*property_Attrs)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Attrs)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobConstraint.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobConstraint.cpp -new file mode 100644 -index 0000000..890ec68 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobConstraint.cpp -@@ -0,0 +1,717 @@ -+ -+ -+ /** -+ * JobConstraint.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobConstraint.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = JobConstraint -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::JobConstraint::JobConstraint() -+ { -+ -+ -+ property_Type = NULL; -+ -+ isValidType = false; -+ -+ property_Value; -+ -+ isValidValue = false; -+ -+ } -+ -+ AviaryCommon::JobConstraint::JobConstraint(AviaryCommon::JobConstraintType* arg_Type,std::string arg_Value) -+ { -+ -+ property_Type = NULL; -+ -+ isValidType = true; -+ -+ property_Value; -+ -+ isValidValue = true; -+ -+ property_Type = arg_Type; -+ -+ property_Value = arg_Value; -+ -+ } -+ AviaryCommon::JobConstraint::~JobConstraint() -+ { -+ if (property_Type) delete property_Type; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building type element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "type", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("type", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("type", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobConstraintType* element = new AviaryCommon::JobConstraintType(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element type"); -+ } -+ else -+ { -+ status = setType(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for type "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element type missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building value element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "value", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("value", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("value", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setValue(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element value"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setValue(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for value "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element value missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobConstraint::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobConstraint::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_2; -+ axis2_char_t *text_value_2_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidType) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property type"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("type"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("type"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing type element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%stype", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Type->serialize(current_node, parent_element, -+ property_Type->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidValue) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property value"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("value"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("value"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing value element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%svalue>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_2 = (axis2_char_t*)property_Value.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_2_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_2, true); -+ if (text_value_2_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2_temp, axutil_strlen(text_value_2_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_2_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for type by Property Number 1 -+ */ -+ AviaryCommon::JobConstraintType* WSF_CALL -+ AviaryCommon::JobConstraint::getProperty1() -+ { -+ return getType(); -+ } -+ -+ /** -+ * getter for type. -+ */ -+ AviaryCommon::JobConstraintType* WSF_CALL -+ AviaryCommon::JobConstraint::getType() -+ { -+ return property_Type; -+ } -+ -+ /** -+ * setter for type -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::setType( -+ AviaryCommon::JobConstraintType* arg_Type) -+ { -+ -+ -+ if(isValidType && -+ arg_Type == property_Type) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Type) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"type is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetType(); -+ -+ -+ if(NULL == arg_Type) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Type = arg_Type; -+ isValidType = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for type -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::resetType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Type != NULL) -+ { -+ -+ -+ delete property_Type; -+ -+ -+ } -+ -+ -+ -+ -+ isValidType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether type is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::isTypeNil() -+ { -+ return !isValidType; -+ } -+ -+ /** -+ * Set type to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::setTypeNil() -+ { -+ return resetType(); -+ } -+ -+ -+ -+ /** -+ * Getter for value by Property Number 2 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobConstraint::getProperty2() -+ { -+ return getValue(); -+ } -+ -+ /** -+ * getter for value. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobConstraint::getValue() -+ { -+ return property_Value; -+ } -+ -+ /** -+ * setter for value -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::setValue( -+ const std::string arg_Value) -+ { -+ -+ -+ if(isValidValue && -+ arg_Value == property_Value) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Value.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"value is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetValue(); -+ -+ -+ property_Value = std::string(arg_Value.c_str()); -+ isValidValue = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for value -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::resetValue() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidValue = false; -+ return true; -+ } -+ -+ /** -+ * Check whether value is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::isValueNil() -+ { -+ return !isValidValue; -+ } -+ -+ /** -+ * Set value to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraint::setValueNil() -+ { -+ return resetValue(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobConstraintType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobConstraintType.cpp -new file mode 100644 -index 0000000..35584e7 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobConstraintType.cpp -@@ -0,0 +1,361 @@ -+ -+ -+ /** -+ * JobConstraintType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobConstraintType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the JobConstraintType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::JobConstraintType::JobConstraintType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_JobConstraintType; -+ -+ isValidJobConstraintType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "JobConstraintType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::JobConstraintType::JobConstraintType(std::string arg_JobConstraintType) -+ { -+ -+ qname = NULL; -+ -+ property_JobConstraintType; -+ -+ isValidJobConstraintType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "JobConstraintType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_JobConstraintType = arg_JobConstraintType; -+ -+ } -+ AviaryCommon::JobConstraintType::~JobConstraintType() -+ { -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ JobConstraintType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setJobConstraintType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobConstraintType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element JobConstraintType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobConstraintType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobConstraintType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::JobConstraintType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_JobConstraintType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_JobConstraintType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobConstraintType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for JobConstraintType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobConstraintType::getProperty1() -+ { -+ return getJobConstraintType(); -+ } -+ -+ /** -+ * getter for JobConstraintType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobConstraintType::getJobConstraintType() -+ { -+ return property_JobConstraintType; -+ } -+ -+ /** -+ * setter for JobConstraintType -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraintType::setJobConstraintType( -+ const std::string arg_JobConstraintType) -+ { -+ -+ -+ if(isValidJobConstraintType && -+ arg_JobConstraintType == property_JobConstraintType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_JobConstraintType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"JobConstraintType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetJobConstraintType(); -+ -+ -+ property_JobConstraintType = std::string(arg_JobConstraintType.c_str()); -+ isValidJobConstraintType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for JobConstraintType. -+ */ -+ ADBJobConstraintTypeEnum WSF_CALL -+ AviaryCommon::JobConstraintType::getJobConstraintTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_JobConstraintType.c_str(), "CMD") == 0) -+ return JobConstraintType_CMD; -+ -+ if (axutil_strcmp(property_JobConstraintType.c_str(), "ARGS") == 0) -+ return JobConstraintType_ARGS; -+ -+ if (axutil_strcmp(property_JobConstraintType.c_str(), "OWNER") == 0) -+ return JobConstraintType_OWNER; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBJobConstraintTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for JobConstraintType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraintType::setJobConstraintTypeEnum(const ADBJobConstraintTypeEnum arg_JobConstraintType) -+ { -+ -+ -+ -+ resetJobConstraintType(); -+ -+ -+ switch (arg_JobConstraintType) -+ { -+ -+ case JobConstraintType_CMD : -+ property_JobConstraintType = ("CMD"); -+ break; -+ -+ case JobConstraintType_ARGS : -+ property_JobConstraintType = ("ARGS"); -+ break; -+ -+ case JobConstraintType_OWNER : -+ property_JobConstraintType = ("OWNER"); -+ break; -+ -+ -+ default: -+ isValidJobConstraintType = false; -+ property_JobConstraintType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting JobConstraintType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_JobConstraintType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidJobConstraintType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for JobConstraintType -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraintType::resetJobConstraintType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidJobConstraintType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether JobConstraintType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraintType::isJobConstraintTypeNil() -+ { -+ return !isValidJobConstraintType; -+ } -+ -+ /** -+ * Set JobConstraintType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobConstraintType::setJobConstraintTypeNil() -+ { -+ return resetJobConstraintType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobData.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobData.cpp -new file mode 100644 -index 0000000..89912cd ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobData.cpp -@@ -0,0 +1,680 @@ -+ -+ -+ /** -+ * JobData.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobData.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = JobData -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::JobData::JobData() -+ { -+ -+ -+ property_Id = NULL; -+ -+ isValidId = false; -+ -+ property_Type = NULL; -+ -+ isValidType = false; -+ -+ } -+ -+ AviaryCommon::JobData::JobData(AviaryCommon::JobID* arg_Id,AviaryCommon::JobDataType* arg_Type) -+ { -+ -+ property_Id = NULL; -+ -+ isValidId = true; -+ -+ property_Type = NULL; -+ -+ isValidType = true; -+ -+ property_Id = arg_Id; -+ -+ property_Type = arg_Type; -+ -+ } -+ AviaryCommon::JobData::~JobData() -+ { -+ if (property_Id) delete property_Id; -+ if (property_Type) delete property_Type; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobData::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building id element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "id", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element id"); -+ } -+ else -+ { -+ status = setId(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for id "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element id missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building type element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "type", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("type", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("type", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobDataType* element = new AviaryCommon::JobDataType(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element type"); -+ } -+ else -+ { -+ status = setType(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for type "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element type missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobData::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobData::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobData::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidId) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property id"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("id"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("id"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing id element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sid", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Id->serialize(current_node, parent_element, -+ property_Id->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidType) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property type"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("type"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("type"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing type element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%stype", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Type->serialize(current_node, parent_element, -+ property_Type->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for id by Property Number 1 -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryCommon::JobData::getProperty1() -+ { -+ return getId(); -+ } -+ -+ /** -+ * getter for id. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryCommon::JobData::getId() -+ { -+ return property_Id; -+ } -+ -+ /** -+ * setter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobData::setId( -+ AviaryCommon::JobID* arg_Id) -+ { -+ -+ -+ if(isValidId && -+ arg_Id == property_Id) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"id is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetId(); -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Id = arg_Id; -+ isValidId = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobData::resetId() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Id != NULL) -+ { -+ -+ -+ delete property_Id; -+ -+ -+ } -+ -+ -+ -+ -+ isValidId = false; -+ return true; -+ } -+ -+ /** -+ * Check whether id is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobData::isIdNil() -+ { -+ return !isValidId; -+ } -+ -+ /** -+ * Set id to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobData::setIdNil() -+ { -+ return resetId(); -+ } -+ -+ -+ -+ /** -+ * Getter for type by Property Number 2 -+ */ -+ AviaryCommon::JobDataType* WSF_CALL -+ AviaryCommon::JobData::getProperty2() -+ { -+ return getType(); -+ } -+ -+ /** -+ * getter for type. -+ */ -+ AviaryCommon::JobDataType* WSF_CALL -+ AviaryCommon::JobData::getType() -+ { -+ return property_Type; -+ } -+ -+ /** -+ * setter for type -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobData::setType( -+ AviaryCommon::JobDataType* arg_Type) -+ { -+ -+ -+ if(isValidType && -+ arg_Type == property_Type) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Type) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"type is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetType(); -+ -+ -+ if(NULL == arg_Type) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Type = arg_Type; -+ isValidType = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for type -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobData::resetType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Type != NULL) -+ { -+ -+ -+ delete property_Type; -+ -+ -+ } -+ -+ -+ -+ -+ isValidType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether type is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobData::isTypeNil() -+ { -+ return !isValidType; -+ } -+ -+ /** -+ * Set type to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobData::setTypeNil() -+ { -+ return resetType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobDataType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobDataType.cpp -new file mode 100644 -index 0000000..ef63f82 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobDataType.cpp -@@ -0,0 +1,361 @@ -+ -+ -+ /** -+ * JobDataType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobDataType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the JobDataType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::JobDataType::JobDataType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_JobDataType; -+ -+ isValidJobDataType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "JobDataType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::JobDataType::JobDataType(std::string arg_JobDataType) -+ { -+ -+ qname = NULL; -+ -+ property_JobDataType; -+ -+ isValidJobDataType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "JobDataType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_JobDataType = arg_JobDataType; -+ -+ } -+ AviaryCommon::JobDataType::~JobDataType() -+ { -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ JobDataType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setJobDataType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobDataType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element JobDataType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobDataType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobDataType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::JobDataType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_JobDataType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_JobDataType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobDataType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for JobDataType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobDataType::getProperty1() -+ { -+ return getJobDataType(); -+ } -+ -+ /** -+ * getter for JobDataType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobDataType::getJobDataType() -+ { -+ return property_JobDataType; -+ } -+ -+ /** -+ * setter for JobDataType -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDataType::setJobDataType( -+ const std::string arg_JobDataType) -+ { -+ -+ -+ if(isValidJobDataType && -+ arg_JobDataType == property_JobDataType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_JobDataType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"JobDataType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetJobDataType(); -+ -+ -+ property_JobDataType = std::string(arg_JobDataType.c_str()); -+ isValidJobDataType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for JobDataType. -+ */ -+ ADBJobDataTypeEnum WSF_CALL -+ AviaryCommon::JobDataType::getJobDataTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_JobDataType.c_str(), "ERR") == 0) -+ return JobDataType_ERR; -+ -+ if (axutil_strcmp(property_JobDataType.c_str(), "LOG") == 0) -+ return JobDataType_LOG; -+ -+ if (axutil_strcmp(property_JobDataType.c_str(), "OUT") == 0) -+ return JobDataType_OUT; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBJobDataTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for JobDataType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDataType::setJobDataTypeEnum(const ADBJobDataTypeEnum arg_JobDataType) -+ { -+ -+ -+ -+ resetJobDataType(); -+ -+ -+ switch (arg_JobDataType) -+ { -+ -+ case JobDataType_ERR : -+ property_JobDataType = ("ERR"); -+ break; -+ -+ case JobDataType_LOG : -+ property_JobDataType = ("LOG"); -+ break; -+ -+ case JobDataType_OUT : -+ property_JobDataType = ("OUT"); -+ break; -+ -+ -+ default: -+ isValidJobDataType = false; -+ property_JobDataType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting JobDataType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_JobDataType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidJobDataType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for JobDataType -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDataType::resetJobDataType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidJobDataType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether JobDataType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDataType::isJobDataTypeNil() -+ { -+ return !isValidJobDataType; -+ } -+ -+ /** -+ * Set JobDataType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDataType::setJobDataTypeNil() -+ { -+ return resetJobDataType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobDetails.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobDetails.cpp -new file mode 100644 -index 0000000..c1ca804 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobDetails.cpp -@@ -0,0 +1,929 @@ -+ -+ -+ /** -+ * JobDetails.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobDetails.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = JobDetails -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::JobDetails::JobDetails() -+ { -+ -+ -+ property_Id = NULL; -+ -+ isValidId = false; -+ -+ property_Status = NULL; -+ -+ isValidStatus = false; -+ -+ property_Details = NULL; -+ -+ isValidDetails = false; -+ -+ } -+ -+ AviaryCommon::JobDetails::JobDetails(AviaryCommon::JobID* arg_Id,AviaryCommon::Status* arg_Status,AviaryCommon::Attributes* arg_Details) -+ { -+ -+ property_Id = NULL; -+ -+ isValidId = true; -+ -+ property_Status = NULL; -+ -+ isValidStatus = true; -+ -+ property_Details = NULL; -+ -+ isValidDetails = true; -+ -+ property_Id = arg_Id; -+ -+ property_Status = arg_Status; -+ -+ property_Details = arg_Details; -+ -+ } -+ AviaryCommon::JobDetails::~JobDetails() -+ { -+ if (property_Id) delete property_Id; -+ if (property_Status) delete property_Status; -+ if (property_Details) delete property_Details; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building id element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "id", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element id"); -+ } -+ else -+ { -+ status = setId(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for id "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element id missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building status element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Status* element = new AviaryCommon::Status(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element status"); -+ } -+ else -+ { -+ status = setStatus(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element status missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building details element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "details", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("details", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("details", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Attributes* element = new AviaryCommon::Attributes(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element details"); -+ } -+ else -+ { -+ status = setDetails(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for details "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobDetails::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobDetails::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_3[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidId) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property id"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("id"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("id"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing id element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sid", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Id->serialize(current_node, parent_element, -+ property_Id->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidStatus) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property status"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sstatus", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Status->serialize(current_node, parent_element, -+ property_Status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidDetails) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("details"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("details"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing details element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sdetails", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Details->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Details->serialize(current_node, parent_element, -+ property_Details->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Details->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for id by Property Number 1 -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryCommon::JobDetails::getProperty1() -+ { -+ return getId(); -+ } -+ -+ /** -+ * getter for id. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryCommon::JobDetails::getId() -+ { -+ return property_Id; -+ } -+ -+ /** -+ * setter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::setId( -+ AviaryCommon::JobID* arg_Id) -+ { -+ -+ -+ if(isValidId && -+ arg_Id == property_Id) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"id is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetId(); -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Id = arg_Id; -+ isValidId = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::resetId() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Id != NULL) -+ { -+ -+ -+ delete property_Id; -+ -+ -+ } -+ -+ -+ -+ -+ isValidId = false; -+ return true; -+ } -+ -+ /** -+ * Check whether id is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::isIdNil() -+ { -+ return !isValidId; -+ } -+ -+ /** -+ * Set id to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::setIdNil() -+ { -+ return resetId(); -+ } -+ -+ -+ -+ /** -+ * Getter for status by Property Number 2 -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryCommon::JobDetails::getProperty2() -+ { -+ return getStatus(); -+ } -+ -+ /** -+ * getter for status. -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryCommon::JobDetails::getStatus() -+ { -+ return property_Status; -+ } -+ -+ /** -+ * setter for status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::setStatus( -+ AviaryCommon::Status* arg_Status) -+ { -+ -+ -+ if(isValidStatus && -+ arg_Status == property_Status) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"status is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetStatus(); -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Status = arg_Status; -+ isValidStatus = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::resetStatus() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Status != NULL) -+ { -+ -+ -+ delete property_Status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidStatus = false; -+ return true; -+ } -+ -+ /** -+ * Check whether status is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::isStatusNil() -+ { -+ return !isValidStatus; -+ } -+ -+ /** -+ * Set status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::setStatusNil() -+ { -+ return resetStatus(); -+ } -+ -+ -+ -+ /** -+ * Getter for details by Property Number 3 -+ */ -+ AviaryCommon::Attributes* WSF_CALL -+ AviaryCommon::JobDetails::getProperty3() -+ { -+ return getDetails(); -+ } -+ -+ /** -+ * getter for details. -+ */ -+ AviaryCommon::Attributes* WSF_CALL -+ AviaryCommon::JobDetails::getDetails() -+ { -+ return property_Details; -+ } -+ -+ /** -+ * setter for details -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::setDetails( -+ AviaryCommon::Attributes* arg_Details) -+ { -+ -+ -+ if(isValidDetails && -+ arg_Details == property_Details) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetDetails(); -+ -+ -+ if(NULL == arg_Details) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Details = arg_Details; -+ isValidDetails = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for details -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::resetDetails() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Details != NULL) -+ { -+ -+ -+ delete property_Details; -+ -+ -+ } -+ -+ -+ -+ -+ isValidDetails = false; -+ return true; -+ } -+ -+ /** -+ * Check whether details is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::isDetailsNil() -+ { -+ return !isValidDetails; -+ } -+ -+ /** -+ * Set details to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobDetails::setDetailsNil() -+ { -+ return resetDetails(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobID.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobID.cpp -new file mode 100644 -index 0000000..ae21485 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobID.cpp -@@ -0,0 +1,1270 @@ -+ -+ -+ /** -+ * JobID.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobID.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = JobID -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::JobID::JobID() -+ { -+ -+ -+ property_Job; -+ -+ isValidJob = false; -+ -+ property_Pool; -+ -+ isValidPool = false; -+ -+ property_Scheduler; -+ -+ isValidScheduler = false; -+ -+ property_Submission = NULL; -+ -+ isValidSubmission = false; -+ -+ } -+ -+ AviaryCommon::JobID::JobID(std::string arg_Job,std::string arg_Pool,std::string arg_Scheduler,AviaryCommon::SubmissionID* arg_Submission) -+ { -+ -+ property_Job; -+ -+ isValidJob = true; -+ -+ property_Pool; -+ -+ isValidPool = true; -+ -+ property_Scheduler; -+ -+ isValidScheduler = true; -+ -+ property_Submission = NULL; -+ -+ isValidSubmission = true; -+ -+ property_Job = arg_Job; -+ -+ property_Pool = arg_Pool; -+ -+ property_Scheduler = arg_Scheduler; -+ -+ property_Submission = arg_Submission; -+ -+ } -+ AviaryCommon::JobID::~JobID() -+ { -+ if (property_Submission) delete property_Submission; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobID::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building job element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "job", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("job", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("job", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setJob(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element job"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setJob(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for job "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element job missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building pool element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "pool", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("pool", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("pool", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setPool(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element pool"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setPool(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for pool "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building scheduler element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "scheduler", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("scheduler", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("scheduler", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setScheduler(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element scheduler"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setScheduler(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for scheduler "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building submission element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "submission", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("submission", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("submission", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::SubmissionID* element = new AviaryCommon::SubmissionID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element submission"); -+ } -+ else -+ { -+ status = setSubmission(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for submission "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobID::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobID::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobID::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t *text_value_1; -+ axis2_char_t *text_value_1_temp; -+ -+ axis2_char_t *text_value_2; -+ axis2_char_t *text_value_2_temp; -+ -+ axis2_char_t *text_value_3; -+ axis2_char_t *text_value_3_temp; -+ -+ axis2_char_t text_value_4[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidJob) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property job"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("job"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("job"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing job element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sjob>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_1 = (axis2_char_t*)property_Job.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_1_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_1, true); -+ if (text_value_1_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_1_temp, axutil_strlen(text_value_1_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_1_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_1, axutil_strlen(text_value_1)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidPool) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("pool"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("pool"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing pool element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%spool>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_2 = (axis2_char_t*)property_Pool.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_2_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_2, true); -+ if (text_value_2_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2_temp, axutil_strlen(text_value_2_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_2_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidScheduler) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("scheduler"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("scheduler"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing scheduler element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sscheduler>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_3 = (axis2_char_t*)property_Scheduler.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_3_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_3, true); -+ if (text_value_3_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3_temp, axutil_strlen(text_value_3_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_3_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidSubmission) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("submission"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("submission"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing submission element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%ssubmission", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Submission->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Submission->serialize(current_node, parent_element, -+ property_Submission->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Submission->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for job by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobID::getProperty1() -+ { -+ return getJob(); -+ } -+ -+ /** -+ * getter for job. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobID::getJob() -+ { -+ return property_Job; -+ } -+ -+ /** -+ * setter for job -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::setJob( -+ const std::string arg_Job) -+ { -+ -+ -+ if(isValidJob && -+ arg_Job == property_Job) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Job.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"job is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetJob(); -+ -+ -+ property_Job = std::string(arg_Job.c_str()); -+ isValidJob = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for job -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::resetJob() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidJob = false; -+ return true; -+ } -+ -+ /** -+ * Check whether job is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::isJobNil() -+ { -+ return !isValidJob; -+ } -+ -+ /** -+ * Set job to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::setJobNil() -+ { -+ return resetJob(); -+ } -+ -+ -+ -+ /** -+ * Getter for pool by Property Number 2 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobID::getProperty2() -+ { -+ return getPool(); -+ } -+ -+ /** -+ * getter for pool. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobID::getPool() -+ { -+ return property_Pool; -+ } -+ -+ /** -+ * setter for pool -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::setPool( -+ const std::string arg_Pool) -+ { -+ -+ -+ if(isValidPool && -+ arg_Pool == property_Pool) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetPool(); -+ -+ -+ property_Pool = std::string(arg_Pool.c_str()); -+ isValidPool = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for pool -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::resetPool() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidPool = false; -+ return true; -+ } -+ -+ /** -+ * Check whether pool is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::isPoolNil() -+ { -+ return !isValidPool; -+ } -+ -+ /** -+ * Set pool to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::setPoolNil() -+ { -+ return resetPool(); -+ } -+ -+ -+ -+ /** -+ * Getter for scheduler by Property Number 3 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobID::getProperty3() -+ { -+ return getScheduler(); -+ } -+ -+ /** -+ * getter for scheduler. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobID::getScheduler() -+ { -+ return property_Scheduler; -+ } -+ -+ /** -+ * setter for scheduler -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::setScheduler( -+ const std::string arg_Scheduler) -+ { -+ -+ -+ if(isValidScheduler && -+ arg_Scheduler == property_Scheduler) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetScheduler(); -+ -+ -+ property_Scheduler = std::string(arg_Scheduler.c_str()); -+ isValidScheduler = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for scheduler -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::resetScheduler() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidScheduler = false; -+ return true; -+ } -+ -+ /** -+ * Check whether scheduler is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::isSchedulerNil() -+ { -+ return !isValidScheduler; -+ } -+ -+ /** -+ * Set scheduler to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::setSchedulerNil() -+ { -+ return resetScheduler(); -+ } -+ -+ -+ -+ /** -+ * Getter for submission by Property Number 4 -+ */ -+ AviaryCommon::SubmissionID* WSF_CALL -+ AviaryCommon::JobID::getProperty4() -+ { -+ return getSubmission(); -+ } -+ -+ /** -+ * getter for submission. -+ */ -+ AviaryCommon::SubmissionID* WSF_CALL -+ AviaryCommon::JobID::getSubmission() -+ { -+ return property_Submission; -+ } -+ -+ /** -+ * setter for submission -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::setSubmission( -+ AviaryCommon::SubmissionID* arg_Submission) -+ { -+ -+ -+ if(isValidSubmission && -+ arg_Submission == property_Submission) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetSubmission(); -+ -+ -+ if(NULL == arg_Submission) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Submission = arg_Submission; -+ isValidSubmission = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for submission -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::resetSubmission() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Submission != NULL) -+ { -+ -+ -+ delete property_Submission; -+ -+ -+ } -+ -+ -+ -+ -+ isValidSubmission = false; -+ return true; -+ } -+ -+ /** -+ * Check whether submission is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::isSubmissionNil() -+ { -+ return !isValidSubmission; -+ } -+ -+ /** -+ * Set submission to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobID::setSubmissionNil() -+ { -+ return resetSubmission(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobStatus.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobStatus.cpp -new file mode 100644 -index 0000000..df7def8 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobStatus.cpp -@@ -0,0 +1,929 @@ -+ -+ -+ /** -+ * JobStatus.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobStatus.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = JobStatus -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::JobStatus::JobStatus() -+ { -+ -+ -+ property_Id = NULL; -+ -+ isValidId = false; -+ -+ property_Status = NULL; -+ -+ isValidStatus = false; -+ -+ property_Job_status = NULL; -+ -+ isValidJob_status = false; -+ -+ } -+ -+ AviaryCommon::JobStatus::JobStatus(AviaryCommon::JobID* arg_Id,AviaryCommon::Status* arg_Status,AviaryCommon::JobStatusType* arg_Job_status) -+ { -+ -+ property_Id = NULL; -+ -+ isValidId = true; -+ -+ property_Status = NULL; -+ -+ isValidStatus = true; -+ -+ property_Job_status = NULL; -+ -+ isValidJob_status = true; -+ -+ property_Id = arg_Id; -+ -+ property_Status = arg_Status; -+ -+ property_Job_status = arg_Job_status; -+ -+ } -+ AviaryCommon::JobStatus::~JobStatus() -+ { -+ if (property_Id) delete property_Id; -+ if (property_Status) delete property_Status; -+ if (property_Job_status) delete property_Job_status; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building id element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "id", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element id"); -+ } -+ else -+ { -+ status = setId(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for id "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element id missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building status element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Status* element = new AviaryCommon::Status(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element status"); -+ } -+ else -+ { -+ status = setStatus(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element status missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building job_status element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "job_status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("job_status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("job_status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobStatusType* element = new AviaryCommon::JobStatusType(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element job_status"); -+ } -+ else -+ { -+ status = setJob_status(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for job_status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobStatus::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobStatus::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_3[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidId) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property id"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("id"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("id"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing id element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sid", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Id->serialize(current_node, parent_element, -+ property_Id->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidStatus) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property status"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sstatus", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Status->serialize(current_node, parent_element, -+ property_Status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidJob_status) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("job_status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("job_status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing job_status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sjob_status", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Job_status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Job_status->serialize(current_node, parent_element, -+ property_Job_status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Job_status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for id by Property Number 1 -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryCommon::JobStatus::getProperty1() -+ { -+ return getId(); -+ } -+ -+ /** -+ * getter for id. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryCommon::JobStatus::getId() -+ { -+ return property_Id; -+ } -+ -+ /** -+ * setter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::setId( -+ AviaryCommon::JobID* arg_Id) -+ { -+ -+ -+ if(isValidId && -+ arg_Id == property_Id) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"id is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetId(); -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Id = arg_Id; -+ isValidId = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::resetId() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Id != NULL) -+ { -+ -+ -+ delete property_Id; -+ -+ -+ } -+ -+ -+ -+ -+ isValidId = false; -+ return true; -+ } -+ -+ /** -+ * Check whether id is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::isIdNil() -+ { -+ return !isValidId; -+ } -+ -+ /** -+ * Set id to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::setIdNil() -+ { -+ return resetId(); -+ } -+ -+ -+ -+ /** -+ * Getter for status by Property Number 2 -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryCommon::JobStatus::getProperty2() -+ { -+ return getStatus(); -+ } -+ -+ /** -+ * getter for status. -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryCommon::JobStatus::getStatus() -+ { -+ return property_Status; -+ } -+ -+ /** -+ * setter for status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::setStatus( -+ AviaryCommon::Status* arg_Status) -+ { -+ -+ -+ if(isValidStatus && -+ arg_Status == property_Status) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"status is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetStatus(); -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Status = arg_Status; -+ isValidStatus = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::resetStatus() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Status != NULL) -+ { -+ -+ -+ delete property_Status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidStatus = false; -+ return true; -+ } -+ -+ /** -+ * Check whether status is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::isStatusNil() -+ { -+ return !isValidStatus; -+ } -+ -+ /** -+ * Set status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::setStatusNil() -+ { -+ return resetStatus(); -+ } -+ -+ -+ -+ /** -+ * Getter for job_status by Property Number 3 -+ */ -+ AviaryCommon::JobStatusType* WSF_CALL -+ AviaryCommon::JobStatus::getProperty3() -+ { -+ return getJob_status(); -+ } -+ -+ /** -+ * getter for job_status. -+ */ -+ AviaryCommon::JobStatusType* WSF_CALL -+ AviaryCommon::JobStatus::getJob_status() -+ { -+ return property_Job_status; -+ } -+ -+ /** -+ * setter for job_status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::setJob_status( -+ AviaryCommon::JobStatusType* arg_Job_status) -+ { -+ -+ -+ if(isValidJob_status && -+ arg_Job_status == property_Job_status) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetJob_status(); -+ -+ -+ if(NULL == arg_Job_status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Job_status = arg_Job_status; -+ isValidJob_status = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for job_status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::resetJob_status() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Job_status != NULL) -+ { -+ -+ -+ delete property_Job_status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidJob_status = false; -+ return true; -+ } -+ -+ /** -+ * Check whether job_status is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::isJob_statusNil() -+ { -+ return !isValidJob_status; -+ } -+ -+ /** -+ * Set job_status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatus::setJob_statusNil() -+ { -+ return resetJob_status(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobStatusType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobStatusType.cpp -new file mode 100644 -index 0000000..99e0832 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobStatusType.cpp -@@ -0,0 +1,375 @@ -+ -+ -+ /** -+ * JobStatusType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobStatusType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the JobStatusType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::JobStatusType::JobStatusType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_JobStatusType; -+ -+ isValidJobStatusType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "JobStatusType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::JobStatusType::JobStatusType(std::string arg_JobStatusType) -+ { -+ -+ qname = NULL; -+ -+ property_JobStatusType; -+ -+ isValidJobStatusType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "JobStatusType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_JobStatusType = arg_JobStatusType; -+ -+ } -+ AviaryCommon::JobStatusType::~JobStatusType() -+ { -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ JobStatusType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setJobStatusType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobStatusType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element JobStatusType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobStatusType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobStatusType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::JobStatusType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_JobStatusType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_JobStatusType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobStatusType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for JobStatusType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobStatusType::getProperty1() -+ { -+ return getJobStatusType(); -+ } -+ -+ /** -+ * getter for JobStatusType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobStatusType::getJobStatusType() -+ { -+ return property_JobStatusType; -+ } -+ -+ /** -+ * setter for JobStatusType -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatusType::setJobStatusType( -+ const std::string arg_JobStatusType) -+ { -+ -+ -+ if(isValidJobStatusType && -+ arg_JobStatusType == property_JobStatusType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_JobStatusType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"JobStatusType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetJobStatusType(); -+ -+ -+ property_JobStatusType = std::string(arg_JobStatusType.c_str()); -+ isValidJobStatusType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for JobStatusType. -+ */ -+ ADBJobStatusTypeEnum WSF_CALL -+ AviaryCommon::JobStatusType::getJobStatusTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_JobStatusType.c_str(), "IDLE") == 0) -+ return JobStatusType_IDLE; -+ -+ if (axutil_strcmp(property_JobStatusType.c_str(), "RUNNING") == 0) -+ return JobStatusType_RUNNING; -+ -+ if (axutil_strcmp(property_JobStatusType.c_str(), "REMOVED") == 0) -+ return JobStatusType_REMOVED; -+ -+ if (axutil_strcmp(property_JobStatusType.c_str(), "COMPLETED") == 0) -+ return JobStatusType_COMPLETED; -+ -+ if (axutil_strcmp(property_JobStatusType.c_str(), "HELD") == 0) -+ return JobStatusType_HELD; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBJobStatusTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for JobStatusType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatusType::setJobStatusTypeEnum(const ADBJobStatusTypeEnum arg_JobStatusType) -+ { -+ -+ -+ -+ resetJobStatusType(); -+ -+ -+ switch (arg_JobStatusType) -+ { -+ -+ case JobStatusType_IDLE : -+ property_JobStatusType = ("IDLE"); -+ break; -+ -+ case JobStatusType_RUNNING : -+ property_JobStatusType = ("RUNNING"); -+ break; -+ -+ case JobStatusType_REMOVED : -+ property_JobStatusType = ("REMOVED"); -+ break; -+ -+ case JobStatusType_COMPLETED : -+ property_JobStatusType = ("COMPLETED"); -+ break; -+ -+ case JobStatusType_HELD : -+ property_JobStatusType = ("HELD"); -+ break; -+ -+ -+ default: -+ isValidJobStatusType = false; -+ property_JobStatusType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting JobStatusType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_JobStatusType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidJobStatusType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for JobStatusType -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatusType::resetJobStatusType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidJobStatusType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether JobStatusType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatusType::isJobStatusTypeNil() -+ { -+ return !isValidJobStatusType; -+ } -+ -+ /** -+ * Set JobStatusType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobStatusType::setJobStatusTypeNil() -+ { -+ return resetJobStatusType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobSummary.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobSummary.cpp -new file mode 100644 -index 0000000..75ac107 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_JobSummary.cpp -@@ -0,0 +1,3247 @@ -+ -+ -+ /** -+ * JobSummary.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_JobSummary.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = JobSummary -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::JobSummary::JobSummary() -+ { -+ -+ -+ property_Id = NULL; -+ -+ isValidId = false; -+ -+ property_Status = NULL; -+ -+ isValidStatus = false; -+ -+ property_Queued = NULL; -+ -+ isValidQueued = false; -+ -+ property_Last_update = NULL; -+ -+ isValidLast_update = false; -+ -+ property_Job_status = NULL; -+ -+ isValidJob_status = false; -+ -+ property_Cmd; -+ -+ isValidCmd = false; -+ -+ property_Args1; -+ -+ isValidArgs1 = false; -+ -+ property_Args2; -+ -+ isValidArgs2 = false; -+ -+ property_Held; -+ -+ isValidHeld = false; -+ -+ property_Released; -+ -+ isValidReleased = false; -+ -+ property_Removed; -+ -+ isValidRemoved = false; -+ -+ } -+ -+ AviaryCommon::JobSummary::JobSummary(AviaryCommon::JobID* arg_Id,AviaryCommon::Status* arg_Status,axutil_date_time_t* arg_Queued,axutil_date_time_t* arg_Last_update,AviaryCommon::JobStatusType* arg_Job_status,std::string arg_Cmd,std::string arg_Args1,std::string arg_Args2,std::string arg_Held,std::string arg_Released,std::string arg_Removed) -+ { -+ -+ property_Id = NULL; -+ -+ isValidId = true; -+ -+ property_Status = NULL; -+ -+ isValidStatus = true; -+ -+ property_Queued = NULL; -+ -+ isValidQueued = true; -+ -+ property_Last_update = NULL; -+ -+ isValidLast_update = true; -+ -+ property_Job_status = NULL; -+ -+ isValidJob_status = true; -+ -+ property_Cmd; -+ -+ isValidCmd = true; -+ -+ property_Args1; -+ -+ isValidArgs1 = true; -+ -+ property_Args2; -+ -+ isValidArgs2 = true; -+ -+ property_Held; -+ -+ isValidHeld = true; -+ -+ property_Released; -+ -+ isValidReleased = true; -+ -+ property_Removed; -+ -+ isValidRemoved = true; -+ -+ property_Id = arg_Id; -+ -+ property_Status = arg_Status; -+ -+ property_Queued = arg_Queued; -+ -+ property_Last_update = arg_Last_update; -+ -+ property_Job_status = arg_Job_status; -+ -+ property_Cmd = arg_Cmd; -+ -+ property_Args1 = arg_Args1; -+ -+ property_Args2 = arg_Args2; -+ -+ property_Held = arg_Held; -+ -+ property_Released = arg_Released; -+ -+ property_Removed = arg_Removed; -+ -+ } -+ AviaryCommon::JobSummary::~JobSummary() -+ { -+ if (property_Id) delete property_Id; -+ if (property_Status) delete property_Status; -+ if (property_Job_status) delete property_Job_status; -+ axutil_date_time_free(property_Queued,Environment::getEnv()); -+ axutil_date_time_free(property_Last_update,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building id element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "id", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element id"); -+ } -+ else -+ { -+ status = setId(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for id "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element id missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building status element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Status* element = new AviaryCommon::Status(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element status"); -+ } -+ else -+ { -+ status = setStatus(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element status missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building queued element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "queued", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("queued", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("queued", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ axutil_date_time_t* element = axutil_date_time_create(Environment::getEnv()); -+ status = axutil_date_time_deserialize_date_time((axutil_date_time_t*)element, Environment::getEnv(), -+ text_value); -+ if(AXIS2_FAILURE == status) -+ { -+ if(element != NULL) -+ { -+ axutil_date_time_free(element, Environment::getEnv()); -+ } -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI ,"failed in building element queued "); -+ } -+ else -+ { -+ status = setQueued(element); -+ } -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "NULL value is set to a non nillable element queued"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for queued "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element queued missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building last_update element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "last_update", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("last_update", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("last_update", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ axutil_date_time_t* element = axutil_date_time_create(Environment::getEnv()); -+ status = axutil_date_time_deserialize_date_time((axutil_date_time_t*)element, Environment::getEnv(), -+ text_value); -+ if(AXIS2_FAILURE == status) -+ { -+ if(element != NULL) -+ { -+ axutil_date_time_free(element, Environment::getEnv()); -+ } -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI ,"failed in building element last_update "); -+ } -+ else -+ { -+ status = setLast_update(element); -+ } -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "NULL value is set to a non nillable element last_update"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for last_update "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element last_update missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building job_status element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "job_status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("job_status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("job_status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobStatusType* element = new AviaryCommon::JobStatusType(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element job_status"); -+ } -+ else -+ { -+ status = setJob_status(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for job_status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element job_status missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building cmd element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "cmd", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("cmd", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("cmd", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setCmd(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element cmd"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setCmd(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for cmd "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element cmd missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building args1 element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "args1", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("args1", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("args1", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setArgs1(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element args1"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setArgs1(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for args1 "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building args2 element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "args2", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("args2", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("args2", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setArgs2(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element args2"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setArgs2(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for args2 "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building held element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "held", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("held", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("held", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setHeld(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element held"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setHeld(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for held "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building released element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "released", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("released", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("released", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setReleased(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element released"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setReleased(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for released "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building removed element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "removed", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("removed", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("removed", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setRemoved(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element removed"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setRemoved(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for removed "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::JobSummary::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::JobSummary::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_3; -+ axis2_char_t *text_value_3_temp; -+ -+ axis2_char_t *text_value_4; -+ axis2_char_t *text_value_4_temp; -+ -+ axis2_char_t text_value_5[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_6; -+ axis2_char_t *text_value_6_temp; -+ -+ axis2_char_t *text_value_7; -+ axis2_char_t *text_value_7_temp; -+ -+ axis2_char_t *text_value_8; -+ axis2_char_t *text_value_8_temp; -+ -+ axis2_char_t *text_value_9; -+ axis2_char_t *text_value_9_temp; -+ -+ axis2_char_t *text_value_10; -+ axis2_char_t *text_value_10_temp; -+ -+ axis2_char_t *text_value_11; -+ axis2_char_t *text_value_11_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidId) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property id"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("id"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("id"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing id element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sid", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Id->serialize(current_node, parent_element, -+ property_Id->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidStatus) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property status"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sstatus", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Status->serialize(current_node, parent_element, -+ property_Status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidQueued) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property queued"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("queued"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("queued"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing queued element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%squeued>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_3 = axutil_date_time_serialize_date_time(property_Queued, Environment::getEnv()); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,text_value_3); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidLast_update) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property last_update"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("last_update"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("last_update"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing last_update element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%slast_update>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_4 = axutil_date_time_serialize_date_time(property_Last_update, Environment::getEnv()); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_4, axutil_strlen(text_value_4)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,text_value_4); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidJob_status) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property job_status"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("job_status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("job_status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing job_status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sjob_status", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Job_status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Job_status->serialize(current_node, parent_element, -+ property_Job_status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Job_status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidCmd) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property cmd"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("cmd"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("cmd"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing cmd element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%scmd>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_6 = (axis2_char_t*)property_Cmd.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_6_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_6, true); -+ if (text_value_6_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_6_temp, axutil_strlen(text_value_6_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_6_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_6, axutil_strlen(text_value_6)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidArgs1) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("args1"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("args1"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing args1 element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sargs1>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_7 = (axis2_char_t*)property_Args1.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_7_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_7, true); -+ if (text_value_7_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_7_temp, axutil_strlen(text_value_7_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_7_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_7, axutil_strlen(text_value_7)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidArgs2) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("args2"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("args2"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing args2 element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sargs2>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_8 = (axis2_char_t*)property_Args2.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_8_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_8, true); -+ if (text_value_8_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_8_temp, axutil_strlen(text_value_8_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_8_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_8, axutil_strlen(text_value_8)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidHeld) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("held"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("held"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing held element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sheld>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_9 = (axis2_char_t*)property_Held.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_9_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_9, true); -+ if (text_value_9_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_9_temp, axutil_strlen(text_value_9_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_9_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_9, axutil_strlen(text_value_9)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidReleased) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("released"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("released"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing released element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sreleased>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_10 = (axis2_char_t*)property_Released.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_10_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_10, true); -+ if (text_value_10_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_10_temp, axutil_strlen(text_value_10_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_10_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_10, axutil_strlen(text_value_10)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidRemoved) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("removed"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("removed"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing removed element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sremoved>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_11 = (axis2_char_t*)property_Removed.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_11_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_11, true); -+ if (text_value_11_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_11_temp, axutil_strlen(text_value_11_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_11_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_11, axutil_strlen(text_value_11)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for id by Property Number 1 -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryCommon::JobSummary::getProperty1() -+ { -+ return getId(); -+ } -+ -+ /** -+ * getter for id. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryCommon::JobSummary::getId() -+ { -+ return property_Id; -+ } -+ -+ /** -+ * setter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setId( -+ AviaryCommon::JobID* arg_Id) -+ { -+ -+ -+ if(isValidId && -+ arg_Id == property_Id) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"id is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetId(); -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Id = arg_Id; -+ isValidId = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetId() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Id != NULL) -+ { -+ -+ -+ delete property_Id; -+ -+ -+ } -+ -+ -+ -+ -+ isValidId = false; -+ return true; -+ } -+ -+ /** -+ * Check whether id is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isIdNil() -+ { -+ return !isValidId; -+ } -+ -+ /** -+ * Set id to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setIdNil() -+ { -+ return resetId(); -+ } -+ -+ -+ -+ /** -+ * Getter for status by Property Number 2 -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryCommon::JobSummary::getProperty2() -+ { -+ return getStatus(); -+ } -+ -+ /** -+ * getter for status. -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryCommon::JobSummary::getStatus() -+ { -+ return property_Status; -+ } -+ -+ /** -+ * setter for status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setStatus( -+ AviaryCommon::Status* arg_Status) -+ { -+ -+ -+ if(isValidStatus && -+ arg_Status == property_Status) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"status is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetStatus(); -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Status = arg_Status; -+ isValidStatus = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetStatus() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Status != NULL) -+ { -+ -+ -+ delete property_Status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidStatus = false; -+ return true; -+ } -+ -+ /** -+ * Check whether status is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isStatusNil() -+ { -+ return !isValidStatus; -+ } -+ -+ /** -+ * Set status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setStatusNil() -+ { -+ return resetStatus(); -+ } -+ -+ -+ -+ /** -+ * Getter for queued by Property Number 3 -+ */ -+ axutil_date_time_t* WSF_CALL -+ AviaryCommon::JobSummary::getProperty3() -+ { -+ return getQueued(); -+ } -+ -+ /** -+ * getter for queued. -+ */ -+ axutil_date_time_t* WSF_CALL -+ AviaryCommon::JobSummary::getQueued() -+ { -+ return property_Queued; -+ } -+ -+ /** -+ * setter for queued -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setQueued( -+ axutil_date_time_t* arg_Queued) -+ { -+ -+ -+ if(isValidQueued && -+ arg_Queued == property_Queued) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Queued) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"queued is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetQueued(); -+ -+ -+ if(NULL == arg_Queued) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Queued = arg_Queued; -+ isValidQueued = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for queued -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetQueued() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Queued != NULL) -+ { -+ -+ -+ axutil_date_time_free(property_Queued, Environment::getEnv()); -+ property_Queued = NULL; -+ -+ -+ } -+ -+ -+ -+ -+ isValidQueued = false; -+ return true; -+ } -+ -+ /** -+ * Check whether queued is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isQueuedNil() -+ { -+ return !isValidQueued; -+ } -+ -+ /** -+ * Set queued to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setQueuedNil() -+ { -+ return resetQueued(); -+ } -+ -+ -+ -+ /** -+ * Getter for last_update by Property Number 4 -+ */ -+ axutil_date_time_t* WSF_CALL -+ AviaryCommon::JobSummary::getProperty4() -+ { -+ return getLast_update(); -+ } -+ -+ /** -+ * getter for last_update. -+ */ -+ axutil_date_time_t* WSF_CALL -+ AviaryCommon::JobSummary::getLast_update() -+ { -+ return property_Last_update; -+ } -+ -+ /** -+ * setter for last_update -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setLast_update( -+ axutil_date_time_t* arg_Last_update) -+ { -+ -+ -+ if(isValidLast_update && -+ arg_Last_update == property_Last_update) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Last_update) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"last_update is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetLast_update(); -+ -+ -+ if(NULL == arg_Last_update) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Last_update = arg_Last_update; -+ isValidLast_update = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for last_update -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetLast_update() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Last_update != NULL) -+ { -+ -+ -+ axutil_date_time_free(property_Last_update, Environment::getEnv()); -+ property_Last_update = NULL; -+ -+ -+ } -+ -+ -+ -+ -+ isValidLast_update = false; -+ return true; -+ } -+ -+ /** -+ * Check whether last_update is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isLast_updateNil() -+ { -+ return !isValidLast_update; -+ } -+ -+ /** -+ * Set last_update to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setLast_updateNil() -+ { -+ return resetLast_update(); -+ } -+ -+ -+ -+ /** -+ * Getter for job_status by Property Number 5 -+ */ -+ AviaryCommon::JobStatusType* WSF_CALL -+ AviaryCommon::JobSummary::getProperty5() -+ { -+ return getJob_status(); -+ } -+ -+ /** -+ * getter for job_status. -+ */ -+ AviaryCommon::JobStatusType* WSF_CALL -+ AviaryCommon::JobSummary::getJob_status() -+ { -+ return property_Job_status; -+ } -+ -+ /** -+ * setter for job_status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setJob_status( -+ AviaryCommon::JobStatusType* arg_Job_status) -+ { -+ -+ -+ if(isValidJob_status && -+ arg_Job_status == property_Job_status) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Job_status) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"job_status is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetJob_status(); -+ -+ -+ if(NULL == arg_Job_status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Job_status = arg_Job_status; -+ isValidJob_status = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for job_status -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetJob_status() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Job_status != NULL) -+ { -+ -+ -+ delete property_Job_status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidJob_status = false; -+ return true; -+ } -+ -+ /** -+ * Check whether job_status is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isJob_statusNil() -+ { -+ return !isValidJob_status; -+ } -+ -+ /** -+ * Set job_status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setJob_statusNil() -+ { -+ return resetJob_status(); -+ } -+ -+ -+ -+ /** -+ * Getter for cmd by Property Number 6 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getProperty6() -+ { -+ return getCmd(); -+ } -+ -+ /** -+ * getter for cmd. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getCmd() -+ { -+ return property_Cmd; -+ } -+ -+ /** -+ * setter for cmd -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setCmd( -+ const std::string arg_Cmd) -+ { -+ -+ -+ if(isValidCmd && -+ arg_Cmd == property_Cmd) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Cmd.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"cmd is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetCmd(); -+ -+ -+ property_Cmd = std::string(arg_Cmd.c_str()); -+ isValidCmd = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for cmd -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetCmd() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidCmd = false; -+ return true; -+ } -+ -+ /** -+ * Check whether cmd is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isCmdNil() -+ { -+ return !isValidCmd; -+ } -+ -+ /** -+ * Set cmd to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setCmdNil() -+ { -+ return resetCmd(); -+ } -+ -+ -+ -+ /** -+ * Getter for args1 by Property Number 7 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getProperty7() -+ { -+ return getArgs1(); -+ } -+ -+ /** -+ * getter for args1. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getArgs1() -+ { -+ return property_Args1; -+ } -+ -+ /** -+ * setter for args1 -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setArgs1( -+ const std::string arg_Args1) -+ { -+ -+ -+ if(isValidArgs1 && -+ arg_Args1 == property_Args1) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetArgs1(); -+ -+ -+ property_Args1 = std::string(arg_Args1.c_str()); -+ isValidArgs1 = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for args1 -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetArgs1() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidArgs1 = false; -+ return true; -+ } -+ -+ /** -+ * Check whether args1 is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isArgs1Nil() -+ { -+ return !isValidArgs1; -+ } -+ -+ /** -+ * Set args1 to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setArgs1Nil() -+ { -+ return resetArgs1(); -+ } -+ -+ -+ -+ /** -+ * Getter for args2 by Property Number 8 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getProperty8() -+ { -+ return getArgs2(); -+ } -+ -+ /** -+ * getter for args2. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getArgs2() -+ { -+ return property_Args2; -+ } -+ -+ /** -+ * setter for args2 -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setArgs2( -+ const std::string arg_Args2) -+ { -+ -+ -+ if(isValidArgs2 && -+ arg_Args2 == property_Args2) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetArgs2(); -+ -+ -+ property_Args2 = std::string(arg_Args2.c_str()); -+ isValidArgs2 = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for args2 -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetArgs2() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidArgs2 = false; -+ return true; -+ } -+ -+ /** -+ * Check whether args2 is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isArgs2Nil() -+ { -+ return !isValidArgs2; -+ } -+ -+ /** -+ * Set args2 to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setArgs2Nil() -+ { -+ return resetArgs2(); -+ } -+ -+ -+ -+ /** -+ * Getter for held by Property Number 9 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getProperty9() -+ { -+ return getHeld(); -+ } -+ -+ /** -+ * getter for held. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getHeld() -+ { -+ return property_Held; -+ } -+ -+ /** -+ * setter for held -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setHeld( -+ const std::string arg_Held) -+ { -+ -+ -+ if(isValidHeld && -+ arg_Held == property_Held) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetHeld(); -+ -+ -+ property_Held = std::string(arg_Held.c_str()); -+ isValidHeld = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for held -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetHeld() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidHeld = false; -+ return true; -+ } -+ -+ /** -+ * Check whether held is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isHeldNil() -+ { -+ return !isValidHeld; -+ } -+ -+ /** -+ * Set held to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setHeldNil() -+ { -+ return resetHeld(); -+ } -+ -+ -+ -+ /** -+ * Getter for released by Property Number 10 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getProperty10() -+ { -+ return getReleased(); -+ } -+ -+ /** -+ * getter for released. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getReleased() -+ { -+ return property_Released; -+ } -+ -+ /** -+ * setter for released -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setReleased( -+ const std::string arg_Released) -+ { -+ -+ -+ if(isValidReleased && -+ arg_Released == property_Released) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetReleased(); -+ -+ -+ property_Released = std::string(arg_Released.c_str()); -+ isValidReleased = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for released -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetReleased() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidReleased = false; -+ return true; -+ } -+ -+ /** -+ * Check whether released is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isReleasedNil() -+ { -+ return !isValidReleased; -+ } -+ -+ /** -+ * Set released to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setReleasedNil() -+ { -+ return resetReleased(); -+ } -+ -+ -+ -+ /** -+ * Getter for removed by Property Number 11 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getProperty11() -+ { -+ return getRemoved(); -+ } -+ -+ /** -+ * getter for removed. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::JobSummary::getRemoved() -+ { -+ return property_Removed; -+ } -+ -+ /** -+ * setter for removed -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setRemoved( -+ const std::string arg_Removed) -+ { -+ -+ -+ if(isValidRemoved && -+ arg_Removed == property_Removed) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetRemoved(); -+ -+ -+ property_Removed = std::string(arg_Removed.c_str()); -+ isValidRemoved = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for removed -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::resetRemoved() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidRemoved = false; -+ return true; -+ } -+ -+ /** -+ * Check whether removed is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::isRemovedNil() -+ { -+ return !isValidRemoved; -+ } -+ -+ /** -+ * Set removed to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::JobSummary::setRemovedNil() -+ { -+ return resetRemoved(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_OSType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_OSType.cpp -new file mode 100644 -index 0000000..8be66d4 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_OSType.cpp -@@ -0,0 +1,354 @@ -+ -+ -+ /** -+ * OSType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_OSType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the OSType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::OSType::OSType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_OSType; -+ -+ isValidOSType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "OSType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::OSType::OSType(std::string arg_OSType) -+ { -+ -+ qname = NULL; -+ -+ property_OSType; -+ -+ isValidOSType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "OSType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_OSType = arg_OSType; -+ -+ } -+ AviaryCommon::OSType::~OSType() -+ { -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ OSType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setOSType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::OSType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element OSType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::OSType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::OSType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::OSType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_OSType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_OSType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::OSType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for OSType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::OSType::getProperty1() -+ { -+ return getOSType(); -+ } -+ -+ /** -+ * getter for OSType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::OSType::getOSType() -+ { -+ return property_OSType; -+ } -+ -+ /** -+ * setter for OSType -+ */ -+ bool WSF_CALL -+ AviaryCommon::OSType::setOSType( -+ const std::string arg_OSType) -+ { -+ -+ -+ if(isValidOSType && -+ arg_OSType == property_OSType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_OSType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"OSType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetOSType(); -+ -+ -+ property_OSType = std::string(arg_OSType.c_str()); -+ isValidOSType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for OSType. -+ */ -+ ADBOSTypeEnum WSF_CALL -+ AviaryCommon::OSType::getOSTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_OSType.c_str(), "LINUX") == 0) -+ return OSType_LINUX; -+ -+ if (axutil_strcmp(property_OSType.c_str(), "WINDOWS") == 0) -+ return OSType_WINDOWS; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBOSTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for OSType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::OSType::setOSTypeEnum(const ADBOSTypeEnum arg_OSType) -+ { -+ -+ -+ -+ resetOSType(); -+ -+ -+ switch (arg_OSType) -+ { -+ -+ case OSType_LINUX : -+ property_OSType = ("LINUX"); -+ break; -+ -+ case OSType_WINDOWS : -+ property_OSType = ("WINDOWS"); -+ break; -+ -+ -+ default: -+ isValidOSType = false; -+ property_OSType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting OSType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_OSType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidOSType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for OSType -+ */ -+ bool WSF_CALL -+ AviaryCommon::OSType::resetOSType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidOSType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether OSType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::OSType::isOSTypeNil() -+ { -+ return !isValidOSType; -+ } -+ -+ /** -+ * Set OSType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::OSType::setOSTypeNil() -+ { -+ return resetOSType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceConstraint.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceConstraint.cpp -new file mode 100644 -index 0000000..c98aa05 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceConstraint.cpp -@@ -0,0 +1,717 @@ -+ -+ -+ /** -+ * ResourceConstraint.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_ResourceConstraint.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = ResourceConstraint -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::ResourceConstraint::ResourceConstraint() -+ { -+ -+ -+ property_Type = NULL; -+ -+ isValidType = false; -+ -+ property_Value; -+ -+ isValidValue = false; -+ -+ } -+ -+ AviaryCommon::ResourceConstraint::ResourceConstraint(AviaryCommon::ResourceConstraintType* arg_Type,std::string arg_Value) -+ { -+ -+ property_Type = NULL; -+ -+ isValidType = true; -+ -+ property_Value; -+ -+ isValidValue = true; -+ -+ property_Type = arg_Type; -+ -+ property_Value = arg_Value; -+ -+ } -+ AviaryCommon::ResourceConstraint::~ResourceConstraint() -+ { -+ if (property_Type) delete property_Type; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building type element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "type", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("type", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("type", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::ResourceConstraintType* element = new AviaryCommon::ResourceConstraintType(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element type"); -+ } -+ else -+ { -+ status = setType(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for type "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element type missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building value element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "value", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("value", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("value", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setValue(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element value"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setValue(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for value "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element value missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::ResourceConstraint::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::ResourceConstraint::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_2; -+ axis2_char_t *text_value_2_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidType) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property type"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("type"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("type"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing type element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%stype", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Type->serialize(current_node, parent_element, -+ property_Type->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidValue) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property value"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("value"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("value"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing value element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%svalue>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_2 = (axis2_char_t*)property_Value.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_2_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_2, true); -+ if (text_value_2_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2_temp, axutil_strlen(text_value_2_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_2_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for type by Property Number 1 -+ */ -+ AviaryCommon::ResourceConstraintType* WSF_CALL -+ AviaryCommon::ResourceConstraint::getProperty1() -+ { -+ return getType(); -+ } -+ -+ /** -+ * getter for type. -+ */ -+ AviaryCommon::ResourceConstraintType* WSF_CALL -+ AviaryCommon::ResourceConstraint::getType() -+ { -+ return property_Type; -+ } -+ -+ /** -+ * setter for type -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::setType( -+ AviaryCommon::ResourceConstraintType* arg_Type) -+ { -+ -+ -+ if(isValidType && -+ arg_Type == property_Type) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Type) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"type is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetType(); -+ -+ -+ if(NULL == arg_Type) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Type = arg_Type; -+ isValidType = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for type -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::resetType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Type != NULL) -+ { -+ -+ -+ delete property_Type; -+ -+ -+ } -+ -+ -+ -+ -+ isValidType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether type is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::isTypeNil() -+ { -+ return !isValidType; -+ } -+ -+ /** -+ * Set type to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::setTypeNil() -+ { -+ return resetType(); -+ } -+ -+ -+ -+ /** -+ * Getter for value by Property Number 2 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceConstraint::getProperty2() -+ { -+ return getValue(); -+ } -+ -+ /** -+ * getter for value. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceConstraint::getValue() -+ { -+ return property_Value; -+ } -+ -+ /** -+ * setter for value -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::setValue( -+ const std::string arg_Value) -+ { -+ -+ -+ if(isValidValue && -+ arg_Value == property_Value) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Value.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"value is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetValue(); -+ -+ -+ property_Value = std::string(arg_Value.c_str()); -+ isValidValue = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for value -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::resetValue() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidValue = false; -+ return true; -+ } -+ -+ /** -+ * Check whether value is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::isValueNil() -+ { -+ return !isValidValue; -+ } -+ -+ /** -+ * Set value to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraint::setValueNil() -+ { -+ return resetValue(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceConstraintType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceConstraintType.cpp -new file mode 100644 -index 0000000..d26600b ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceConstraintType.cpp -@@ -0,0 +1,375 @@ -+ -+ -+ /** -+ * ResourceConstraintType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_ResourceConstraintType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the ResourceConstraintType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::ResourceConstraintType::ResourceConstraintType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_ResourceConstraintType; -+ -+ isValidResourceConstraintType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ResourceConstraintType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::ResourceConstraintType::ResourceConstraintType(std::string arg_ResourceConstraintType) -+ { -+ -+ qname = NULL; -+ -+ property_ResourceConstraintType; -+ -+ isValidResourceConstraintType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ResourceConstraintType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_ResourceConstraintType = arg_ResourceConstraintType; -+ -+ } -+ AviaryCommon::ResourceConstraintType::~ResourceConstraintType() -+ { -+ axutil_qname_free (qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ ResourceConstraintType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setResourceConstraintType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraintType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element ResourceConstraintType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraintType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::ResourceConstraintType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::ResourceConstraintType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_ResourceConstraintType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_ResourceConstraintType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::ResourceConstraintType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ResourceConstraintType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceConstraintType::getProperty1() -+ { -+ return getResourceConstraintType(); -+ } -+ -+ /** -+ * getter for ResourceConstraintType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceConstraintType::getResourceConstraintType() -+ { -+ return property_ResourceConstraintType; -+ } -+ -+ /** -+ * setter for ResourceConstraintType -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraintType::setResourceConstraintType( -+ const std::string arg_ResourceConstraintType) -+ { -+ -+ -+ if(isValidResourceConstraintType && -+ arg_ResourceConstraintType == property_ResourceConstraintType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_ResourceConstraintType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ResourceConstraintType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetResourceConstraintType(); -+ -+ -+ property_ResourceConstraintType = std::string(arg_ResourceConstraintType.c_str()); -+ isValidResourceConstraintType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for ResourceConstraintType. -+ */ -+ ADBResourceConstraintTypeEnum WSF_CALL -+ AviaryCommon::ResourceConstraintType::getResourceConstraintTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_ResourceConstraintType.c_str(), "OS") == 0) -+ return ResourceConstraintType_OS; -+ -+ if (axutil_strcmp(property_ResourceConstraintType.c_str(), "ARCH") == 0) -+ return ResourceConstraintType_ARCH; -+ -+ if (axutil_strcmp(property_ResourceConstraintType.c_str(), "MEMORY") == 0) -+ return ResourceConstraintType_MEMORY; -+ -+ if (axutil_strcmp(property_ResourceConstraintType.c_str(), "DISK") == 0) -+ return ResourceConstraintType_DISK; -+ -+ if (axutil_strcmp(property_ResourceConstraintType.c_str(), "FILESYSTEM") == 0) -+ return ResourceConstraintType_FILESYSTEM; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBResourceConstraintTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for ResourceConstraintType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraintType::setResourceConstraintTypeEnum(const ADBResourceConstraintTypeEnum arg_ResourceConstraintType) -+ { -+ -+ -+ -+ resetResourceConstraintType(); -+ -+ -+ switch (arg_ResourceConstraintType) -+ { -+ -+ case ResourceConstraintType_OS : -+ property_ResourceConstraintType = ("OS"); -+ break; -+ -+ case ResourceConstraintType_ARCH : -+ property_ResourceConstraintType = ("ARCH"); -+ break; -+ -+ case ResourceConstraintType_MEMORY : -+ property_ResourceConstraintType = ("MEMORY"); -+ break; -+ -+ case ResourceConstraintType_DISK : -+ property_ResourceConstraintType = ("DISK"); -+ break; -+ -+ case ResourceConstraintType_FILESYSTEM : -+ property_ResourceConstraintType = ("FILESYSTEM"); -+ break; -+ -+ -+ default: -+ isValidResourceConstraintType = false; -+ property_ResourceConstraintType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting ResourceConstraintType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_ResourceConstraintType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidResourceConstraintType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for ResourceConstraintType -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraintType::resetResourceConstraintType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidResourceConstraintType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ResourceConstraintType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraintType::isResourceConstraintTypeNil() -+ { -+ return !isValidResourceConstraintType; -+ } -+ -+ /** -+ * Set ResourceConstraintType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceConstraintType::setResourceConstraintTypeNil() -+ { -+ return resetResourceConstraintType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceID.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceID.cpp -new file mode 100644 -index 0000000..580a5f3 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceID.cpp -@@ -0,0 +1,1308 @@ -+ -+ -+ /** -+ * ResourceID.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_ResourceID.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = ResourceID -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::ResourceID::ResourceID() -+ { -+ -+ -+ property_Subsystem_type = NULL; -+ -+ isValidSubsystem_type = false; -+ -+ property_Pool; -+ -+ isValidPool = false; -+ -+ property_Name; -+ -+ isValidName = false; -+ -+ property_Custom_name; -+ -+ isValidCustom_name = false; -+ -+ } -+ -+ AviaryCommon::ResourceID::ResourceID(AviaryCommon::ResourceType* arg_Subsystem_type,std::string arg_Pool,std::string arg_Name,std::string arg_Custom_name) -+ { -+ -+ property_Subsystem_type = NULL; -+ -+ isValidSubsystem_type = true; -+ -+ property_Pool; -+ -+ isValidPool = true; -+ -+ property_Name; -+ -+ isValidName = true; -+ -+ property_Custom_name; -+ -+ isValidCustom_name = true; -+ -+ property_Subsystem_type = arg_Subsystem_type; -+ -+ property_Pool = arg_Pool; -+ -+ property_Name = arg_Name; -+ -+ property_Custom_name = arg_Custom_name; -+ -+ } -+ AviaryCommon::ResourceID::~ResourceID() -+ { -+ if (property_Subsystem_type) delete property_Subsystem_type; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building subsystem_type element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "subsystem_type", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("subsystem_type", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("subsystem_type", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::ResourceType* element = new AviaryCommon::ResourceType(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element subsystem_type"); -+ } -+ else -+ { -+ status = setSubsystem_type(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for subsystem_type "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element subsystem_type missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building pool element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "pool", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("pool", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("pool", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setPool(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element pool"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setPool(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for pool "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element pool missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building name element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "name", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("name", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("name", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setName(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element name"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setName(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for name "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element name missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building custom_name element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "custom_name", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("custom_name", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("custom_name", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setCustom_name(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element custom_name"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setCustom_name(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for custom_name "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::ResourceID::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::ResourceID::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_2; -+ axis2_char_t *text_value_2_temp; -+ -+ axis2_char_t *text_value_3; -+ axis2_char_t *text_value_3_temp; -+ -+ axis2_char_t *text_value_4; -+ axis2_char_t *text_value_4_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidSubsystem_type) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property subsystem_type"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("subsystem_type"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("subsystem_type"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing subsystem_type element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%ssubsystem_type", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Subsystem_type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Subsystem_type->serialize(current_node, parent_element, -+ property_Subsystem_type->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Subsystem_type->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidPool) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property pool"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("pool"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("pool"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing pool element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%spool>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_2 = (axis2_char_t*)property_Pool.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_2_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_2, true); -+ if (text_value_2_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2_temp, axutil_strlen(text_value_2_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_2_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidName) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property name"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("name"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("name"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing name element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sname>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_3 = (axis2_char_t*)property_Name.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_3_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_3, true); -+ if (text_value_3_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3_temp, axutil_strlen(text_value_3_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_3_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidCustom_name) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("custom_name"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("custom_name"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing custom_name element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%scustom_name>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_4 = (axis2_char_t*)property_Custom_name.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_4_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_4, true); -+ if (text_value_4_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_4_temp, axutil_strlen(text_value_4_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_4_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_4, axutil_strlen(text_value_4)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for subsystem_type by Property Number 1 -+ */ -+ AviaryCommon::ResourceType* WSF_CALL -+ AviaryCommon::ResourceID::getProperty1() -+ { -+ return getSubsystem_type(); -+ } -+ -+ /** -+ * getter for subsystem_type. -+ */ -+ AviaryCommon::ResourceType* WSF_CALL -+ AviaryCommon::ResourceID::getSubsystem_type() -+ { -+ return property_Subsystem_type; -+ } -+ -+ /** -+ * setter for subsystem_type -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::setSubsystem_type( -+ AviaryCommon::ResourceType* arg_Subsystem_type) -+ { -+ -+ -+ if(isValidSubsystem_type && -+ arg_Subsystem_type == property_Subsystem_type) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Subsystem_type) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"subsystem_type is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetSubsystem_type(); -+ -+ -+ if(NULL == arg_Subsystem_type) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Subsystem_type = arg_Subsystem_type; -+ isValidSubsystem_type = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for subsystem_type -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::resetSubsystem_type() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Subsystem_type != NULL) -+ { -+ -+ -+ delete property_Subsystem_type; -+ -+ -+ } -+ -+ -+ -+ -+ isValidSubsystem_type = false; -+ return true; -+ } -+ -+ /** -+ * Check whether subsystem_type is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::isSubsystem_typeNil() -+ { -+ return !isValidSubsystem_type; -+ } -+ -+ /** -+ * Set subsystem_type to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::setSubsystem_typeNil() -+ { -+ return resetSubsystem_type(); -+ } -+ -+ -+ -+ /** -+ * Getter for pool by Property Number 2 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceID::getProperty2() -+ { -+ return getPool(); -+ } -+ -+ /** -+ * getter for pool. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceID::getPool() -+ { -+ return property_Pool; -+ } -+ -+ /** -+ * setter for pool -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::setPool( -+ const std::string arg_Pool) -+ { -+ -+ -+ if(isValidPool && -+ arg_Pool == property_Pool) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Pool.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"pool is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetPool(); -+ -+ -+ property_Pool = std::string(arg_Pool.c_str()); -+ isValidPool = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for pool -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::resetPool() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidPool = false; -+ return true; -+ } -+ -+ /** -+ * Check whether pool is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::isPoolNil() -+ { -+ return !isValidPool; -+ } -+ -+ /** -+ * Set pool to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::setPoolNil() -+ { -+ return resetPool(); -+ } -+ -+ -+ -+ /** -+ * Getter for name by Property Number 3 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceID::getProperty3() -+ { -+ return getName(); -+ } -+ -+ /** -+ * getter for name. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceID::getName() -+ { -+ return property_Name; -+ } -+ -+ /** -+ * setter for name -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::setName( -+ const std::string arg_Name) -+ { -+ -+ -+ if(isValidName && -+ arg_Name == property_Name) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Name.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"name is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetName(); -+ -+ -+ property_Name = std::string(arg_Name.c_str()); -+ isValidName = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for name -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::resetName() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidName = false; -+ return true; -+ } -+ -+ /** -+ * Check whether name is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::isNameNil() -+ { -+ return !isValidName; -+ } -+ -+ /** -+ * Set name to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::setNameNil() -+ { -+ return resetName(); -+ } -+ -+ -+ -+ /** -+ * Getter for custom_name by Property Number 4 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceID::getProperty4() -+ { -+ return getCustom_name(); -+ } -+ -+ /** -+ * getter for custom_name. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceID::getCustom_name() -+ { -+ return property_Custom_name; -+ } -+ -+ /** -+ * setter for custom_name -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::setCustom_name( -+ const std::string arg_Custom_name) -+ { -+ -+ -+ if(isValidCustom_name && -+ arg_Custom_name == property_Custom_name) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetCustom_name(); -+ -+ -+ property_Custom_name = std::string(arg_Custom_name.c_str()); -+ isValidCustom_name = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for custom_name -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::resetCustom_name() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidCustom_name = false; -+ return true; -+ } -+ -+ /** -+ * Check whether custom_name is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::isCustom_nameNil() -+ { -+ return !isValidCustom_name; -+ } -+ -+ /** -+ * Set custom_name to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceID::setCustom_nameNil() -+ { -+ return resetCustom_name(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceType.cpp -new file mode 100644 -index 0000000..70a7f21 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_ResourceType.cpp -@@ -0,0 +1,403 @@ -+ -+ -+ /** -+ * ResourceType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_ResourceType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the ResourceType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::ResourceType::ResourceType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_ResourceType; -+ -+ isValidResourceType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ResourceType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::ResourceType::ResourceType(std::string arg_ResourceType) -+ { -+ -+ qname = NULL; -+ -+ property_ResourceType; -+ -+ isValidResourceType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ResourceType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_ResourceType = arg_ResourceType; -+ -+ } -+ AviaryCommon::ResourceType::~ResourceType() -+ { -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ ResourceType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setResourceType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::ResourceType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element ResourceType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::ResourceType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::ResourceType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::ResourceType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_ResourceType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_ResourceType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::ResourceType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ResourceType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceType::getProperty1() -+ { -+ return getResourceType(); -+ } -+ -+ /** -+ * getter for ResourceType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::ResourceType::getResourceType() -+ { -+ return property_ResourceType; -+ } -+ -+ /** -+ * setter for ResourceType -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceType::setResourceType( -+ const std::string arg_ResourceType) -+ { -+ -+ -+ if(isValidResourceType && -+ arg_ResourceType == property_ResourceType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_ResourceType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ResourceType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetResourceType(); -+ -+ -+ property_ResourceType = std::string(arg_ResourceType.c_str()); -+ isValidResourceType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for ResourceType. -+ */ -+ ADBResourceTypeEnum WSF_CALL -+ AviaryCommon::ResourceType::getResourceTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "COLLECTOR") == 0) -+ return ResourceType_COLLECTOR; -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "EXECUTOR") == 0) -+ return ResourceType_EXECUTOR; -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "EVENT_SERVER") == 0) -+ return ResourceType_EVENT_SERVER; -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "JOB_SERVER") == 0) -+ return ResourceType_JOB_SERVER; -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "LOW_LATENCY") == 0) -+ return ResourceType_LOW_LATENCY; -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "MASTER") == 0) -+ return ResourceType_MASTER; -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "NEGOTIATOR") == 0) -+ return ResourceType_NEGOTIATOR; -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "SCHEDULER") == 0) -+ return ResourceType_SCHEDULER; -+ -+ if (axutil_strcmp(property_ResourceType.c_str(), "CUSTOM") == 0) -+ return ResourceType_CUSTOM; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBResourceTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for ResourceType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceType::setResourceTypeEnum(const ADBResourceTypeEnum arg_ResourceType) -+ { -+ -+ -+ -+ resetResourceType(); -+ -+ -+ switch (arg_ResourceType) -+ { -+ -+ case ResourceType_COLLECTOR : -+ property_ResourceType = ("COLLECTOR"); -+ break; -+ -+ case ResourceType_EXECUTOR : -+ property_ResourceType = ("EXECUTOR"); -+ break; -+ -+ case ResourceType_EVENT_SERVER : -+ property_ResourceType = ("EVENT_SERVER"); -+ break; -+ -+ case ResourceType_JOB_SERVER : -+ property_ResourceType = ("JOB_SERVER"); -+ break; -+ -+ case ResourceType_LOW_LATENCY : -+ property_ResourceType = ("LOW_LATENCY"); -+ break; -+ -+ case ResourceType_MASTER : -+ property_ResourceType = ("MASTER"); -+ break; -+ -+ case ResourceType_NEGOTIATOR : -+ property_ResourceType = ("NEGOTIATOR"); -+ break; -+ -+ case ResourceType_SCHEDULER : -+ property_ResourceType = ("SCHEDULER"); -+ break; -+ -+ case ResourceType_CUSTOM : -+ property_ResourceType = ("CUSTOM"); -+ break; -+ -+ -+ default: -+ isValidResourceType = false; -+ property_ResourceType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting ResourceType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_ResourceType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidResourceType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for ResourceType -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceType::resetResourceType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidResourceType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ResourceType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceType::isResourceTypeNil() -+ { -+ return !isValidResourceType; -+ } -+ -+ /** -+ * Set ResourceType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::ResourceType::setResourceTypeNil() -+ { -+ return resetResourceType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Status.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Status.cpp -new file mode 100644 -index 0000000..623267a ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_Status.cpp -@@ -0,0 +1,698 @@ -+ -+ -+ /** -+ * Status.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_Status.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = Status -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::Status::Status() -+ { -+ -+ -+ property_Code = NULL; -+ -+ isValidCode = false; -+ -+ property_Text; -+ -+ isValidText = false; -+ -+ } -+ -+ AviaryCommon::Status::Status(AviaryCommon::StatusCodeType* arg_Code,std::string arg_Text) -+ { -+ -+ property_Code = NULL; -+ -+ isValidCode = true; -+ -+ property_Text; -+ -+ isValidText = true; -+ -+ property_Code = arg_Code; -+ -+ property_Text = arg_Text; -+ -+ } -+ AviaryCommon::Status::~Status() -+ { -+ if (property_Code) delete property_Code; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::Status::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building code element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "code", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("code", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("code", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::StatusCodeType* element = new AviaryCommon::StatusCodeType(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element code"); -+ } -+ else -+ { -+ status = setCode(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for code "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element code missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building text element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "text", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("text", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("text", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setText(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element text"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setText(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for text "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::Status::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::Status::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::Status::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_2; -+ axis2_char_t *text_value_2_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidCode) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property code"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("code"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("code"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing code element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%scode", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Code->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Code->serialize(current_node, parent_element, -+ property_Code->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Code->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidText) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("text"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("text"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing text element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%stext>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_2 = (axis2_char_t*)property_Text.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_2_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_2, true); -+ if (text_value_2_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2_temp, axutil_strlen(text_value_2_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_2_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for code by Property Number 1 -+ */ -+ AviaryCommon::StatusCodeType* WSF_CALL -+ AviaryCommon::Status::getProperty1() -+ { -+ return getCode(); -+ } -+ -+ /** -+ * getter for code. -+ */ -+ AviaryCommon::StatusCodeType* WSF_CALL -+ AviaryCommon::Status::getCode() -+ { -+ return property_Code; -+ } -+ -+ /** -+ * setter for code -+ */ -+ bool WSF_CALL -+ AviaryCommon::Status::setCode( -+ AviaryCommon::StatusCodeType* arg_Code) -+ { -+ -+ -+ if(isValidCode && -+ arg_Code == property_Code) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Code) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"code is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetCode(); -+ -+ -+ if(NULL == arg_Code) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Code = arg_Code; -+ isValidCode = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for code -+ */ -+ bool WSF_CALL -+ AviaryCommon::Status::resetCode() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Code != NULL) -+ { -+ -+ -+ delete property_Code; -+ -+ -+ } -+ -+ -+ -+ -+ isValidCode = false; -+ return true; -+ } -+ -+ /** -+ * Check whether code is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::Status::isCodeNil() -+ { -+ return !isValidCode; -+ } -+ -+ /** -+ * Set code to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::Status::setCodeNil() -+ { -+ return resetCode(); -+ } -+ -+ -+ -+ /** -+ * Getter for text by Property Number 2 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::Status::getProperty2() -+ { -+ return getText(); -+ } -+ -+ /** -+ * getter for text. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::Status::getText() -+ { -+ return property_Text; -+ } -+ -+ /** -+ * setter for text -+ */ -+ bool WSF_CALL -+ AviaryCommon::Status::setText( -+ const std::string arg_Text) -+ { -+ -+ -+ if(isValidText && -+ arg_Text == property_Text) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetText(); -+ -+ -+ property_Text = std::string(arg_Text.c_str()); -+ isValidText = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for text -+ */ -+ bool WSF_CALL -+ AviaryCommon::Status::resetText() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidText = false; -+ return true; -+ } -+ -+ /** -+ * Check whether text is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::Status::isTextNil() -+ { -+ return !isValidText; -+ } -+ -+ /** -+ * Set text to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::Status::setTextNil() -+ { -+ return resetText(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_StatusCodeType.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_StatusCodeType.cpp -new file mode 100644 -index 0000000..aa1e1a6 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_StatusCodeType.cpp -@@ -0,0 +1,382 @@ -+ -+ -+ /** -+ * StatusCodeType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_StatusCodeType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * Implementation of the StatusCodeType|http://common.aviary.grid.redhat.com Element -+ */ -+ AviaryCommon::StatusCodeType::StatusCodeType() -+ { -+ -+ -+ qname = NULL; -+ -+ property_StatusCodeType; -+ -+ isValidStatusCodeType = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "StatusCodeType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryCommon::StatusCodeType::StatusCodeType(std::string arg_StatusCodeType) -+ { -+ -+ qname = NULL; -+ -+ property_StatusCodeType; -+ -+ isValidStatusCodeType = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "StatusCodeType", -+ "http://common.aviary.grid.redhat.com", -+ NULL); -+ -+ property_StatusCodeType = arg_StatusCodeType; -+ -+ } -+ AviaryCommon::StatusCodeType::~StatusCodeType() -+ { -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ bool WSF_CALL -+ StatusCodeType::deserializeFromString( -+ const axis2_char_t *node_value, -+ axiom_node_t *parent) -+ { -+ bool status = true; -+ -+ setStatusCodeType(node_value); -+ -+ return status; -+ } -+ -+ -+ bool WSF_CALL -+ AviaryCommon::StatusCodeType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ -+ status = AXIS2_FAILURE; -+ if(parent) -+ { -+ axis2_char_t *attrib_text = NULL; -+ attrib_text = axiom_element_get_attribute_value_by_name((axiom_element_t*)axiom_node_get_data_element(parent, Environment::getEnv()), Environment::getEnv(), "nil"); -+ if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true")) -+ { -+ -+ /* but the wsdl says that, this is non nillable */ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element StatusCodeType"); -+ status = AXIS2_FAILURE; -+ -+ } -+ else -+ { -+ axiom_node_t *text_node = NULL; -+ text_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ axiom_text_t *text_element = NULL; -+ if (text_node && -+ axiom_node_get_node_type(text_node, Environment::getEnv()) == AXIOM_TEXT) -+ text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, Environment::getEnv()); -+ text_value = ""; -+ if(text_element && axiom_text_get_value(text_element, Environment::getEnv())) -+ { -+ text_value = (axis2_char_t*)axiom_text_get_value(text_element, Environment::getEnv()); -+ } -+ status = deserializeFromString(text_value, parent); -+ } -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::StatusCodeType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::StatusCodeType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ char* WSF_CALL -+ AviaryCommon::StatusCodeType::serializeToString(axutil_hash_t *namespaces) -+ { -+ axis2_char_t *text_value = NULL; -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ -+ text_value = (axis2_char_t*)axutil_xml_quote_string(Environment::getEnv(), (axis2_char_t*)property_StatusCodeType.c_str(), false); -+ if (!text_value) -+ { -+ text_value = (axis2_char_t*)axutil_strdup(Environment::getEnv(), property_StatusCodeType.c_str()); -+ } -+ -+ return text_value; -+ } -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::StatusCodeType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ axis2_char_t *text_value; -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed && !tag_closed) -+ { -+ text_value = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ } -+ -+ text_value = serializeToString(namespaces); -+ if(text_value) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value, axutil_strlen(text_value)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for StatusCodeType by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::StatusCodeType::getProperty1() -+ { -+ return getStatusCodeType(); -+ } -+ -+ /** -+ * getter for StatusCodeType. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::StatusCodeType::getStatusCodeType() -+ { -+ return property_StatusCodeType; -+ } -+ -+ /** -+ * setter for StatusCodeType -+ */ -+ bool WSF_CALL -+ AviaryCommon::StatusCodeType::setStatusCodeType( -+ const std::string arg_StatusCodeType) -+ { -+ -+ -+ if(isValidStatusCodeType && -+ arg_StatusCodeType == property_StatusCodeType) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_StatusCodeType.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"StatusCodeType is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetStatusCodeType(); -+ -+ -+ property_StatusCodeType = std::string(arg_StatusCodeType.c_str()); -+ isValidStatusCodeType = true; -+ -+ return true; -+ } -+ -+ -+ /** -+ * specialized enum getter for StatusCodeType. -+ */ -+ ADBStatusCodeTypeEnum WSF_CALL -+ AviaryCommon::StatusCodeType::getStatusCodeTypeEnum() -+ { -+ -+ -+ if (axutil_strcmp(property_StatusCodeType.c_str(), "OK") == 0) -+ return StatusCodeType_OK; -+ -+ if (axutil_strcmp(property_StatusCodeType.c_str(), "FAIL") == 0) -+ return StatusCodeType_FAIL; -+ -+ if (axutil_strcmp(property_StatusCodeType.c_str(), "NO_MATCH") == 0) -+ return StatusCodeType_NO_MATCH; -+ -+ if (axutil_strcmp(property_StatusCodeType.c_str(), "INVALID_OFFSET") == 0) -+ return StatusCodeType_INVALID_OFFSET; -+ -+ if (axutil_strcmp(property_StatusCodeType.c_str(), "UNIMPLEMENTED") == 0) -+ return StatusCodeType_UNIMPLEMENTED; -+ -+ if (axutil_strcmp(property_StatusCodeType.c_str(), "UNAVAILABLE") == 0) -+ return StatusCodeType_UNAVAILABLE; -+ -+ -+ /* Error: none of the strings matched; invalid enum value */ -+ return (ADBStatusCodeTypeEnum)-1; -+ } -+ -+ -+ /** -+ * specialized enum setter for StatusCodeType. -+ */ -+ bool WSF_CALL -+ AviaryCommon::StatusCodeType::setStatusCodeTypeEnum(const ADBStatusCodeTypeEnum arg_StatusCodeType) -+ { -+ -+ -+ -+ resetStatusCodeType(); -+ -+ -+ switch (arg_StatusCodeType) -+ { -+ -+ case StatusCodeType_OK : -+ property_StatusCodeType = ("OK"); -+ break; -+ -+ case StatusCodeType_FAIL : -+ property_StatusCodeType = ("FAIL"); -+ break; -+ -+ case StatusCodeType_NO_MATCH : -+ property_StatusCodeType = ("NO_MATCH"); -+ break; -+ -+ case StatusCodeType_INVALID_OFFSET : -+ property_StatusCodeType = ("INVALID_OFFSET"); -+ break; -+ -+ case StatusCodeType_UNIMPLEMENTED : -+ property_StatusCodeType = ("UNIMPLEMENTED"); -+ break; -+ -+ case StatusCodeType_UNAVAILABLE : -+ property_StatusCodeType = ("UNAVAILABLE"); -+ break; -+ -+ -+ default: -+ isValidStatusCodeType = false; -+ property_StatusCodeType = ""; -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Error setting StatusCodeType: undefined enum value"); -+ return false; -+ } -+ -+ if(property_StatusCodeType.empty()) -+ { -+ return AXIS2_FAILURE; -+ } -+ isValidStatusCodeType = true; -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * resetter for StatusCodeType -+ */ -+ bool WSF_CALL -+ AviaryCommon::StatusCodeType::resetStatusCodeType() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidStatusCodeType = false; -+ return true; -+ } -+ -+ /** -+ * Check whether StatusCodeType is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::StatusCodeType::isStatusCodeTypeNil() -+ { -+ return !isValidStatusCodeType; -+ } -+ -+ /** -+ * Set StatusCodeType to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::StatusCodeType::setStatusCodeTypeNil() -+ { -+ return resetStatusCodeType(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_SubmissionID.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_SubmissionID.cpp -new file mode 100644 -index 0000000..0d23b22 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_SubmissionID.cpp -@@ -0,0 +1,717 @@ -+ -+ -+ /** -+ * SubmissionID.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_SubmissionID.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = SubmissionID -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::SubmissionID::SubmissionID() -+ { -+ -+ -+ property_Name; -+ -+ isValidName = false; -+ -+ property_Owner; -+ -+ isValidOwner = false; -+ -+ } -+ -+ AviaryCommon::SubmissionID::SubmissionID(std::string arg_Name,std::string arg_Owner) -+ { -+ -+ property_Name; -+ -+ isValidName = true; -+ -+ property_Owner; -+ -+ isValidOwner = true; -+ -+ property_Name = arg_Name; -+ -+ property_Owner = arg_Owner; -+ -+ } -+ AviaryCommon::SubmissionID::~SubmissionID() -+ { -+ -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building name element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "name", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("name", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("name", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setName(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element name"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setName(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for name "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building owner element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "owner", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("owner", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("owner", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setOwner(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element owner"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setOwner(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for owner "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::SubmissionID::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::SubmissionID::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t *text_value_1; -+ axis2_char_t *text_value_1_temp; -+ -+ axis2_char_t *text_value_2; -+ axis2_char_t *text_value_2_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidName) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("name"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("name"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing name element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sname>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_1 = (axis2_char_t*)property_Name.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_1_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_1, true); -+ if (text_value_1_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_1_temp, axutil_strlen(text_value_1_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_1_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_1, axutil_strlen(text_value_1)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidOwner) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("owner"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("owner"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing owner element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sowner>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_2 = (axis2_char_t*)property_Owner.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_2_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_2, true); -+ if (text_value_2_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2_temp, axutil_strlen(text_value_2_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_2_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for name by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::SubmissionID::getProperty1() -+ { -+ return getName(); -+ } -+ -+ /** -+ * getter for name. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::SubmissionID::getName() -+ { -+ return property_Name; -+ } -+ -+ /** -+ * setter for name -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::setName( -+ const std::string arg_Name) -+ { -+ -+ -+ if(isValidName && -+ arg_Name == property_Name) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetName(); -+ -+ -+ property_Name = std::string(arg_Name.c_str()); -+ isValidName = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for name -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::resetName() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidName = false; -+ return true; -+ } -+ -+ /** -+ * Check whether name is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::isNameNil() -+ { -+ return !isValidName; -+ } -+ -+ /** -+ * Set name to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::setNameNil() -+ { -+ return resetName(); -+ } -+ -+ -+ -+ /** -+ * Getter for owner by Property Number 2 -+ */ -+ std::string WSF_CALL -+ AviaryCommon::SubmissionID::getProperty2() -+ { -+ return getOwner(); -+ } -+ -+ /** -+ * getter for owner. -+ */ -+ std::string WSF_CALL -+ AviaryCommon::SubmissionID::getOwner() -+ { -+ return property_Owner; -+ } -+ -+ /** -+ * setter for owner -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::setOwner( -+ const std::string arg_Owner) -+ { -+ -+ -+ if(isValidOwner && -+ arg_Owner == property_Owner) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetOwner(); -+ -+ -+ property_Owner = std::string(arg_Owner.c_str()); -+ isValidOwner = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for owner -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::resetOwner() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidOwner = false; -+ return true; -+ } -+ -+ /** -+ * Check whether owner is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::isOwnerNil() -+ { -+ return !isValidOwner; -+ } -+ -+ /** -+ * Set owner to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionID::setOwnerNil() -+ { -+ return resetOwner(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_SubmissionSummary.cpp b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_SubmissionSummary.cpp -new file mode 100644 -index 0000000..903178f ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/common/src/AviaryCommon_SubmissionSummary.cpp -@@ -0,0 +1,2420 @@ -+ -+ -+ /** -+ * SubmissionSummary.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryCommon_SubmissionSummary.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryCommon; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = SubmissionSummary -+ * Namespace URI = http://common.aviary.grid.redhat.com -+ * Namespace Prefix = ns1 -+ */ -+ AviaryCommon::SubmissionSummary::SubmissionSummary() -+ { -+ -+ -+ property_Id = NULL; -+ -+ isValidId = false; -+ -+ property_Status = NULL; -+ -+ isValidStatus = false; -+ -+ isValidCompleted = false; -+ -+ isValidHeld = false; -+ -+ isValidIdle = false; -+ -+ isValidRemoved = false; -+ -+ isValidRunning = false; -+ -+ property_Jobs = NULL; -+ -+ isValidJobs = false; -+ -+ } -+ -+ AviaryCommon::SubmissionSummary::SubmissionSummary(AviaryCommon::SubmissionID* arg_Id,AviaryCommon::Status* arg_Status,int arg_Completed,int arg_Held,int arg_Idle,int arg_Removed,int arg_Running,std::vector* arg_Jobs) -+ { -+ -+ property_Id = NULL; -+ -+ isValidId = true; -+ -+ property_Status = NULL; -+ -+ isValidStatus = true; -+ -+ isValidCompleted = true; -+ -+ isValidHeld = true; -+ -+ isValidIdle = true; -+ -+ isValidRemoved = true; -+ -+ isValidRunning = true; -+ -+ property_Jobs = NULL; -+ -+ isValidJobs = true; -+ -+ property_Id = arg_Id; -+ -+ property_Status = arg_Status; -+ -+ property_Completed = arg_Completed; -+ -+ property_Held = arg_Held; -+ -+ property_Idle = arg_Idle; -+ -+ property_Removed = arg_Removed; -+ -+ property_Running = arg_Running; -+ -+ property_Jobs = arg_Jobs; -+ -+ } -+ AviaryCommon::SubmissionSummary::~SubmissionSummary() -+ { -+ if (property_Id) delete property_Id; -+ if (property_Status) delete property_Status; -+ if (property_Jobs) { -+ while(!property_Jobs->empty()) delete property_Jobs->back(), property_Jobs->pop_back(); -+ delete property_Jobs; -+ } -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building id element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "id", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::SubmissionID* element = new AviaryCommon::SubmissionID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element id"); -+ } -+ else -+ { -+ status = setId(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for id "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element id missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building status element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Status* element = new AviaryCommon::Status(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element status"); -+ } -+ else -+ { -+ status = setStatus(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element status missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building completed element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "completed", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("completed", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("completed", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setCompleted(atoi(text_value)); -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element completed"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for completed "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element completed missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building held element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "held", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("held", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("held", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setHeld(atoi(text_value)); -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element held"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for held "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element held missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building idle element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "idle", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("idle", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("idle", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setIdle(atoi(text_value)); -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element idle"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for idle "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element idle missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building removed element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "removed", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("removed", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("removed", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setRemoved(atoi(text_value)); -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element removed"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for removed "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element removed missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building running element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "running", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("running", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("running", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setRunning(atoi(text_value)); -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element running"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for running "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element running missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ { -+ /* -+ * building Jobs array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building jobs element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "jobs", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = (is_early_node_valid?axiom_node_get_next_sibling(current_node, Environment::getEnv()):current_node); !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("jobs", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::JobSummary* element = new AviaryCommon::JobSummary(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element jobs "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for jobs "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"jobs (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setJobs(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryCommon::SubmissionSummary::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryCommon::SubmissionSummary::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_3[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_4[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_5[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_6[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_7[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_8[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidId) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property id"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("id"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("id"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing id element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sid", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Id->serialize(current_node, parent_element, -+ property_Id->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidStatus) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property status"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sstatus", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Status->serialize(current_node, parent_element, -+ property_Status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidCompleted) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property completed"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("completed"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("completed"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing completed element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%scompleted>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ sprintf (text_value_3, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, property_Completed); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidHeld) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property held"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("held"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("held"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing held element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sheld>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ sprintf (text_value_4, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, property_Held); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_4, axutil_strlen(text_value_4)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidIdle) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property idle"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("idle"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("idle"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing idle element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sidle>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ sprintf (text_value_5, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, property_Idle); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_5, axutil_strlen(text_value_5)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidRemoved) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property removed"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("removed"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("removed"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing removed element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sremoved>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ sprintf (text_value_6, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, property_Removed); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_6, axutil_strlen(text_value_6)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidRunning) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property running"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("running"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("running"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing running element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%srunning>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ sprintf (text_value_7, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, property_Running); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_7, axutil_strlen(text_value_7)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidJobs) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("jobs"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("jobs"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Jobs array -+ */ -+ if (property_Jobs != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sjobs", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Jobs->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::JobSummary* element = (*property_Jobs)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing jobs element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for id by Property Number 1 -+ */ -+ AviaryCommon::SubmissionID* WSF_CALL -+ AviaryCommon::SubmissionSummary::getProperty1() -+ { -+ return getId(); -+ } -+ -+ /** -+ * getter for id. -+ */ -+ AviaryCommon::SubmissionID* WSF_CALL -+ AviaryCommon::SubmissionSummary::getId() -+ { -+ return property_Id; -+ } -+ -+ /** -+ * setter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setId( -+ AviaryCommon::SubmissionID* arg_Id) -+ { -+ -+ -+ if(isValidId && -+ arg_Id == property_Id) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"id is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetId(); -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Id = arg_Id; -+ isValidId = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for id -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::resetId() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Id != NULL) -+ { -+ -+ -+ delete property_Id; -+ -+ -+ } -+ -+ -+ -+ -+ isValidId = false; -+ return true; -+ } -+ -+ /** -+ * Check whether id is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isIdNil() -+ { -+ return !isValidId; -+ } -+ -+ /** -+ * Set id to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setIdNil() -+ { -+ return resetId(); -+ } -+ -+ -+ -+ /** -+ * Getter for status by Property Number 2 -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryCommon::SubmissionSummary::getProperty2() -+ { -+ return getStatus(); -+ } -+ -+ /** -+ * getter for status. -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryCommon::SubmissionSummary::getStatus() -+ { -+ return property_Status; -+ } -+ -+ /** -+ * setter for status -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setStatus( -+ AviaryCommon::Status* arg_Status) -+ { -+ -+ -+ if(isValidStatus && -+ arg_Status == property_Status) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"status is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetStatus(); -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Status = arg_Status; -+ isValidStatus = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for status -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::resetStatus() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Status != NULL) -+ { -+ -+ -+ delete property_Status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidStatus = false; -+ return true; -+ } -+ -+ /** -+ * Check whether status is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isStatusNil() -+ { -+ return !isValidStatus; -+ } -+ -+ /** -+ * Set status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setStatusNil() -+ { -+ return resetStatus(); -+ } -+ -+ -+ -+ /** -+ * Getter for completed by Property Number 3 -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getProperty3() -+ { -+ return getCompleted(); -+ } -+ -+ /** -+ * getter for completed. -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getCompleted() -+ { -+ return property_Completed; -+ } -+ -+ /** -+ * setter for completed -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setCompleted( -+ const int arg_Completed) -+ { -+ -+ -+ if(isValidCompleted && -+ arg_Completed == property_Completed) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetCompleted(); -+ -+ -+ property_Completed = arg_Completed; -+ isValidCompleted = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for completed -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::resetCompleted() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidCompleted = false; -+ return true; -+ } -+ -+ /** -+ * Check whether completed is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isCompletedNil() -+ { -+ return !isValidCompleted; -+ } -+ -+ /** -+ * Set completed to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setCompletedNil() -+ { -+ return resetCompleted(); -+ } -+ -+ -+ -+ /** -+ * Getter for held by Property Number 4 -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getProperty4() -+ { -+ return getHeld(); -+ } -+ -+ /** -+ * getter for held. -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getHeld() -+ { -+ return property_Held; -+ } -+ -+ /** -+ * setter for held -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setHeld( -+ const int arg_Held) -+ { -+ -+ -+ if(isValidHeld && -+ arg_Held == property_Held) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetHeld(); -+ -+ -+ property_Held = arg_Held; -+ isValidHeld = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for held -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::resetHeld() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidHeld = false; -+ return true; -+ } -+ -+ /** -+ * Check whether held is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isHeldNil() -+ { -+ return !isValidHeld; -+ } -+ -+ /** -+ * Set held to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setHeldNil() -+ { -+ return resetHeld(); -+ } -+ -+ -+ -+ /** -+ * Getter for idle by Property Number 5 -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getProperty5() -+ { -+ return getIdle(); -+ } -+ -+ /** -+ * getter for idle. -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getIdle() -+ { -+ return property_Idle; -+ } -+ -+ /** -+ * setter for idle -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setIdle( -+ const int arg_Idle) -+ { -+ -+ -+ if(isValidIdle && -+ arg_Idle == property_Idle) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetIdle(); -+ -+ -+ property_Idle = arg_Idle; -+ isValidIdle = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for idle -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::resetIdle() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidIdle = false; -+ return true; -+ } -+ -+ /** -+ * Check whether idle is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isIdleNil() -+ { -+ return !isValidIdle; -+ } -+ -+ /** -+ * Set idle to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setIdleNil() -+ { -+ return resetIdle(); -+ } -+ -+ -+ -+ /** -+ * Getter for removed by Property Number 6 -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getProperty6() -+ { -+ return getRemoved(); -+ } -+ -+ /** -+ * getter for removed. -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getRemoved() -+ { -+ return property_Removed; -+ } -+ -+ /** -+ * setter for removed -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setRemoved( -+ const int arg_Removed) -+ { -+ -+ -+ if(isValidRemoved && -+ arg_Removed == property_Removed) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetRemoved(); -+ -+ -+ property_Removed = arg_Removed; -+ isValidRemoved = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for removed -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::resetRemoved() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidRemoved = false; -+ return true; -+ } -+ -+ /** -+ * Check whether removed is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isRemovedNil() -+ { -+ return !isValidRemoved; -+ } -+ -+ /** -+ * Set removed to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setRemovedNil() -+ { -+ return resetRemoved(); -+ } -+ -+ -+ -+ /** -+ * Getter for running by Property Number 7 -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getProperty7() -+ { -+ return getRunning(); -+ } -+ -+ /** -+ * getter for running. -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::getRunning() -+ { -+ return property_Running; -+ } -+ -+ /** -+ * setter for running -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setRunning( -+ const int arg_Running) -+ { -+ -+ -+ if(isValidRunning && -+ arg_Running == property_Running) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetRunning(); -+ -+ -+ property_Running = arg_Running; -+ isValidRunning = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for running -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::resetRunning() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidRunning = false; -+ return true; -+ } -+ -+ /** -+ * Check whether running is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isRunningNil() -+ { -+ return !isValidRunning; -+ } -+ -+ /** -+ * Set running to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setRunningNil() -+ { -+ return resetRunning(); -+ } -+ -+ -+ -+ /** -+ * Getter for jobs by Property Number 8 -+ */ -+ std::vector* WSF_CALL -+ AviaryCommon::SubmissionSummary::getProperty8() -+ { -+ return getJobs(); -+ } -+ -+ /** -+ * getter for jobs. -+ */ -+ std::vector* WSF_CALL -+ AviaryCommon::SubmissionSummary::getJobs() -+ { -+ return property_Jobs; -+ } -+ -+ /** -+ * setter for jobs -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setJobs( -+ std::vector* arg_Jobs) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidJobs && -+ arg_Jobs == property_Jobs) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Jobs->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"jobs has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Jobs)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetJobs(); -+ -+ -+ if(NULL == arg_Jobs) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Jobs = arg_Jobs; -+ if(non_nil_exists) -+ { -+ isValidJobs = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of jobs. -+ */ -+ AviaryCommon::JobSummary* WSF_CALL -+ AviaryCommon::SubmissionSummary::getJobsAt(int i) -+ { -+ AviaryCommon::JobSummary* ret_val; -+ if(property_Jobs == NULL) -+ { -+ return (AviaryCommon::JobSummary*)0; -+ } -+ ret_val = (*property_Jobs)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of jobs. -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setJobsAt(int i, -+ AviaryCommon::JobSummary* arg_Jobs) -+ { -+ AviaryCommon::JobSummary* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidJobs && -+ property_Jobs && -+ -+ arg_Jobs == (*property_Jobs)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Jobs == NULL) -+ { -+ property_Jobs = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Jobs)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidJobs = true; -+ (*property_Jobs)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Jobs)[i] = arg_Jobs; -+ -+ -+ isValidJobs = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to jobs. -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::addJobs( -+ AviaryCommon::JobSummary* arg_Jobs) -+ { -+ -+ -+ if( NULL == arg_Jobs -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Jobs == NULL) -+ { -+ property_Jobs = new std::vector(); -+ } -+ -+ property_Jobs->push_back(arg_Jobs); -+ -+ isValidJobs = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the jobs array. -+ */ -+ int WSF_CALL -+ AviaryCommon::SubmissionSummary::sizeofJobs() -+ { -+ -+ if(property_Jobs == NULL) -+ { -+ return 0; -+ } -+ return property_Jobs->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::removeJobsAt(int i) -+ { -+ return setJobsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for jobs -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::resetJobs() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Jobs != NULL) -+ { -+ std::vector::iterator it = property_Jobs->begin(); -+ for( ; it < property_Jobs->end() ; ++it) -+ { -+ AviaryCommon::JobSummary* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Jobs) -+ delete property_Jobs; -+ -+ isValidJobs = false; -+ return true; -+ } -+ -+ /** -+ * Check whether jobs is nill -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isJobsNil() -+ { -+ return !isValidJobs; -+ } -+ -+ /** -+ * Set jobs to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setJobsNil() -+ { -+ return resetJobs(); -+ } -+ -+ -+ /** -+ * Check whether jobs is nill at i -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::isJobsNilAt(int i) -+ { -+ return (isValidJobs == false || -+ NULL == property_Jobs || -+ NULL == (*property_Jobs)[i]); -+ } -+ -+ /** -+ * Set jobs to nil at i -+ */ -+ bool WSF_CALL -+ AviaryCommon::SubmissionSummary::setJobsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Jobs == NULL || -+ isValidJobs == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Jobs->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Jobs)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of jobs is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Jobs == NULL) -+ { -+ isValidJobs = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::JobSummary* element = (*property_Jobs)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidJobs = false; -+ (*property_Jobs)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Jobs)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ControlJob.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ControlJob.cpp -new file mode 100644 -index 0000000..520716c ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ControlJob.cpp -@@ -0,0 +1,717 @@ -+ -+ -+ /** -+ * ControlJob.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_ControlJob.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = ControlJob -+ * Namespace URI = http://job.aviary.grid.redhat.com -+ * Namespace Prefix = ns2 -+ */ -+ AviaryJob::ControlJob::ControlJob() -+ { -+ -+ -+ property_Id = NULL; -+ -+ isValidId = false; -+ -+ property_Reason; -+ -+ isValidReason = false; -+ -+ } -+ -+ AviaryJob::ControlJob::ControlJob(AviaryCommon::JobID* arg_Id,std::string arg_Reason) -+ { -+ -+ property_Id = NULL; -+ -+ isValidId = true; -+ -+ property_Reason; -+ -+ isValidReason = true; -+ -+ property_Id = arg_Id; -+ -+ property_Reason = arg_Reason; -+ -+ } -+ AviaryJob::ControlJob::~ControlJob() -+ { -+ if (property_Id) delete property_Id; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::ControlJob::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building id element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "id", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element id"); -+ } -+ else -+ { -+ status = setId(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for id "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element id missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building reason element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "reason", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("reason", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("reason", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setReason(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element reason"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setReason(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for reason "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element reason missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::ControlJob::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::ControlJob::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::ControlJob::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_2; -+ axis2_char_t *text_value_2_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidId) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property id"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("id"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("id"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing id element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sid", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Id->serialize(current_node, parent_element, -+ property_Id->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidReason) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property reason"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("reason"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("reason"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing reason element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sreason>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_2 = (axis2_char_t*)property_Reason.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_2_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_2, true); -+ if (text_value_2_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2_temp, axutil_strlen(text_value_2_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_2_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for id by Property Number 1 -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryJob::ControlJob::getProperty1() -+ { -+ return getId(); -+ } -+ -+ /** -+ * getter for id. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryJob::ControlJob::getId() -+ { -+ return property_Id; -+ } -+ -+ /** -+ * setter for id -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJob::setId( -+ AviaryCommon::JobID* arg_Id) -+ { -+ -+ -+ if(isValidId && -+ arg_Id == property_Id) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"id is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetId(); -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Id = arg_Id; -+ isValidId = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for id -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJob::resetId() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Id != NULL) -+ { -+ -+ -+ delete property_Id; -+ -+ -+ } -+ -+ -+ -+ -+ isValidId = false; -+ return true; -+ } -+ -+ /** -+ * Check whether id is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJob::isIdNil() -+ { -+ return !isValidId; -+ } -+ -+ /** -+ * Set id to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJob::setIdNil() -+ { -+ return resetId(); -+ } -+ -+ -+ -+ /** -+ * Getter for reason by Property Number 2 -+ */ -+ std::string WSF_CALL -+ AviaryJob::ControlJob::getProperty2() -+ { -+ return getReason(); -+ } -+ -+ /** -+ * getter for reason. -+ */ -+ std::string WSF_CALL -+ AviaryJob::ControlJob::getReason() -+ { -+ return property_Reason; -+ } -+ -+ /** -+ * setter for reason -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJob::setReason( -+ const std::string arg_Reason) -+ { -+ -+ -+ if(isValidReason && -+ arg_Reason == property_Reason) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Reason.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"reason is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetReason(); -+ -+ -+ property_Reason = std::string(arg_Reason.c_str()); -+ isValidReason = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for reason -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJob::resetReason() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidReason = false; -+ return true; -+ } -+ -+ /** -+ * Check whether reason is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJob::isReasonNil() -+ { -+ return !isValidReason; -+ } -+ -+ /** -+ * Set reason to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJob::setReasonNil() -+ { -+ return resetReason(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ControlJobResponse.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ControlJobResponse.cpp -new file mode 100644 -index 0000000..cd6696c ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ControlJobResponse.cpp -@@ -0,0 +1,412 @@ -+ -+ -+ /** -+ * ControlJobResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_ControlJobResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = ControlJobResponse -+ * Namespace URI = http://job.aviary.grid.redhat.com -+ * Namespace Prefix = ns2 -+ */ -+ AviaryJob::ControlJobResponse::ControlJobResponse() -+ { -+ -+ -+ property_Status = NULL; -+ -+ isValidStatus = false; -+ -+ } -+ -+ AviaryJob::ControlJobResponse::ControlJobResponse(AviaryCommon::Status* arg_Status) -+ { -+ -+ property_Status = NULL; -+ -+ isValidStatus = true; -+ -+ property_Status = arg_Status; -+ -+ } -+ AviaryJob::ControlJobResponse::~ControlJobResponse() -+ { -+ if (property_Status) delete property_Status; -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::ControlJobResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ -+ -+ /* -+ * building status element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Status* element = new AviaryCommon::Status(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element status"); -+ } -+ else -+ { -+ status = setStatus(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element status missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::ControlJobResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::ControlJobResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::ControlJobResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidStatus) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property status"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sstatus", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Status->serialize(current_node, parent_element, -+ property_Status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for status by Property Number 1 -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryJob::ControlJobResponse::getProperty1() -+ { -+ return getStatus(); -+ } -+ -+ /** -+ * getter for status. -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryJob::ControlJobResponse::getStatus() -+ { -+ return property_Status; -+ } -+ -+ /** -+ * setter for status -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJobResponse::setStatus( -+ AviaryCommon::Status* arg_Status) -+ { -+ -+ -+ if(isValidStatus && -+ arg_Status == property_Status) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"status is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetStatus(); -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Status = arg_Status; -+ isValidStatus = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for status -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJobResponse::resetStatus() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Status != NULL) -+ { -+ -+ -+ delete property_Status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidStatus = false; -+ return true; -+ } -+ -+ /** -+ * Check whether status is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJobResponse::isStatusNil() -+ { -+ return !isValidStatus; -+ } -+ -+ /** -+ * Set status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::ControlJobResponse::setStatusNil() -+ { -+ return resetStatus(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_HoldJob.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_HoldJob.cpp -new file mode 100644 -index 0000000..2d323cf ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_HoldJob.cpp -@@ -0,0 +1,452 @@ -+ -+ -+ /** -+ * HoldJob.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_HoldJob.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the HoldJob|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::HoldJob::HoldJob() -+ { -+ -+ -+ qname = NULL; -+ -+ property_HoldJob = NULL; -+ -+ isValidHoldJob = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "HoldJob", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::HoldJob::HoldJob(AviaryJob::ControlJob* arg_HoldJob) -+ { -+ -+ qname = NULL; -+ -+ property_HoldJob = NULL; -+ -+ isValidHoldJob = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "HoldJob", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_HoldJob = arg_HoldJob; -+ -+ } -+ AviaryJob::HoldJob::~HoldJob() -+ { -+ if (property_HoldJob) delete property_HoldJob; -+ axutil_qname_free (qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::HoldJob::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = parent; -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for HoldJob : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building HoldJob element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "HoldJob", "http://job.aviary.grid.redhat.com", NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryJob::ControlJob* element = new AviaryJob::ControlJob(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element HoldJob"); -+ } -+ else -+ { -+ status = setHoldJob(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for HoldJob "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element HoldJob missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::HoldJob::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::HoldJob::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::HoldJob::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "HoldJob", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING))) -+ { -+ p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); -+ sprintf(p_prefix, "n%d", (*next_ns_index)++); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, p_prefix); -+ -+ axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", p_prefix)); -+ } -+ -+ -+ if (!isValidHoldJob) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property HoldJob"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("HoldJob"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("HoldJob"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing HoldJob element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sHoldJob", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ property_HoldJob->serialize(current_node, parent_element, -+ property_HoldJob->isParticle() || true, namespaces, next_ns_index); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for HoldJob by Property Number 1 -+ */ -+ AviaryJob::ControlJob* WSF_CALL -+ AviaryJob::HoldJob::getProperty1() -+ { -+ return getHoldJob(); -+ } -+ -+ /** -+ * getter for HoldJob. -+ */ -+ AviaryJob::ControlJob* WSF_CALL -+ AviaryJob::HoldJob::getHoldJob() -+ { -+ return property_HoldJob; -+ } -+ -+ /** -+ * setter for HoldJob -+ */ -+ bool WSF_CALL -+ AviaryJob::HoldJob::setHoldJob( -+ AviaryJob::ControlJob* arg_HoldJob) -+ { -+ -+ -+ if(isValidHoldJob && -+ arg_HoldJob == property_HoldJob) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_HoldJob) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"HoldJob is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetHoldJob(); -+ -+ -+ if(NULL == arg_HoldJob) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_HoldJob = arg_HoldJob; -+ isValidHoldJob = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for HoldJob -+ */ -+ bool WSF_CALL -+ AviaryJob::HoldJob::resetHoldJob() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_HoldJob != NULL) -+ { -+ -+ -+ delete property_HoldJob; -+ -+ -+ } -+ -+ -+ -+ -+ isValidHoldJob = false; -+ return true; -+ } -+ -+ /** -+ * Check whether HoldJob is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::HoldJob::isHoldJobNil() -+ { -+ return !isValidHoldJob; -+ } -+ -+ /** -+ * Set HoldJob to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::HoldJob::setHoldJobNil() -+ { -+ return resetHoldJob(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_HoldJobResponse.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_HoldJobResponse.cpp -new file mode 100644 -index 0000000..5fde78b ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_HoldJobResponse.cpp -@@ -0,0 +1,452 @@ -+ -+ -+ /** -+ * HoldJobResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_HoldJobResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the HoldJobResponse|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::HoldJobResponse::HoldJobResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_HoldJobResponse = NULL; -+ -+ isValidHoldJobResponse = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "HoldJobResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::HoldJobResponse::HoldJobResponse(AviaryJob::ControlJobResponse* arg_HoldJobResponse) -+ { -+ -+ qname = NULL; -+ -+ property_HoldJobResponse = NULL; -+ -+ isValidHoldJobResponse = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "HoldJobResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_HoldJobResponse = arg_HoldJobResponse; -+ -+ } -+ AviaryJob::HoldJobResponse::~HoldJobResponse() -+ { -+ if (property_HoldJobResponse) delete property_HoldJobResponse; -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::HoldJobResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = parent; -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for HoldJobResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building HoldJobResponse element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "HoldJobResponse", "http://job.aviary.grid.redhat.com", NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryJob::ControlJobResponse* element = new AviaryJob::ControlJobResponse(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element HoldJobResponse"); -+ } -+ else -+ { -+ status = setHoldJobResponse(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for HoldJobResponse "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element HoldJobResponse missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::HoldJobResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::HoldJobResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::HoldJobResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "HoldJobResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING))) -+ { -+ p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); -+ sprintf(p_prefix, "n%d", (*next_ns_index)++); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, p_prefix); -+ -+ axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", p_prefix)); -+ } -+ -+ -+ if (!isValidHoldJobResponse) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property HoldJobResponse"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("HoldJobResponse"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("HoldJobResponse"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing HoldJobResponse element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sHoldJobResponse", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ property_HoldJobResponse->serialize(current_node, parent_element, -+ property_HoldJobResponse->isParticle() || true, namespaces, next_ns_index); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for HoldJobResponse by Property Number 1 -+ */ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ AviaryJob::HoldJobResponse::getProperty1() -+ { -+ return getHoldJobResponse(); -+ } -+ -+ /** -+ * getter for HoldJobResponse. -+ */ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ AviaryJob::HoldJobResponse::getHoldJobResponse() -+ { -+ return property_HoldJobResponse; -+ } -+ -+ /** -+ * setter for HoldJobResponse -+ */ -+ bool WSF_CALL -+ AviaryJob::HoldJobResponse::setHoldJobResponse( -+ AviaryJob::ControlJobResponse* arg_HoldJobResponse) -+ { -+ -+ -+ if(isValidHoldJobResponse && -+ arg_HoldJobResponse == property_HoldJobResponse) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_HoldJobResponse) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"HoldJobResponse is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetHoldJobResponse(); -+ -+ -+ if(NULL == arg_HoldJobResponse) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_HoldJobResponse = arg_HoldJobResponse; -+ isValidHoldJobResponse = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for HoldJobResponse -+ */ -+ bool WSF_CALL -+ AviaryJob::HoldJobResponse::resetHoldJobResponse() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_HoldJobResponse != NULL) -+ { -+ -+ -+ delete property_HoldJobResponse; -+ -+ -+ } -+ -+ -+ -+ -+ isValidHoldJobResponse = false; -+ return true; -+ } -+ -+ /** -+ * Check whether HoldJobResponse is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::HoldJobResponse::isHoldJobResponseNil() -+ { -+ return !isValidHoldJobResponse; -+ } -+ -+ /** -+ * Set HoldJobResponse to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::HoldJobResponse::setHoldJobResponseNil() -+ { -+ return resetHoldJobResponse(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ReleaseJob.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ReleaseJob.cpp -new file mode 100644 -index 0000000..5ebab53 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ReleaseJob.cpp -@@ -0,0 +1,452 @@ -+ -+ -+ /** -+ * ReleaseJob.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_ReleaseJob.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the ReleaseJob|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::ReleaseJob::ReleaseJob() -+ { -+ -+ -+ qname = NULL; -+ -+ property_ReleaseJob = NULL; -+ -+ isValidReleaseJob = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ReleaseJob", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::ReleaseJob::ReleaseJob(AviaryJob::ControlJob* arg_ReleaseJob) -+ { -+ -+ qname = NULL; -+ -+ property_ReleaseJob = NULL; -+ -+ isValidReleaseJob = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ReleaseJob", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_ReleaseJob = arg_ReleaseJob; -+ -+ } -+ AviaryJob::ReleaseJob::~ReleaseJob() -+ { -+ if (property_ReleaseJob) delete property_ReleaseJob; -+ axutil_qname_free (qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::ReleaseJob::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = parent; -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for ReleaseJob : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building ReleaseJob element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "ReleaseJob", "http://job.aviary.grid.redhat.com", NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryJob::ControlJob* element = new AviaryJob::ControlJob(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element ReleaseJob"); -+ } -+ else -+ { -+ status = setReleaseJob(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for ReleaseJob "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element ReleaseJob missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::ReleaseJob::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::ReleaseJob::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::ReleaseJob::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "ReleaseJob", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING))) -+ { -+ p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); -+ sprintf(p_prefix, "n%d", (*next_ns_index)++); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, p_prefix); -+ -+ axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", p_prefix)); -+ } -+ -+ -+ if (!isValidReleaseJob) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property ReleaseJob"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("ReleaseJob"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("ReleaseJob"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing ReleaseJob element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sReleaseJob", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ property_ReleaseJob->serialize(current_node, parent_element, -+ property_ReleaseJob->isParticle() || true, namespaces, next_ns_index); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ReleaseJob by Property Number 1 -+ */ -+ AviaryJob::ControlJob* WSF_CALL -+ AviaryJob::ReleaseJob::getProperty1() -+ { -+ return getReleaseJob(); -+ } -+ -+ /** -+ * getter for ReleaseJob. -+ */ -+ AviaryJob::ControlJob* WSF_CALL -+ AviaryJob::ReleaseJob::getReleaseJob() -+ { -+ return property_ReleaseJob; -+ } -+ -+ /** -+ * setter for ReleaseJob -+ */ -+ bool WSF_CALL -+ AviaryJob::ReleaseJob::setReleaseJob( -+ AviaryJob::ControlJob* arg_ReleaseJob) -+ { -+ -+ -+ if(isValidReleaseJob && -+ arg_ReleaseJob == property_ReleaseJob) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_ReleaseJob) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ReleaseJob is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetReleaseJob(); -+ -+ -+ if(NULL == arg_ReleaseJob) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_ReleaseJob = arg_ReleaseJob; -+ isValidReleaseJob = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for ReleaseJob -+ */ -+ bool WSF_CALL -+ AviaryJob::ReleaseJob::resetReleaseJob() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_ReleaseJob != NULL) -+ { -+ -+ -+ delete property_ReleaseJob; -+ -+ -+ } -+ -+ -+ -+ -+ isValidReleaseJob = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ReleaseJob is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::ReleaseJob::isReleaseJobNil() -+ { -+ return !isValidReleaseJob; -+ } -+ -+ /** -+ * Set ReleaseJob to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::ReleaseJob::setReleaseJobNil() -+ { -+ return resetReleaseJob(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ReleaseJobResponse.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ReleaseJobResponse.cpp -new file mode 100644 -index 0000000..a7c3cb7 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_ReleaseJobResponse.cpp -@@ -0,0 +1,452 @@ -+ -+ -+ /** -+ * ReleaseJobResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_ReleaseJobResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the ReleaseJobResponse|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::ReleaseJobResponse::ReleaseJobResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_ReleaseJobResponse = NULL; -+ -+ isValidReleaseJobResponse = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ReleaseJobResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::ReleaseJobResponse::ReleaseJobResponse(AviaryJob::ControlJobResponse* arg_ReleaseJobResponse) -+ { -+ -+ qname = NULL; -+ -+ property_ReleaseJobResponse = NULL; -+ -+ isValidReleaseJobResponse = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "ReleaseJobResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_ReleaseJobResponse = arg_ReleaseJobResponse; -+ -+ } -+ AviaryJob::ReleaseJobResponse::~ReleaseJobResponse() -+ { -+ if (property_ReleaseJobResponse) delete property_ReleaseJobResponse; -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::ReleaseJobResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = parent; -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for ReleaseJobResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building ReleaseJobResponse element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "ReleaseJobResponse", "http://job.aviary.grid.redhat.com", NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryJob::ControlJobResponse* element = new AviaryJob::ControlJobResponse(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element ReleaseJobResponse"); -+ } -+ else -+ { -+ status = setReleaseJobResponse(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for ReleaseJobResponse "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element ReleaseJobResponse missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::ReleaseJobResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::ReleaseJobResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::ReleaseJobResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "ReleaseJobResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING))) -+ { -+ p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); -+ sprintf(p_prefix, "n%d", (*next_ns_index)++); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, p_prefix); -+ -+ axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", p_prefix)); -+ } -+ -+ -+ if (!isValidReleaseJobResponse) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property ReleaseJobResponse"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("ReleaseJobResponse"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("ReleaseJobResponse"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing ReleaseJobResponse element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sReleaseJobResponse", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ property_ReleaseJobResponse->serialize(current_node, parent_element, -+ property_ReleaseJobResponse->isParticle() || true, namespaces, next_ns_index); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ReleaseJobResponse by Property Number 1 -+ */ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ AviaryJob::ReleaseJobResponse::getProperty1() -+ { -+ return getReleaseJobResponse(); -+ } -+ -+ /** -+ * getter for ReleaseJobResponse. -+ */ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ AviaryJob::ReleaseJobResponse::getReleaseJobResponse() -+ { -+ return property_ReleaseJobResponse; -+ } -+ -+ /** -+ * setter for ReleaseJobResponse -+ */ -+ bool WSF_CALL -+ AviaryJob::ReleaseJobResponse::setReleaseJobResponse( -+ AviaryJob::ControlJobResponse* arg_ReleaseJobResponse) -+ { -+ -+ -+ if(isValidReleaseJobResponse && -+ arg_ReleaseJobResponse == property_ReleaseJobResponse) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_ReleaseJobResponse) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ReleaseJobResponse is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetReleaseJobResponse(); -+ -+ -+ if(NULL == arg_ReleaseJobResponse) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_ReleaseJobResponse = arg_ReleaseJobResponse; -+ isValidReleaseJobResponse = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for ReleaseJobResponse -+ */ -+ bool WSF_CALL -+ AviaryJob::ReleaseJobResponse::resetReleaseJobResponse() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_ReleaseJobResponse != NULL) -+ { -+ -+ -+ delete property_ReleaseJobResponse; -+ -+ -+ } -+ -+ -+ -+ -+ isValidReleaseJobResponse = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ReleaseJobResponse is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::ReleaseJobResponse::isReleaseJobResponseNil() -+ { -+ return !isValidReleaseJobResponse; -+ } -+ -+ /** -+ * Set ReleaseJobResponse to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::ReleaseJobResponse::setReleaseJobResponseNil() -+ { -+ return resetReleaseJobResponse(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_RemoveJob.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_RemoveJob.cpp -new file mode 100644 -index 0000000..b2a81b2 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_RemoveJob.cpp -@@ -0,0 +1,452 @@ -+ -+ -+ /** -+ * RemoveJob.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_RemoveJob.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the RemoveJob|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::RemoveJob::RemoveJob() -+ { -+ -+ -+ qname = NULL; -+ -+ property_RemoveJob = NULL; -+ -+ isValidRemoveJob = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "RemoveJob", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::RemoveJob::RemoveJob(AviaryJob::ControlJob* arg_RemoveJob) -+ { -+ -+ qname = NULL; -+ -+ property_RemoveJob = NULL; -+ -+ isValidRemoveJob = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "RemoveJob", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_RemoveJob = arg_RemoveJob; -+ -+ } -+ AviaryJob::RemoveJob::~RemoveJob() -+ { -+ if (property_RemoveJob) delete property_RemoveJob; -+ axutil_qname_free (qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::RemoveJob::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = parent; -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for RemoveJob : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building RemoveJob element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "RemoveJob", "http://job.aviary.grid.redhat.com", NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryJob::ControlJob* element = new AviaryJob::ControlJob(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element RemoveJob"); -+ } -+ else -+ { -+ status = setRemoveJob(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for RemoveJob "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element RemoveJob missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::RemoveJob::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::RemoveJob::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::RemoveJob::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "RemoveJob", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING))) -+ { -+ p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); -+ sprintf(p_prefix, "n%d", (*next_ns_index)++); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, p_prefix); -+ -+ axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", p_prefix)); -+ } -+ -+ -+ if (!isValidRemoveJob) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property RemoveJob"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("RemoveJob"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("RemoveJob"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing RemoveJob element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sRemoveJob", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ property_RemoveJob->serialize(current_node, parent_element, -+ property_RemoveJob->isParticle() || true, namespaces, next_ns_index); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for RemoveJob by Property Number 1 -+ */ -+ AviaryJob::ControlJob* WSF_CALL -+ AviaryJob::RemoveJob::getProperty1() -+ { -+ return getRemoveJob(); -+ } -+ -+ /** -+ * getter for RemoveJob. -+ */ -+ AviaryJob::ControlJob* WSF_CALL -+ AviaryJob::RemoveJob::getRemoveJob() -+ { -+ return property_RemoveJob; -+ } -+ -+ /** -+ * setter for RemoveJob -+ */ -+ bool WSF_CALL -+ AviaryJob::RemoveJob::setRemoveJob( -+ AviaryJob::ControlJob* arg_RemoveJob) -+ { -+ -+ -+ if(isValidRemoveJob && -+ arg_RemoveJob == property_RemoveJob) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_RemoveJob) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"RemoveJob is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetRemoveJob(); -+ -+ -+ if(NULL == arg_RemoveJob) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_RemoveJob = arg_RemoveJob; -+ isValidRemoveJob = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for RemoveJob -+ */ -+ bool WSF_CALL -+ AviaryJob::RemoveJob::resetRemoveJob() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_RemoveJob != NULL) -+ { -+ -+ -+ delete property_RemoveJob; -+ -+ -+ } -+ -+ -+ -+ -+ isValidRemoveJob = false; -+ return true; -+ } -+ -+ /** -+ * Check whether RemoveJob is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::RemoveJob::isRemoveJobNil() -+ { -+ return !isValidRemoveJob; -+ } -+ -+ /** -+ * Set RemoveJob to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::RemoveJob::setRemoveJobNil() -+ { -+ return resetRemoveJob(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_RemoveJobResponse.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_RemoveJobResponse.cpp -new file mode 100644 -index 0000000..b454209 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_RemoveJobResponse.cpp -@@ -0,0 +1,452 @@ -+ -+ -+ /** -+ * RemoveJobResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_RemoveJobResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the RemoveJobResponse|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::RemoveJobResponse::RemoveJobResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_RemoveJobResponse = NULL; -+ -+ isValidRemoveJobResponse = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "RemoveJobResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::RemoveJobResponse::RemoveJobResponse(AviaryJob::ControlJobResponse* arg_RemoveJobResponse) -+ { -+ -+ qname = NULL; -+ -+ property_RemoveJobResponse = NULL; -+ -+ isValidRemoveJobResponse = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "RemoveJobResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_RemoveJobResponse = arg_RemoveJobResponse; -+ -+ } -+ AviaryJob::RemoveJobResponse::~RemoveJobResponse() -+ { -+ if (property_RemoveJobResponse) delete property_RemoveJobResponse; -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::RemoveJobResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = parent; -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for RemoveJobResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building RemoveJobResponse element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "RemoveJobResponse", "http://job.aviary.grid.redhat.com", NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryJob::ControlJobResponse* element = new AviaryJob::ControlJobResponse(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element RemoveJobResponse"); -+ } -+ else -+ { -+ status = setRemoveJobResponse(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for RemoveJobResponse "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element RemoveJobResponse missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::RemoveJobResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::RemoveJobResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::RemoveJobResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "RemoveJobResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING))) -+ { -+ p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); -+ sprintf(p_prefix, "n%d", (*next_ns_index)++); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, p_prefix); -+ -+ axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", p_prefix)); -+ } -+ -+ -+ if (!isValidRemoveJobResponse) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property RemoveJobResponse"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("RemoveJobResponse"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("RemoveJobResponse"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing RemoveJobResponse element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sRemoveJobResponse", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ property_RemoveJobResponse->serialize(current_node, parent_element, -+ property_RemoveJobResponse->isParticle() || true, namespaces, next_ns_index); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for RemoveJobResponse by Property Number 1 -+ */ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ AviaryJob::RemoveJobResponse::getProperty1() -+ { -+ return getRemoveJobResponse(); -+ } -+ -+ /** -+ * getter for RemoveJobResponse. -+ */ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ AviaryJob::RemoveJobResponse::getRemoveJobResponse() -+ { -+ return property_RemoveJobResponse; -+ } -+ -+ /** -+ * setter for RemoveJobResponse -+ */ -+ bool WSF_CALL -+ AviaryJob::RemoveJobResponse::setRemoveJobResponse( -+ AviaryJob::ControlJobResponse* arg_RemoveJobResponse) -+ { -+ -+ -+ if(isValidRemoveJobResponse && -+ arg_RemoveJobResponse == property_RemoveJobResponse) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_RemoveJobResponse) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"RemoveJobResponse is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetRemoveJobResponse(); -+ -+ -+ if(NULL == arg_RemoveJobResponse) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_RemoveJobResponse = arg_RemoveJobResponse; -+ isValidRemoveJobResponse = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for RemoveJobResponse -+ */ -+ bool WSF_CALL -+ AviaryJob::RemoveJobResponse::resetRemoveJobResponse() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_RemoveJobResponse != NULL) -+ { -+ -+ -+ delete property_RemoveJobResponse; -+ -+ -+ } -+ -+ -+ -+ -+ isValidRemoveJobResponse = false; -+ return true; -+ } -+ -+ /** -+ * Check whether RemoveJobResponse is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::RemoveJobResponse::isRemoveJobResponseNil() -+ { -+ return !isValidRemoveJobResponse; -+ } -+ -+ /** -+ * Set RemoveJobResponse to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::RemoveJobResponse::setRemoveJobResponseNil() -+ { -+ return resetRemoveJobResponse(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SetJobAttribute.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SetJobAttribute.cpp -new file mode 100644 -index 0000000..67f2550 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SetJobAttribute.cpp -@@ -0,0 +1,722 @@ -+ -+ -+ /** -+ * SetJobAttribute.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_SetJobAttribute.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the SetJobAttribute|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::SetJobAttribute::SetJobAttribute() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Id = NULL; -+ -+ isValidId = false; -+ -+ property_Attribute = NULL; -+ -+ isValidAttribute = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "SetJobAttribute", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::SetJobAttribute::SetJobAttribute(AviaryCommon::JobID* arg_Id,AviaryCommon::Attribute* arg_Attribute) -+ { -+ -+ qname = NULL; -+ -+ property_Id = NULL; -+ -+ isValidId = true; -+ -+ property_Attribute = NULL; -+ -+ isValidAttribute = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "SetJobAttribute", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Id = arg_Id; -+ -+ property_Attribute = arg_Attribute; -+ -+ } -+ AviaryJob::SetJobAttribute::~SetJobAttribute() -+ { -+ if (property_Id) delete property_Id; -+ if (property_Attribute) delete property_Attribute; -+ axutil_qname_free (qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for SetJobAttribute : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building id element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "id", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element id"); -+ } -+ else -+ { -+ status = setId(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for id "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element id missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building attribute element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "attribute", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("attribute", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("attribute", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Attribute* element = new AviaryCommon::Attribute(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element attribute"); -+ } -+ else -+ { -+ status = setAttribute(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for attribute "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element attribute missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::SetJobAttribute::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::SetJobAttribute::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "SetJobAttribute", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidId) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property id"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("id"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("id"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing id element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sid", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Id->serialize(current_node, parent_element, -+ property_Id->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidAttribute) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property attribute"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("attribute"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("attribute"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing attribute element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sattribute", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Attribute->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Attribute->serialize(current_node, parent_element, -+ property_Attribute->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Attribute->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for id by Property Number 1 -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryJob::SetJobAttribute::getProperty1() -+ { -+ return getId(); -+ } -+ -+ /** -+ * getter for id. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryJob::SetJobAttribute::getId() -+ { -+ return property_Id; -+ } -+ -+ /** -+ * setter for id -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::setId( -+ AviaryCommon::JobID* arg_Id) -+ { -+ -+ -+ if(isValidId && -+ arg_Id == property_Id) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"id is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetId(); -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Id = arg_Id; -+ isValidId = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for id -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::resetId() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Id != NULL) -+ { -+ -+ -+ delete property_Id; -+ -+ -+ } -+ -+ -+ -+ -+ isValidId = false; -+ return true; -+ } -+ -+ /** -+ * Check whether id is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::isIdNil() -+ { -+ return !isValidId; -+ } -+ -+ /** -+ * Set id to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::setIdNil() -+ { -+ return resetId(); -+ } -+ -+ -+ -+ /** -+ * Getter for attribute by Property Number 2 -+ */ -+ AviaryCommon::Attribute* WSF_CALL -+ AviaryJob::SetJobAttribute::getProperty2() -+ { -+ return getAttribute(); -+ } -+ -+ /** -+ * getter for attribute. -+ */ -+ AviaryCommon::Attribute* WSF_CALL -+ AviaryJob::SetJobAttribute::getAttribute() -+ { -+ return property_Attribute; -+ } -+ -+ /** -+ * setter for attribute -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::setAttribute( -+ AviaryCommon::Attribute* arg_Attribute) -+ { -+ -+ -+ if(isValidAttribute && -+ arg_Attribute == property_Attribute) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Attribute) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"attribute is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetAttribute(); -+ -+ -+ if(NULL == arg_Attribute) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Attribute = arg_Attribute; -+ isValidAttribute = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for attribute -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::resetAttribute() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Attribute != NULL) -+ { -+ -+ -+ delete property_Attribute; -+ -+ -+ } -+ -+ -+ -+ -+ isValidAttribute = false; -+ return true; -+ } -+ -+ /** -+ * Check whether attribute is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::isAttributeNil() -+ { -+ return !isValidAttribute; -+ } -+ -+ /** -+ * Set attribute to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttribute::setAttributeNil() -+ { -+ return resetAttribute(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SetJobAttributeResponse.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SetJobAttributeResponse.cpp -new file mode 100644 -index 0000000..e6b8a64 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SetJobAttributeResponse.cpp -@@ -0,0 +1,452 @@ -+ -+ -+ /** -+ * SetJobAttributeResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_SetJobAttributeResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the SetJobAttributeResponse|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::SetJobAttributeResponse::SetJobAttributeResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_SetJobAttributeResponse = NULL; -+ -+ isValidSetJobAttributeResponse = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "SetJobAttributeResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::SetJobAttributeResponse::SetJobAttributeResponse(AviaryJob::ControlJobResponse* arg_SetJobAttributeResponse) -+ { -+ -+ qname = NULL; -+ -+ property_SetJobAttributeResponse = NULL; -+ -+ isValidSetJobAttributeResponse = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "SetJobAttributeResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_SetJobAttributeResponse = arg_SetJobAttributeResponse; -+ -+ } -+ AviaryJob::SetJobAttributeResponse::~SetJobAttributeResponse() -+ { -+ if (property_SetJobAttributeResponse) delete property_SetJobAttributeResponse; -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::SetJobAttributeResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = parent; -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for SetJobAttributeResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building SetJobAttributeResponse element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "SetJobAttributeResponse", "http://job.aviary.grid.redhat.com", NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryJob::ControlJobResponse* element = new AviaryJob::ControlJobResponse(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element SetJobAttributeResponse"); -+ } -+ else -+ { -+ status = setSetJobAttributeResponse(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for SetJobAttributeResponse "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element SetJobAttributeResponse missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::SetJobAttributeResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::SetJobAttributeResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::SetJobAttributeResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "SetJobAttributeResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING))) -+ { -+ p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); -+ sprintf(p_prefix, "n%d", (*next_ns_index)++); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, p_prefix); -+ -+ axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", p_prefix)); -+ } -+ -+ -+ if (!isValidSetJobAttributeResponse) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property SetJobAttributeResponse"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("SetJobAttributeResponse"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("SetJobAttributeResponse"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing SetJobAttributeResponse element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sSetJobAttributeResponse", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ property_SetJobAttributeResponse->serialize(current_node, parent_element, -+ property_SetJobAttributeResponse->isParticle() || true, namespaces, next_ns_index); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for SetJobAttributeResponse by Property Number 1 -+ */ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ AviaryJob::SetJobAttributeResponse::getProperty1() -+ { -+ return getSetJobAttributeResponse(); -+ } -+ -+ /** -+ * getter for SetJobAttributeResponse. -+ */ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ AviaryJob::SetJobAttributeResponse::getSetJobAttributeResponse() -+ { -+ return property_SetJobAttributeResponse; -+ } -+ -+ /** -+ * setter for SetJobAttributeResponse -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttributeResponse::setSetJobAttributeResponse( -+ AviaryJob::ControlJobResponse* arg_SetJobAttributeResponse) -+ { -+ -+ -+ if(isValidSetJobAttributeResponse && -+ arg_SetJobAttributeResponse == property_SetJobAttributeResponse) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_SetJobAttributeResponse) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"SetJobAttributeResponse is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetSetJobAttributeResponse(); -+ -+ -+ if(NULL == arg_SetJobAttributeResponse) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_SetJobAttributeResponse = arg_SetJobAttributeResponse; -+ isValidSetJobAttributeResponse = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for SetJobAttributeResponse -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttributeResponse::resetSetJobAttributeResponse() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_SetJobAttributeResponse != NULL) -+ { -+ -+ -+ delete property_SetJobAttributeResponse; -+ -+ -+ } -+ -+ -+ -+ -+ isValidSetJobAttributeResponse = false; -+ return true; -+ } -+ -+ /** -+ * Check whether SetJobAttributeResponse is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttributeResponse::isSetJobAttributeResponseNil() -+ { -+ return !isValidSetJobAttributeResponse; -+ } -+ -+ /** -+ * Set SetJobAttributeResponse to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SetJobAttributeResponse::setSetJobAttributeResponseNil() -+ { -+ return resetSetJobAttributeResponse(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SubmitJob.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SubmitJob.cpp -new file mode 100644 -index 0000000..fad98ac ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SubmitJob.cpp -@@ -0,0 +1,3038 @@ -+ -+ -+ /** -+ * SubmitJob.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_SubmitJob.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the SubmitJob|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::SubmitJob::SubmitJob() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Cmd; -+ -+ isValidCmd = false; -+ -+ property_Args; -+ -+ isValidArgs = false; -+ -+ property_Owner; -+ -+ isValidOwner = false; -+ -+ property_Iwd; -+ -+ isValidIwd = false; -+ -+ property_Submission_name; -+ -+ isValidSubmission_name = false; -+ -+ property_Requirements = NULL; -+ -+ isValidRequirements = false; -+ -+ property_Extra = NULL; -+ -+ isValidExtra = false; -+ -+ isValidAllowOverrides = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "SubmitJob", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::SubmitJob::SubmitJob(std::string arg_Cmd,std::string arg_Args,std::string arg_Owner,std::string arg_Iwd,std::string arg_Submission_name,std::vector* arg_Requirements,std::vector* arg_Extra,bool arg_AllowOverrides) -+ { -+ -+ qname = NULL; -+ -+ property_Cmd; -+ -+ isValidCmd = true; -+ -+ property_Args; -+ -+ isValidArgs = true; -+ -+ property_Owner; -+ -+ isValidOwner = true; -+ -+ property_Iwd; -+ -+ isValidIwd = true; -+ -+ property_Submission_name; -+ -+ isValidSubmission_name = true; -+ -+ property_Requirements = NULL; -+ -+ isValidRequirements = true; -+ -+ property_Extra = NULL; -+ -+ isValidExtra = true; -+ -+ isValidAllowOverrides = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "SubmitJob", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Cmd = arg_Cmd; -+ -+ property_Args = arg_Args; -+ -+ property_Owner = arg_Owner; -+ -+ property_Iwd = arg_Iwd; -+ -+ property_Submission_name = arg_Submission_name; -+ -+ property_Requirements = arg_Requirements; -+ -+ property_Extra = arg_Extra; -+ -+ property_AllowOverrides = arg_AllowOverrides; -+ -+ } -+ AviaryJob::SubmitJob::~SubmitJob() -+ { -+ if (property_Requirements) { -+ while(!property_Requirements->empty()) delete property_Requirements->back(), property_Requirements->pop_back(); -+ delete property_Requirements; -+ } -+ if (property_Extra) { -+ while(!property_Extra->empty()) delete property_Extra->back(), property_Extra->pop_back(); -+ delete property_Extra; -+ } -+ axutil_qname_free (qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ axiom_attribute_t *parent_attri = NULL; -+ axiom_element_t *parent_element = NULL; -+ axis2_char_t *attrib_text = NULL; -+ -+ axutil_hash_t *attribute_hash = NULL; -+ -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for SubmitJob : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ parent_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ attribute_hash = axiom_element_get_all_attributes(parent_element, Environment::getEnv()); -+ -+ -+ -+ /* -+ * building cmd element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "cmd", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("cmd", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("cmd", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setCmd(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element cmd"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setCmd(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for cmd "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element cmd missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building args element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "args", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("args", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("args", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setArgs(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element args"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setArgs(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for args "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building owner element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "owner", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("owner", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("owner", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setOwner(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element owner"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setOwner(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for owner "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element owner missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building iwd element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "iwd", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("iwd", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("iwd", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setIwd(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element iwd"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setIwd(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for iwd "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element iwd missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building submission_name element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "submission_name", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("submission_name", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("submission_name", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setSubmission_name(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element submission_name"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setSubmission_name(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for submission_name "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ { -+ /* -+ * building Requirements array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building requirements element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "requirements", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = (is_early_node_valid?axiom_node_get_next_sibling(current_node, Environment::getEnv()):current_node); !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("requirements", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::ResourceConstraint* element = new AviaryCommon::ResourceConstraint(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element requirements "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for requirements "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"requirements (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setRequirements(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ { -+ /* -+ * building Extra array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building extra element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "extra", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = (is_early_node_valid?axiom_node_get_next_sibling(current_node, Environment::getEnv()):current_node); !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("extra", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::Attribute* element = new AviaryCommon::Attribute(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element extra "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for extra "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"extra (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setExtra(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ parent_attri = NULL; -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ -+ if(!strcmp((axis2_char_t*)key, "allowOverrides")) -+ -+ { -+ parent_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(parent_attri) -+ { -+ attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "allowOverrides", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "allowOverrides"); -+ } -+ -+ if(attrib_text != NULL) -+ { -+ -+ -+ if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true")) -+ { -+ setAllowOverrides(true); -+ } -+ else -+ { -+ setAllowOverrides(false); -+ } -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::SubmitJob::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::SubmitJob::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axiom_attribute_t *text_attri = NULL; -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t *text_value_1; -+ axis2_char_t *text_value_1_temp; -+ -+ axis2_char_t *text_value_2; -+ axis2_char_t *text_value_2_temp; -+ -+ axis2_char_t *text_value_3; -+ axis2_char_t *text_value_3_temp; -+ -+ axis2_char_t *text_value_4; -+ axis2_char_t *text_value_4_temp; -+ -+ axis2_char_t *text_value_5; -+ axis2_char_t *text_value_5_temp; -+ -+ axis2_char_t text_value_6[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_7[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_8[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value = NULL; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "SubmitJob", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!parent_tag_closed) -+ { -+ -+ if(isValidAllowOverrides) -+ { -+ -+ p_prefix = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_AllowOverrides)?"true":"false"); -+ string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) * -+ (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + -+ axutil_strlen(text_value) + -+ axutil_strlen("allowOverrides"))); -+ sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", -+ "allowOverrides", text_value); -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream); -+ -+ } -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidCmd) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property cmd"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("cmd"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("cmd"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing cmd element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%scmd>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_1 = (axis2_char_t*)property_Cmd.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_1_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_1, true); -+ if (text_value_1_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_1_temp, axutil_strlen(text_value_1_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_1_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_1, axutil_strlen(text_value_1)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidArgs) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("args"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("args"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing args element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sargs>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_2 = (axis2_char_t*)property_Args.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_2_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_2, true); -+ if (text_value_2_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2_temp, axutil_strlen(text_value_2_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_2_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidOwner) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property owner"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("owner"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("owner"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing owner element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sowner>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_3 = (axis2_char_t*)property_Owner.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_3_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_3, true); -+ if (text_value_3_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3_temp, axutil_strlen(text_value_3_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_3_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidIwd) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property iwd"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("iwd"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("iwd"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing iwd element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%siwd>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_4 = (axis2_char_t*)property_Iwd.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_4_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_4, true); -+ if (text_value_4_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_4_temp, axutil_strlen(text_value_4_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_4_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_4, axutil_strlen(text_value_4)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidSubmission_name) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("submission_name"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("submission_name"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing submission_name element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%ssubmission_name>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_5 = (axis2_char_t*)property_Submission_name.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_5_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_5, true); -+ if (text_value_5_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_5_temp, axutil_strlen(text_value_5_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_5_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_5, axutil_strlen(text_value_5)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidRequirements) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("requirements"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("requirements"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Requirements array -+ */ -+ if (property_Requirements != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%srequirements", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Requirements->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::ResourceConstraint* element = (*property_Requirements)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing requirements element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidExtra) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("extra"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("extra"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Extra array -+ */ -+ if (property_Extra != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sextra", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Extra->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::Attribute* element = (*property_Extra)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing extra element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ if(parent_tag_closed) -+ { -+ if(isValidAllowOverrides) -+ { -+ -+ p_prefix = NULL; -+ ns1 = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_AllowOverrides)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false")); -+ text_attri = axiom_attribute_create (Environment::getEnv(), "allowOverrides", text_value, ns1); -+ axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ -+ } -+ -+ } -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for cmd by Property Number 1 -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getProperty1() -+ { -+ return getCmd(); -+ } -+ -+ /** -+ * getter for cmd. -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getCmd() -+ { -+ return property_Cmd; -+ } -+ -+ /** -+ * setter for cmd -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setCmd( -+ const std::string arg_Cmd) -+ { -+ -+ -+ if(isValidCmd && -+ arg_Cmd == property_Cmd) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Cmd.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"cmd is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetCmd(); -+ -+ -+ property_Cmd = std::string(arg_Cmd.c_str()); -+ isValidCmd = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for cmd -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::resetCmd() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidCmd = false; -+ return true; -+ } -+ -+ /** -+ * Check whether cmd is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isCmdNil() -+ { -+ return !isValidCmd; -+ } -+ -+ /** -+ * Set cmd to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setCmdNil() -+ { -+ return resetCmd(); -+ } -+ -+ -+ -+ /** -+ * Getter for args by Property Number 2 -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getProperty2() -+ { -+ return getArgs(); -+ } -+ -+ /** -+ * getter for args. -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getArgs() -+ { -+ return property_Args; -+ } -+ -+ /** -+ * setter for args -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setArgs( -+ const std::string arg_Args) -+ { -+ -+ -+ if(isValidArgs && -+ arg_Args == property_Args) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetArgs(); -+ -+ -+ property_Args = std::string(arg_Args.c_str()); -+ isValidArgs = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for args -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::resetArgs() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidArgs = false; -+ return true; -+ } -+ -+ /** -+ * Check whether args is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isArgsNil() -+ { -+ return !isValidArgs; -+ } -+ -+ /** -+ * Set args to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setArgsNil() -+ { -+ return resetArgs(); -+ } -+ -+ -+ -+ /** -+ * Getter for owner by Property Number 3 -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getProperty3() -+ { -+ return getOwner(); -+ } -+ -+ /** -+ * getter for owner. -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getOwner() -+ { -+ return property_Owner; -+ } -+ -+ /** -+ * setter for owner -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setOwner( -+ const std::string arg_Owner) -+ { -+ -+ -+ if(isValidOwner && -+ arg_Owner == property_Owner) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Owner.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"owner is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetOwner(); -+ -+ -+ property_Owner = std::string(arg_Owner.c_str()); -+ isValidOwner = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for owner -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::resetOwner() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidOwner = false; -+ return true; -+ } -+ -+ /** -+ * Check whether owner is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isOwnerNil() -+ { -+ return !isValidOwner; -+ } -+ -+ /** -+ * Set owner to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setOwnerNil() -+ { -+ return resetOwner(); -+ } -+ -+ -+ -+ /** -+ * Getter for iwd by Property Number 4 -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getProperty4() -+ { -+ return getIwd(); -+ } -+ -+ /** -+ * getter for iwd. -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getIwd() -+ { -+ return property_Iwd; -+ } -+ -+ /** -+ * setter for iwd -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setIwd( -+ const std::string arg_Iwd) -+ { -+ -+ -+ if(isValidIwd && -+ arg_Iwd == property_Iwd) -+ { -+ -+ return true; -+ } -+ -+ -+ if(arg_Iwd.empty()) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"iwd is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetIwd(); -+ -+ -+ property_Iwd = std::string(arg_Iwd.c_str()); -+ isValidIwd = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for iwd -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::resetIwd() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidIwd = false; -+ return true; -+ } -+ -+ /** -+ * Check whether iwd is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isIwdNil() -+ { -+ return !isValidIwd; -+ } -+ -+ /** -+ * Set iwd to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setIwdNil() -+ { -+ return resetIwd(); -+ } -+ -+ -+ -+ /** -+ * Getter for submission_name by Property Number 5 -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getProperty5() -+ { -+ return getSubmission_name(); -+ } -+ -+ /** -+ * getter for submission_name. -+ */ -+ std::string WSF_CALL -+ AviaryJob::SubmitJob::getSubmission_name() -+ { -+ return property_Submission_name; -+ } -+ -+ /** -+ * setter for submission_name -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setSubmission_name( -+ const std::string arg_Submission_name) -+ { -+ -+ -+ if(isValidSubmission_name && -+ arg_Submission_name == property_Submission_name) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetSubmission_name(); -+ -+ -+ property_Submission_name = std::string(arg_Submission_name.c_str()); -+ isValidSubmission_name = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for submission_name -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::resetSubmission_name() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidSubmission_name = false; -+ return true; -+ } -+ -+ /** -+ * Check whether submission_name is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isSubmission_nameNil() -+ { -+ return !isValidSubmission_name; -+ } -+ -+ /** -+ * Set submission_name to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setSubmission_nameNil() -+ { -+ return resetSubmission_name(); -+ } -+ -+ -+ -+ /** -+ * Getter for requirements by Property Number 6 -+ */ -+ std::vector* WSF_CALL -+ AviaryJob::SubmitJob::getProperty6() -+ { -+ return getRequirements(); -+ } -+ -+ /** -+ * getter for requirements. -+ */ -+ std::vector* WSF_CALL -+ AviaryJob::SubmitJob::getRequirements() -+ { -+ return property_Requirements; -+ } -+ -+ /** -+ * setter for requirements -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setRequirements( -+ std::vector* arg_Requirements) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidRequirements && -+ arg_Requirements == property_Requirements) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Requirements->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"requirements has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Requirements)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetRequirements(); -+ -+ -+ if(NULL == arg_Requirements) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Requirements = arg_Requirements; -+ if(non_nil_exists) -+ { -+ isValidRequirements = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of requirements. -+ */ -+ AviaryCommon::ResourceConstraint* WSF_CALL -+ AviaryJob::SubmitJob::getRequirementsAt(int i) -+ { -+ AviaryCommon::ResourceConstraint* ret_val; -+ if(property_Requirements == NULL) -+ { -+ return (AviaryCommon::ResourceConstraint*)0; -+ } -+ ret_val = (*property_Requirements)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of requirements. -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setRequirementsAt(int i, -+ AviaryCommon::ResourceConstraint* arg_Requirements) -+ { -+ AviaryCommon::ResourceConstraint* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidRequirements && -+ property_Requirements && -+ -+ arg_Requirements == (*property_Requirements)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Requirements == NULL) -+ { -+ property_Requirements = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Requirements)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidRequirements = true; -+ (*property_Requirements)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Requirements)[i] = arg_Requirements; -+ -+ -+ isValidRequirements = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to requirements. -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::addRequirements( -+ AviaryCommon::ResourceConstraint* arg_Requirements) -+ { -+ -+ -+ if( NULL == arg_Requirements -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Requirements == NULL) -+ { -+ property_Requirements = new std::vector(); -+ } -+ -+ property_Requirements->push_back(arg_Requirements); -+ -+ isValidRequirements = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the requirements array. -+ */ -+ int WSF_CALL -+ AviaryJob::SubmitJob::sizeofRequirements() -+ { -+ -+ if(property_Requirements == NULL) -+ { -+ return 0; -+ } -+ return property_Requirements->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::removeRequirementsAt(int i) -+ { -+ return setRequirementsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for requirements -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::resetRequirements() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Requirements != NULL) -+ { -+ std::vector::iterator it = property_Requirements->begin(); -+ for( ; it < property_Requirements->end() ; ++it) -+ { -+ AviaryCommon::ResourceConstraint* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Requirements) -+ delete property_Requirements; -+ -+ isValidRequirements = false; -+ return true; -+ } -+ -+ /** -+ * Check whether requirements is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isRequirementsNil() -+ { -+ return !isValidRequirements; -+ } -+ -+ /** -+ * Set requirements to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setRequirementsNil() -+ { -+ return resetRequirements(); -+ } -+ -+ -+ /** -+ * Check whether requirements is nill at i -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isRequirementsNilAt(int i) -+ { -+ return (isValidRequirements == false || -+ NULL == property_Requirements || -+ NULL == (*property_Requirements)[i]); -+ } -+ -+ /** -+ * Set requirements to nil at i -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setRequirementsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Requirements == NULL || -+ isValidRequirements == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Requirements->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Requirements)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of requirements is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Requirements == NULL) -+ { -+ isValidRequirements = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::ResourceConstraint* element = (*property_Requirements)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidRequirements = false; -+ (*property_Requirements)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Requirements)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -+ /** -+ * Getter for extra by Property Number 7 -+ */ -+ std::vector* WSF_CALL -+ AviaryJob::SubmitJob::getProperty7() -+ { -+ return getExtra(); -+ } -+ -+ /** -+ * getter for extra. -+ */ -+ std::vector* WSF_CALL -+ AviaryJob::SubmitJob::getExtra() -+ { -+ return property_Extra; -+ } -+ -+ /** -+ * setter for extra -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setExtra( -+ std::vector* arg_Extra) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidExtra && -+ arg_Extra == property_Extra) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Extra->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"extra has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Extra)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetExtra(); -+ -+ -+ if(NULL == arg_Extra) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Extra = arg_Extra; -+ if(non_nil_exists) -+ { -+ isValidExtra = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of extra. -+ */ -+ AviaryCommon::Attribute* WSF_CALL -+ AviaryJob::SubmitJob::getExtraAt(int i) -+ { -+ AviaryCommon::Attribute* ret_val; -+ if(property_Extra == NULL) -+ { -+ return (AviaryCommon::Attribute*)0; -+ } -+ ret_val = (*property_Extra)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of extra. -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setExtraAt(int i, -+ AviaryCommon::Attribute* arg_Extra) -+ { -+ AviaryCommon::Attribute* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidExtra && -+ property_Extra && -+ -+ arg_Extra == (*property_Extra)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Extra == NULL) -+ { -+ property_Extra = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Extra)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidExtra = true; -+ (*property_Extra)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Extra)[i] = arg_Extra; -+ -+ -+ isValidExtra = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to extra. -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::addExtra( -+ AviaryCommon::Attribute* arg_Extra) -+ { -+ -+ -+ if( NULL == arg_Extra -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Extra == NULL) -+ { -+ property_Extra = new std::vector(); -+ } -+ -+ property_Extra->push_back(arg_Extra); -+ -+ isValidExtra = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the extra array. -+ */ -+ int WSF_CALL -+ AviaryJob::SubmitJob::sizeofExtra() -+ { -+ -+ if(property_Extra == NULL) -+ { -+ return 0; -+ } -+ return property_Extra->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::removeExtraAt(int i) -+ { -+ return setExtraNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for extra -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::resetExtra() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Extra != NULL) -+ { -+ std::vector::iterator it = property_Extra->begin(); -+ for( ; it < property_Extra->end() ; ++it) -+ { -+ AviaryCommon::Attribute* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Extra) -+ delete property_Extra; -+ -+ isValidExtra = false; -+ return true; -+ } -+ -+ /** -+ * Check whether extra is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isExtraNil() -+ { -+ return !isValidExtra; -+ } -+ -+ /** -+ * Set extra to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setExtraNil() -+ { -+ return resetExtra(); -+ } -+ -+ -+ /** -+ * Check whether extra is nill at i -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isExtraNilAt(int i) -+ { -+ return (isValidExtra == false || -+ NULL == property_Extra || -+ NULL == (*property_Extra)[i]); -+ } -+ -+ /** -+ * Set extra to nil at i -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setExtraNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Extra == NULL || -+ isValidExtra == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Extra->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Extra)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of extra is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Extra == NULL) -+ { -+ isValidExtra = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::Attribute* element = (*property_Extra)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidExtra = false; -+ (*property_Extra)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Extra)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -+ /** -+ * Getter for allowOverrides by Property Number 8 -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::getProperty8() -+ { -+ return getAllowOverrides(); -+ } -+ -+ /** -+ * getter for allowOverrides. -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::getAllowOverrides() -+ { -+ return property_AllowOverrides; -+ } -+ -+ /** -+ * setter for allowOverrides -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setAllowOverrides( -+ bool arg_AllowOverrides) -+ { -+ -+ -+ if(isValidAllowOverrides && -+ arg_AllowOverrides == property_AllowOverrides) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetAllowOverrides(); -+ -+ -+ property_AllowOverrides = arg_AllowOverrides; -+ isValidAllowOverrides = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for allowOverrides -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::resetAllowOverrides() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidAllowOverrides = false; -+ return true; -+ } -+ -+ /** -+ * Check whether allowOverrides is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::isAllowOverridesNil() -+ { -+ return !isValidAllowOverrides; -+ } -+ -+ /** -+ * Set allowOverrides to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJob::setAllowOverridesNil() -+ { -+ return resetAllowOverrides(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SubmitJobResponse.cpp b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SubmitJobResponse.cpp -new file mode 100644 -index 0000000..9f03b7f ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/job/src/AviaryJob_SubmitJobResponse.cpp -@@ -0,0 +1,703 @@ -+ -+ -+ /** -+ * SubmitJobResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryJob_SubmitJobResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryJob; -+ -+ /* -+ * Implementation of the SubmitJobResponse|http://job.aviary.grid.redhat.com Element -+ */ -+ AviaryJob::SubmitJobResponse::SubmitJobResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Id = NULL; -+ -+ isValidId = false; -+ -+ property_Status = NULL; -+ -+ isValidStatus = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "SubmitJobResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryJob::SubmitJobResponse::SubmitJobResponse(AviaryCommon::JobID* arg_Id,AviaryCommon::Status* arg_Status) -+ { -+ -+ qname = NULL; -+ -+ property_Id = NULL; -+ -+ isValidId = true; -+ -+ property_Status = NULL; -+ -+ isValidStatus = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "SubmitJobResponse", -+ "http://job.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Id = arg_Id; -+ -+ property_Status = arg_Status; -+ -+ } -+ AviaryJob::SubmitJobResponse::~SubmitJobResponse() -+ { -+ delete property_Id; -+ delete property_Status; -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for SubmitJobResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building id element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "id", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("id", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element id"); -+ } -+ else -+ { -+ status = setId(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for id "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building status element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Status* element = new AviaryCommon::Status(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element status"); -+ } -+ else -+ { -+ status = setStatus(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element status missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryJob::SubmitJobResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryJob::SubmitJobResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://job.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://job.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "SubmitJobResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidId) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("id"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("id"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing id element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sid", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Id->serialize(current_node, parent_element, -+ property_Id->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Id->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidStatus) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property status"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sstatus", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Status->serialize(current_node, parent_element, -+ property_Status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for id by Property Number 1 -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryJob::SubmitJobResponse::getProperty1() -+ { -+ return getId(); -+ } -+ -+ /** -+ * getter for id. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryJob::SubmitJobResponse::getId() -+ { -+ return property_Id; -+ } -+ -+ /** -+ * setter for id -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::setId( -+ AviaryCommon::JobID* arg_Id) -+ { -+ -+ -+ if(isValidId && -+ arg_Id == property_Id) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetId(); -+ -+ -+ if(NULL == arg_Id) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Id = arg_Id; -+ isValidId = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for id -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::resetId() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Id != NULL) -+ { -+ -+ -+ delete property_Id; -+ -+ -+ } -+ -+ -+ -+ -+ isValidId = false; -+ return true; -+ } -+ -+ /** -+ * Check whether id is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::isIdNil() -+ { -+ return !isValidId; -+ } -+ -+ /** -+ * Set id to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::setIdNil() -+ { -+ return resetId(); -+ } -+ -+ -+ -+ /** -+ * Getter for status by Property Number 2 -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryJob::SubmitJobResponse::getProperty2() -+ { -+ return getStatus(); -+ } -+ -+ /** -+ * getter for status. -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryJob::SubmitJobResponse::getStatus() -+ { -+ return property_Status; -+ } -+ -+ /** -+ * setter for status -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::setStatus( -+ AviaryCommon::Status* arg_Status) -+ { -+ -+ -+ if(isValidStatus && -+ arg_Status == property_Status) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"status is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetStatus(); -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Status = arg_Status; -+ isValidStatus = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for status -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::resetStatus() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Status != NULL) -+ { -+ -+ -+ delete property_Status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidStatus = false; -+ return true; -+ } -+ -+ /** -+ * Check whether status is nill -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::isStatusNil() -+ { -+ return !isValidStatus; -+ } -+ -+ /** -+ * Set status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryJob::SubmitJobResponse::setStatusNil() -+ { -+ return resetStatus(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobData.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobData.cpp -new file mode 100644 -index 0000000..1b73427 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobData.cpp -@@ -0,0 +1,911 @@ -+ -+ -+ /** -+ * GetJobData.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetJobData.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetJobData|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetJobData::GetJobData() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Data = NULL; -+ -+ isValidData = false; -+ -+ isValidMax_bytes = false; -+ -+ isValidFrom_end = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobData", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetJobData::GetJobData(AviaryCommon::JobData* arg_Data,int arg_Max_bytes,bool arg_From_end) -+ { -+ -+ qname = NULL; -+ -+ property_Data = NULL; -+ -+ isValidData = true; -+ -+ isValidMax_bytes = true; -+ -+ isValidFrom_end = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobData", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Data = arg_Data; -+ -+ property_Max_bytes = arg_Max_bytes; -+ -+ property_From_end = arg_From_end; -+ -+ } -+ AviaryQuery::GetJobData::~GetJobData() -+ { -+ if (property_Data) delete property_Data; -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetJobData : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building data element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "data", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("data", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("data", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobData* element = new AviaryCommon::JobData(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element data"); -+ } -+ else -+ { -+ status = setData(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for data "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element data missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building max_bytes element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "max_bytes", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("max_bytes", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("max_bytes", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setMax_bytes(atoi(text_value)); -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element max_bytes"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for max_bytes "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element max_bytes missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building from_end element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "from_end", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("from_end", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("from_end", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ if (!axutil_strcasecmp(text_value , "true")) -+ { -+ status = setFrom_end(true); -+ } -+ else -+ { -+ status = setFrom_end(false); -+ } -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element from_end"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for from_end "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetJobData::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetJobData::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_3[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetJobData", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidData) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property data"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("data"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("data"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing data element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sdata", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Data->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Data->serialize(current_node, parent_element, -+ property_Data->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Data->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidMax_bytes) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property max_bytes"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("max_bytes"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("max_bytes"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing max_bytes element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%smax_bytes>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ sprintf (text_value_2, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, property_Max_bytes); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_2, axutil_strlen(text_value_2)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidFrom_end) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("from_end"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("from_end"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing from_end element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sfrom_end>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ strcpy(text_value_3, (property_From_end)?"true":"false"); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for data by Property Number 1 -+ */ -+ AviaryCommon::JobData* WSF_CALL -+ AviaryQuery::GetJobData::getProperty1() -+ { -+ return getData(); -+ } -+ -+ /** -+ * getter for data. -+ */ -+ AviaryCommon::JobData* WSF_CALL -+ AviaryQuery::GetJobData::getData() -+ { -+ return property_Data; -+ } -+ -+ /** -+ * setter for data -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::setData( -+ AviaryCommon::JobData* arg_Data) -+ { -+ -+ -+ if(isValidData && -+ arg_Data == property_Data) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Data) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"data is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetData(); -+ -+ -+ if(NULL == arg_Data) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Data = arg_Data; -+ isValidData = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for data -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::resetData() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Data != NULL) -+ { -+ -+ -+ delete property_Data; -+ -+ -+ } -+ -+ -+ -+ -+ isValidData = false; -+ return true; -+ } -+ -+ /** -+ * Check whether data is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::isDataNil() -+ { -+ return !isValidData; -+ } -+ -+ /** -+ * Set data to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::setDataNil() -+ { -+ return resetData(); -+ } -+ -+ -+ -+ /** -+ * Getter for max_bytes by Property Number 2 -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobData::getProperty2() -+ { -+ return getMax_bytes(); -+ } -+ -+ /** -+ * getter for max_bytes. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobData::getMax_bytes() -+ { -+ return property_Max_bytes; -+ } -+ -+ /** -+ * setter for max_bytes -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::setMax_bytes( -+ const int arg_Max_bytes) -+ { -+ -+ -+ if(isValidMax_bytes && -+ arg_Max_bytes == property_Max_bytes) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetMax_bytes(); -+ -+ -+ property_Max_bytes = arg_Max_bytes; -+ isValidMax_bytes = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for max_bytes -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::resetMax_bytes() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidMax_bytes = false; -+ return true; -+ } -+ -+ /** -+ * Check whether max_bytes is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::isMax_bytesNil() -+ { -+ return !isValidMax_bytes; -+ } -+ -+ /** -+ * Set max_bytes to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::setMax_bytesNil() -+ { -+ return resetMax_bytes(); -+ } -+ -+ -+ -+ /** -+ * Getter for from_end by Property Number 3 -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::getProperty3() -+ { -+ return getFrom_end(); -+ } -+ -+ /** -+ * getter for from_end. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::getFrom_end() -+ { -+ return property_From_end; -+ } -+ -+ /** -+ * setter for from_end -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::setFrom_end( -+ bool arg_From_end) -+ { -+ -+ -+ if(isValidFrom_end && -+ arg_From_end == property_From_end) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetFrom_end(); -+ -+ -+ property_From_end = arg_From_end; -+ isValidFrom_end = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for from_end -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::resetFrom_end() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidFrom_end = false; -+ return true; -+ } -+ -+ /** -+ * Check whether from_end is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::isFrom_endNil() -+ { -+ return !isValidFrom_end; -+ } -+ -+ /** -+ * Set from_end to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobData::setFrom_endNil() -+ { -+ return resetFrom_end(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDataResponse.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDataResponse.cpp -new file mode 100644 -index 0000000..f2c6f6b ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDataResponse.cpp -@@ -0,0 +1,1513 @@ -+ -+ -+ /** -+ * GetJobDataResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetJobDataResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetJobDataResponse|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetJobDataResponse::GetJobDataResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Data = NULL; -+ -+ isValidData = false; -+ -+ property_Status = NULL; -+ -+ isValidStatus = false; -+ -+ property_File_name; -+ -+ isValidFile_name = false; -+ -+ isValidFile_size = false; -+ -+ property_Content; -+ -+ isValidContent = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobDataResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetJobDataResponse::GetJobDataResponse(AviaryCommon::JobData* arg_Data,AviaryCommon::Status* arg_Status,std::string arg_File_name,int arg_File_size,std::string arg_Content) -+ { -+ -+ qname = NULL; -+ -+ property_Data = NULL; -+ -+ isValidData = true; -+ -+ property_Status = NULL; -+ -+ isValidStatus = true; -+ -+ property_File_name; -+ -+ isValidFile_name = true; -+ -+ isValidFile_size = true; -+ -+ property_Content; -+ -+ isValidContent = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobDataResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Data = arg_Data; -+ -+ property_Status = arg_Status; -+ -+ property_File_name = arg_File_name; -+ -+ property_File_size = arg_File_size; -+ -+ property_Content = arg_Content; -+ -+ } -+ AviaryQuery::GetJobDataResponse::~GetJobDataResponse() -+ { -+ if (property_Data) delete property_Data; -+ if (property_Status) delete property_Status; -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetJobDataResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ /* -+ * building data element -+ */ -+ -+ -+ -+ current_node = first_node; -+ is_early_node_valid = false; -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "data", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("data", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("data", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::JobData* element = new AviaryCommon::JobData(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element data"); -+ } -+ else -+ { -+ status = setData(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for data "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element data missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building status element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "status", NULL, NULL); -+ -+ -+ if (isParticle() || -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("status", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ AviaryCommon::Status* element = new AviaryCommon::Status(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in building adb object for element status"); -+ } -+ else -+ { -+ status = setStatus(element); -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for status "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ else if(!dont_care_minoccurs) -+ { -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ /* this is not a nillable element*/ -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "non nillable or minOuccrs != 0 element status missing"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building file_name element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "file_name", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("file_name", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("file_name", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setFile_name(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element file_name"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setFile_name(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for file_name "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building file_size element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "file_size", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("file_size", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("file_size", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setFile_size(atoi(text_value)); -+ } -+ -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element file_size"); -+ status = AXIS2_FAILURE; -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for file_size "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ /* -+ * building content element -+ */ -+ -+ -+ -+ /* -+ * because elements are ordered this works fine -+ */ -+ -+ -+ if(current_node != NULL && is_early_node_valid) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ -+ -+ while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ if(current_node != NULL) -+ { -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ } -+ -+ } -+ is_early_node_valid = false; -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "content", NULL, NULL); -+ -+ -+ if ( -+ (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("content", axiom_element_get_localname(current_element, Environment::getEnv()))))) -+ { -+ if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("content", axiom_element_get_localname(current_element, Environment::getEnv())))) -+ { -+ is_early_node_valid = true; -+ } -+ -+ -+ text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node); -+ if(text_value != NULL) -+ { -+ status = setContent(text_value); -+ } -+ -+ else -+ { -+ /* -+ * axis2_qname_t *qname = NULL; -+ * axiom_attribute_t *the_attri = NULL; -+ * -+ * qname = axutil_qname_create(Environment::getEnv(), "nil", "http://www.w3.org/2001/XMLSchema-instance", "xsi"); -+ * the_attri = axiom_element_get_attribute(current_element, Environment::getEnv(), qname); -+ */ -+ /* currently thereis a bug in the axiom_element_get_attribute, so we have to go to this bad method */ -+ -+ axiom_attribute_t *the_attri = NULL; -+ axis2_char_t *attrib_text = NULL; -+ axutil_hash_t *attribute_hash = NULL; -+ -+ attribute_hash = axiom_element_get_all_attributes(current_element, Environment::getEnv()); -+ -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ if(strstr((axis2_char_t*)key, "nil|http://www.w3.org/2001/XMLSchema-instance")) -+ { -+ the_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(the_attri) -+ { -+ attrib_text = axiom_attribute_get_value(the_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "http://www.w3.org/2001/XMLSchema-instance", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(current_element, Environment::getEnv(), "nil"); -+ } -+ -+ if(attrib_text && 0 == axutil_strcmp(attrib_text, "1")) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "NULL value is set to a non nillable element content"); -+ status = AXIS2_FAILURE; -+ } -+ else -+ { -+ /* after all, we found this is a empty string */ -+ status = setContent(""); -+ } -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for content "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ return AXIS2_FAILURE; -+ } -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetJobDataResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetJobDataResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_3; -+ axis2_char_t *text_value_3_temp; -+ -+ axis2_char_t text_value_4[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value_5; -+ axis2_char_t *text_value_5_temp; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetJobDataResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidData) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property data"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("data"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("data"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing data element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sdata", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Data->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Data->serialize(current_node, parent_element, -+ property_Data->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Data->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidStatus) -+ { -+ -+ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"Nil value found in non-nillable property status"); -+ return NULL; -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("status"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("status"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing status element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sstatus", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ property_Status->serialize(current_node, parent_element, -+ property_Status->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!property_Status->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidFile_name) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("file_name"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("file_name"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing file_name element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sfile_name>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_3 = (axis2_char_t*)property_File_name.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_3_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_3, true); -+ if (text_value_3_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3_temp, axutil_strlen(text_value_3_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_3_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_3, axutil_strlen(text_value_3)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidFile_size) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("file_size"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("file_size"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing file_size element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%sfile_size>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ sprintf (text_value_4, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, property_File_size); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ axutil_stream_write(stream, Environment::getEnv(), text_value_4, axutil_strlen(text_value_4)); -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidContent) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("content"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("content"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ -+ /* -+ * parsing content element -+ */ -+ -+ -+ -+ sprintf(start_input_str, "<%s%scontent>", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ text_value_5 = (axis2_char_t*)property_Content.c_str(); -+ -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ -+ -+ text_value_5_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_5, true); -+ if (text_value_5_temp) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_5_temp, axutil_strlen(text_value_5_temp)); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value_5_temp); -+ } -+ else -+ { -+ axutil_stream_write(stream, Environment::getEnv(), text_value_5, axutil_strlen(text_value_5)); -+ } -+ -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for data by Property Number 1 -+ */ -+ AviaryCommon::JobData* WSF_CALL -+ AviaryQuery::GetJobDataResponse::getProperty1() -+ { -+ return getData(); -+ } -+ -+ /** -+ * getter for data. -+ */ -+ AviaryCommon::JobData* WSF_CALL -+ AviaryQuery::GetJobDataResponse::getData() -+ { -+ return property_Data; -+ } -+ -+ /** -+ * setter for data -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setData( -+ AviaryCommon::JobData* arg_Data) -+ { -+ -+ -+ if(isValidData && -+ arg_Data == property_Data) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Data) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"data is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetData(); -+ -+ -+ if(NULL == arg_Data) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Data = arg_Data; -+ isValidData = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for data -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::resetData() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Data != NULL) -+ { -+ -+ -+ delete property_Data; -+ -+ -+ } -+ -+ -+ -+ -+ isValidData = false; -+ return true; -+ } -+ -+ /** -+ * Check whether data is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::isDataNil() -+ { -+ return !isValidData; -+ } -+ -+ /** -+ * Set data to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setDataNil() -+ { -+ return resetData(); -+ } -+ -+ -+ -+ /** -+ * Getter for status by Property Number 2 -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryQuery::GetJobDataResponse::getProperty2() -+ { -+ return getStatus(); -+ } -+ -+ /** -+ * getter for status. -+ */ -+ AviaryCommon::Status* WSF_CALL -+ AviaryQuery::GetJobDataResponse::getStatus() -+ { -+ return property_Status; -+ } -+ -+ /** -+ * setter for status -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setStatus( -+ AviaryCommon::Status* arg_Status) -+ { -+ -+ -+ if(isValidStatus && -+ arg_Status == property_Status) -+ { -+ -+ return true; -+ } -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"status is being set to NULL, but it is not a nullable element"); -+ return AXIS2_FAILURE; -+ } -+ -+ -+ -+ resetStatus(); -+ -+ -+ if(NULL == arg_Status) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Status = arg_Status; -+ isValidStatus = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for status -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::resetStatus() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ -+ -+ -+ if(property_Status != NULL) -+ { -+ -+ -+ delete property_Status; -+ -+ -+ } -+ -+ -+ -+ -+ isValidStatus = false; -+ return true; -+ } -+ -+ /** -+ * Check whether status is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::isStatusNil() -+ { -+ return !isValidStatus; -+ } -+ -+ /** -+ * Set status to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setStatusNil() -+ { -+ return resetStatus(); -+ } -+ -+ -+ -+ /** -+ * Getter for file_name by Property Number 3 -+ */ -+ std::string WSF_CALL -+ AviaryQuery::GetJobDataResponse::getProperty3() -+ { -+ return getFile_name(); -+ } -+ -+ /** -+ * getter for file_name. -+ */ -+ std::string WSF_CALL -+ AviaryQuery::GetJobDataResponse::getFile_name() -+ { -+ return property_File_name; -+ } -+ -+ /** -+ * setter for file_name -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setFile_name( -+ const std::string arg_File_name) -+ { -+ -+ -+ if(isValidFile_name && -+ arg_File_name == property_File_name) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetFile_name(); -+ -+ -+ property_File_name = std::string(arg_File_name.c_str()); -+ isValidFile_name = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for file_name -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::resetFile_name() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidFile_name = false; -+ return true; -+ } -+ -+ /** -+ * Check whether file_name is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::isFile_nameNil() -+ { -+ return !isValidFile_name; -+ } -+ -+ /** -+ * Set file_name to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setFile_nameNil() -+ { -+ return resetFile_name(); -+ } -+ -+ -+ -+ /** -+ * Getter for file_size by Property Number 4 -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobDataResponse::getProperty4() -+ { -+ return getFile_size(); -+ } -+ -+ /** -+ * getter for file_size. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobDataResponse::getFile_size() -+ { -+ return property_File_size; -+ } -+ -+ /** -+ * setter for file_size -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setFile_size( -+ const int arg_File_size) -+ { -+ -+ -+ if(isValidFile_size && -+ arg_File_size == property_File_size) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetFile_size(); -+ -+ -+ property_File_size = arg_File_size; -+ isValidFile_size = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for file_size -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::resetFile_size() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidFile_size = false; -+ return true; -+ } -+ -+ /** -+ * Check whether file_size is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::isFile_sizeNil() -+ { -+ return !isValidFile_size; -+ } -+ -+ /** -+ * Set file_size to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setFile_sizeNil() -+ { -+ return resetFile_size(); -+ } -+ -+ -+ -+ /** -+ * Getter for content by Property Number 5 -+ */ -+ std::string WSF_CALL -+ AviaryQuery::GetJobDataResponse::getProperty5() -+ { -+ return getContent(); -+ } -+ -+ /** -+ * getter for content. -+ */ -+ std::string WSF_CALL -+ AviaryQuery::GetJobDataResponse::getContent() -+ { -+ return property_Content; -+ } -+ -+ /** -+ * setter for content -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setContent( -+ const std::string arg_Content) -+ { -+ -+ -+ if(isValidContent && -+ arg_Content == property_Content) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetContent(); -+ -+ -+ property_Content = std::string(arg_Content.c_str()); -+ isValidContent = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for content -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::resetContent() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidContent = false; -+ return true; -+ } -+ -+ /** -+ * Check whether content is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::isContentNil() -+ { -+ return !isValidContent; -+ } -+ -+ /** -+ * Set content to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDataResponse::setContentNil() -+ { -+ return resetContent(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDetails.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDetails.cpp -new file mode 100644 -index 0000000..95ea11a ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDetails.cpp -@@ -0,0 +1,984 @@ -+ -+ -+ /** -+ * GetJobDetails.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetJobDetails.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetJobDetails|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetJobDetails::GetJobDetails() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Ids = NULL; -+ -+ isValidIds = false; -+ -+ isValidPartialMatches = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobDetails", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetJobDetails::GetJobDetails(std::vector* arg_Ids,bool arg_PartialMatches) -+ { -+ -+ qname = NULL; -+ -+ property_Ids = NULL; -+ -+ isValidIds = true; -+ -+ isValidPartialMatches = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobDetails", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Ids = arg_Ids; -+ -+ property_PartialMatches = arg_PartialMatches; -+ -+ } -+ AviaryQuery::GetJobDetails::~GetJobDetails() -+ { -+ if (property_Ids) { -+ while(!property_Ids->empty()) delete property_Ids->back(), property_Ids->pop_back(); -+ delete property_Ids; -+ } -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ axiom_attribute_t *parent_attri = NULL; -+ axiom_element_t *parent_element = NULL; -+ axis2_char_t *attrib_text = NULL; -+ -+ axutil_hash_t *attribute_hash = NULL; -+ -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetJobDetails : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ parent_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ attribute_hash = axiom_element_get_all_attributes(parent_element, Environment::getEnv()); -+ -+ { -+ /* -+ * building Ids array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building ids element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "ids", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("ids", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element ids "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for ids "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setIds(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ parent_attri = NULL; -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ -+ if(!strcmp((axis2_char_t*)key, "partialMatches")) -+ -+ { -+ parent_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(parent_attri) -+ { -+ attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "partialMatches", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "partialMatches"); -+ } -+ -+ if(attrib_text != NULL) -+ { -+ -+ -+ if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true")) -+ { -+ setPartialMatches(true); -+ } -+ else -+ { -+ setPartialMatches(false); -+ } -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetJobDetails::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetJobDetails::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axiom_attribute_t *text_attri = NULL; -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value = NULL; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetJobDetails", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!parent_tag_closed) -+ { -+ -+ if(isValidPartialMatches) -+ { -+ -+ p_prefix = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_PartialMatches)?"true":"false"); -+ string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) * -+ (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + -+ axutil_strlen(text_value) + -+ axutil_strlen("partialMatches"))); -+ sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", -+ "partialMatches", text_value); -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream); -+ -+ } -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidIds) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("ids"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("ids"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Ids array -+ */ -+ if (property_Ids != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sids", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Ids->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::JobID* element = (*property_Ids)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing ids element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ if(parent_tag_closed) -+ { -+ if(isValidPartialMatches) -+ { -+ -+ p_prefix = NULL; -+ ns1 = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_PartialMatches)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false")); -+ text_attri = axiom_attribute_create (Environment::getEnv(), "partialMatches", text_value, ns1); -+ axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ -+ } -+ -+ } -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ids by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobDetails::getProperty1() -+ { -+ return getIds(); -+ } -+ -+ /** -+ * getter for ids. -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobDetails::getIds() -+ { -+ return property_Ids; -+ } -+ -+ /** -+ * setter for ids -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::setIds( -+ std::vector* arg_Ids) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidIds && -+ arg_Ids == property_Ids) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Ids->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Ids)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetIds(); -+ -+ -+ if(NULL == arg_Ids) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Ids = arg_Ids; -+ if(non_nil_exists) -+ { -+ isValidIds = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of ids. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryQuery::GetJobDetails::getIdsAt(int i) -+ { -+ AviaryCommon::JobID* ret_val; -+ if(property_Ids == NULL) -+ { -+ return (AviaryCommon::JobID*)0; -+ } -+ ret_val = (*property_Ids)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of ids. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::setIdsAt(int i, -+ AviaryCommon::JobID* arg_Ids) -+ { -+ AviaryCommon::JobID* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidIds && -+ property_Ids && -+ -+ arg_Ids == (*property_Ids)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Ids == NULL) -+ { -+ property_Ids = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Ids)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidIds = true; -+ (*property_Ids)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Ids)[i] = arg_Ids; -+ -+ -+ isValidIds = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to ids. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::addIds( -+ AviaryCommon::JobID* arg_Ids) -+ { -+ -+ -+ if( NULL == arg_Ids -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Ids == NULL) -+ { -+ property_Ids = new std::vector(); -+ } -+ -+ property_Ids->push_back(arg_Ids); -+ -+ isValidIds = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the ids array. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobDetails::sizeofIds() -+ { -+ -+ if(property_Ids == NULL) -+ { -+ return 0; -+ } -+ return property_Ids->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::removeIdsAt(int i) -+ { -+ return setIdsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for ids -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::resetIds() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Ids != NULL) -+ { -+ std::vector::iterator it = property_Ids->begin(); -+ for( ; it < property_Ids->end() ; ++it) -+ { -+ AviaryCommon::JobID* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Ids) -+ delete property_Ids; -+ -+ isValidIds = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ids is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::isIdsNil() -+ { -+ return !isValidIds; -+ } -+ -+ /** -+ * Set ids to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::setIdsNil() -+ { -+ return resetIds(); -+ } -+ -+ -+ /** -+ * Check whether ids is nill at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::isIdsNilAt(int i) -+ { -+ return (isValidIds == false || -+ NULL == property_Ids || -+ NULL == (*property_Ids)[i]); -+ } -+ -+ /** -+ * Set ids to nil at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::setIdsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Ids == NULL || -+ isValidIds == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Ids->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Ids)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of ids is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Ids == NULL) -+ { -+ isValidIds = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::JobID* element = (*property_Ids)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidIds = false; -+ (*property_Ids)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Ids)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -+ /** -+ * Getter for partialMatches by Property Number 2 -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::getProperty2() -+ { -+ return getPartialMatches(); -+ } -+ -+ /** -+ * getter for partialMatches. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::getPartialMatches() -+ { -+ return property_PartialMatches; -+ } -+ -+ /** -+ * setter for partialMatches -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::setPartialMatches( -+ bool arg_PartialMatches) -+ { -+ -+ -+ if(isValidPartialMatches && -+ arg_PartialMatches == property_PartialMatches) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetPartialMatches(); -+ -+ -+ property_PartialMatches = arg_PartialMatches; -+ isValidPartialMatches = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for partialMatches -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::resetPartialMatches() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidPartialMatches = false; -+ return true; -+ } -+ -+ /** -+ * Check whether partialMatches is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::isPartialMatchesNil() -+ { -+ return !isValidPartialMatches; -+ } -+ -+ /** -+ * Set partialMatches to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetails::setPartialMatchesNil() -+ { -+ return resetPartialMatches(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDetailsResponse.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDetailsResponse.cpp -new file mode 100644 -index 0000000..0fcb9ae ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobDetailsResponse.cpp -@@ -0,0 +1,780 @@ -+ -+ -+ /** -+ * GetJobDetailsResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetJobDetailsResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetJobDetailsResponse|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetJobDetailsResponse::GetJobDetailsResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Jobs = NULL; -+ -+ isValidJobs = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobDetailsResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetJobDetailsResponse::GetJobDetailsResponse(std::vector* arg_Jobs) -+ { -+ -+ qname = NULL; -+ -+ property_Jobs = NULL; -+ -+ isValidJobs = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobDetailsResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Jobs = arg_Jobs; -+ -+ } -+ AviaryQuery::GetJobDetailsResponse::~GetJobDetailsResponse() -+ { -+ if (property_Jobs) { -+ while(!property_Jobs->empty()) delete property_Jobs->back(), property_Jobs->pop_back(); -+ delete property_Jobs; -+ } -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetJobDetailsResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ { -+ /* -+ * building Jobs array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building jobs element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "jobs", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("jobs", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::JobDetails* element = new AviaryCommon::JobDetails(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element jobs "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for jobs "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"jobs (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setJobs(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetJobDetailsResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidJobs) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("jobs"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("jobs"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Jobs array -+ */ -+ if (property_Jobs != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sjobs", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Jobs->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::JobDetails* element = (*property_Jobs)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing jobs element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for jobs by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::getProperty1() -+ { -+ return getJobs(); -+ } -+ -+ /** -+ * getter for jobs. -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::getJobs() -+ { -+ return property_Jobs; -+ } -+ -+ /** -+ * setter for jobs -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::setJobs( -+ std::vector* arg_Jobs) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidJobs && -+ arg_Jobs == property_Jobs) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Jobs->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"jobs has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Jobs)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetJobs(); -+ -+ -+ if(NULL == arg_Jobs) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Jobs = arg_Jobs; -+ if(non_nil_exists) -+ { -+ isValidJobs = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of jobs. -+ */ -+ AviaryCommon::JobDetails* WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::getJobsAt(int i) -+ { -+ AviaryCommon::JobDetails* ret_val; -+ if(property_Jobs == NULL) -+ { -+ return (AviaryCommon::JobDetails*)0; -+ } -+ ret_val = (*property_Jobs)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of jobs. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::setJobsAt(int i, -+ AviaryCommon::JobDetails* arg_Jobs) -+ { -+ AviaryCommon::JobDetails* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidJobs && -+ property_Jobs && -+ -+ arg_Jobs == (*property_Jobs)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Jobs == NULL) -+ { -+ property_Jobs = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Jobs)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidJobs = true; -+ (*property_Jobs)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Jobs)[i] = arg_Jobs; -+ -+ -+ isValidJobs = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to jobs. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::addJobs( -+ AviaryCommon::JobDetails* arg_Jobs) -+ { -+ -+ -+ if( NULL == arg_Jobs -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Jobs == NULL) -+ { -+ property_Jobs = new std::vector(); -+ } -+ -+ property_Jobs->push_back(arg_Jobs); -+ -+ isValidJobs = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the jobs array. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::sizeofJobs() -+ { -+ -+ if(property_Jobs == NULL) -+ { -+ return 0; -+ } -+ return property_Jobs->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::removeJobsAt(int i) -+ { -+ return setJobsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for jobs -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::resetJobs() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Jobs != NULL) -+ { -+ std::vector::iterator it = property_Jobs->begin(); -+ for( ; it < property_Jobs->end() ; ++it) -+ { -+ AviaryCommon::JobDetails* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Jobs) -+ delete property_Jobs; -+ -+ isValidJobs = false; -+ return true; -+ } -+ -+ /** -+ * Check whether jobs is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::isJobsNil() -+ { -+ return !isValidJobs; -+ } -+ -+ /** -+ * Set jobs to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::setJobsNil() -+ { -+ return resetJobs(); -+ } -+ -+ -+ /** -+ * Check whether jobs is nill at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::isJobsNilAt(int i) -+ { -+ return (isValidJobs == false || -+ NULL == property_Jobs || -+ NULL == (*property_Jobs)[i]); -+ } -+ -+ /** -+ * Set jobs to nil at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobDetailsResponse::setJobsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Jobs == NULL || -+ isValidJobs == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Jobs->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Jobs)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of jobs is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Jobs == NULL) -+ { -+ isValidJobs = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::JobDetails* element = (*property_Jobs)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidJobs = false; -+ (*property_Jobs)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Jobs)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobStatus.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobStatus.cpp -new file mode 100644 -index 0000000..e7e69fe ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobStatus.cpp -@@ -0,0 +1,984 @@ -+ -+ -+ /** -+ * GetJobStatus.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetJobStatus.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetJobStatus|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetJobStatus::GetJobStatus() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Ids = NULL; -+ -+ isValidIds = false; -+ -+ isValidPartialMatches = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobStatus", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetJobStatus::GetJobStatus(std::vector* arg_Ids,bool arg_PartialMatches) -+ { -+ -+ qname = NULL; -+ -+ property_Ids = NULL; -+ -+ isValidIds = true; -+ -+ isValidPartialMatches = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobStatus", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Ids = arg_Ids; -+ -+ property_PartialMatches = arg_PartialMatches; -+ -+ } -+ AviaryQuery::GetJobStatus::~GetJobStatus() -+ { -+ if (property_Ids) { -+ while(!property_Ids->empty()) delete property_Ids->back(), property_Ids->pop_back(); -+ delete property_Ids; -+ } -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ axiom_attribute_t *parent_attri = NULL; -+ axiom_element_t *parent_element = NULL; -+ axis2_char_t *attrib_text = NULL; -+ -+ axutil_hash_t *attribute_hash = NULL; -+ -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetJobStatus : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ parent_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ attribute_hash = axiom_element_get_all_attributes(parent_element, Environment::getEnv()); -+ -+ { -+ /* -+ * building Ids array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building ids element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "ids", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("ids", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element ids "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for ids "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setIds(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ parent_attri = NULL; -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ -+ if(!strcmp((axis2_char_t*)key, "partialMatches")) -+ -+ { -+ parent_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(parent_attri) -+ { -+ attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "partialMatches", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "partialMatches"); -+ } -+ -+ if(attrib_text != NULL) -+ { -+ -+ -+ if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true")) -+ { -+ setPartialMatches(true); -+ } -+ else -+ { -+ setPartialMatches(false); -+ } -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetJobStatus::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetJobStatus::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axiom_attribute_t *text_attri = NULL; -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value = NULL; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetJobStatus", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!parent_tag_closed) -+ { -+ -+ if(isValidPartialMatches) -+ { -+ -+ p_prefix = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_PartialMatches)?"true":"false"); -+ string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) * -+ (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + -+ axutil_strlen(text_value) + -+ axutil_strlen("partialMatches"))); -+ sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", -+ "partialMatches", text_value); -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream); -+ -+ } -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidIds) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("ids"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("ids"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Ids array -+ */ -+ if (property_Ids != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sids", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Ids->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::JobID* element = (*property_Ids)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing ids element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ if(parent_tag_closed) -+ { -+ if(isValidPartialMatches) -+ { -+ -+ p_prefix = NULL; -+ ns1 = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_PartialMatches)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false")); -+ text_attri = axiom_attribute_create (Environment::getEnv(), "partialMatches", text_value, ns1); -+ axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ -+ } -+ -+ } -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ids by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobStatus::getProperty1() -+ { -+ return getIds(); -+ } -+ -+ /** -+ * getter for ids. -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobStatus::getIds() -+ { -+ return property_Ids; -+ } -+ -+ /** -+ * setter for ids -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::setIds( -+ std::vector* arg_Ids) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidIds && -+ arg_Ids == property_Ids) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Ids->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Ids)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetIds(); -+ -+ -+ if(NULL == arg_Ids) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Ids = arg_Ids; -+ if(non_nil_exists) -+ { -+ isValidIds = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of ids. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryQuery::GetJobStatus::getIdsAt(int i) -+ { -+ AviaryCommon::JobID* ret_val; -+ if(property_Ids == NULL) -+ { -+ return (AviaryCommon::JobID*)0; -+ } -+ ret_val = (*property_Ids)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of ids. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::setIdsAt(int i, -+ AviaryCommon::JobID* arg_Ids) -+ { -+ AviaryCommon::JobID* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidIds && -+ property_Ids && -+ -+ arg_Ids == (*property_Ids)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Ids == NULL) -+ { -+ property_Ids = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Ids)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidIds = true; -+ (*property_Ids)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Ids)[i] = arg_Ids; -+ -+ -+ isValidIds = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to ids. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::addIds( -+ AviaryCommon::JobID* arg_Ids) -+ { -+ -+ -+ if( NULL == arg_Ids -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Ids == NULL) -+ { -+ property_Ids = new std::vector(); -+ } -+ -+ property_Ids->push_back(arg_Ids); -+ -+ isValidIds = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the ids array. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobStatus::sizeofIds() -+ { -+ -+ if(property_Ids == NULL) -+ { -+ return 0; -+ } -+ return property_Ids->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::removeIdsAt(int i) -+ { -+ return setIdsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for ids -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::resetIds() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Ids != NULL) -+ { -+ std::vector::iterator it = property_Ids->begin(); -+ for( ; it < property_Ids->end() ; ++it) -+ { -+ AviaryCommon::JobID* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Ids) -+ delete property_Ids; -+ -+ isValidIds = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ids is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::isIdsNil() -+ { -+ return !isValidIds; -+ } -+ -+ /** -+ * Set ids to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::setIdsNil() -+ { -+ return resetIds(); -+ } -+ -+ -+ /** -+ * Check whether ids is nill at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::isIdsNilAt(int i) -+ { -+ return (isValidIds == false || -+ NULL == property_Ids || -+ NULL == (*property_Ids)[i]); -+ } -+ -+ /** -+ * Set ids to nil at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::setIdsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Ids == NULL || -+ isValidIds == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Ids->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Ids)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of ids is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Ids == NULL) -+ { -+ isValidIds = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::JobID* element = (*property_Ids)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidIds = false; -+ (*property_Ids)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Ids)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -+ /** -+ * Getter for partialMatches by Property Number 2 -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::getProperty2() -+ { -+ return getPartialMatches(); -+ } -+ -+ /** -+ * getter for partialMatches. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::getPartialMatches() -+ { -+ return property_PartialMatches; -+ } -+ -+ /** -+ * setter for partialMatches -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::setPartialMatches( -+ bool arg_PartialMatches) -+ { -+ -+ -+ if(isValidPartialMatches && -+ arg_PartialMatches == property_PartialMatches) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetPartialMatches(); -+ -+ -+ property_PartialMatches = arg_PartialMatches; -+ isValidPartialMatches = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for partialMatches -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::resetPartialMatches() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidPartialMatches = false; -+ return true; -+ } -+ -+ /** -+ * Check whether partialMatches is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::isPartialMatchesNil() -+ { -+ return !isValidPartialMatches; -+ } -+ -+ /** -+ * Set partialMatches to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatus::setPartialMatchesNil() -+ { -+ return resetPartialMatches(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobStatusResponse.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobStatusResponse.cpp -new file mode 100644 -index 0000000..aa9aff2 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobStatusResponse.cpp -@@ -0,0 +1,780 @@ -+ -+ -+ /** -+ * GetJobStatusResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetJobStatusResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetJobStatusResponse|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetJobStatusResponse::GetJobStatusResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Jobs = NULL; -+ -+ isValidJobs = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobStatusResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetJobStatusResponse::GetJobStatusResponse(std::vector* arg_Jobs) -+ { -+ -+ qname = NULL; -+ -+ property_Jobs = NULL; -+ -+ isValidJobs = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobStatusResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Jobs = arg_Jobs; -+ -+ } -+ AviaryQuery::GetJobStatusResponse::~GetJobStatusResponse() -+ { -+ if (property_Jobs) { -+ while(!property_Jobs->empty()) delete property_Jobs->back(), property_Jobs->pop_back(); -+ delete property_Jobs; -+ } -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetJobStatusResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ { -+ /* -+ * building Jobs array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building jobs element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "jobs", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("jobs", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::JobStatus* element = new AviaryCommon::JobStatus(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element jobs "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for jobs "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"jobs (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setJobs(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetJobStatusResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetJobStatusResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetJobStatusResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidJobs) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("jobs"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("jobs"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Jobs array -+ */ -+ if (property_Jobs != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sjobs", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Jobs->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::JobStatus* element = (*property_Jobs)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing jobs element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for jobs by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobStatusResponse::getProperty1() -+ { -+ return getJobs(); -+ } -+ -+ /** -+ * getter for jobs. -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobStatusResponse::getJobs() -+ { -+ return property_Jobs; -+ } -+ -+ /** -+ * setter for jobs -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::setJobs( -+ std::vector* arg_Jobs) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidJobs && -+ arg_Jobs == property_Jobs) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Jobs->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"jobs has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Jobs)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetJobs(); -+ -+ -+ if(NULL == arg_Jobs) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Jobs = arg_Jobs; -+ if(non_nil_exists) -+ { -+ isValidJobs = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of jobs. -+ */ -+ AviaryCommon::JobStatus* WSF_CALL -+ AviaryQuery::GetJobStatusResponse::getJobsAt(int i) -+ { -+ AviaryCommon::JobStatus* ret_val; -+ if(property_Jobs == NULL) -+ { -+ return (AviaryCommon::JobStatus*)0; -+ } -+ ret_val = (*property_Jobs)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of jobs. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::setJobsAt(int i, -+ AviaryCommon::JobStatus* arg_Jobs) -+ { -+ AviaryCommon::JobStatus* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidJobs && -+ property_Jobs && -+ -+ arg_Jobs == (*property_Jobs)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Jobs == NULL) -+ { -+ property_Jobs = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Jobs)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidJobs = true; -+ (*property_Jobs)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Jobs)[i] = arg_Jobs; -+ -+ -+ isValidJobs = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to jobs. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::addJobs( -+ AviaryCommon::JobStatus* arg_Jobs) -+ { -+ -+ -+ if( NULL == arg_Jobs -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Jobs == NULL) -+ { -+ property_Jobs = new std::vector(); -+ } -+ -+ property_Jobs->push_back(arg_Jobs); -+ -+ isValidJobs = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the jobs array. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobStatusResponse::sizeofJobs() -+ { -+ -+ if(property_Jobs == NULL) -+ { -+ return 0; -+ } -+ return property_Jobs->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::removeJobsAt(int i) -+ { -+ return setJobsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for jobs -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::resetJobs() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Jobs != NULL) -+ { -+ std::vector::iterator it = property_Jobs->begin(); -+ for( ; it < property_Jobs->end() ; ++it) -+ { -+ AviaryCommon::JobStatus* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Jobs) -+ delete property_Jobs; -+ -+ isValidJobs = false; -+ return true; -+ } -+ -+ /** -+ * Check whether jobs is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::isJobsNil() -+ { -+ return !isValidJobs; -+ } -+ -+ /** -+ * Set jobs to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::setJobsNil() -+ { -+ return resetJobs(); -+ } -+ -+ -+ /** -+ * Check whether jobs is nill at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::isJobsNilAt(int i) -+ { -+ return (isValidJobs == false || -+ NULL == property_Jobs || -+ NULL == (*property_Jobs)[i]); -+ } -+ -+ /** -+ * Set jobs to nil at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobStatusResponse::setJobsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Jobs == NULL || -+ isValidJobs == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Jobs->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Jobs)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of jobs is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Jobs == NULL) -+ { -+ isValidJobs = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::JobStatus* element = (*property_Jobs)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidJobs = false; -+ (*property_Jobs)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Jobs)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobSummary.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobSummary.cpp -new file mode 100644 -index 0000000..f511bd0 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobSummary.cpp -@@ -0,0 +1,984 @@ -+ -+ -+ /** -+ * GetJobSummary.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetJobSummary.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetJobSummary|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetJobSummary::GetJobSummary() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Ids = NULL; -+ -+ isValidIds = false; -+ -+ isValidPartialMatches = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobSummary", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetJobSummary::GetJobSummary(std::vector* arg_Ids,bool arg_PartialMatches) -+ { -+ -+ qname = NULL; -+ -+ property_Ids = NULL; -+ -+ isValidIds = true; -+ -+ isValidPartialMatches = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobSummary", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Ids = arg_Ids; -+ -+ property_PartialMatches = arg_PartialMatches; -+ -+ } -+ AviaryQuery::GetJobSummary::~GetJobSummary() -+ { -+ if (property_Ids) { -+ while(!property_Ids->empty()) delete property_Ids->back(), property_Ids->pop_back(); -+ delete property_Ids; -+ } -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ axiom_attribute_t *parent_attri = NULL; -+ axiom_element_t *parent_element = NULL; -+ axis2_char_t *attrib_text = NULL; -+ -+ axutil_hash_t *attribute_hash = NULL; -+ -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetJobSummary : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ parent_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ attribute_hash = axiom_element_get_all_attributes(parent_element, Environment::getEnv()); -+ -+ { -+ /* -+ * building Ids array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building ids element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "ids", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("ids", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::JobID* element = new AviaryCommon::JobID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element ids "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for ids "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setIds(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ parent_attri = NULL; -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ -+ if(!strcmp((axis2_char_t*)key, "partialMatches")) -+ -+ { -+ parent_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(parent_attri) -+ { -+ attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "partialMatches", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "partialMatches"); -+ } -+ -+ if(attrib_text != NULL) -+ { -+ -+ -+ if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true")) -+ { -+ setPartialMatches(true); -+ } -+ else -+ { -+ setPartialMatches(false); -+ } -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetJobSummary::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetJobSummary::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axiom_attribute_t *text_attri = NULL; -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value = NULL; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetJobSummary", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!parent_tag_closed) -+ { -+ -+ if(isValidPartialMatches) -+ { -+ -+ p_prefix = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_PartialMatches)?"true":"false"); -+ string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) * -+ (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + -+ axutil_strlen(text_value) + -+ axutil_strlen("partialMatches"))); -+ sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", -+ "partialMatches", text_value); -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream); -+ -+ } -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidIds) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("ids"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("ids"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Ids array -+ */ -+ if (property_Ids != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sids", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Ids->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::JobID* element = (*property_Ids)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing ids element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ if(parent_tag_closed) -+ { -+ if(isValidPartialMatches) -+ { -+ -+ p_prefix = NULL; -+ ns1 = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_PartialMatches)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false")); -+ text_attri = axiom_attribute_create (Environment::getEnv(), "partialMatches", text_value, ns1); -+ axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ -+ } -+ -+ } -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ids by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobSummary::getProperty1() -+ { -+ return getIds(); -+ } -+ -+ /** -+ * getter for ids. -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobSummary::getIds() -+ { -+ return property_Ids; -+ } -+ -+ /** -+ * setter for ids -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::setIds( -+ std::vector* arg_Ids) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidIds && -+ arg_Ids == property_Ids) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Ids->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Ids)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetIds(); -+ -+ -+ if(NULL == arg_Ids) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Ids = arg_Ids; -+ if(non_nil_exists) -+ { -+ isValidIds = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of ids. -+ */ -+ AviaryCommon::JobID* WSF_CALL -+ AviaryQuery::GetJobSummary::getIdsAt(int i) -+ { -+ AviaryCommon::JobID* ret_val; -+ if(property_Ids == NULL) -+ { -+ return (AviaryCommon::JobID*)0; -+ } -+ ret_val = (*property_Ids)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of ids. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::setIdsAt(int i, -+ AviaryCommon::JobID* arg_Ids) -+ { -+ AviaryCommon::JobID* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidIds && -+ property_Ids && -+ -+ arg_Ids == (*property_Ids)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Ids == NULL) -+ { -+ property_Ids = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Ids)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidIds = true; -+ (*property_Ids)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Ids)[i] = arg_Ids; -+ -+ -+ isValidIds = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to ids. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::addIds( -+ AviaryCommon::JobID* arg_Ids) -+ { -+ -+ -+ if( NULL == arg_Ids -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Ids == NULL) -+ { -+ property_Ids = new std::vector(); -+ } -+ -+ property_Ids->push_back(arg_Ids); -+ -+ isValidIds = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the ids array. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobSummary::sizeofIds() -+ { -+ -+ if(property_Ids == NULL) -+ { -+ return 0; -+ } -+ return property_Ids->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::removeIdsAt(int i) -+ { -+ return setIdsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for ids -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::resetIds() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Ids != NULL) -+ { -+ std::vector::iterator it = property_Ids->begin(); -+ for( ; it < property_Ids->end() ; ++it) -+ { -+ AviaryCommon::JobID* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Ids) -+ delete property_Ids; -+ -+ isValidIds = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ids is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::isIdsNil() -+ { -+ return !isValidIds; -+ } -+ -+ /** -+ * Set ids to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::setIdsNil() -+ { -+ return resetIds(); -+ } -+ -+ -+ /** -+ * Check whether ids is nill at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::isIdsNilAt(int i) -+ { -+ return (isValidIds == false || -+ NULL == property_Ids || -+ NULL == (*property_Ids)[i]); -+ } -+ -+ /** -+ * Set ids to nil at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::setIdsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Ids == NULL || -+ isValidIds == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Ids->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Ids)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of ids is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Ids == NULL) -+ { -+ isValidIds = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::JobID* element = (*property_Ids)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidIds = false; -+ (*property_Ids)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Ids)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -+ /** -+ * Getter for partialMatches by Property Number 2 -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::getProperty2() -+ { -+ return getPartialMatches(); -+ } -+ -+ /** -+ * getter for partialMatches. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::getPartialMatches() -+ { -+ return property_PartialMatches; -+ } -+ -+ /** -+ * setter for partialMatches -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::setPartialMatches( -+ bool arg_PartialMatches) -+ { -+ -+ -+ if(isValidPartialMatches && -+ arg_PartialMatches == property_PartialMatches) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetPartialMatches(); -+ -+ -+ property_PartialMatches = arg_PartialMatches; -+ isValidPartialMatches = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for partialMatches -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::resetPartialMatches() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidPartialMatches = false; -+ return true; -+ } -+ -+ /** -+ * Check whether partialMatches is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::isPartialMatchesNil() -+ { -+ return !isValidPartialMatches; -+ } -+ -+ /** -+ * Set partialMatches to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummary::setPartialMatchesNil() -+ { -+ return resetPartialMatches(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobSummaryResponse.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobSummaryResponse.cpp -new file mode 100644 -index 0000000..5c9c574 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetJobSummaryResponse.cpp -@@ -0,0 +1,780 @@ -+ -+ -+ /** -+ * GetJobSummaryResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetJobSummaryResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetJobSummaryResponse|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetJobSummaryResponse::GetJobSummaryResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Jobs = NULL; -+ -+ isValidJobs = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobSummaryResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetJobSummaryResponse::GetJobSummaryResponse(std::vector* arg_Jobs) -+ { -+ -+ qname = NULL; -+ -+ property_Jobs = NULL; -+ -+ isValidJobs = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetJobSummaryResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Jobs = arg_Jobs; -+ -+ } -+ AviaryQuery::GetJobSummaryResponse::~GetJobSummaryResponse() -+ { -+ if (property_Jobs) { -+ while(!property_Jobs->empty()) delete property_Jobs->back(), property_Jobs->pop_back(); -+ delete property_Jobs; -+ } -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetJobSummaryResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ { -+ /* -+ * building Jobs array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building jobs element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "jobs", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("jobs", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::JobSummary* element = new AviaryCommon::JobSummary(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element jobs "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for jobs "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"jobs (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setJobs(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetJobSummaryResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidJobs) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("jobs"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("jobs"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Jobs array -+ */ -+ if (property_Jobs != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sjobs", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Jobs->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::JobSummary* element = (*property_Jobs)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing jobs element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for jobs by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::getProperty1() -+ { -+ return getJobs(); -+ } -+ -+ /** -+ * getter for jobs. -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::getJobs() -+ { -+ return property_Jobs; -+ } -+ -+ /** -+ * setter for jobs -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::setJobs( -+ std::vector* arg_Jobs) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidJobs && -+ arg_Jobs == property_Jobs) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Jobs->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"jobs has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Jobs)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetJobs(); -+ -+ -+ if(NULL == arg_Jobs) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Jobs = arg_Jobs; -+ if(non_nil_exists) -+ { -+ isValidJobs = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of jobs. -+ */ -+ AviaryCommon::JobSummary* WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::getJobsAt(int i) -+ { -+ AviaryCommon::JobSummary* ret_val; -+ if(property_Jobs == NULL) -+ { -+ return (AviaryCommon::JobSummary*)0; -+ } -+ ret_val = (*property_Jobs)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of jobs. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::setJobsAt(int i, -+ AviaryCommon::JobSummary* arg_Jobs) -+ { -+ AviaryCommon::JobSummary* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidJobs && -+ property_Jobs && -+ -+ arg_Jobs == (*property_Jobs)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Jobs == NULL) -+ { -+ property_Jobs = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Jobs)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidJobs = true; -+ (*property_Jobs)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Jobs)[i] = arg_Jobs; -+ -+ -+ isValidJobs = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to jobs. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::addJobs( -+ AviaryCommon::JobSummary* arg_Jobs) -+ { -+ -+ -+ if( NULL == arg_Jobs -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Jobs == NULL) -+ { -+ property_Jobs = new std::vector(); -+ } -+ -+ property_Jobs->push_back(arg_Jobs); -+ -+ isValidJobs = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the jobs array. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::sizeofJobs() -+ { -+ -+ if(property_Jobs == NULL) -+ { -+ return 0; -+ } -+ return property_Jobs->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::removeJobsAt(int i) -+ { -+ return setJobsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for jobs -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::resetJobs() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Jobs != NULL) -+ { -+ std::vector::iterator it = property_Jobs->begin(); -+ for( ; it < property_Jobs->end() ; ++it) -+ { -+ AviaryCommon::JobSummary* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Jobs) -+ delete property_Jobs; -+ -+ isValidJobs = false; -+ return true; -+ } -+ -+ /** -+ * Check whether jobs is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::isJobsNil() -+ { -+ return !isValidJobs; -+ } -+ -+ /** -+ * Set jobs to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::setJobsNil() -+ { -+ return resetJobs(); -+ } -+ -+ -+ /** -+ * Check whether jobs is nill at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::isJobsNilAt(int i) -+ { -+ return (isValidJobs == false || -+ NULL == property_Jobs || -+ NULL == (*property_Jobs)[i]); -+ } -+ -+ /** -+ * Set jobs to nil at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetJobSummaryResponse::setJobsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Jobs == NULL || -+ isValidJobs == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Jobs->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Jobs)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of jobs is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Jobs == NULL) -+ { -+ isValidJobs = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::JobSummary* element = (*property_Jobs)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidJobs = false; -+ (*property_Jobs)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Jobs)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetSubmissionSummary.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetSubmissionSummary.cpp -new file mode 100644 -index 0000000..beb6ed6 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetSubmissionSummary.cpp -@@ -0,0 +1,1167 @@ -+ -+ -+ /** -+ * GetSubmissionSummary.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetSubmissionSummary.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetSubmissionSummary|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetSubmissionSummary::GetSubmissionSummary() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Ids = NULL; -+ -+ isValidIds = false; -+ -+ isValidPartialMatches = false; -+ -+ isValidIncludeJobSummaries = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetSubmissionSummary", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetSubmissionSummary::GetSubmissionSummary(std::vector* arg_Ids,bool arg_PartialMatches,bool arg_IncludeJobSummaries) -+ { -+ -+ qname = NULL; -+ -+ property_Ids = NULL; -+ -+ isValidIds = true; -+ -+ isValidPartialMatches = true; -+ -+ isValidIncludeJobSummaries = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetSubmissionSummary", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Ids = arg_Ids; -+ -+ property_PartialMatches = arg_PartialMatches; -+ -+ property_IncludeJobSummaries = arg_IncludeJobSummaries; -+ -+ } -+ AviaryQuery::GetSubmissionSummary::~GetSubmissionSummary() -+ { -+ if (property_Ids) { -+ while(!property_Ids->empty()) delete property_Ids->back(), property_Ids->pop_back(); -+ delete property_Ids; -+ } -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ axiom_attribute_t *parent_attri = NULL; -+ axiom_element_t *parent_element = NULL; -+ axis2_char_t *attrib_text = NULL; -+ -+ axutil_hash_t *attribute_hash = NULL; -+ -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetSubmissionSummary : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ parent_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ attribute_hash = axiom_element_get_all_attributes(parent_element, Environment::getEnv()); -+ -+ { -+ /* -+ * building Ids array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building ids element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "ids", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("ids", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::SubmissionID* element = new AviaryCommon::SubmissionID(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element ids "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for ids "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setIds(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ parent_attri = NULL; -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ -+ if(!strcmp((axis2_char_t*)key, "partialMatches")) -+ -+ { -+ parent_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(parent_attri) -+ { -+ attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "partialMatches", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "partialMatches"); -+ } -+ -+ if(attrib_text != NULL) -+ { -+ -+ -+ if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true")) -+ { -+ setPartialMatches(true); -+ } -+ else -+ { -+ setPartialMatches(false); -+ } -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ -+ -+ parent_attri = NULL; -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ -+ if(!strcmp((axis2_char_t*)key, "includeJobSummaries")) -+ -+ { -+ parent_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(parent_attri) -+ { -+ attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "includeJobSummaries", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "includeJobSummaries"); -+ } -+ -+ if(attrib_text != NULL) -+ { -+ -+ -+ if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true")) -+ { -+ setIncludeJobSummaries(true); -+ } -+ else -+ { -+ setIncludeJobSummaries(false); -+ } -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetSubmissionSummary::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetSubmissionSummary::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axiom_attribute_t *text_attri = NULL; -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t text_value_3[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value = NULL; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetSubmissionSummary", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ if(!parent_tag_closed) -+ { -+ -+ if(isValidPartialMatches) -+ { -+ -+ p_prefix = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_PartialMatches)?"true":"false"); -+ string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) * -+ (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + -+ axutil_strlen(text_value) + -+ axutil_strlen("partialMatches"))); -+ sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", -+ "partialMatches", text_value); -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream); -+ -+ } -+ -+ if(isValidIncludeJobSummaries) -+ { -+ -+ p_prefix = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_IncludeJobSummaries)?"true":"false"); -+ string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) * -+ (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + -+ axutil_strlen(text_value) + -+ axutil_strlen("includeJobSummaries"))); -+ sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", -+ "includeJobSummaries", text_value); -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream); -+ -+ } -+ -+ } -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidIds) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("ids"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("ids"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Ids array -+ */ -+ if (property_Ids != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%sids", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Ids->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::SubmissionID* element = (*property_Ids)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing ids element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ -+ if(parent_tag_closed) -+ { -+ if(isValidPartialMatches) -+ { -+ -+ p_prefix = NULL; -+ ns1 = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_PartialMatches)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false")); -+ text_attri = axiom_attribute_create (Environment::getEnv(), "partialMatches", text_value, ns1); -+ axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ -+ } -+ -+ } -+ -+ -+ if(parent_tag_closed) -+ { -+ if(isValidIncludeJobSummaries) -+ { -+ -+ p_prefix = NULL; -+ ns1 = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_IncludeJobSummaries)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false")); -+ text_attri = axiom_attribute_create (Environment::getEnv(), "includeJobSummaries", text_value, ns1); -+ axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ -+ } -+ -+ } -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for ids by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetSubmissionSummary::getProperty1() -+ { -+ return getIds(); -+ } -+ -+ /** -+ * getter for ids. -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetSubmissionSummary::getIds() -+ { -+ return property_Ids; -+ } -+ -+ /** -+ * setter for ids -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::setIds( -+ std::vector* arg_Ids) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidIds && -+ arg_Ids == property_Ids) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Ids->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"ids has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Ids)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetIds(); -+ -+ -+ if(NULL == arg_Ids) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Ids = arg_Ids; -+ if(non_nil_exists) -+ { -+ isValidIds = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of ids. -+ */ -+ AviaryCommon::SubmissionID* WSF_CALL -+ AviaryQuery::GetSubmissionSummary::getIdsAt(int i) -+ { -+ AviaryCommon::SubmissionID* ret_val; -+ if(property_Ids == NULL) -+ { -+ return (AviaryCommon::SubmissionID*)0; -+ } -+ ret_val = (*property_Ids)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of ids. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::setIdsAt(int i, -+ AviaryCommon::SubmissionID* arg_Ids) -+ { -+ AviaryCommon::SubmissionID* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidIds && -+ property_Ids && -+ -+ arg_Ids == (*property_Ids)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Ids == NULL) -+ { -+ property_Ids = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Ids)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidIds = true; -+ (*property_Ids)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Ids)[i] = arg_Ids; -+ -+ -+ isValidIds = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to ids. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::addIds( -+ AviaryCommon::SubmissionID* arg_Ids) -+ { -+ -+ -+ if( NULL == arg_Ids -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Ids == NULL) -+ { -+ property_Ids = new std::vector(); -+ } -+ -+ property_Ids->push_back(arg_Ids); -+ -+ isValidIds = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the ids array. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetSubmissionSummary::sizeofIds() -+ { -+ -+ if(property_Ids == NULL) -+ { -+ return 0; -+ } -+ return property_Ids->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::removeIdsAt(int i) -+ { -+ return setIdsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for ids -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::resetIds() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Ids != NULL) -+ { -+ std::vector::iterator it = property_Ids->begin(); -+ for( ; it < property_Ids->end() ; ++it) -+ { -+ AviaryCommon::SubmissionID* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Ids) -+ delete property_Ids; -+ -+ isValidIds = false; -+ return true; -+ } -+ -+ /** -+ * Check whether ids is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::isIdsNil() -+ { -+ return !isValidIds; -+ } -+ -+ /** -+ * Set ids to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::setIdsNil() -+ { -+ return resetIds(); -+ } -+ -+ -+ /** -+ * Check whether ids is nill at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::isIdsNilAt(int i) -+ { -+ return (isValidIds == false || -+ NULL == property_Ids || -+ NULL == (*property_Ids)[i]); -+ } -+ -+ /** -+ * Set ids to nil at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::setIdsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Ids == NULL || -+ isValidIds == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Ids->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Ids)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of ids is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Ids == NULL) -+ { -+ isValidIds = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::SubmissionID* element = (*property_Ids)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidIds = false; -+ (*property_Ids)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Ids)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -+ /** -+ * Getter for partialMatches by Property Number 2 -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::getProperty2() -+ { -+ return getPartialMatches(); -+ } -+ -+ /** -+ * getter for partialMatches. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::getPartialMatches() -+ { -+ return property_PartialMatches; -+ } -+ -+ /** -+ * setter for partialMatches -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::setPartialMatches( -+ bool arg_PartialMatches) -+ { -+ -+ -+ if(isValidPartialMatches && -+ arg_PartialMatches == property_PartialMatches) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetPartialMatches(); -+ -+ -+ property_PartialMatches = arg_PartialMatches; -+ isValidPartialMatches = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for partialMatches -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::resetPartialMatches() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidPartialMatches = false; -+ return true; -+ } -+ -+ /** -+ * Check whether partialMatches is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::isPartialMatchesNil() -+ { -+ return !isValidPartialMatches; -+ } -+ -+ /** -+ * Set partialMatches to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::setPartialMatchesNil() -+ { -+ return resetPartialMatches(); -+ } -+ -+ -+ -+ /** -+ * Getter for includeJobSummaries by Property Number 3 -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::getProperty3() -+ { -+ return getIncludeJobSummaries(); -+ } -+ -+ /** -+ * getter for includeJobSummaries. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::getIncludeJobSummaries() -+ { -+ return property_IncludeJobSummaries; -+ } -+ -+ /** -+ * setter for includeJobSummaries -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::setIncludeJobSummaries( -+ bool arg_IncludeJobSummaries) -+ { -+ -+ -+ if(isValidIncludeJobSummaries && -+ arg_IncludeJobSummaries == property_IncludeJobSummaries) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetIncludeJobSummaries(); -+ -+ -+ property_IncludeJobSummaries = arg_IncludeJobSummaries; -+ isValidIncludeJobSummaries = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for includeJobSummaries -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::resetIncludeJobSummaries() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidIncludeJobSummaries = false; -+ return true; -+ } -+ -+ /** -+ * Check whether includeJobSummaries is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::isIncludeJobSummariesNil() -+ { -+ return !isValidIncludeJobSummaries; -+ } -+ -+ /** -+ * Set includeJobSummaries to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummary::setIncludeJobSummariesNil() -+ { -+ return resetIncludeJobSummaries(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetSubmissionSummaryResponse.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetSubmissionSummaryResponse.cpp -new file mode 100644 -index 0000000..b04a16c ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_GetSubmissionSummaryResponse.cpp -@@ -0,0 +1,780 @@ -+ -+ -+ /** -+ * GetSubmissionSummaryResponse.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_GetSubmissionSummaryResponse.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * Implementation of the GetSubmissionSummaryResponse|http://query.aviary.grid.redhat.com Element -+ */ -+ AviaryQuery::GetSubmissionSummaryResponse::GetSubmissionSummaryResponse() -+ { -+ -+ -+ qname = NULL; -+ -+ property_Submissions = NULL; -+ -+ isValidSubmissions = false; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetSubmissionSummaryResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ } -+ -+ AviaryQuery::GetSubmissionSummaryResponse::GetSubmissionSummaryResponse(std::vector* arg_Submissions) -+ { -+ -+ qname = NULL; -+ -+ property_Submissions = NULL; -+ -+ isValidSubmissions = true; -+ -+ qname = axutil_qname_create (Environment::getEnv(), -+ "GetSubmissionSummaryResponse", -+ "http://query.aviary.grid.redhat.com", -+ NULL); -+ -+ property_Submissions = arg_Submissions; -+ -+ } -+ AviaryQuery::GetSubmissionSummaryResponse::~GetSubmissionSummaryResponse() -+ { -+ if (property_Submissions) { -+ while(!property_Submissions->empty()) delete property_Submissions->back(), property_Submissions->pop_back(); -+ delete property_Submissions; -+ } -+ axutil_qname_free(qname,Environment::getEnv()); -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ int i = 0; -+ -+ int sequence_broken = 0; -+ axiom_node_t *tmp_node = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent); -+ if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname)) -+ { -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ } -+ else -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, -+ "Failed in building adb object for GetSubmissionSummaryResponse : " -+ "Expected %s but returned %s", -+ axutil_qname_to_string(qname, Environment::getEnv()), -+ axutil_qname_to_string(mqname, Environment::getEnv())); -+ -+ return AXIS2_FAILURE; -+ } -+ -+ { -+ /* -+ * building Submissions array -+ */ -+ std::vector* arr_list =new std::vector(); -+ -+ -+ -+ /* -+ * building submissions element -+ */ -+ -+ -+ -+ element_qname = axutil_qname_create(Environment::getEnv(), "submissions", NULL, NULL); -+ -+ -+ for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken && current_node != NULL;) -+ -+ { -+ if(axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ current_node =axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ is_early_node_valid = false; -+ continue; -+ } -+ -+ current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node); -+ -+ if (axutil_qname_equals(element_qname, Environment::getEnv(), mqname) || !axutil_strcmp("submissions", axiom_element_get_localname(current_element, Environment::getEnv()))) -+ { -+ -+ is_early_node_valid = true; -+ -+ AviaryCommon::SubmissionSummary* element = new AviaryCommon::SubmissionSummary(); -+ -+ status = element->deserialize(¤t_node, &is_early_node_valid, false); -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element submissions "); -+ } -+ else -+ { -+ arr_list->push_back(element); -+ -+ } -+ -+ if(AXIS2_FAILURE == status) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "failed in setting the value for submissions "); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ i++; -+ current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv()); -+ } -+ else -+ { -+ is_early_node_valid = false; -+ sequence_broken = 1; -+ } -+ -+ } -+ -+ -+ if (i < 0) -+ { -+ /* found element out of order */ -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"submissions (@minOccurs = '0') only have %d elements", i); -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ } -+ if(arr_list) -+ { -+ delete arr_list; -+ } -+ return false; -+ } -+ -+ -+ if(0 == arr_list->size()) -+ { -+ delete arr_list; -+ } -+ else -+ { -+ status = setSubmissions(arr_list); -+ } -+ -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ int i = 0; -+ int count = 0; -+ void *element = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *start_input_str = NULL; -+ axis2_char_t *end_input_str = NULL; -+ unsigned int start_input_str_len = 0; -+ unsigned int end_input_str_len = 0; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ int next_ns_index_value = 0; -+ -+ namespaces = axutil_hash_make(Environment::getEnv()); -+ next_ns_index = &next_ns_index_value; -+ -+ ns1 = axiom_namespace_create (Environment::getEnv(), -+ "http://query.aviary.grid.redhat.com", -+ "n"); -+ axutil_hash_set(namespaces, "http://query.aviary.grid.redhat.com", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n")); -+ -+ -+ parent_element = axiom_element_create (Environment::getEnv(), NULL, "GetSubmissionSummaryResponse", ns1 , &parent); -+ -+ -+ axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent); -+ -+ -+ -+ data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node); -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); -+ -+ p_prefix = NULL; -+ -+ -+ if (!isValidSubmissions) -+ { -+ -+ /* no need to complain for minoccurs=0 element */ -+ -+ -+ } -+ else -+ { -+ start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (4 + axutil_strlen(p_prefix) + -+ axutil_strlen("submissions"))); -+ -+ /* axutil_strlen("<:>") + 1 = 4 */ -+ end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) * -+ (5 + axutil_strlen(p_prefix) + axutil_strlen("submissions"))); -+ /* axutil_strlen("") + 1 = 5 */ -+ -+ -+ -+ -+ -+ /* -+ * Parsing Submissions array -+ */ -+ if (property_Submissions != NULL) -+ { -+ -+ -+ sprintf(start_input_str, "<%s%ssubmissions", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ -+ start_input_str_len = axutil_strlen(start_input_str); -+ -+ sprintf(end_input_str, "", -+ p_prefix?p_prefix:"", -+ (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); -+ end_input_str_len = axutil_strlen(end_input_str); -+ -+ count = property_Submissions->size(); -+ for(i = 0; i < count; i++) -+ { -+ AviaryCommon::SubmissionSummary* element = (*property_Submissions)[i]; -+ -+ if(NULL == element) -+ { -+ continue; -+ } -+ -+ -+ -+ /* -+ * parsing submissions element -+ */ -+ -+ -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len); -+ } -+ element->serialize(current_node, parent_element, -+ element->isParticle() || false, namespaces, next_ns_index); -+ -+ if(!element->isParticle()) -+ { -+ axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len); -+ } -+ -+ } -+ } -+ -+ -+ AXIS2_FREE(Environment::getEnv()->allocator,start_input_str); -+ AXIS2_FREE(Environment::getEnv()->allocator,end_input_str); -+ } -+ -+ -+ if(namespaces) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, NULL, NULL, &val); -+ AXIS2_FREE(Environment::getEnv()->allocator, val); -+ } -+ axutil_hash_free(namespaces, Environment::getEnv()); -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for submissions by Property Number 1 -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::getProperty1() -+ { -+ return getSubmissions(); -+ } -+ -+ /** -+ * getter for submissions. -+ */ -+ std::vector* WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::getSubmissions() -+ { -+ return property_Submissions; -+ } -+ -+ /** -+ * setter for submissions -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::setSubmissions( -+ std::vector* arg_Submissions) -+ { -+ -+ int size = 0; -+ int i = 0; -+ bool non_nil_exists = false; -+ -+ -+ if(isValidSubmissions && -+ arg_Submissions == property_Submissions) -+ { -+ -+ return true; -+ } -+ -+ -+ size = arg_Submissions->size(); -+ -+ if (size < 0) -+ { -+ WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"submissions has less than minOccurs(0)"); -+ return false; -+ } -+ for(i = 0; i < size; i ++ ) -+ { -+ if(NULL != (*arg_Submissions)[i]) -+ { -+ non_nil_exists = true; -+ break; -+ } -+ } -+ -+ -+ -+ -+ resetSubmissions(); -+ -+ -+ if(NULL == arg_Submissions) -+ -+ { -+ /* We are already done */ -+ return true; -+ } -+ -+ property_Submissions = arg_Submissions; -+ if(non_nil_exists) -+ { -+ isValidSubmissions = true; -+ } -+ -+ -+ return true; -+ } -+ -+ -+ /** -+ * Get ith element of submissions. -+ */ -+ AviaryCommon::SubmissionSummary* WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::getSubmissionsAt(int i) -+ { -+ AviaryCommon::SubmissionSummary* ret_val; -+ if(property_Submissions == NULL) -+ { -+ return (AviaryCommon::SubmissionSummary*)0; -+ } -+ ret_val = (*property_Submissions)[i]; -+ -+ return ret_val; -+ -+ } -+ -+ /** -+ * Set the ith element of submissions. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::setSubmissionsAt(int i, -+ AviaryCommon::SubmissionSummary* arg_Submissions) -+ { -+ AviaryCommon::SubmissionSummary* element; -+ int size = 0; -+ -+ int non_nil_count; -+ bool non_nil_exists = false; -+ -+ -+ -+ if( isValidSubmissions && -+ property_Submissions && -+ -+ arg_Submissions == (*property_Submissions)[i]) -+ -+ { -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ non_nil_exists = true; -+ -+ -+ if(property_Submissions == NULL) -+ { -+ property_Submissions = new std::vector(); -+ } -+ else{ -+ /* check whether there already exist an element */ -+ element = (*property_Submissions)[i]; -+ } -+ -+ -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidSubmissions = true; -+ (*property_Submissions)[i]= NULL; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ (*property_Submissions)[i] = arg_Submissions; -+ -+ -+ isValidSubmissions = true; -+ -+ return AXIS2_SUCCESS; -+ } -+ -+ /** -+ * Add to submissions. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::addSubmissions( -+ AviaryCommon::SubmissionSummary* arg_Submissions) -+ { -+ -+ -+ if( NULL == arg_Submissions -+ ) -+ { -+ -+ return true; -+ -+ } -+ -+ -+ if(property_Submissions == NULL) -+ { -+ property_Submissions = new std::vector(); -+ } -+ -+ property_Submissions->push_back(arg_Submissions); -+ -+ isValidSubmissions = true; -+ return true; -+ } -+ -+ /** -+ * Get the size of the submissions array. -+ */ -+ int WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::sizeofSubmissions() -+ { -+ -+ if(property_Submissions == NULL) -+ { -+ return 0; -+ } -+ return property_Submissions->size(); -+ } -+ -+ /** -+ * remove the ith element, same as set_nil_at. -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::removeSubmissionsAt(int i) -+ { -+ return setSubmissionsNilAt(i); -+ } -+ -+ -+ -+ /** -+ * resetter for submissions -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::resetSubmissions() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ if (property_Submissions != NULL) -+ { -+ std::vector::iterator it = property_Submissions->begin(); -+ for( ; it < property_Submissions->end() ; ++it) -+ { -+ AviaryCommon::SubmissionSummary* element = *it; -+ -+ -+ -+ -+ if(element != NULL) -+ { -+ -+ -+ delete element; -+ -+ -+ } -+ -+ -+ -+ -+ } -+ -+ } -+ -+ if(NULL != property_Submissions) -+ delete property_Submissions; -+ -+ isValidSubmissions = false; -+ return true; -+ } -+ -+ /** -+ * Check whether submissions is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::isSubmissionsNil() -+ { -+ return !isValidSubmissions; -+ } -+ -+ /** -+ * Set submissions to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::setSubmissionsNil() -+ { -+ return resetSubmissions(); -+ } -+ -+ -+ /** -+ * Check whether submissions is nill at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::isSubmissionsNilAt(int i) -+ { -+ return (isValidSubmissions == false || -+ NULL == property_Submissions || -+ NULL == (*property_Submissions)[i]); -+ } -+ -+ /** -+ * Set submissions to nil at i -+ */ -+ bool WSF_CALL -+ AviaryQuery::GetSubmissionSummaryResponse::setSubmissionsNilAt(int i) -+ { -+ int size = 0; -+ int j; -+ bool non_nil_exists = false; -+ -+ int k = 0; -+ -+ if(property_Submissions == NULL || -+ isValidSubmissions == false) -+ { -+ -+ non_nil_exists = false; -+ } -+ else -+ { -+ size = property_Submissions->size(); -+ for(j = 0, k = 0; j < size; j ++ ) -+ { -+ if(i == j) continue; -+ if(NULL != (*property_Submissions)[i]) -+ { -+ k++; -+ non_nil_exists = true; -+ if( k >= 0) -+ { -+ break; -+ } -+ } -+ } -+ } -+ -+ -+ if( k < 0) -+ { -+ WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI, "Size of the array of submissions is beinng set to be smaller than the specificed number of minOccurs(0)"); -+ return AXIS2_FAILURE; -+ } -+ -+ if(property_Submissions == NULL) -+ { -+ isValidSubmissions = false; -+ -+ return true; -+ } -+ -+ /* check whether there already exist an element */ -+ AviaryCommon::SubmissionSummary* element = (*property_Submissions)[i]; -+ if(NULL != element) -+ { -+ -+ -+ -+ delete element; -+ -+ } -+ -+ if(!non_nil_exists) -+ { -+ -+ isValidSubmissions = false; -+ (*property_Submissions)[i] = NULL; -+ return AXIS2_SUCCESS; -+ } -+ -+ -+ -+ (*property_Submissions)[i] = NULL; -+ -+ return AXIS2_SUCCESS; -+ -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_QueryRequestType.cpp b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_QueryRequestType.cpp -new file mode 100644 -index 0000000..f59b227 ---- /dev/null -+++ b/src/condor_contrib/aviary/codegen/query/src/AviaryQuery_QueryRequestType.cpp -@@ -0,0 +1,346 @@ -+ -+ -+ /** -+ * QueryRequestType.cpp -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) -+ */ -+ -+ #include "AviaryQuery_QueryRequestType.h" -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ using namespace std; -+ -+ using namespace AviaryQuery; -+ -+ /* -+ * This type was generated from the piece of schema that had -+ * name = QueryRequestType -+ * Namespace URI = http://query.aviary.grid.redhat.com -+ * Namespace Prefix = ns2 -+ */ -+ AviaryQuery::QueryRequestType::QueryRequestType() -+ { -+ -+ -+ isValidAllowPartialMatching = false; -+ -+ } -+ -+ AviaryQuery::QueryRequestType::QueryRequestType(bool arg_AllowPartialMatching) -+ { -+ -+ isValidAllowPartialMatching = true; -+ -+ property_AllowPartialMatching = arg_AllowPartialMatching; -+ -+ } -+ AviaryQuery::QueryRequestType::~QueryRequestType() -+ { -+ -+ } -+ -+ -+ -+ bool WSF_CALL -+ AviaryQuery::QueryRequestType::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs) -+ { -+ axiom_node_t *parent = *dp_parent; -+ -+ bool status = AXIS2_SUCCESS; -+ -+ axiom_attribute_t *parent_attri = NULL; -+ axiom_element_t *parent_element = NULL; -+ axis2_char_t *attrib_text = NULL; -+ -+ axutil_hash_t *attribute_hash = NULL; -+ -+ -+ const axis2_char_t* text_value = NULL; -+ axutil_qname_t *mqname = NULL; -+ -+ axutil_qname_t *element_qname = NULL; -+ -+ axiom_node_t *first_node = NULL; -+ bool is_early_node_valid = true; -+ axiom_node_t *current_node = NULL; -+ axiom_element_t *current_element = NULL; -+ -+ -+ while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT) -+ { -+ parent = axiom_node_get_next_sibling(parent, Environment::getEnv()); -+ } -+ if (NULL == parent) -+ { -+ return AXIS2_FAILURE; -+ } -+ -+ -+ first_node = axiom_node_get_first_child(parent, Environment::getEnv()); -+ -+ -+ parent_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv()); -+ attribute_hash = axiom_element_get_all_attributes(parent_element, Environment::getEnv()); -+ -+ -+ -+ parent_attri = NULL; -+ attrib_text = NULL; -+ if(attribute_hash) -+ { -+ axutil_hash_index_t *hi; -+ void *val; -+ const void *key; -+ -+ for (hi = axutil_hash_first(attribute_hash, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi)) -+ { -+ axutil_hash_this(hi, &key, NULL, &val); -+ -+ -+ if(!strcmp((axis2_char_t*)key, "allowPartialMatching")) -+ -+ { -+ parent_attri = (axiom_attribute_t*)val; -+ break; -+ } -+ } -+ } -+ -+ if(parent_attri) -+ { -+ attrib_text = axiom_attribute_get_value(parent_attri, Environment::getEnv()); -+ } -+ else -+ { -+ /* this is hoping that attribute is stored in "allowPartialMatching", this happnes when name is in default namespace */ -+ attrib_text = axiom_element_get_attribute_value_by_name(parent_element, Environment::getEnv(), "allowPartialMatching"); -+ } -+ -+ if(attrib_text != NULL) -+ { -+ -+ -+ if (!axutil_strcmp(attrib_text, "TRUE") || !axutil_strcmp(attrib_text, "true")) -+ { -+ setAllowPartialMatching(true); -+ } -+ else -+ { -+ setAllowPartialMatching(false); -+ } -+ -+ } -+ -+ if(element_qname) -+ { -+ axutil_qname_free(element_qname, Environment::getEnv()); -+ element_qname = NULL; -+ } -+ -+ return status; -+ } -+ -+ bool WSF_CALL -+ AviaryQuery::QueryRequestType::isParticle() -+ { -+ -+ return false; -+ -+ } -+ -+ -+ void WSF_CALL -+ AviaryQuery::QueryRequestType::declareParentNamespaces( -+ axiom_element_t *parent_element, -+ axutil_hash_t *namespaces, int *next_ns_index) -+ { -+ -+ /* Here this is an empty function, Nothing to declare */ -+ -+ } -+ -+ -+ -+ axiom_node_t* WSF_CALL -+ AviaryQuery::QueryRequestType::serialize(axiom_node_t *parent, -+ axiom_element_t *parent_element, -+ int parent_tag_closed, -+ axutil_hash_t *namespaces, -+ int *next_ns_index) -+ { -+ -+ -+ axiom_attribute_t *text_attri = NULL; -+ -+ axis2_char_t *string_to_stream; -+ -+ -+ axiom_node_t *current_node = NULL; -+ int tag_closed = 0; -+ -+ -+ -+ axiom_namespace_t *ns1 = NULL; -+ -+ axis2_char_t *qname_uri = NULL; -+ axis2_char_t *qname_prefix = NULL; -+ axis2_char_t *p_prefix = NULL; -+ -+ axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; -+ -+ axis2_char_t *text_value = NULL; -+ -+ -+ axiom_data_source_t *data_source = NULL; -+ axutil_stream_t *stream = NULL; -+ -+ -+ current_node = parent; -+ data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, Environment::getEnv()); -+ if (!data_source) -+ return NULL; -+ stream = axiom_data_source_get_stream(data_source, Environment::getEnv()); /* assume parent is of type data source */ -+ if (!stream) -+ return NULL; -+ -+ if(!parent_tag_closed) -+ { -+ -+ if(isValidAllowPartialMatching) -+ { -+ -+ p_prefix = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_AllowPartialMatching)?"true":"false"); -+ string_to_stream = (axis2_char_t*) AXIS2_MALLOC (Environment::getEnv()-> allocator, sizeof (axis2_char_t) * -+ (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + -+ axutil_strlen(text_value) + -+ axutil_strlen("allowPartialMatching"))); -+ sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", -+ "allowPartialMatching", text_value); -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ AXIS2_FREE(Environment::getEnv()-> allocator, string_to_stream); -+ -+ } -+ -+ string_to_stream = ">"; -+ axutil_stream_write(stream, Environment::getEnv(), string_to_stream, axutil_strlen(string_to_stream)); -+ tag_closed = 1; -+ -+ } -+ -+ -+ if(parent_tag_closed) -+ { -+ if(isValidAllowPartialMatching) -+ { -+ -+ p_prefix = NULL; -+ ns1 = NULL; -+ -+ -+ text_value = (axis2_char_t*)((property_AllowPartialMatching)?axutil_strdup(Environment::getEnv(), "true"):axutil_strdup(Environment::getEnv(), "false")); -+ text_attri = axiom_attribute_create (Environment::getEnv(), "allowPartialMatching", text_value, ns1); -+ axiom_element_add_attribute (parent_element, Environment::getEnv(), text_attri, parent); -+ AXIS2_FREE(Environment::getEnv()->allocator, text_value); -+ -+ } -+ -+ } -+ -+ -+ return parent; -+ } -+ -+ -+ -+ -+ /** -+ * Getter for allowPartialMatching by Property Number 1 -+ */ -+ bool WSF_CALL -+ AviaryQuery::QueryRequestType::getProperty1() -+ { -+ return getAllowPartialMatching(); -+ } -+ -+ /** -+ * getter for allowPartialMatching. -+ */ -+ bool WSF_CALL -+ AviaryQuery::QueryRequestType::getAllowPartialMatching() -+ { -+ return property_AllowPartialMatching; -+ } -+ -+ /** -+ * setter for allowPartialMatching -+ */ -+ bool WSF_CALL -+ AviaryQuery::QueryRequestType::setAllowPartialMatching( -+ bool arg_AllowPartialMatching) -+ { -+ -+ -+ if(isValidAllowPartialMatching && -+ arg_AllowPartialMatching == property_AllowPartialMatching) -+ { -+ -+ return true; -+ } -+ -+ -+ -+ -+ resetAllowPartialMatching(); -+ -+ -+ property_AllowPartialMatching = arg_AllowPartialMatching; -+ isValidAllowPartialMatching = true; -+ -+ return true; -+ } -+ -+ -+ -+ /** -+ * resetter for allowPartialMatching -+ */ -+ bool WSF_CALL -+ AviaryQuery::QueryRequestType::resetAllowPartialMatching() -+ { -+ int i = 0; -+ int count = 0; -+ -+ -+ -+ isValidAllowPartialMatching = false; -+ return true; -+ } -+ -+ /** -+ * Check whether allowPartialMatching is nill -+ */ -+ bool WSF_CALL -+ AviaryQuery::QueryRequestType::isAllowPartialMatchingNil() -+ { -+ return !isValidAllowPartialMatching; -+ } -+ -+ /** -+ * Set allowPartialMatching to nill (currently the same as reset) -+ */ -+ bool WSF_CALL -+ AviaryQuery::QueryRequestType::setAllowPartialMatchingNil() -+ { -+ return resetAllowPartialMatching(); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/etc/61aviary.config b/src/condor_contrib/aviary/etc/61aviary.config -new file mode 100644 -index 0000000..5fdc884 ---- /dev/null -+++ b/src/condor_contrib/aviary/etc/61aviary.config -@@ -0,0 +1,34 @@ -+# Base configuration for Aviary -+# -+# Included is the Schedd plugin, AviaryScheddPlugin-plugin.so, and the aviary_query_server -+ -+# The general Aviary config file for Axis2 -+# axis2.xml has parameters that point to lib and services dir -+WSFCPP_HOME=/var/lib/condor/aviary/axis2.xml -+ -+# Aviary Schedd plugin, provides submission and job control endpoint -+SCHEDD.PLUGINS = $(SCHEDD.PLUGINS) $(LIB)/plugins/AviaryScheddPlugin-plugin.so -+ -+# Port the Aviary Schedd plugin listens on, default 9090 -+#SCHEDD.HTTP_PORT = 9090 -+ -+# Aviary query server, provides endpoint for job and submission queries -+QUERY_SERVER = $(SBIN)/aviary_query_server -+QUERY_SERVER_ARGS = -f -+QUERY_SERVER.QUERY_SERVER_LOG = $(LOG)/QueryServerLog -+QUERY_SERVER.QUERY_SERVER_DEBUG = D_ALWAYS -+DAEMON_LIST = $(DAEMON_LIST), QUERY_SERVER -+ -+# Port the QueryServer listens on, default 9091 -+#QUERY_SERVER.HTTP_PORT = 9091 -+ -+# HISTORY_INTERVAL specifies the number of seconds between polls of the HISTORY file, default 120 -+#QUERY_SERVER.HISTORY_INTERVAL = 120 -+ -+# If there is more than one Schedd on the system or if the Schedd and -+# QueryServer reside on different systems, it is necessary to tell the -+# QueryServer the name of the Schedd it is working with via -+# QUERY_SERVER.SCHEDD_NAME. This allows the QueryServer to provide -+# fully-qualified job ids, i.e. cluster.proc:pool:scheduler. Default -+# is constructed in the same way the Schedd constructs its name. -+#QUERY_SERVER.SCHEDD_NAME = -diff --git a/src/condor_contrib/aviary/etc/aviary-common.xsd b/src/condor_contrib/aviary/etc/aviary-common.xsd -new file mode 100644 -index 0000000..30f20be ---- /dev/null -+++ b/src/condor_contrib/aviary/etc/aviary-common.xsd -@@ -0,0 +1,203 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/src/condor_contrib/aviary/etc/aviary-job.wsdl b/src/condor_contrib/aviary/etc/aviary-job.wsdl -new file mode 100644 -index 0000000..c401778 ---- /dev/null -+++ b/src/condor_contrib/aviary/etc/aviary-job.wsdl -@@ -0,0 +1,130 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/src/condor_contrib/aviary/etc/aviary-job.xsd b/src/condor_contrib/aviary/etc/aviary-job.xsd -new file mode 100644 -index 0000000..d00b63b ---- /dev/null -+++ b/src/condor_contrib/aviary/etc/aviary-job.xsd -@@ -0,0 +1,71 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/src/condor_contrib/aviary/etc/aviary-query.wsdl b/src/condor_contrib/aviary/etc/aviary-query.wsdl -new file mode 100644 -index 0000000..3769e05 ---- /dev/null -+++ b/src/condor_contrib/aviary/etc/aviary-query.wsdl -@@ -0,0 +1,130 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/src/condor_contrib/aviary/etc/aviary-query.xsd b/src/condor_contrib/aviary/etc/aviary-query.xsd -new file mode 100644 -index 0000000..a46ceb8 ---- /dev/null -+++ b/src/condor_contrib/aviary/etc/aviary-query.xsd -@@ -0,0 +1,106 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/src/condor_contrib/aviary/etc/axis2.xml.in b/src/condor_contrib/aviary/etc/axis2.xml.in -new file mode 100644 -index 0000000..4e06bbd ---- /dev/null -+++ b/src/condor_contrib/aviary/etc/axis2.xml.in -@@ -0,0 +1,102 @@ -+ -+ -+ -+ -+ -+ -+ -+ @WS02_LIB_ROOT@ -+ /var/lib/condor/aviary/services -+ true -+ true -+ -+ -+ -+ -+ -+ 6060 -+ -+ -+ -+ -+ 6060 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ HTTP/1.1 -+ -+ -+ -+ -+ -+ -+ -+ HTTP/1.1 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/src/condor_contrib/aviary/gen-xsd-cpp.sh b/src/condor_contrib/aviary/gen-xsd-cpp.sh -new file mode 100755 -index 0000000..2740157 ---- /dev/null -+++ b/src/condor_contrib/aviary/gen-xsd-cpp.sh -@@ -0,0 +1,51 @@ -+#!/bin/sh -+ -+# -+# Copyright 2009-2011 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+ -+# codegen to provide WSDL/XSD CPP headers and source -+ -+WSFCPP_HOME=/usr -+if [ -z "$1" ]; then -+ echo No arg - using default -+else -+ WSFCPP_HOME=$1 -+fi -+echo WSFCPP_HOME=$WSFCPP_HOME -+ -+# generate our cpp types from WSDL -+WSDL2CPP.sh -uri etc/aviary-job.wsdl -or -d adb -ss -g -ns2p http://common.aviary.grid.redhat.com=AviaryCommon,http://job.aviary.grid.redhat.com=AviaryJob -o codegen/job -+WSDL2CPP.sh -uri etc/aviary-query.wsdl -or -d adb -ss -g -ns2p http://common.aviary.grid.redhat.com=AviaryCommon,http://query.aviary.grid.redhat.com=AviaryQuery -o codegen/query -+ -+# get rid of the extraneous stuff that WSDL2CPP won't let us turn off -+rm -f codegen/job/*AviaryJob*Service*.{h,cpp,vcproj} -+rm -f codegen/query/*AviaryQuery*Service*.{h,cpp,vcproj} -+ -+# setup our include dir -+if ! test -d include; then -+ mkdir include; -+fi -+ -+# stow the headers for others steps in the build -+mv codegen/job/src/*.h include; -+mv codegen/query/src/*.h include; -+ -+# WSDLCPP should do this for us but break out common -+if ! test -d codegen/common/src; then -+ mkdir -p codegen/common/src; -+fi -+mv codegen/query/src/AviaryCommon*.cpp codegen/common/src -+rm -f codegen/job/src/AviaryCommon*.cpp -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_ArchType.h b/src/condor_contrib/aviary/include/AviaryCommon_ArchType.h -new file mode 100644 -index 0000000..89aa5c2 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_ArchType.h -@@ -0,0 +1,245 @@ -+ -+ -+ #ifndef AviaryCommon_ARCHTYPE_H -+ #define AviaryCommon_ARCHTYPE_H -+ -+ /** -+ * ArchType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ArchType class -+ */ -+ -+ namespace AviaryCommon{ -+ class ArchType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ ArchType_INTEL, -+ ArchType_X86_64 -+ } ADBArchTypeEnum; -+ -+ -+ -+ class ArchType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_ArchType; -+ -+ -+ bool isValidArchType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setArchTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ArchType -+ */ -+ -+ ArchType(); -+ -+ /** -+ * Destructor ArchType -+ */ -+ ~ArchType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ArchType -+ * @param -+ * @param ArchType std::string -+ * @return newly created ArchType object -+ */ -+ ArchType(std::string arg_ArchType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for ArchType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getArchType(); -+ -+ /** -+ * Setter for ArchType. -+ * @param arg_ArchType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setArchType(const std::string arg_ArchType); -+ -+ /** -+ * Re setter for ArchType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetArchType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for ArchType. -+ * @return ADBArchTypeEnum; -1 on failure -+ */ -+ ADBArchTypeEnum WSF_CALL -+ getArchTypeEnum(); -+ -+ /** -+ * Enum setter for ArchType. -+ * @param arg_ArchType ADBArchTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setArchTypeEnum( -+ const ADBArchTypeEnum arg_ArchType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ArchType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isArchTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ArchType_om_node node to serialize from -+ * @param ArchType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ArchType_om_node, axiom_element_t *ArchType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ArchType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ArchType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* ARCHTYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_Attribute.h b/src/condor_contrib/aviary/include/AviaryCommon_Attribute.h -new file mode 100644 -index 0000000..1f47890 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_Attribute.h -@@ -0,0 +1,307 @@ -+ -+ -+ #ifndef AviaryCommon_ATTRIBUTE_H -+ #define AviaryCommon_ATTRIBUTE_H -+ -+ /** -+ * Attribute.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * Attribute class -+ */ -+ -+ namespace AviaryCommon{ -+ class Attribute; -+ } -+ -+ -+ -+ #include "AviaryCommon_AttributeType.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class Attribute { -+ -+ private: -+ std::string property_Name; -+ -+ -+ bool isValidName; -+ AviaryCommon::AttributeType* property_Type; -+ -+ -+ bool isValidType; -+ std::string property_Value; -+ -+ -+ bool isValidValue; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setNameNil(); -+ -+ -+ bool WSF_CALL -+ setTypeNil(); -+ -+ -+ bool WSF_CALL -+ setValueNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class Attribute -+ */ -+ -+ Attribute(); -+ -+ /** -+ * Destructor Attribute -+ */ -+ ~Attribute(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating Attribute -+ * @param -+ * @param Name std::string -+ * @param Type AviaryCommon::AttributeType* -+ * @param Value std::string -+ * @return newly created Attribute object -+ */ -+ Attribute(std::string arg_Name,AviaryCommon::AttributeType* arg_Type,std::string arg_Value); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for name. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getName(); -+ -+ /** -+ * Setter for name. -+ * @param arg_Name std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setName(const std::string arg_Name); -+ -+ /** -+ * Re setter for name -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetName(); -+ -+ -+ -+ /** -+ * Getter for type. -+ * @return AviaryCommon::AttributeType* -+ */ -+ WSF_EXTERN AviaryCommon::AttributeType* WSF_CALL -+ getType(); -+ -+ /** -+ * Setter for type. -+ * @param arg_Type AviaryCommon::AttributeType* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setType(AviaryCommon::AttributeType* arg_Type); -+ -+ /** -+ * Re setter for type -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetType(); -+ -+ -+ -+ /** -+ * Getter for value. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getValue(); -+ -+ /** -+ * Setter for value. -+ * @param arg_Value std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setValue(const std::string arg_Value); -+ -+ /** -+ * Re setter for value -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetValue(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether name is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isNameNil(); -+ -+ -+ -+ -+ /** -+ * Check whether type is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isTypeNil(); -+ -+ -+ -+ -+ /** -+ * Check whether value is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isValueNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param Attribute_om_node node to serialize from -+ * @param Attribute_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* Attribute_om_node, axiom_element_t *Attribute_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the Attribute is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for name by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for type by property number (2) -+ * @return AviaryCommon::AttributeType -+ */ -+ -+ AviaryCommon::AttributeType* WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for value by property number (3) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty3(); -+ -+ -+ -+}; -+ -+} -+ #endif /* ATTRIBUTE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_AttributeType.h b/src/condor_contrib/aviary/include/AviaryCommon_AttributeType.h -new file mode 100644 -index 0000000..34d7c36 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_AttributeType.h -@@ -0,0 +1,250 @@ -+ -+ -+ #ifndef AviaryCommon_ATTRIBUTETYPE_H -+ #define AviaryCommon_ATTRIBUTETYPE_H -+ -+ /** -+ * AttributeType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * AttributeType class -+ */ -+ -+ namespace AviaryCommon{ -+ class AttributeType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ AttributeType_INTEGER, -+ AttributeType_FLOAT, -+ AttributeType_STRING, -+ AttributeType_EXPRESSION, -+ AttributeType_BOOLEAN, -+ AttributeType_UNDEFINED, -+ AttributeType_ERROR -+ } ADBAttributeTypeEnum; -+ -+ -+ -+ class AttributeType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_AttributeType; -+ -+ -+ bool isValidAttributeType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setAttributeTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class AttributeType -+ */ -+ -+ AttributeType(); -+ -+ /** -+ * Destructor AttributeType -+ */ -+ ~AttributeType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating AttributeType -+ * @param -+ * @param AttributeType std::string -+ * @return newly created AttributeType object -+ */ -+ AttributeType(std::string arg_AttributeType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for AttributeType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getAttributeType(); -+ -+ /** -+ * Setter for AttributeType. -+ * @param arg_AttributeType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setAttributeType(const std::string arg_AttributeType); -+ -+ /** -+ * Re setter for AttributeType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetAttributeType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for AttributeType. -+ * @return ADBAttributeTypeEnum; -1 on failure -+ */ -+ ADBAttributeTypeEnum WSF_CALL -+ getAttributeTypeEnum(); -+ -+ /** -+ * Enum setter for AttributeType. -+ * @param arg_AttributeType ADBAttributeTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setAttributeTypeEnum( -+ const ADBAttributeTypeEnum arg_AttributeType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether AttributeType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isAttributeTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param AttributeType_om_node node to serialize from -+ * @param AttributeType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* AttributeType_om_node, axiom_element_t *AttributeType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the AttributeType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for AttributeType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* ATTRIBUTETYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_Attributes.h b/src/condor_contrib/aviary/include/AviaryCommon_Attributes.h -new file mode 100644 -index 0000000..d3c9823 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_Attributes.h -@@ -0,0 +1,296 @@ -+ -+ -+ #ifndef AviaryCommon_ATTRIBUTES_H -+ #define AviaryCommon_ATTRIBUTES_H -+ -+ /** -+ * Attributes.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * Attributes class -+ */ -+ -+ namespace AviaryCommon{ -+ class Attributes; -+ } -+ -+ -+ -+ #include "AviaryCommon_Attribute.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class Attributes { -+ -+ private: -+ std::vector* property_Attrs; -+ -+ -+ bool isValidAttrs; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setAttrsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class Attributes -+ */ -+ -+ Attributes(); -+ -+ /** -+ * Destructor Attributes -+ */ -+ ~Attributes(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating Attributes -+ * @param -+ * @param Attrs std::vector* -+ * @return newly created Attributes object -+ */ -+ Attributes(std::vector* arg_Attrs); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for attrs. Deprecated for array types, Use getAttrsAt instead -+ * @return Array of AviaryCommon::Attribute*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getAttrs(); -+ -+ /** -+ * Setter for attrs.Deprecated for array types, Use setAttrsAt -+ * or addAttrs instead. -+ * @param arg_Attrs Array of AviaryCommon::Attribute*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setAttrs(std::vector* arg_Attrs); -+ -+ /** -+ * Re setter for attrs -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetAttrs(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of attrs. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::Attribute* of the array -+ */ -+ WSF_EXTERN AviaryCommon::Attribute* WSF_CALL -+ getAttrsAt(int i); -+ -+ /** -+ * Set the ith element of attrs. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Attrs element to set AviaryCommon::Attribute* to the array -+ * @return ith AviaryCommon::Attribute* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setAttrsAt(int i, -+ AviaryCommon::Attribute* arg_Attrs); -+ -+ -+ /** -+ * Add to attrs. -+ * @param arg_Attrs element to add AviaryCommon::Attribute* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addAttrs( -+ AviaryCommon::Attribute* arg_Attrs); -+ -+ /** -+ * Get the size of the attrs array. -+ * @return the size of the attrs array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofAttrs(); -+ -+ /** -+ * Remove the ith element of attrs. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeAttrsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether attrs is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isAttrsNil(); -+ -+ -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether attrs is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isAttrsNilAt(int i); -+ -+ -+ /** -+ * Set attrs to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setAttrsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param Attributes_om_node node to serialize from -+ * @param Attributes_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* Attributes_om_node, axiom_element_t *Attributes_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the Attributes is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for attrs by property number (1) -+ * @return Array of AviaryCommon::Attributes. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* ATTRIBUTES_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobConstraint.h b/src/condor_contrib/aviary/include/AviaryCommon_JobConstraint.h -new file mode 100644 -index 0000000..80f3da0 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobConstraint.h -@@ -0,0 +1,253 @@ -+ -+ -+ #ifndef AviaryCommon_JOBCONSTRAINT_H -+ #define AviaryCommon_JOBCONSTRAINT_H -+ -+ /** -+ * JobConstraint.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobConstraint class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobConstraint; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobConstraintType.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class JobConstraint { -+ -+ private: -+ AviaryCommon::JobConstraintType* property_Type; -+ -+ -+ bool isValidType; -+ std::string property_Value; -+ -+ -+ bool isValidValue; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setTypeNil(); -+ -+ -+ bool WSF_CALL -+ setValueNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobConstraint -+ */ -+ -+ JobConstraint(); -+ -+ /** -+ * Destructor JobConstraint -+ */ -+ ~JobConstraint(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobConstraint -+ * @param -+ * @param Type AviaryCommon::JobConstraintType* -+ * @param Value std::string -+ * @return newly created JobConstraint object -+ */ -+ JobConstraint(AviaryCommon::JobConstraintType* arg_Type,std::string arg_Value); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for type. -+ * @return AviaryCommon::JobConstraintType* -+ */ -+ WSF_EXTERN AviaryCommon::JobConstraintType* WSF_CALL -+ getType(); -+ -+ /** -+ * Setter for type. -+ * @param arg_Type AviaryCommon::JobConstraintType* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setType(AviaryCommon::JobConstraintType* arg_Type); -+ -+ /** -+ * Re setter for type -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetType(); -+ -+ -+ -+ /** -+ * Getter for value. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getValue(); -+ -+ /** -+ * Setter for value. -+ * @param arg_Value std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setValue(const std::string arg_Value); -+ -+ /** -+ * Re setter for value -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetValue(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether type is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isTypeNil(); -+ -+ -+ -+ -+ /** -+ * Check whether value is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isValueNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobConstraint_om_node node to serialize from -+ * @param JobConstraint_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobConstraint_om_node, axiom_element_t *JobConstraint_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobConstraint is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for type by property number (1) -+ * @return AviaryCommon::JobConstraintType -+ */ -+ -+ AviaryCommon::JobConstraintType* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for value by property number (2) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBCONSTRAINT_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobConstraintType.h b/src/condor_contrib/aviary/include/AviaryCommon_JobConstraintType.h -new file mode 100644 -index 0000000..032c481 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobConstraintType.h -@@ -0,0 +1,246 @@ -+ -+ -+ #ifndef AviaryCommon_JOBCONSTRAINTTYPE_H -+ #define AviaryCommon_JOBCONSTRAINTTYPE_H -+ -+ /** -+ * JobConstraintType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobConstraintType class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobConstraintType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ JobConstraintType_CMD, -+ JobConstraintType_ARGS, -+ JobConstraintType_OWNER -+ } ADBJobConstraintTypeEnum; -+ -+ -+ -+ class JobConstraintType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_JobConstraintType; -+ -+ -+ bool isValidJobConstraintType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setJobConstraintTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobConstraintType -+ */ -+ -+ JobConstraintType(); -+ -+ /** -+ * Destructor JobConstraintType -+ */ -+ ~JobConstraintType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobConstraintType -+ * @param -+ * @param JobConstraintType std::string -+ * @return newly created JobConstraintType object -+ */ -+ JobConstraintType(std::string arg_JobConstraintType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for JobConstraintType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getJobConstraintType(); -+ -+ /** -+ * Setter for JobConstraintType. -+ * @param arg_JobConstraintType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobConstraintType(const std::string arg_JobConstraintType); -+ -+ /** -+ * Re setter for JobConstraintType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJobConstraintType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for JobConstraintType. -+ * @return ADBJobConstraintTypeEnum; -1 on failure -+ */ -+ ADBJobConstraintTypeEnum WSF_CALL -+ getJobConstraintTypeEnum(); -+ -+ /** -+ * Enum setter for JobConstraintType. -+ * @param arg_JobConstraintType ADBJobConstraintTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setJobConstraintTypeEnum( -+ const ADBJobConstraintTypeEnum arg_JobConstraintType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether JobConstraintType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJobConstraintTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobConstraintType_om_node node to serialize from -+ * @param JobConstraintType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobConstraintType_om_node, axiom_element_t *JobConstraintType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobConstraintType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for JobConstraintType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBCONSTRAINTTYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobData.h b/src/condor_contrib/aviary/include/AviaryCommon_JobData.h -new file mode 100644 -index 0000000..970bc6c ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobData.h -@@ -0,0 +1,255 @@ -+ -+ -+ #ifndef AviaryCommon_JOBDATA_H -+ #define AviaryCommon_JOBDATA_H -+ -+ /** -+ * JobData.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobData class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobData; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include "AviaryCommon_JobDataType.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class JobData { -+ -+ private: -+ AviaryCommon::JobID* property_Id; -+ -+ -+ bool isValidId; -+ AviaryCommon::JobDataType* property_Type; -+ -+ -+ bool isValidType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdNil(); -+ -+ -+ bool WSF_CALL -+ setTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobData -+ */ -+ -+ JobData(); -+ -+ /** -+ * Destructor JobData -+ */ -+ ~JobData(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobData -+ * @param -+ * @param Id AviaryCommon::JobID* -+ * @param Type AviaryCommon::JobDataType* -+ * @return newly created JobData object -+ */ -+ JobData(AviaryCommon::JobID* arg_Id,AviaryCommon::JobDataType* arg_Type); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for id. -+ * @return AviaryCommon::JobID* -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getId(); -+ -+ /** -+ * Setter for id. -+ * @param arg_Id AviaryCommon::JobID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setId(AviaryCommon::JobID* arg_Id); -+ -+ /** -+ * Re setter for id -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetId(); -+ -+ -+ -+ /** -+ * Getter for type. -+ * @return AviaryCommon::JobDataType* -+ */ -+ WSF_EXTERN AviaryCommon::JobDataType* WSF_CALL -+ getType(); -+ -+ /** -+ * Setter for type. -+ * @param arg_Type AviaryCommon::JobDataType* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setType(AviaryCommon::JobDataType* arg_Type); -+ -+ /** -+ * Re setter for type -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetType(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether id is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether type is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobData_om_node node to serialize from -+ * @param JobData_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobData_om_node, axiom_element_t *JobData_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobData is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for id by property number (1) -+ * @return AviaryCommon::JobID -+ */ -+ -+ AviaryCommon::JobID* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for type by property number (2) -+ * @return AviaryCommon::JobDataType -+ */ -+ -+ AviaryCommon::JobDataType* WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBDATA_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobDataType.h b/src/condor_contrib/aviary/include/AviaryCommon_JobDataType.h -new file mode 100644 -index 0000000..94e2873 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobDataType.h -@@ -0,0 +1,246 @@ -+ -+ -+ #ifndef AviaryCommon_JOBDATATYPE_H -+ #define AviaryCommon_JOBDATATYPE_H -+ -+ /** -+ * JobDataType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobDataType class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobDataType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ JobDataType_ERR, -+ JobDataType_LOG, -+ JobDataType_OUT -+ } ADBJobDataTypeEnum; -+ -+ -+ -+ class JobDataType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_JobDataType; -+ -+ -+ bool isValidJobDataType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setJobDataTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobDataType -+ */ -+ -+ JobDataType(); -+ -+ /** -+ * Destructor JobDataType -+ */ -+ ~JobDataType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobDataType -+ * @param -+ * @param JobDataType std::string -+ * @return newly created JobDataType object -+ */ -+ JobDataType(std::string arg_JobDataType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for JobDataType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getJobDataType(); -+ -+ /** -+ * Setter for JobDataType. -+ * @param arg_JobDataType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobDataType(const std::string arg_JobDataType); -+ -+ /** -+ * Re setter for JobDataType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJobDataType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for JobDataType. -+ * @return ADBJobDataTypeEnum; -1 on failure -+ */ -+ ADBJobDataTypeEnum WSF_CALL -+ getJobDataTypeEnum(); -+ -+ /** -+ * Enum setter for JobDataType. -+ * @param arg_JobDataType ADBJobDataTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setJobDataTypeEnum( -+ const ADBJobDataTypeEnum arg_JobDataType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether JobDataType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJobDataTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobDataType_om_node node to serialize from -+ * @param JobDataType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobDataType_om_node, axiom_element_t *JobDataType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobDataType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for JobDataType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBDATATYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobDetails.h b/src/condor_contrib/aviary/include/AviaryCommon_JobDetails.h -new file mode 100644 -index 0000000..6012bdb ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobDetails.h -@@ -0,0 +1,311 @@ -+ -+ -+ #ifndef AviaryCommon_JOBDETAILS_H -+ #define AviaryCommon_JOBDETAILS_H -+ -+ /** -+ * JobDetails.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobDetails class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobDetails; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include "AviaryCommon_Status.h" -+ -+ #include "AviaryCommon_Attributes.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class JobDetails { -+ -+ private: -+ AviaryCommon::JobID* property_Id; -+ -+ -+ bool isValidId; -+ AviaryCommon::Status* property_Status; -+ -+ -+ bool isValidStatus; -+ AviaryCommon::Attributes* property_Details; -+ -+ -+ bool isValidDetails; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdNil(); -+ -+ -+ bool WSF_CALL -+ setStatusNil(); -+ -+ -+ bool WSF_CALL -+ setDetailsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobDetails -+ */ -+ -+ JobDetails(); -+ -+ /** -+ * Destructor JobDetails -+ */ -+ ~JobDetails(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobDetails -+ * @param -+ * @param Id AviaryCommon::JobID* -+ * @param Status AviaryCommon::Status* -+ * @param Details AviaryCommon::Attributes* -+ * @return newly created JobDetails object -+ */ -+ JobDetails(AviaryCommon::JobID* arg_Id,AviaryCommon::Status* arg_Status,AviaryCommon::Attributes* arg_Details); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for id. -+ * @return AviaryCommon::JobID* -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getId(); -+ -+ /** -+ * Setter for id. -+ * @param arg_Id AviaryCommon::JobID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setId(AviaryCommon::JobID* arg_Id); -+ -+ /** -+ * Re setter for id -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetId(); -+ -+ -+ -+ /** -+ * Getter for status. -+ * @return AviaryCommon::Status* -+ */ -+ WSF_EXTERN AviaryCommon::Status* WSF_CALL -+ getStatus(); -+ -+ /** -+ * Setter for status. -+ * @param arg_Status AviaryCommon::Status* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setStatus(AviaryCommon::Status* arg_Status); -+ -+ /** -+ * Re setter for status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetStatus(); -+ -+ -+ -+ /** -+ * Getter for details. -+ * @return AviaryCommon::Attributes* -+ */ -+ WSF_EXTERN AviaryCommon::Attributes* WSF_CALL -+ getDetails(); -+ -+ /** -+ * Setter for details. -+ * @param arg_Details AviaryCommon::Attributes* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setDetails(AviaryCommon::Attributes* arg_Details); -+ -+ /** -+ * Re setter for details -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetDetails(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether id is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isStatusNil(); -+ -+ -+ -+ -+ /** -+ * Check whether details is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isDetailsNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobDetails_om_node node to serialize from -+ * @param JobDetails_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobDetails_om_node, axiom_element_t *JobDetails_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobDetails is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for id by property number (1) -+ * @return AviaryCommon::JobID -+ */ -+ -+ AviaryCommon::JobID* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for status by property number (2) -+ * @return AviaryCommon::Status -+ */ -+ -+ AviaryCommon::Status* WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for details by property number (3) -+ * @return AviaryCommon::Attributes -+ */ -+ -+ AviaryCommon::Attributes* WSF_CALL -+ getProperty3(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBDETAILS_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobID.h b/src/condor_contrib/aviary/include/AviaryCommon_JobID.h -new file mode 100644 -index 0000000..4c62c81 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobID.h -@@ -0,0 +1,361 @@ -+ -+ -+ #ifndef AviaryCommon_JOBID_H -+ #define AviaryCommon_JOBID_H -+ -+ /** -+ * JobID.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobID class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobID; -+ } -+ -+ -+ -+ #include "AviaryCommon_SubmissionID.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class JobID { -+ -+ private: -+ std::string property_Job; -+ -+ -+ bool isValidJob; -+ std::string property_Pool; -+ -+ -+ bool isValidPool; -+ std::string property_Scheduler; -+ -+ -+ bool isValidScheduler; -+ AviaryCommon::SubmissionID* property_Submission; -+ -+ -+ bool isValidSubmission; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setJobNil(); -+ -+ -+ bool WSF_CALL -+ setPoolNil(); -+ -+ -+ bool WSF_CALL -+ setSchedulerNil(); -+ -+ -+ bool WSF_CALL -+ setSubmissionNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobID -+ */ -+ -+ JobID(); -+ -+ /** -+ * Destructor JobID -+ */ -+ ~JobID(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobID -+ * @param -+ * @param Job std::string -+ * @param Pool std::string -+ * @param Scheduler std::string -+ * @param Submission AviaryCommon::SubmissionID* -+ * @return newly created JobID object -+ */ -+ JobID(std::string arg_Job,std::string arg_Pool,std::string arg_Scheduler,AviaryCommon::SubmissionID* arg_Submission); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for job. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getJob(); -+ -+ /** -+ * Setter for job. -+ * @param arg_Job std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJob(const std::string arg_Job); -+ -+ /** -+ * Re setter for job -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJob(); -+ -+ -+ -+ /** -+ * Getter for pool. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getPool(); -+ -+ /** -+ * Setter for pool. -+ * @param arg_Pool std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setPool(const std::string arg_Pool); -+ -+ /** -+ * Re setter for pool -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetPool(); -+ -+ -+ -+ /** -+ * Getter for scheduler. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getScheduler(); -+ -+ /** -+ * Setter for scheduler. -+ * @param arg_Scheduler std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setScheduler(const std::string arg_Scheduler); -+ -+ /** -+ * Re setter for scheduler -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetScheduler(); -+ -+ -+ -+ /** -+ * Getter for submission. -+ * @return AviaryCommon::SubmissionID* -+ */ -+ WSF_EXTERN AviaryCommon::SubmissionID* WSF_CALL -+ getSubmission(); -+ -+ /** -+ * Setter for submission. -+ * @param arg_Submission AviaryCommon::SubmissionID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setSubmission(AviaryCommon::SubmissionID* arg_Submission); -+ -+ /** -+ * Re setter for submission -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetSubmission(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether job is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJobNil(); -+ -+ -+ -+ -+ /** -+ * Check whether pool is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isPoolNil(); -+ -+ -+ -+ -+ /** -+ * Check whether scheduler is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isSchedulerNil(); -+ -+ -+ -+ -+ /** -+ * Check whether submission is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isSubmissionNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobID_om_node node to serialize from -+ * @param JobID_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobID_om_node, axiom_element_t *JobID_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobID is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for job by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for pool by property number (2) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for scheduler by property number (3) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty3(); -+ -+ -+ -+ -+ /** -+ * Getter for submission by property number (4) -+ * @return AviaryCommon::SubmissionID -+ */ -+ -+ AviaryCommon::SubmissionID* WSF_CALL -+ getProperty4(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBID_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobStatus.h b/src/condor_contrib/aviary/include/AviaryCommon_JobStatus.h -new file mode 100644 -index 0000000..999d200 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobStatus.h -@@ -0,0 +1,311 @@ -+ -+ -+ #ifndef AviaryCommon_JOBSTATUS_H -+ #define AviaryCommon_JOBSTATUS_H -+ -+ /** -+ * JobStatus.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobStatus class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobStatus; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include "AviaryCommon_Status.h" -+ -+ #include "AviaryCommon_JobStatusType.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class JobStatus { -+ -+ private: -+ AviaryCommon::JobID* property_Id; -+ -+ -+ bool isValidId; -+ AviaryCommon::Status* property_Status; -+ -+ -+ bool isValidStatus; -+ AviaryCommon::JobStatusType* property_Job_status; -+ -+ -+ bool isValidJob_status; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdNil(); -+ -+ -+ bool WSF_CALL -+ setStatusNil(); -+ -+ -+ bool WSF_CALL -+ setJob_statusNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobStatus -+ */ -+ -+ JobStatus(); -+ -+ /** -+ * Destructor JobStatus -+ */ -+ ~JobStatus(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobStatus -+ * @param -+ * @param Id AviaryCommon::JobID* -+ * @param Status AviaryCommon::Status* -+ * @param Job_status AviaryCommon::JobStatusType* -+ * @return newly created JobStatus object -+ */ -+ JobStatus(AviaryCommon::JobID* arg_Id,AviaryCommon::Status* arg_Status,AviaryCommon::JobStatusType* arg_Job_status); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for id. -+ * @return AviaryCommon::JobID* -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getId(); -+ -+ /** -+ * Setter for id. -+ * @param arg_Id AviaryCommon::JobID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setId(AviaryCommon::JobID* arg_Id); -+ -+ /** -+ * Re setter for id -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetId(); -+ -+ -+ -+ /** -+ * Getter for status. -+ * @return AviaryCommon::Status* -+ */ -+ WSF_EXTERN AviaryCommon::Status* WSF_CALL -+ getStatus(); -+ -+ /** -+ * Setter for status. -+ * @param arg_Status AviaryCommon::Status* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setStatus(AviaryCommon::Status* arg_Status); -+ -+ /** -+ * Re setter for status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetStatus(); -+ -+ -+ -+ /** -+ * Getter for job_status. -+ * @return AviaryCommon::JobStatusType* -+ */ -+ WSF_EXTERN AviaryCommon::JobStatusType* WSF_CALL -+ getJob_status(); -+ -+ /** -+ * Setter for job_status. -+ * @param arg_Job_status AviaryCommon::JobStatusType* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJob_status(AviaryCommon::JobStatusType* arg_Job_status); -+ -+ /** -+ * Re setter for job_status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJob_status(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether id is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isStatusNil(); -+ -+ -+ -+ -+ /** -+ * Check whether job_status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJob_statusNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobStatus_om_node node to serialize from -+ * @param JobStatus_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobStatus_om_node, axiom_element_t *JobStatus_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobStatus is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for id by property number (1) -+ * @return AviaryCommon::JobID -+ */ -+ -+ AviaryCommon::JobID* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for status by property number (2) -+ * @return AviaryCommon::Status -+ */ -+ -+ AviaryCommon::Status* WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for job_status by property number (3) -+ * @return AviaryCommon::JobStatusType -+ */ -+ -+ AviaryCommon::JobStatusType* WSF_CALL -+ getProperty3(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBSTATUS_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobStatusType.h b/src/condor_contrib/aviary/include/AviaryCommon_JobStatusType.h -new file mode 100644 -index 0000000..076191a ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobStatusType.h -@@ -0,0 +1,248 @@ -+ -+ -+ #ifndef AviaryCommon_JOBSTATUSTYPE_H -+ #define AviaryCommon_JOBSTATUSTYPE_H -+ -+ /** -+ * JobStatusType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobStatusType class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobStatusType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ JobStatusType_IDLE, -+ JobStatusType_RUNNING, -+ JobStatusType_REMOVED, -+ JobStatusType_COMPLETED, -+ JobStatusType_HELD -+ } ADBJobStatusTypeEnum; -+ -+ -+ -+ class JobStatusType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_JobStatusType; -+ -+ -+ bool isValidJobStatusType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setJobStatusTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobStatusType -+ */ -+ -+ JobStatusType(); -+ -+ /** -+ * Destructor JobStatusType -+ */ -+ ~JobStatusType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobStatusType -+ * @param -+ * @param JobStatusType std::string -+ * @return newly created JobStatusType object -+ */ -+ JobStatusType(std::string arg_JobStatusType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for JobStatusType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getJobStatusType(); -+ -+ /** -+ * Setter for JobStatusType. -+ * @param arg_JobStatusType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobStatusType(const std::string arg_JobStatusType); -+ -+ /** -+ * Re setter for JobStatusType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJobStatusType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for JobStatusType. -+ * @return ADBJobStatusTypeEnum; -1 on failure -+ */ -+ ADBJobStatusTypeEnum WSF_CALL -+ getJobStatusTypeEnum(); -+ -+ /** -+ * Enum setter for JobStatusType. -+ * @param arg_JobStatusType ADBJobStatusTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setJobStatusTypeEnum( -+ const ADBJobStatusTypeEnum arg_JobStatusType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether JobStatusType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJobStatusTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobStatusType_om_node node to serialize from -+ * @param JobStatusType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobStatusType_om_node, axiom_element_t *JobStatusType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobStatusType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for JobStatusType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBSTATUSTYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_JobSummary.h b/src/condor_contrib/aviary/include/AviaryCommon_JobSummary.h -new file mode 100644 -index 0000000..b6128a6 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_JobSummary.h -@@ -0,0 +1,745 @@ -+ -+ -+ #ifndef AviaryCommon_JOBSUMMARY_H -+ #define AviaryCommon_JOBSUMMARY_H -+ -+ /** -+ * JobSummary.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * JobSummary class -+ */ -+ -+ namespace AviaryCommon{ -+ class JobSummary; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include "AviaryCommon_Status.h" -+ -+ #include "AviaryCommon_JobStatusType.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class JobSummary { -+ -+ private: -+ AviaryCommon::JobID* property_Id; -+ -+ -+ bool isValidId; -+ AviaryCommon::Status* property_Status; -+ -+ -+ bool isValidStatus; -+ axutil_date_time_t* property_Queued; -+ -+ -+ bool isValidQueued; -+ axutil_date_time_t* property_Last_update; -+ -+ -+ bool isValidLast_update; -+ AviaryCommon::JobStatusType* property_Job_status; -+ -+ -+ bool isValidJob_status; -+ std::string property_Cmd; -+ -+ -+ bool isValidCmd; -+ std::string property_Args1; -+ -+ -+ bool isValidArgs1; -+ std::string property_Args2; -+ -+ -+ bool isValidArgs2; -+ std::string property_Held; -+ -+ -+ bool isValidHeld; -+ std::string property_Released; -+ -+ -+ bool isValidReleased; -+ std::string property_Removed; -+ -+ -+ bool isValidRemoved; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdNil(); -+ -+ -+ bool WSF_CALL -+ setStatusNil(); -+ -+ -+ bool WSF_CALL -+ setQueuedNil(); -+ -+ -+ bool WSF_CALL -+ setLast_updateNil(); -+ -+ -+ bool WSF_CALL -+ setJob_statusNil(); -+ -+ -+ bool WSF_CALL -+ setCmdNil(); -+ -+ -+ bool WSF_CALL -+ setArgs1Nil(); -+ -+ -+ bool WSF_CALL -+ setArgs2Nil(); -+ -+ -+ bool WSF_CALL -+ setHeldNil(); -+ -+ -+ bool WSF_CALL -+ setReleasedNil(); -+ -+ -+ bool WSF_CALL -+ setRemovedNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class JobSummary -+ */ -+ -+ JobSummary(); -+ -+ /** -+ * Destructor JobSummary -+ */ -+ ~JobSummary(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating JobSummary -+ * @param -+ * @param Id AviaryCommon::JobID* -+ * @param Status AviaryCommon::Status* -+ * @param Queued axutil_date_time_t* -+ * @param Last_update axutil_date_time_t* -+ * @param Job_status AviaryCommon::JobStatusType* -+ * @param Cmd std::string -+ * @param Args1 std::string -+ * @param Args2 std::string -+ * @param Held std::string -+ * @param Released std::string -+ * @param Removed std::string -+ * @return newly created JobSummary object -+ */ -+ JobSummary(AviaryCommon::JobID* arg_Id,AviaryCommon::Status* arg_Status,axutil_date_time_t* arg_Queued,axutil_date_time_t* arg_Last_update,AviaryCommon::JobStatusType* arg_Job_status,std::string arg_Cmd,std::string arg_Args1,std::string arg_Args2,std::string arg_Held,std::string arg_Released,std::string arg_Removed); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for id. -+ * @return AviaryCommon::JobID* -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getId(); -+ -+ /** -+ * Setter for id. -+ * @param arg_Id AviaryCommon::JobID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setId(AviaryCommon::JobID* arg_Id); -+ -+ /** -+ * Re setter for id -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetId(); -+ -+ -+ -+ /** -+ * Getter for status. -+ * @return AviaryCommon::Status* -+ */ -+ WSF_EXTERN AviaryCommon::Status* WSF_CALL -+ getStatus(); -+ -+ /** -+ * Setter for status. -+ * @param arg_Status AviaryCommon::Status* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setStatus(AviaryCommon::Status* arg_Status); -+ -+ /** -+ * Re setter for status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetStatus(); -+ -+ -+ -+ /** -+ * Getter for queued. -+ * @return axutil_date_time_t* -+ */ -+ WSF_EXTERN axutil_date_time_t* WSF_CALL -+ getQueued(); -+ -+ /** -+ * Setter for queued. -+ * @param arg_Queued axutil_date_time_t* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setQueued(axutil_date_time_t* arg_Queued); -+ -+ /** -+ * Re setter for queued -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetQueued(); -+ -+ -+ -+ /** -+ * Getter for last_update. -+ * @return axutil_date_time_t* -+ */ -+ WSF_EXTERN axutil_date_time_t* WSF_CALL -+ getLast_update(); -+ -+ /** -+ * Setter for last_update. -+ * @param arg_Last_update axutil_date_time_t* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setLast_update(axutil_date_time_t* arg_Last_update); -+ -+ /** -+ * Re setter for last_update -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetLast_update(); -+ -+ -+ -+ /** -+ * Getter for job_status. -+ * @return AviaryCommon::JobStatusType* -+ */ -+ WSF_EXTERN AviaryCommon::JobStatusType* WSF_CALL -+ getJob_status(); -+ -+ /** -+ * Setter for job_status. -+ * @param arg_Job_status AviaryCommon::JobStatusType* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJob_status(AviaryCommon::JobStatusType* arg_Job_status); -+ -+ /** -+ * Re setter for job_status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJob_status(); -+ -+ -+ -+ /** -+ * Getter for cmd. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getCmd(); -+ -+ /** -+ * Setter for cmd. -+ * @param arg_Cmd std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setCmd(const std::string arg_Cmd); -+ -+ /** -+ * Re setter for cmd -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetCmd(); -+ -+ -+ -+ /** -+ * Getter for args1. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getArgs1(); -+ -+ /** -+ * Setter for args1. -+ * @param arg_Args1 std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setArgs1(const std::string arg_Args1); -+ -+ /** -+ * Re setter for args1 -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetArgs1(); -+ -+ -+ -+ /** -+ * Getter for args2. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getArgs2(); -+ -+ /** -+ * Setter for args2. -+ * @param arg_Args2 std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setArgs2(const std::string arg_Args2); -+ -+ /** -+ * Re setter for args2 -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetArgs2(); -+ -+ -+ -+ /** -+ * Getter for held. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getHeld(); -+ -+ /** -+ * Setter for held. -+ * @param arg_Held std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setHeld(const std::string arg_Held); -+ -+ /** -+ * Re setter for held -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetHeld(); -+ -+ -+ -+ /** -+ * Getter for released. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getReleased(); -+ -+ /** -+ * Setter for released. -+ * @param arg_Released std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setReleased(const std::string arg_Released); -+ -+ /** -+ * Re setter for released -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetReleased(); -+ -+ -+ -+ /** -+ * Getter for removed. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getRemoved(); -+ -+ /** -+ * Setter for removed. -+ * @param arg_Removed std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setRemoved(const std::string arg_Removed); -+ -+ /** -+ * Re setter for removed -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetRemoved(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether id is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isStatusNil(); -+ -+ -+ -+ -+ /** -+ * Check whether queued is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isQueuedNil(); -+ -+ -+ -+ -+ /** -+ * Check whether last_update is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isLast_updateNil(); -+ -+ -+ -+ -+ /** -+ * Check whether job_status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJob_statusNil(); -+ -+ -+ -+ -+ /** -+ * Check whether cmd is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isCmdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether args1 is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isArgs1Nil(); -+ -+ -+ -+ -+ /** -+ * Check whether args2 is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isArgs2Nil(); -+ -+ -+ -+ -+ /** -+ * Check whether held is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isHeldNil(); -+ -+ -+ -+ -+ /** -+ * Check whether released is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isReleasedNil(); -+ -+ -+ -+ -+ /** -+ * Check whether removed is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isRemovedNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param JobSummary_om_node node to serialize from -+ * @param JobSummary_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* JobSummary_om_node, axiom_element_t *JobSummary_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the JobSummary is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for id by property number (1) -+ * @return AviaryCommon::JobID -+ */ -+ -+ AviaryCommon::JobID* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for status by property number (2) -+ * @return AviaryCommon::Status -+ */ -+ -+ AviaryCommon::Status* WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for queued by property number (3) -+ * @return axutil_date_time_t* -+ */ -+ -+ axutil_date_time_t* WSF_CALL -+ getProperty3(); -+ -+ -+ -+ -+ /** -+ * Getter for last_update by property number (4) -+ * @return axutil_date_time_t* -+ */ -+ -+ axutil_date_time_t* WSF_CALL -+ getProperty4(); -+ -+ -+ -+ -+ /** -+ * Getter for job_status by property number (5) -+ * @return AviaryCommon::JobStatusType -+ */ -+ -+ AviaryCommon::JobStatusType* WSF_CALL -+ getProperty5(); -+ -+ -+ -+ -+ /** -+ * Getter for cmd by property number (6) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty6(); -+ -+ -+ -+ -+ /** -+ * Getter for args1 by property number (7) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty7(); -+ -+ -+ -+ -+ /** -+ * Getter for args2 by property number (8) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty8(); -+ -+ -+ -+ -+ /** -+ * Getter for held by property number (9) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty9(); -+ -+ -+ -+ -+ /** -+ * Getter for released by property number (10) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty10(); -+ -+ -+ -+ -+ /** -+ * Getter for removed by property number (11) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty11(); -+ -+ -+ -+}; -+ -+} -+ #endif /* JOBSUMMARY_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_OSType.h b/src/condor_contrib/aviary/include/AviaryCommon_OSType.h -new file mode 100644 -index 0000000..3322a71 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_OSType.h -@@ -0,0 +1,245 @@ -+ -+ -+ #ifndef AviaryCommon_OSTYPE_H -+ #define AviaryCommon_OSTYPE_H -+ -+ /** -+ * OSType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * OSType class -+ */ -+ -+ namespace AviaryCommon{ -+ class OSType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ OSType_LINUX, -+ OSType_WINDOWS -+ } ADBOSTypeEnum; -+ -+ -+ -+ class OSType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_OSType; -+ -+ -+ bool isValidOSType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setOSTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class OSType -+ */ -+ -+ OSType(); -+ -+ /** -+ * Destructor OSType -+ */ -+ ~OSType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating OSType -+ * @param -+ * @param OSType std::string -+ * @return newly created OSType object -+ */ -+ OSType(std::string arg_OSType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for OSType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getOSType(); -+ -+ /** -+ * Setter for OSType. -+ * @param arg_OSType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setOSType(const std::string arg_OSType); -+ -+ /** -+ * Re setter for OSType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetOSType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for OSType. -+ * @return ADBOSTypeEnum; -1 on failure -+ */ -+ ADBOSTypeEnum WSF_CALL -+ getOSTypeEnum(); -+ -+ /** -+ * Enum setter for OSType. -+ * @param arg_OSType ADBOSTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setOSTypeEnum( -+ const ADBOSTypeEnum arg_OSType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether OSType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isOSTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param OSType_om_node node to serialize from -+ * @param OSType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* OSType_om_node, axiom_element_t *OSType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the OSType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for OSType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* OSTYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_ResourceConstraint.h b/src/condor_contrib/aviary/include/AviaryCommon_ResourceConstraint.h -new file mode 100644 -index 0000000..12557d8 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_ResourceConstraint.h -@@ -0,0 +1,253 @@ -+ -+ -+ #ifndef AviaryCommon_RESOURCECONSTRAINT_H -+ #define AviaryCommon_RESOURCECONSTRAINT_H -+ -+ /** -+ * ResourceConstraint.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ResourceConstraint class -+ */ -+ -+ namespace AviaryCommon{ -+ class ResourceConstraint; -+ } -+ -+ -+ -+ #include "AviaryCommon_ResourceConstraintType.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class ResourceConstraint { -+ -+ private: -+ AviaryCommon::ResourceConstraintType* property_Type; -+ -+ -+ bool isValidType; -+ std::string property_Value; -+ -+ -+ bool isValidValue; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setTypeNil(); -+ -+ -+ bool WSF_CALL -+ setValueNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ResourceConstraint -+ */ -+ -+ ResourceConstraint(); -+ -+ /** -+ * Destructor ResourceConstraint -+ */ -+ ~ResourceConstraint(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ResourceConstraint -+ * @param -+ * @param Type AviaryCommon::ResourceConstraintType* -+ * @param Value std::string -+ * @return newly created ResourceConstraint object -+ */ -+ ResourceConstraint(AviaryCommon::ResourceConstraintType* arg_Type,std::string arg_Value); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for type. -+ * @return AviaryCommon::ResourceConstraintType* -+ */ -+ WSF_EXTERN AviaryCommon::ResourceConstraintType* WSF_CALL -+ getType(); -+ -+ /** -+ * Setter for type. -+ * @param arg_Type AviaryCommon::ResourceConstraintType* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setType(AviaryCommon::ResourceConstraintType* arg_Type); -+ -+ /** -+ * Re setter for type -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetType(); -+ -+ -+ -+ /** -+ * Getter for value. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getValue(); -+ -+ /** -+ * Setter for value. -+ * @param arg_Value std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setValue(const std::string arg_Value); -+ -+ /** -+ * Re setter for value -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetValue(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether type is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isTypeNil(); -+ -+ -+ -+ -+ /** -+ * Check whether value is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isValueNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ResourceConstraint_om_node node to serialize from -+ * @param ResourceConstraint_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ResourceConstraint_om_node, axiom_element_t *ResourceConstraint_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ResourceConstraint is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for type by property number (1) -+ * @return AviaryCommon::ResourceConstraintType -+ */ -+ -+ AviaryCommon::ResourceConstraintType* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for value by property number (2) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* RESOURCECONSTRAINT_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_ResourceConstraintType.h b/src/condor_contrib/aviary/include/AviaryCommon_ResourceConstraintType.h -new file mode 100644 -index 0000000..1b90eb1 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_ResourceConstraintType.h -@@ -0,0 +1,248 @@ -+ -+ -+ #ifndef AviaryCommon_RESOURCECONSTRAINTTYPE_H -+ #define AviaryCommon_RESOURCECONSTRAINTTYPE_H -+ -+ /** -+ * ResourceConstraintType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ResourceConstraintType class -+ */ -+ -+ namespace AviaryCommon{ -+ class ResourceConstraintType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ ResourceConstraintType_OS, -+ ResourceConstraintType_ARCH, -+ ResourceConstraintType_MEMORY, -+ ResourceConstraintType_DISK, -+ ResourceConstraintType_FILESYSTEM -+ } ADBResourceConstraintTypeEnum; -+ -+ -+ -+ class ResourceConstraintType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_ResourceConstraintType; -+ -+ -+ bool isValidResourceConstraintType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setResourceConstraintTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ResourceConstraintType -+ */ -+ -+ ResourceConstraintType(); -+ -+ /** -+ * Destructor ResourceConstraintType -+ */ -+ ~ResourceConstraintType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ResourceConstraintType -+ * @param -+ * @param ResourceConstraintType std::string -+ * @return newly created ResourceConstraintType object -+ */ -+ ResourceConstraintType(std::string arg_ResourceConstraintType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for ResourceConstraintType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getResourceConstraintType(); -+ -+ /** -+ * Setter for ResourceConstraintType. -+ * @param arg_ResourceConstraintType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setResourceConstraintType(const std::string arg_ResourceConstraintType); -+ -+ /** -+ * Re setter for ResourceConstraintType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetResourceConstraintType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for ResourceConstraintType. -+ * @return ADBResourceConstraintTypeEnum; -1 on failure -+ */ -+ ADBResourceConstraintTypeEnum WSF_CALL -+ getResourceConstraintTypeEnum(); -+ -+ /** -+ * Enum setter for ResourceConstraintType. -+ * @param arg_ResourceConstraintType ADBResourceConstraintTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setResourceConstraintTypeEnum( -+ const ADBResourceConstraintTypeEnum arg_ResourceConstraintType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ResourceConstraintType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isResourceConstraintTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ResourceConstraintType_om_node node to serialize from -+ * @param ResourceConstraintType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ResourceConstraintType_om_node, axiom_element_t *ResourceConstraintType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ResourceConstraintType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ResourceConstraintType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* RESOURCECONSTRAINTTYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_ResourceID.h b/src/condor_contrib/aviary/include/AviaryCommon_ResourceID.h -new file mode 100644 -index 0000000..c900d7b ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_ResourceID.h -@@ -0,0 +1,361 @@ -+ -+ -+ #ifndef AviaryCommon_RESOURCEID_H -+ #define AviaryCommon_RESOURCEID_H -+ -+ /** -+ * ResourceID.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ResourceID class -+ */ -+ -+ namespace AviaryCommon{ -+ class ResourceID; -+ } -+ -+ -+ -+ #include "AviaryCommon_ResourceType.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class ResourceID { -+ -+ private: -+ AviaryCommon::ResourceType* property_Subsystem_type; -+ -+ -+ bool isValidSubsystem_type; -+ std::string property_Pool; -+ -+ -+ bool isValidPool; -+ std::string property_Name; -+ -+ -+ bool isValidName; -+ std::string property_Custom_name; -+ -+ -+ bool isValidCustom_name; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setSubsystem_typeNil(); -+ -+ -+ bool WSF_CALL -+ setPoolNil(); -+ -+ -+ bool WSF_CALL -+ setNameNil(); -+ -+ -+ bool WSF_CALL -+ setCustom_nameNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ResourceID -+ */ -+ -+ ResourceID(); -+ -+ /** -+ * Destructor ResourceID -+ */ -+ ~ResourceID(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ResourceID -+ * @param -+ * @param Subsystem_type AviaryCommon::ResourceType* -+ * @param Pool std::string -+ * @param Name std::string -+ * @param Custom_name std::string -+ * @return newly created ResourceID object -+ */ -+ ResourceID(AviaryCommon::ResourceType* arg_Subsystem_type,std::string arg_Pool,std::string arg_Name,std::string arg_Custom_name); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for subsystem_type. -+ * @return AviaryCommon::ResourceType* -+ */ -+ WSF_EXTERN AviaryCommon::ResourceType* WSF_CALL -+ getSubsystem_type(); -+ -+ /** -+ * Setter for subsystem_type. -+ * @param arg_Subsystem_type AviaryCommon::ResourceType* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setSubsystem_type(AviaryCommon::ResourceType* arg_Subsystem_type); -+ -+ /** -+ * Re setter for subsystem_type -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetSubsystem_type(); -+ -+ -+ -+ /** -+ * Getter for pool. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getPool(); -+ -+ /** -+ * Setter for pool. -+ * @param arg_Pool std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setPool(const std::string arg_Pool); -+ -+ /** -+ * Re setter for pool -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetPool(); -+ -+ -+ -+ /** -+ * Getter for name. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getName(); -+ -+ /** -+ * Setter for name. -+ * @param arg_Name std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setName(const std::string arg_Name); -+ -+ /** -+ * Re setter for name -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetName(); -+ -+ -+ -+ /** -+ * Getter for custom_name. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getCustom_name(); -+ -+ /** -+ * Setter for custom_name. -+ * @param arg_Custom_name std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setCustom_name(const std::string arg_Custom_name); -+ -+ /** -+ * Re setter for custom_name -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetCustom_name(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether subsystem_type is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isSubsystem_typeNil(); -+ -+ -+ -+ -+ /** -+ * Check whether pool is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isPoolNil(); -+ -+ -+ -+ -+ /** -+ * Check whether name is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isNameNil(); -+ -+ -+ -+ -+ /** -+ * Check whether custom_name is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isCustom_nameNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ResourceID_om_node node to serialize from -+ * @param ResourceID_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ResourceID_om_node, axiom_element_t *ResourceID_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ResourceID is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for subsystem_type by property number (1) -+ * @return AviaryCommon::ResourceType -+ */ -+ -+ AviaryCommon::ResourceType* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for pool by property number (2) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for name by property number (3) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty3(); -+ -+ -+ -+ -+ /** -+ * Getter for custom_name by property number (4) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty4(); -+ -+ -+ -+}; -+ -+} -+ #endif /* RESOURCEID_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_ResourceType.h b/src/condor_contrib/aviary/include/AviaryCommon_ResourceType.h -new file mode 100644 -index 0000000..dd42777 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_ResourceType.h -@@ -0,0 +1,252 @@ -+ -+ -+ #ifndef AviaryCommon_RESOURCETYPE_H -+ #define AviaryCommon_RESOURCETYPE_H -+ -+ /** -+ * ResourceType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ResourceType class -+ */ -+ -+ namespace AviaryCommon{ -+ class ResourceType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ ResourceType_COLLECTOR, -+ ResourceType_EXECUTOR, -+ ResourceType_EVENT_SERVER, -+ ResourceType_JOB_SERVER, -+ ResourceType_LOW_LATENCY, -+ ResourceType_MASTER, -+ ResourceType_NEGOTIATOR, -+ ResourceType_SCHEDULER, -+ ResourceType_CUSTOM -+ } ADBResourceTypeEnum; -+ -+ -+ -+ class ResourceType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_ResourceType; -+ -+ -+ bool isValidResourceType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setResourceTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ResourceType -+ */ -+ -+ ResourceType(); -+ -+ /** -+ * Destructor ResourceType -+ */ -+ ~ResourceType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ResourceType -+ * @param -+ * @param ResourceType std::string -+ * @return newly created ResourceType object -+ */ -+ ResourceType(std::string arg_ResourceType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for ResourceType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getResourceType(); -+ -+ /** -+ * Setter for ResourceType. -+ * @param arg_ResourceType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setResourceType(const std::string arg_ResourceType); -+ -+ /** -+ * Re setter for ResourceType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetResourceType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for ResourceType. -+ * @return ADBResourceTypeEnum; -1 on failure -+ */ -+ ADBResourceTypeEnum WSF_CALL -+ getResourceTypeEnum(); -+ -+ /** -+ * Enum setter for ResourceType. -+ * @param arg_ResourceType ADBResourceTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setResourceTypeEnum( -+ const ADBResourceTypeEnum arg_ResourceType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ResourceType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isResourceTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ResourceType_om_node node to serialize from -+ * @param ResourceType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ResourceType_om_node, axiom_element_t *ResourceType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ResourceType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ResourceType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* RESOURCETYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_Status.h b/src/condor_contrib/aviary/include/AviaryCommon_Status.h -new file mode 100644 -index 0000000..6c72d49 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_Status.h -@@ -0,0 +1,253 @@ -+ -+ -+ #ifndef AviaryCommon_STATUS_H -+ #define AviaryCommon_STATUS_H -+ -+ /** -+ * Status.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * Status class -+ */ -+ -+ namespace AviaryCommon{ -+ class Status; -+ } -+ -+ -+ -+ #include "AviaryCommon_StatusCodeType.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class Status { -+ -+ private: -+ AviaryCommon::StatusCodeType* property_Code; -+ -+ -+ bool isValidCode; -+ std::string property_Text; -+ -+ -+ bool isValidText; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setCodeNil(); -+ -+ -+ bool WSF_CALL -+ setTextNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class Status -+ */ -+ -+ Status(); -+ -+ /** -+ * Destructor Status -+ */ -+ ~Status(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating Status -+ * @param -+ * @param Code AviaryCommon::StatusCodeType* -+ * @param Text std::string -+ * @return newly created Status object -+ */ -+ Status(AviaryCommon::StatusCodeType* arg_Code,std::string arg_Text); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for code. -+ * @return AviaryCommon::StatusCodeType* -+ */ -+ WSF_EXTERN AviaryCommon::StatusCodeType* WSF_CALL -+ getCode(); -+ -+ /** -+ * Setter for code. -+ * @param arg_Code AviaryCommon::StatusCodeType* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setCode(AviaryCommon::StatusCodeType* arg_Code); -+ -+ /** -+ * Re setter for code -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetCode(); -+ -+ -+ -+ /** -+ * Getter for text. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getText(); -+ -+ /** -+ * Setter for text. -+ * @param arg_Text std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setText(const std::string arg_Text); -+ -+ /** -+ * Re setter for text -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetText(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether code is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isCodeNil(); -+ -+ -+ -+ -+ /** -+ * Check whether text is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isTextNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param Status_om_node node to serialize from -+ * @param Status_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* Status_om_node, axiom_element_t *Status_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the Status is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for code by property number (1) -+ * @return AviaryCommon::StatusCodeType -+ */ -+ -+ AviaryCommon::StatusCodeType* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for text by property number (2) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* STATUS_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_StatusCodeType.h b/src/condor_contrib/aviary/include/AviaryCommon_StatusCodeType.h -new file mode 100644 -index 0000000..bb71f9b ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_StatusCodeType.h -@@ -0,0 +1,249 @@ -+ -+ -+ #ifndef AviaryCommon_STATUSCODETYPE_H -+ #define AviaryCommon_STATUSCODETYPE_H -+ -+ /** -+ * StatusCodeType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * StatusCodeType class -+ */ -+ -+ namespace AviaryCommon{ -+ class StatusCodeType; -+ } -+ -+ -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ /* Enumeration for this type */ -+ typedef enum { -+ StatusCodeType_OK, -+ StatusCodeType_FAIL, -+ StatusCodeType_NO_MATCH, -+ StatusCodeType_INVALID_OFFSET, -+ StatusCodeType_UNIMPLEMENTED, -+ StatusCodeType_UNAVAILABLE -+ } ADBStatusCodeTypeEnum; -+ -+ -+ -+ class StatusCodeType { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_StatusCodeType; -+ -+ -+ bool isValidStatusCodeType; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setStatusCodeTypeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class StatusCodeType -+ */ -+ -+ StatusCodeType(); -+ -+ /** -+ * Destructor StatusCodeType -+ */ -+ ~StatusCodeType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating StatusCodeType -+ * @param -+ * @param StatusCodeType std::string -+ * @return newly created StatusCodeType object -+ */ -+ StatusCodeType(std::string arg_StatusCodeType); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for StatusCodeType. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getStatusCodeType(); -+ -+ /** -+ * Setter for StatusCodeType. -+ * @param arg_StatusCodeType std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setStatusCodeType(const std::string arg_StatusCodeType); -+ -+ /** -+ * Re setter for StatusCodeType -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetStatusCodeType(); -+ -+ -+ /************************** Getters and Setters For Enumerations ********************************/ -+ /********************* Enumeration Specific Operations: get_enum, set_enum **********************/ -+ -+ /** -+ * Enum getter for StatusCodeType. -+ * @return ADBStatusCodeTypeEnum; -1 on failure -+ */ -+ ADBStatusCodeTypeEnum WSF_CALL -+ getStatusCodeTypeEnum(); -+ -+ /** -+ * Enum setter for StatusCodeType. -+ * @param arg_StatusCodeType ADBStatusCodeTypeEnum -+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE -+ */ -+ bool WSF_CALL -+ setStatusCodeTypeEnum( -+ const ADBStatusCodeTypeEnum arg_StatusCodeType); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether StatusCodeType is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isStatusCodeTypeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the content from a string to an ADB object -+ * @param node_value to deserialize -+ * @param parent_element The parent element if it is an element, NULL otherwise -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserializeFromString(const axis2_char_t *node_value, axiom_node_t *parent); -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ /** -+ * Serialize ADB object to a string -+ * @param namespaces hash which contains a mapping of namespace uris to prefixes -+ * @return serialized string -+ */ -+ char* WSF_CALL -+ serializeToString(axutil_hash_t *namespaces); -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param StatusCodeType_om_node node to serialize from -+ * @param StatusCodeType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* StatusCodeType_om_node, axiom_element_t *StatusCodeType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the StatusCodeType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for StatusCodeType by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* STATUSCODETYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_SubmissionID.h b/src/condor_contrib/aviary/include/AviaryCommon_SubmissionID.h -new file mode 100644 -index 0000000..f4abae2 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_SubmissionID.h -@@ -0,0 +1,251 @@ -+ -+ -+ #ifndef AviaryCommon_SUBMISSIONID_H -+ #define AviaryCommon_SUBMISSIONID_H -+ -+ /** -+ * SubmissionID.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * SubmissionID class -+ */ -+ -+ namespace AviaryCommon{ -+ class SubmissionID; -+ } -+ -+ -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class SubmissionID { -+ -+ private: -+ std::string property_Name; -+ -+ -+ bool isValidName; -+ std::string property_Owner; -+ -+ -+ bool isValidOwner; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setNameNil(); -+ -+ -+ bool WSF_CALL -+ setOwnerNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class SubmissionID -+ */ -+ -+ SubmissionID(); -+ -+ /** -+ * Destructor SubmissionID -+ */ -+ ~SubmissionID(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating SubmissionID -+ * @param -+ * @param Name std::string -+ * @param Owner std::string -+ * @return newly created SubmissionID object -+ */ -+ SubmissionID(std::string arg_Name,std::string arg_Owner); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for name. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getName(); -+ -+ /** -+ * Setter for name. -+ * @param arg_Name std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setName(const std::string arg_Name); -+ -+ /** -+ * Re setter for name -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetName(); -+ -+ -+ -+ /** -+ * Getter for owner. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getOwner(); -+ -+ /** -+ * Setter for owner. -+ * @param arg_Owner std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setOwner(const std::string arg_Owner); -+ -+ /** -+ * Re setter for owner -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetOwner(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether name is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isNameNil(); -+ -+ -+ -+ -+ /** -+ * Check whether owner is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isOwnerNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param SubmissionID_om_node node to serialize from -+ * @param SubmissionID_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* SubmissionID_om_node, axiom_element_t *SubmissionID_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the SubmissionID is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for name by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for owner by property number (2) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* SUBMISSIONID_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryCommon_SubmissionSummary.h b/src/condor_contrib/aviary/include/AviaryCommon_SubmissionSummary.h -new file mode 100644 -index 0000000..f72562e ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryCommon_SubmissionSummary.h -@@ -0,0 +1,678 @@ -+ -+ -+ #ifndef AviaryCommon_SUBMISSIONSUMMARY_H -+ #define AviaryCommon_SUBMISSIONSUMMARY_H -+ -+ /** -+ * SubmissionSummary.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * SubmissionSummary class -+ */ -+ -+ namespace AviaryCommon{ -+ class SubmissionSummary; -+ } -+ -+ -+ -+ #include "AviaryCommon_SubmissionID.h" -+ -+ #include "AviaryCommon_Status.h" -+ -+ #include "AviaryCommon_JobSummary.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryCommon -+{ -+ -+ -+ -+ class SubmissionSummary { -+ -+ private: -+ AviaryCommon::SubmissionID* property_Id; -+ -+ -+ bool isValidId; -+ AviaryCommon::Status* property_Status; -+ -+ -+ bool isValidStatus; -+ int property_Completed; -+ -+ -+ bool isValidCompleted; -+ int property_Held; -+ -+ -+ bool isValidHeld; -+ int property_Idle; -+ -+ -+ bool isValidIdle; -+ int property_Removed; -+ -+ -+ bool isValidRemoved; -+ int property_Running; -+ -+ -+ bool isValidRunning; -+ std::vector* property_Jobs; -+ -+ -+ bool isValidJobs; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdNil(); -+ -+ -+ bool WSF_CALL -+ setStatusNil(); -+ -+ -+ bool WSF_CALL -+ setCompletedNil(); -+ -+ -+ bool WSF_CALL -+ setHeldNil(); -+ -+ -+ bool WSF_CALL -+ setIdleNil(); -+ -+ -+ bool WSF_CALL -+ setRemovedNil(); -+ -+ -+ bool WSF_CALL -+ setRunningNil(); -+ -+ -+ bool WSF_CALL -+ setJobsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class SubmissionSummary -+ */ -+ -+ SubmissionSummary(); -+ -+ /** -+ * Destructor SubmissionSummary -+ */ -+ ~SubmissionSummary(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating SubmissionSummary -+ * @param -+ * @param Id AviaryCommon::SubmissionID* -+ * @param Status AviaryCommon::Status* -+ * @param Completed int -+ * @param Held int -+ * @param Idle int -+ * @param Removed int -+ * @param Running int -+ * @param Jobs std::vector* -+ * @return newly created SubmissionSummary object -+ */ -+ SubmissionSummary(AviaryCommon::SubmissionID* arg_Id,AviaryCommon::Status* arg_Status,int arg_Completed,int arg_Held,int arg_Idle,int arg_Removed,int arg_Running,std::vector* arg_Jobs); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for id. -+ * @return AviaryCommon::SubmissionID* -+ */ -+ WSF_EXTERN AviaryCommon::SubmissionID* WSF_CALL -+ getId(); -+ -+ /** -+ * Setter for id. -+ * @param arg_Id AviaryCommon::SubmissionID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setId(AviaryCommon::SubmissionID* arg_Id); -+ -+ /** -+ * Re setter for id -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetId(); -+ -+ -+ -+ /** -+ * Getter for status. -+ * @return AviaryCommon::Status* -+ */ -+ WSF_EXTERN AviaryCommon::Status* WSF_CALL -+ getStatus(); -+ -+ /** -+ * Setter for status. -+ * @param arg_Status AviaryCommon::Status* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setStatus(AviaryCommon::Status* arg_Status); -+ -+ /** -+ * Re setter for status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetStatus(); -+ -+ -+ -+ /** -+ * Getter for completed. -+ * @return int* -+ */ -+ WSF_EXTERN int WSF_CALL -+ getCompleted(); -+ -+ /** -+ * Setter for completed. -+ * @param arg_Completed int* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setCompleted(const int arg_Completed); -+ -+ /** -+ * Re setter for completed -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetCompleted(); -+ -+ -+ -+ /** -+ * Getter for held. -+ * @return int* -+ */ -+ WSF_EXTERN int WSF_CALL -+ getHeld(); -+ -+ /** -+ * Setter for held. -+ * @param arg_Held int* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setHeld(const int arg_Held); -+ -+ /** -+ * Re setter for held -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetHeld(); -+ -+ -+ -+ /** -+ * Getter for idle. -+ * @return int* -+ */ -+ WSF_EXTERN int WSF_CALL -+ getIdle(); -+ -+ /** -+ * Setter for idle. -+ * @param arg_Idle int* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIdle(const int arg_Idle); -+ -+ /** -+ * Re setter for idle -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetIdle(); -+ -+ -+ -+ /** -+ * Getter for removed. -+ * @return int* -+ */ -+ WSF_EXTERN int WSF_CALL -+ getRemoved(); -+ -+ /** -+ * Setter for removed. -+ * @param arg_Removed int* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setRemoved(const int arg_Removed); -+ -+ /** -+ * Re setter for removed -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetRemoved(); -+ -+ -+ -+ /** -+ * Getter for running. -+ * @return int* -+ */ -+ WSF_EXTERN int WSF_CALL -+ getRunning(); -+ -+ /** -+ * Setter for running. -+ * @param arg_Running int* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setRunning(const int arg_Running); -+ -+ /** -+ * Re setter for running -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetRunning(); -+ -+ -+ -+ /** -+ * Getter for jobs. Deprecated for array types, Use getJobsAt instead -+ * @return Array of AviaryCommon::JobSummary*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getJobs(); -+ -+ /** -+ * Setter for jobs.Deprecated for array types, Use setJobsAt -+ * or addJobs instead. -+ * @param arg_Jobs Array of AviaryCommon::JobSummary*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobs(std::vector* arg_Jobs); -+ -+ /** -+ * Re setter for jobs -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJobs(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of jobs. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::JobSummary* of the array -+ */ -+ WSF_EXTERN AviaryCommon::JobSummary* WSF_CALL -+ getJobsAt(int i); -+ -+ /** -+ * Set the ith element of jobs. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Jobs element to set AviaryCommon::JobSummary* to the array -+ * @return ith AviaryCommon::JobSummary* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobsAt(int i, -+ AviaryCommon::JobSummary* arg_Jobs); -+ -+ -+ /** -+ * Add to jobs. -+ * @param arg_Jobs element to add AviaryCommon::JobSummary* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addJobs( -+ AviaryCommon::JobSummary* arg_Jobs); -+ -+ /** -+ * Get the size of the jobs array. -+ * @return the size of the jobs array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofJobs(); -+ -+ /** -+ * Remove the ith element of jobs. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeJobsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether id is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isStatusNil(); -+ -+ -+ -+ -+ /** -+ * Check whether completed is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isCompletedNil(); -+ -+ -+ -+ -+ /** -+ * Check whether held is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isHeldNil(); -+ -+ -+ -+ -+ /** -+ * Check whether idle is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdleNil(); -+ -+ -+ -+ -+ /** -+ * Check whether removed is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isRemovedNil(); -+ -+ -+ -+ -+ /** -+ * Check whether running is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isRunningNil(); -+ -+ -+ -+ -+ /** -+ * Check whether jobs is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJobsNil(); -+ -+ -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether jobs is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isJobsNilAt(int i); -+ -+ -+ /** -+ * Set jobs to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setJobsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param SubmissionSummary_om_node node to serialize from -+ * @param SubmissionSummary_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* SubmissionSummary_om_node, axiom_element_t *SubmissionSummary_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the SubmissionSummary is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for id by property number (1) -+ * @return AviaryCommon::SubmissionID -+ */ -+ -+ AviaryCommon::SubmissionID* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for status by property number (2) -+ * @return AviaryCommon::Status -+ */ -+ -+ AviaryCommon::Status* WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for completed by property number (3) -+ * @return int -+ */ -+ -+ int WSF_CALL -+ getProperty3(); -+ -+ -+ -+ -+ /** -+ * Getter for held by property number (4) -+ * @return int -+ */ -+ -+ int WSF_CALL -+ getProperty4(); -+ -+ -+ -+ -+ /** -+ * Getter for idle by property number (5) -+ * @return int -+ */ -+ -+ int WSF_CALL -+ getProperty5(); -+ -+ -+ -+ -+ /** -+ * Getter for removed by property number (6) -+ * @return int -+ */ -+ -+ int WSF_CALL -+ getProperty6(); -+ -+ -+ -+ -+ /** -+ * Getter for running by property number (7) -+ * @return int -+ */ -+ -+ int WSF_CALL -+ getProperty7(); -+ -+ -+ -+ -+ /** -+ * Getter for jobs by property number (8) -+ * @return Array of AviaryCommon::JobSummarys. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty8(); -+ -+ -+ -+}; -+ -+} -+ #endif /* SUBMISSIONSUMMARY_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_ControlJob.h b/src/condor_contrib/aviary/include/AviaryJob_ControlJob.h -new file mode 100644 -index 0000000..381e631 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_ControlJob.h -@@ -0,0 +1,253 @@ -+ -+ -+ #ifndef AviaryJob_CONTROLJOB_H -+ #define AviaryJob_CONTROLJOB_H -+ -+ /** -+ * ControlJob.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ControlJob class -+ */ -+ -+ namespace AviaryJob{ -+ class ControlJob; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class ControlJob { -+ -+ private: -+ AviaryCommon::JobID* property_Id; -+ -+ -+ bool isValidId; -+ std::string property_Reason; -+ -+ -+ bool isValidReason; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdNil(); -+ -+ -+ bool WSF_CALL -+ setReasonNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ControlJob -+ */ -+ -+ ControlJob(); -+ -+ /** -+ * Destructor ControlJob -+ */ -+ ~ControlJob(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ControlJob -+ * @param -+ * @param Id AviaryCommon::JobID* -+ * @param Reason std::string -+ * @return newly created ControlJob object -+ */ -+ ControlJob(AviaryCommon::JobID* arg_Id,std::string arg_Reason); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for id. -+ * @return AviaryCommon::JobID* -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getId(); -+ -+ /** -+ * Setter for id. -+ * @param arg_Id AviaryCommon::JobID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setId(AviaryCommon::JobID* arg_Id); -+ -+ /** -+ * Re setter for id -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetId(); -+ -+ -+ -+ /** -+ * Getter for reason. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getReason(); -+ -+ /** -+ * Setter for reason. -+ * @param arg_Reason std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setReason(const std::string arg_Reason); -+ -+ /** -+ * Re setter for reason -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetReason(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether id is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether reason is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isReasonNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ControlJob_om_node node to serialize from -+ * @param ControlJob_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ControlJob_om_node, axiom_element_t *ControlJob_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ControlJob is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for id by property number (1) -+ * @return AviaryCommon::JobID -+ */ -+ -+ AviaryCommon::JobID* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for reason by property number (2) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* CONTROLJOB_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_ControlJobResponse.h b/src/condor_contrib/aviary/include/AviaryJob_ControlJobResponse.h -new file mode 100644 -index 0000000..cf03407 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_ControlJobResponse.h -@@ -0,0 +1,199 @@ -+ -+ -+ #ifndef AviaryJob_CONTROLJOBRESPONSE_H -+ #define AviaryJob_CONTROLJOBRESPONSE_H -+ -+ /** -+ * ControlJobResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ControlJobResponse class -+ */ -+ -+ namespace AviaryJob{ -+ class ControlJobResponse; -+ } -+ -+ -+ -+ #include "AviaryCommon_Status.h" -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class ControlJobResponse { -+ -+ private: -+ AviaryCommon::Status* property_Status; -+ -+ -+ bool isValidStatus; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setStatusNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ControlJobResponse -+ */ -+ -+ ControlJobResponse(); -+ -+ /** -+ * Destructor ControlJobResponse -+ */ -+ ~ControlJobResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ControlJobResponse -+ * @param -+ * @param Status AviaryCommon::Status* -+ * @return newly created ControlJobResponse object -+ */ -+ ControlJobResponse(AviaryCommon::Status* arg_Status); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for status. -+ * @return AviaryCommon::Status* -+ */ -+ WSF_EXTERN AviaryCommon::Status* WSF_CALL -+ getStatus(); -+ -+ /** -+ * Setter for status. -+ * @param arg_Status AviaryCommon::Status* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setStatus(AviaryCommon::Status* arg_Status); -+ -+ /** -+ * Re setter for status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetStatus(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isStatusNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ControlJobResponse_om_node node to serialize from -+ * @param ControlJobResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ControlJobResponse_om_node, axiom_element_t *ControlJobResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ControlJobResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for status by property number (1) -+ * @return AviaryCommon::Status -+ */ -+ -+ AviaryCommon::Status* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* CONTROLJOBRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_HoldJob.h b/src/condor_contrib/aviary/include/AviaryJob_HoldJob.h -new file mode 100644 -index 0000000..119d76f ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_HoldJob.h -@@ -0,0 +1,203 @@ -+ -+ -+ #ifndef AviaryJob_HOLDJOB_H -+ #define AviaryJob_HOLDJOB_H -+ -+ /** -+ * HoldJob.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * HoldJob class -+ */ -+ -+ namespace AviaryJob{ -+ class HoldJob; -+ } -+ -+ -+ -+ #include "AviaryJob_ControlJob.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class HoldJob { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryJob::ControlJob* property_HoldJob; -+ -+ -+ bool isValidHoldJob; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setHoldJobNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class HoldJob -+ */ -+ -+ HoldJob(); -+ -+ /** -+ * Destructor HoldJob -+ */ -+ ~HoldJob(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating HoldJob -+ * @param -+ * @param HoldJob AviaryJob::ControlJob* -+ * @return newly created HoldJob object -+ */ -+ HoldJob(AviaryJob::ControlJob* arg_HoldJob); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for HoldJob. -+ * @return AviaryJob::ControlJob* -+ */ -+ WSF_EXTERN AviaryJob::ControlJob* WSF_CALL -+ getHoldJob(); -+ -+ /** -+ * Setter for HoldJob. -+ * @param arg_HoldJob AviaryJob::ControlJob* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setHoldJob(AviaryJob::ControlJob* arg_HoldJob); -+ -+ /** -+ * Re setter for HoldJob -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetHoldJob(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether HoldJob is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isHoldJobNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param HoldJob_om_node node to serialize from -+ * @param HoldJob_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* HoldJob_om_node, axiom_element_t *HoldJob_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the HoldJob is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for HoldJob by property number (1) -+ * @return AviaryJob::ControlJob -+ */ -+ -+ AviaryJob::ControlJob* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* HOLDJOB_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_HoldJobResponse.h b/src/condor_contrib/aviary/include/AviaryJob_HoldJobResponse.h -new file mode 100644 -index 0000000..3b8d1da ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_HoldJobResponse.h -@@ -0,0 +1,203 @@ -+ -+ -+ #ifndef AviaryJob_HOLDJOBRESPONSE_H -+ #define AviaryJob_HOLDJOBRESPONSE_H -+ -+ /** -+ * HoldJobResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * HoldJobResponse class -+ */ -+ -+ namespace AviaryJob{ -+ class HoldJobResponse; -+ } -+ -+ -+ -+ #include "AviaryJob_ControlJobResponse.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class HoldJobResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryJob::ControlJobResponse* property_HoldJobResponse; -+ -+ -+ bool isValidHoldJobResponse; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setHoldJobResponseNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class HoldJobResponse -+ */ -+ -+ HoldJobResponse(); -+ -+ /** -+ * Destructor HoldJobResponse -+ */ -+ ~HoldJobResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating HoldJobResponse -+ * @param -+ * @param HoldJobResponse AviaryJob::ControlJobResponse* -+ * @return newly created HoldJobResponse object -+ */ -+ HoldJobResponse(AviaryJob::ControlJobResponse* arg_HoldJobResponse); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for HoldJobResponse. -+ * @return AviaryJob::ControlJobResponse* -+ */ -+ WSF_EXTERN AviaryJob::ControlJobResponse* WSF_CALL -+ getHoldJobResponse(); -+ -+ /** -+ * Setter for HoldJobResponse. -+ * @param arg_HoldJobResponse AviaryJob::ControlJobResponse* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setHoldJobResponse(AviaryJob::ControlJobResponse* arg_HoldJobResponse); -+ -+ /** -+ * Re setter for HoldJobResponse -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetHoldJobResponse(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether HoldJobResponse is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isHoldJobResponseNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param HoldJobResponse_om_node node to serialize from -+ * @param HoldJobResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* HoldJobResponse_om_node, axiom_element_t *HoldJobResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the HoldJobResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for HoldJobResponse by property number (1) -+ * @return AviaryJob::ControlJobResponse -+ */ -+ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* HOLDJOBRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_ReleaseJob.h b/src/condor_contrib/aviary/include/AviaryJob_ReleaseJob.h -new file mode 100644 -index 0000000..9fc3c14 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_ReleaseJob.h -@@ -0,0 +1,203 @@ -+ -+ -+ #ifndef AviaryJob_RELEASEJOB_H -+ #define AviaryJob_RELEASEJOB_H -+ -+ /** -+ * ReleaseJob.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ReleaseJob class -+ */ -+ -+ namespace AviaryJob{ -+ class ReleaseJob; -+ } -+ -+ -+ -+ #include "AviaryJob_ControlJob.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class ReleaseJob { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryJob::ControlJob* property_ReleaseJob; -+ -+ -+ bool isValidReleaseJob; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setReleaseJobNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ReleaseJob -+ */ -+ -+ ReleaseJob(); -+ -+ /** -+ * Destructor ReleaseJob -+ */ -+ ~ReleaseJob(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ReleaseJob -+ * @param -+ * @param ReleaseJob AviaryJob::ControlJob* -+ * @return newly created ReleaseJob object -+ */ -+ ReleaseJob(AviaryJob::ControlJob* arg_ReleaseJob); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for ReleaseJob. -+ * @return AviaryJob::ControlJob* -+ */ -+ WSF_EXTERN AviaryJob::ControlJob* WSF_CALL -+ getReleaseJob(); -+ -+ /** -+ * Setter for ReleaseJob. -+ * @param arg_ReleaseJob AviaryJob::ControlJob* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setReleaseJob(AviaryJob::ControlJob* arg_ReleaseJob); -+ -+ /** -+ * Re setter for ReleaseJob -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetReleaseJob(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ReleaseJob is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isReleaseJobNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ReleaseJob_om_node node to serialize from -+ * @param ReleaseJob_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ReleaseJob_om_node, axiom_element_t *ReleaseJob_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ReleaseJob is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ReleaseJob by property number (1) -+ * @return AviaryJob::ControlJob -+ */ -+ -+ AviaryJob::ControlJob* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* RELEASEJOB_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_ReleaseJobResponse.h b/src/condor_contrib/aviary/include/AviaryJob_ReleaseJobResponse.h -new file mode 100644 -index 0000000..6247516 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_ReleaseJobResponse.h -@@ -0,0 +1,203 @@ -+ -+ -+ #ifndef AviaryJob_RELEASEJOBRESPONSE_H -+ #define AviaryJob_RELEASEJOBRESPONSE_H -+ -+ /** -+ * ReleaseJobResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * ReleaseJobResponse class -+ */ -+ -+ namespace AviaryJob{ -+ class ReleaseJobResponse; -+ } -+ -+ -+ -+ #include "AviaryJob_ControlJobResponse.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class ReleaseJobResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryJob::ControlJobResponse* property_ReleaseJobResponse; -+ -+ -+ bool isValidReleaseJobResponse; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setReleaseJobResponseNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class ReleaseJobResponse -+ */ -+ -+ ReleaseJobResponse(); -+ -+ /** -+ * Destructor ReleaseJobResponse -+ */ -+ ~ReleaseJobResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating ReleaseJobResponse -+ * @param -+ * @param ReleaseJobResponse AviaryJob::ControlJobResponse* -+ * @return newly created ReleaseJobResponse object -+ */ -+ ReleaseJobResponse(AviaryJob::ControlJobResponse* arg_ReleaseJobResponse); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for ReleaseJobResponse. -+ * @return AviaryJob::ControlJobResponse* -+ */ -+ WSF_EXTERN AviaryJob::ControlJobResponse* WSF_CALL -+ getReleaseJobResponse(); -+ -+ /** -+ * Setter for ReleaseJobResponse. -+ * @param arg_ReleaseJobResponse AviaryJob::ControlJobResponse* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setReleaseJobResponse(AviaryJob::ControlJobResponse* arg_ReleaseJobResponse); -+ -+ /** -+ * Re setter for ReleaseJobResponse -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetReleaseJobResponse(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ReleaseJobResponse is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isReleaseJobResponseNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param ReleaseJobResponse_om_node node to serialize from -+ * @param ReleaseJobResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* ReleaseJobResponse_om_node, axiom_element_t *ReleaseJobResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the ReleaseJobResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ReleaseJobResponse by property number (1) -+ * @return AviaryJob::ControlJobResponse -+ */ -+ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* RELEASEJOBRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_RemoveJob.h b/src/condor_contrib/aviary/include/AviaryJob_RemoveJob.h -new file mode 100644 -index 0000000..7d66ddc ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_RemoveJob.h -@@ -0,0 +1,203 @@ -+ -+ -+ #ifndef AviaryJob_REMOVEJOB_H -+ #define AviaryJob_REMOVEJOB_H -+ -+ /** -+ * RemoveJob.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * RemoveJob class -+ */ -+ -+ namespace AviaryJob{ -+ class RemoveJob; -+ } -+ -+ -+ -+ #include "AviaryJob_ControlJob.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class RemoveJob { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryJob::ControlJob* property_RemoveJob; -+ -+ -+ bool isValidRemoveJob; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setRemoveJobNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class RemoveJob -+ */ -+ -+ RemoveJob(); -+ -+ /** -+ * Destructor RemoveJob -+ */ -+ ~RemoveJob(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating RemoveJob -+ * @param -+ * @param RemoveJob AviaryJob::ControlJob* -+ * @return newly created RemoveJob object -+ */ -+ RemoveJob(AviaryJob::ControlJob* arg_RemoveJob); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for RemoveJob. -+ * @return AviaryJob::ControlJob* -+ */ -+ WSF_EXTERN AviaryJob::ControlJob* WSF_CALL -+ getRemoveJob(); -+ -+ /** -+ * Setter for RemoveJob. -+ * @param arg_RemoveJob AviaryJob::ControlJob* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setRemoveJob(AviaryJob::ControlJob* arg_RemoveJob); -+ -+ /** -+ * Re setter for RemoveJob -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetRemoveJob(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether RemoveJob is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isRemoveJobNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param RemoveJob_om_node node to serialize from -+ * @param RemoveJob_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* RemoveJob_om_node, axiom_element_t *RemoveJob_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the RemoveJob is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for RemoveJob by property number (1) -+ * @return AviaryJob::ControlJob -+ */ -+ -+ AviaryJob::ControlJob* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* REMOVEJOB_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_RemoveJobResponse.h b/src/condor_contrib/aviary/include/AviaryJob_RemoveJobResponse.h -new file mode 100644 -index 0000000..eb67b57 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_RemoveJobResponse.h -@@ -0,0 +1,203 @@ -+ -+ -+ #ifndef AviaryJob_REMOVEJOBRESPONSE_H -+ #define AviaryJob_REMOVEJOBRESPONSE_H -+ -+ /** -+ * RemoveJobResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * RemoveJobResponse class -+ */ -+ -+ namespace AviaryJob{ -+ class RemoveJobResponse; -+ } -+ -+ -+ -+ #include "AviaryJob_ControlJobResponse.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class RemoveJobResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryJob::ControlJobResponse* property_RemoveJobResponse; -+ -+ -+ bool isValidRemoveJobResponse; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setRemoveJobResponseNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class RemoveJobResponse -+ */ -+ -+ RemoveJobResponse(); -+ -+ /** -+ * Destructor RemoveJobResponse -+ */ -+ ~RemoveJobResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating RemoveJobResponse -+ * @param -+ * @param RemoveJobResponse AviaryJob::ControlJobResponse* -+ * @return newly created RemoveJobResponse object -+ */ -+ RemoveJobResponse(AviaryJob::ControlJobResponse* arg_RemoveJobResponse); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for RemoveJobResponse. -+ * @return AviaryJob::ControlJobResponse* -+ */ -+ WSF_EXTERN AviaryJob::ControlJobResponse* WSF_CALL -+ getRemoveJobResponse(); -+ -+ /** -+ * Setter for RemoveJobResponse. -+ * @param arg_RemoveJobResponse AviaryJob::ControlJobResponse* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setRemoveJobResponse(AviaryJob::ControlJobResponse* arg_RemoveJobResponse); -+ -+ /** -+ * Re setter for RemoveJobResponse -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetRemoveJobResponse(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether RemoveJobResponse is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isRemoveJobResponseNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param RemoveJobResponse_om_node node to serialize from -+ * @param RemoveJobResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* RemoveJobResponse_om_node, axiom_element_t *RemoveJobResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the RemoveJobResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for RemoveJobResponse by property number (1) -+ * @return AviaryJob::ControlJobResponse -+ */ -+ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* REMOVEJOBRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_SetJobAttribute.h b/src/condor_contrib/aviary/include/AviaryJob_SetJobAttribute.h -new file mode 100644 -index 0000000..a046279 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_SetJobAttribute.h -@@ -0,0 +1,259 @@ -+ -+ -+ #ifndef AviaryJob_SETJOBATTRIBUTE_H -+ #define AviaryJob_SETJOBATTRIBUTE_H -+ -+ /** -+ * SetJobAttribute.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * SetJobAttribute class -+ */ -+ -+ namespace AviaryJob{ -+ class SetJobAttribute; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include "AviaryCommon_Attribute.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class SetJobAttribute { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryCommon::JobID* property_Id; -+ -+ -+ bool isValidId; -+ AviaryCommon::Attribute* property_Attribute; -+ -+ -+ bool isValidAttribute; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdNil(); -+ -+ -+ bool WSF_CALL -+ setAttributeNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class SetJobAttribute -+ */ -+ -+ SetJobAttribute(); -+ -+ /** -+ * Destructor SetJobAttribute -+ */ -+ ~SetJobAttribute(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating SetJobAttribute -+ * @param -+ * @param Id AviaryCommon::JobID* -+ * @param Attribute AviaryCommon::Attribute* -+ * @return newly created SetJobAttribute object -+ */ -+ SetJobAttribute(AviaryCommon::JobID* arg_Id,AviaryCommon::Attribute* arg_Attribute); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for id. -+ * @return AviaryCommon::JobID* -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getId(); -+ -+ /** -+ * Setter for id. -+ * @param arg_Id AviaryCommon::JobID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setId(AviaryCommon::JobID* arg_Id); -+ -+ /** -+ * Re setter for id -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetId(); -+ -+ -+ -+ /** -+ * Getter for attribute. -+ * @return AviaryCommon::Attribute* -+ */ -+ WSF_EXTERN AviaryCommon::Attribute* WSF_CALL -+ getAttribute(); -+ -+ /** -+ * Setter for attribute. -+ * @param arg_Attribute AviaryCommon::Attribute* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setAttribute(AviaryCommon::Attribute* arg_Attribute); -+ -+ /** -+ * Re setter for attribute -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetAttribute(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether id is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether attribute is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isAttributeNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param SetJobAttribute_om_node node to serialize from -+ * @param SetJobAttribute_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* SetJobAttribute_om_node, axiom_element_t *SetJobAttribute_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the SetJobAttribute is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for id by property number (1) -+ * @return AviaryCommon::JobID -+ */ -+ -+ AviaryCommon::JobID* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for attribute by property number (2) -+ * @return AviaryCommon::Attribute -+ */ -+ -+ AviaryCommon::Attribute* WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* SETJOBATTRIBUTE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_SetJobAttributeResponse.h b/src/condor_contrib/aviary/include/AviaryJob_SetJobAttributeResponse.h -new file mode 100644 -index 0000000..8d39178 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_SetJobAttributeResponse.h -@@ -0,0 +1,203 @@ -+ -+ -+ #ifndef AviaryJob_SETJOBATTRIBUTERESPONSE_H -+ #define AviaryJob_SETJOBATTRIBUTERESPONSE_H -+ -+ /** -+ * SetJobAttributeResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * SetJobAttributeResponse class -+ */ -+ -+ namespace AviaryJob{ -+ class SetJobAttributeResponse; -+ } -+ -+ -+ -+ #include "AviaryJob_ControlJobResponse.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class SetJobAttributeResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryJob::ControlJobResponse* property_SetJobAttributeResponse; -+ -+ -+ bool isValidSetJobAttributeResponse; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setSetJobAttributeResponseNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class SetJobAttributeResponse -+ */ -+ -+ SetJobAttributeResponse(); -+ -+ /** -+ * Destructor SetJobAttributeResponse -+ */ -+ ~SetJobAttributeResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating SetJobAttributeResponse -+ * @param -+ * @param SetJobAttributeResponse AviaryJob::ControlJobResponse* -+ * @return newly created SetJobAttributeResponse object -+ */ -+ SetJobAttributeResponse(AviaryJob::ControlJobResponse* arg_SetJobAttributeResponse); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for SetJobAttributeResponse. -+ * @return AviaryJob::ControlJobResponse* -+ */ -+ WSF_EXTERN AviaryJob::ControlJobResponse* WSF_CALL -+ getSetJobAttributeResponse(); -+ -+ /** -+ * Setter for SetJobAttributeResponse. -+ * @param arg_SetJobAttributeResponse AviaryJob::ControlJobResponse* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setSetJobAttributeResponse(AviaryJob::ControlJobResponse* arg_SetJobAttributeResponse); -+ -+ /** -+ * Re setter for SetJobAttributeResponse -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetSetJobAttributeResponse(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether SetJobAttributeResponse is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isSetJobAttributeResponseNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param SetJobAttributeResponse_om_node node to serialize from -+ * @param SetJobAttributeResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* SetJobAttributeResponse_om_node, axiom_element_t *SetJobAttributeResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the SetJobAttributeResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for SetJobAttributeResponse by property number (1) -+ * @return AviaryJob::ControlJobResponse -+ */ -+ -+ AviaryJob::ControlJobResponse* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* SETJOBATTRIBUTERESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_SubmitJob.h b/src/condor_contrib/aviary/include/AviaryJob_SubmitJob.h -new file mode 100644 -index 0000000..e26d8ed ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_SubmitJob.h -@@ -0,0 +1,747 @@ -+ -+ -+ #ifndef AviaryJob_SUBMITJOB_H -+ #define AviaryJob_SUBMITJOB_H -+ -+ /** -+ * SubmitJob.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * SubmitJob class -+ */ -+ -+ namespace AviaryJob{ -+ class SubmitJob; -+ } -+ -+ -+ -+ #include "AviaryCommon_ResourceConstraint.h" -+ -+ #include "AviaryCommon_Attribute.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class SubmitJob { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::string property_Cmd; -+ -+ -+ bool isValidCmd; -+ std::string property_Args; -+ -+ -+ bool isValidArgs; -+ std::string property_Owner; -+ -+ -+ bool isValidOwner; -+ std::string property_Iwd; -+ -+ -+ bool isValidIwd; -+ std::string property_Submission_name; -+ -+ -+ bool isValidSubmission_name; -+ std::vector* property_Requirements; -+ -+ -+ bool isValidRequirements; -+ std::vector* property_Extra; -+ -+ -+ bool isValidExtra; -+ bool property_AllowOverrides; -+ -+ -+ bool isValidAllowOverrides; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setCmdNil(); -+ -+ -+ bool WSF_CALL -+ setArgsNil(); -+ -+ -+ bool WSF_CALL -+ setOwnerNil(); -+ -+ -+ bool WSF_CALL -+ setIwdNil(); -+ -+ -+ bool WSF_CALL -+ setSubmission_nameNil(); -+ -+ -+ bool WSF_CALL -+ setRequirementsNil(); -+ -+ -+ bool WSF_CALL -+ setExtraNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class SubmitJob -+ */ -+ -+ SubmitJob(); -+ -+ /** -+ * Destructor SubmitJob -+ */ -+ ~SubmitJob(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating SubmitJob -+ * @param -+ * @param Cmd std::string -+ * @param Args std::string -+ * @param Owner std::string -+ * @param Iwd std::string -+ * @param Submission_name std::string -+ * @param Requirements std::vector* -+ * @param Extra std::vector* -+ * @param AllowOverrides bool -+ * @return newly created SubmitJob object -+ */ -+ SubmitJob(std::string arg_Cmd,std::string arg_Args,std::string arg_Owner,std::string arg_Iwd,std::string arg_Submission_name,std::vector* arg_Requirements,std::vector* arg_Extra,bool arg_AllowOverrides); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for cmd. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getCmd(); -+ -+ /** -+ * Setter for cmd. -+ * @param arg_Cmd std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setCmd(const std::string arg_Cmd); -+ -+ /** -+ * Re setter for cmd -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetCmd(); -+ -+ -+ -+ /** -+ * Getter for args. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getArgs(); -+ -+ /** -+ * Setter for args. -+ * @param arg_Args std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setArgs(const std::string arg_Args); -+ -+ /** -+ * Re setter for args -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetArgs(); -+ -+ -+ -+ /** -+ * Getter for owner. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getOwner(); -+ -+ /** -+ * Setter for owner. -+ * @param arg_Owner std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setOwner(const std::string arg_Owner); -+ -+ /** -+ * Re setter for owner -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetOwner(); -+ -+ -+ -+ /** -+ * Getter for iwd. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getIwd(); -+ -+ /** -+ * Setter for iwd. -+ * @param arg_Iwd std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIwd(const std::string arg_Iwd); -+ -+ /** -+ * Re setter for iwd -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetIwd(); -+ -+ -+ -+ /** -+ * Getter for submission_name. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getSubmission_name(); -+ -+ /** -+ * Setter for submission_name. -+ * @param arg_Submission_name std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setSubmission_name(const std::string arg_Submission_name); -+ -+ /** -+ * Re setter for submission_name -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetSubmission_name(); -+ -+ -+ -+ /** -+ * Getter for requirements. Deprecated for array types, Use getRequirementsAt instead -+ * @return Array of AviaryCommon::ResourceConstraint*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getRequirements(); -+ -+ /** -+ * Setter for requirements.Deprecated for array types, Use setRequirementsAt -+ * or addRequirements instead. -+ * @param arg_Requirements Array of AviaryCommon::ResourceConstraint*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setRequirements(std::vector* arg_Requirements); -+ -+ /** -+ * Re setter for requirements -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetRequirements(); -+ -+ -+ -+ /** -+ * Getter for extra. Deprecated for array types, Use getExtraAt instead -+ * @return Array of AviaryCommon::Attribute*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getExtra(); -+ -+ /** -+ * Setter for extra.Deprecated for array types, Use setExtraAt -+ * or addExtra instead. -+ * @param arg_Extra Array of AviaryCommon::Attribute*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setExtra(std::vector* arg_Extra); -+ -+ /** -+ * Re setter for extra -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetExtra(); -+ -+ -+ -+ /** -+ * Getter for allowOverrides. -+ * @return bool -+ */ -+ WSF_EXTERN bool WSF_CALL -+ getAllowOverrides(); -+ -+ /** -+ * Setter for allowOverrides. -+ * @param arg_AllowOverrides bool -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setAllowOverrides(bool arg_AllowOverrides); -+ -+ /** -+ * Re setter for allowOverrides -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetAllowOverrides(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of requirements. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::ResourceConstraint* of the array -+ */ -+ WSF_EXTERN AviaryCommon::ResourceConstraint* WSF_CALL -+ getRequirementsAt(int i); -+ -+ /** -+ * Set the ith element of requirements. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Requirements element to set AviaryCommon::ResourceConstraint* to the array -+ * @return ith AviaryCommon::ResourceConstraint* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setRequirementsAt(int i, -+ AviaryCommon::ResourceConstraint* arg_Requirements); -+ -+ -+ /** -+ * Add to requirements. -+ * @param arg_Requirements element to add AviaryCommon::ResourceConstraint* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addRequirements( -+ AviaryCommon::ResourceConstraint* arg_Requirements); -+ -+ /** -+ * Get the size of the requirements array. -+ * @return the size of the requirements array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofRequirements(); -+ -+ /** -+ * Remove the ith element of requirements. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeRequirementsAt(int i); -+ -+ -+ -+ /** -+ * Get the ith element of extra. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::Attribute* of the array -+ */ -+ WSF_EXTERN AviaryCommon::Attribute* WSF_CALL -+ getExtraAt(int i); -+ -+ /** -+ * Set the ith element of extra. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Extra element to set AviaryCommon::Attribute* to the array -+ * @return ith AviaryCommon::Attribute* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setExtraAt(int i, -+ AviaryCommon::Attribute* arg_Extra); -+ -+ -+ /** -+ * Add to extra. -+ * @param arg_Extra element to add AviaryCommon::Attribute* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addExtra( -+ AviaryCommon::Attribute* arg_Extra); -+ -+ /** -+ * Get the size of the extra array. -+ * @return the size of the extra array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofExtra(); -+ -+ /** -+ * Remove the ith element of extra. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeExtraAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether cmd is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isCmdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether args is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isArgsNil(); -+ -+ -+ -+ -+ /** -+ * Check whether owner is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isOwnerNil(); -+ -+ -+ -+ -+ /** -+ * Check whether iwd is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIwdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether submission_name is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isSubmission_nameNil(); -+ -+ -+ -+ -+ /** -+ * Check whether requirements is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isRequirementsNil(); -+ -+ -+ -+ -+ /** -+ * Check whether extra is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isExtraNil(); -+ -+ -+ -+ -+ /** -+ * Check whether allowOverrides is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isAllowOverridesNil(); -+ -+ -+ -+ /** -+ * Set allowOverrides to Nill (same as using reset) -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setAllowOverridesNil(); -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether requirements is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isRequirementsNilAt(int i); -+ -+ -+ /** -+ * Set requirements to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setRequirementsNilAt(int i); -+ -+ -+ /** -+ * Check whether extra is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isExtraNilAt(int i); -+ -+ -+ /** -+ * Set extra to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setExtraNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param SubmitJob_om_node node to serialize from -+ * @param SubmitJob_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* SubmitJob_om_node, axiom_element_t *SubmitJob_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the SubmitJob is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for cmd by property number (1) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for args by property number (2) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for owner by property number (3) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty3(); -+ -+ -+ -+ -+ /** -+ * Getter for iwd by property number (4) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty4(); -+ -+ -+ -+ -+ /** -+ * Getter for submission_name by property number (5) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty5(); -+ -+ -+ -+ -+ /** -+ * Getter for requirements by property number (6) -+ * @return Array of AviaryCommon::ResourceConstraints. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty6(); -+ -+ -+ -+ -+ /** -+ * Getter for extra by property number (7) -+ * @return Array of AviaryCommon::Attributes. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty7(); -+ -+ -+ -+ -+ /** -+ * Getter for allowOverrides by property number (8) -+ * @return bool -+ */ -+ -+ bool WSF_CALL -+ getProperty8(); -+ -+ -+ -+}; -+ -+} -+ #endif /* SUBMITJOB_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryJob_SubmitJobResponse.h b/src/condor_contrib/aviary/include/AviaryJob_SubmitJobResponse.h -new file mode 100644 -index 0000000..42b32fd ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryJob_SubmitJobResponse.h -@@ -0,0 +1,259 @@ -+ -+ -+ #ifndef AviaryJob_SUBMITJOBRESPONSE_H -+ #define AviaryJob_SUBMITJOBRESPONSE_H -+ -+ /** -+ * SubmitJobResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * SubmitJobResponse class -+ */ -+ -+ namespace AviaryJob{ -+ class SubmitJobResponse; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include "AviaryCommon_Status.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryJob -+{ -+ -+ -+ -+ class SubmitJobResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryCommon::JobID* property_Id; -+ -+ -+ bool isValidId; -+ AviaryCommon::Status* property_Status; -+ -+ -+ bool isValidStatus; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdNil(); -+ -+ -+ bool WSF_CALL -+ setStatusNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class SubmitJobResponse -+ */ -+ -+ SubmitJobResponse(); -+ -+ /** -+ * Destructor SubmitJobResponse -+ */ -+ ~SubmitJobResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating SubmitJobResponse -+ * @param -+ * @param Id AviaryCommon::JobID* -+ * @param Status AviaryCommon::Status* -+ * @return newly created SubmitJobResponse object -+ */ -+ SubmitJobResponse(AviaryCommon::JobID* arg_Id,AviaryCommon::Status* arg_Status); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for id. -+ * @return AviaryCommon::JobID* -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getId(); -+ -+ /** -+ * Setter for id. -+ * @param arg_Id AviaryCommon::JobID* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setId(AviaryCommon::JobID* arg_Id); -+ -+ /** -+ * Re setter for id -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetId(); -+ -+ -+ -+ /** -+ * Getter for status. -+ * @return AviaryCommon::Status* -+ */ -+ WSF_EXTERN AviaryCommon::Status* WSF_CALL -+ getStatus(); -+ -+ /** -+ * Setter for status. -+ * @param arg_Status AviaryCommon::Status* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setStatus(AviaryCommon::Status* arg_Status); -+ -+ /** -+ * Re setter for status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetStatus(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether id is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdNil(); -+ -+ -+ -+ -+ /** -+ * Check whether status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isStatusNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param SubmitJobResponse_om_node node to serialize from -+ * @param SubmitJobResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* SubmitJobResponse_om_node, axiom_element_t *SubmitJobResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the SubmitJobResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for id by property number (1) -+ * @return AviaryCommon::JobID -+ */ -+ -+ AviaryCommon::JobID* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for status by property number (2) -+ * @return AviaryCommon::Status -+ */ -+ -+ AviaryCommon::Status* WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* SUBMITJOBRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetJobData.h b/src/condor_contrib/aviary/include/AviaryQuery_GetJobData.h -new file mode 100644 -index 0000000..9439d0a ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetJobData.h -@@ -0,0 +1,311 @@ -+ -+ -+ #ifndef AviaryQuery_GETJOBDATA_H -+ #define AviaryQuery_GETJOBDATA_H -+ -+ /** -+ * GetJobData.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetJobData class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetJobData; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobData.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetJobData { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryCommon::JobData* property_Data; -+ -+ -+ bool isValidData; -+ int property_Max_bytes; -+ -+ -+ bool isValidMax_bytes; -+ bool property_From_end; -+ -+ -+ bool isValidFrom_end; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setDataNil(); -+ -+ -+ bool WSF_CALL -+ setMax_bytesNil(); -+ -+ -+ bool WSF_CALL -+ setFrom_endNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetJobData -+ */ -+ -+ GetJobData(); -+ -+ /** -+ * Destructor GetJobData -+ */ -+ ~GetJobData(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetJobData -+ * @param -+ * @param Data AviaryCommon::JobData* -+ * @param Max_bytes int -+ * @param From_end bool -+ * @return newly created GetJobData object -+ */ -+ GetJobData(AviaryCommon::JobData* arg_Data,int arg_Max_bytes,bool arg_From_end); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for data. -+ * @return AviaryCommon::JobData* -+ */ -+ WSF_EXTERN AviaryCommon::JobData* WSF_CALL -+ getData(); -+ -+ /** -+ * Setter for data. -+ * @param arg_Data AviaryCommon::JobData* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setData(AviaryCommon::JobData* arg_Data); -+ -+ /** -+ * Re setter for data -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetData(); -+ -+ -+ -+ /** -+ * Getter for max_bytes. -+ * @return int* -+ */ -+ WSF_EXTERN int WSF_CALL -+ getMax_bytes(); -+ -+ /** -+ * Setter for max_bytes. -+ * @param arg_Max_bytes int* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setMax_bytes(const int arg_Max_bytes); -+ -+ /** -+ * Re setter for max_bytes -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetMax_bytes(); -+ -+ -+ -+ /** -+ * Getter for from_end. -+ * @return bool -+ */ -+ WSF_EXTERN bool WSF_CALL -+ getFrom_end(); -+ -+ /** -+ * Setter for from_end. -+ * @param arg_From_end bool -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setFrom_end(bool arg_From_end); -+ -+ /** -+ * Re setter for from_end -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetFrom_end(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether data is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isDataNil(); -+ -+ -+ -+ -+ /** -+ * Check whether max_bytes is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isMax_bytesNil(); -+ -+ -+ -+ -+ /** -+ * Check whether from_end is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isFrom_endNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetJobData_om_node node to serialize from -+ * @param GetJobData_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetJobData_om_node, axiom_element_t *GetJobData_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetJobData is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for data by property number (1) -+ * @return AviaryCommon::JobData -+ */ -+ -+ AviaryCommon::JobData* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for max_bytes by property number (2) -+ * @return int -+ */ -+ -+ int WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for from_end by property number (3) -+ * @return bool -+ */ -+ -+ bool WSF_CALL -+ getProperty3(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETJOBDATA_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetJobDataResponse.h b/src/condor_contrib/aviary/include/AviaryQuery_GetJobDataResponse.h -new file mode 100644 -index 0000000..6acae59 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetJobDataResponse.h -@@ -0,0 +1,421 @@ -+ -+ -+ #ifndef AviaryQuery_GETJOBDATARESPONSE_H -+ #define AviaryQuery_GETJOBDATARESPONSE_H -+ -+ /** -+ * GetJobDataResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetJobDataResponse class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetJobDataResponse; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobData.h" -+ -+ #include "AviaryCommon_Status.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetJobDataResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ AviaryCommon::JobData* property_Data; -+ -+ -+ bool isValidData; -+ AviaryCommon::Status* property_Status; -+ -+ -+ bool isValidStatus; -+ std::string property_File_name; -+ -+ -+ bool isValidFile_name; -+ int property_File_size; -+ -+ -+ bool isValidFile_size; -+ std::string property_Content; -+ -+ -+ bool isValidContent; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setDataNil(); -+ -+ -+ bool WSF_CALL -+ setStatusNil(); -+ -+ -+ bool WSF_CALL -+ setFile_nameNil(); -+ -+ -+ bool WSF_CALL -+ setFile_sizeNil(); -+ -+ -+ bool WSF_CALL -+ setContentNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetJobDataResponse -+ */ -+ -+ GetJobDataResponse(); -+ -+ /** -+ * Destructor GetJobDataResponse -+ */ -+ ~GetJobDataResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetJobDataResponse -+ * @param -+ * @param Data AviaryCommon::JobData* -+ * @param Status AviaryCommon::Status* -+ * @param File_name std::string -+ * @param File_size int -+ * @param Content std::string -+ * @return newly created GetJobDataResponse object -+ */ -+ GetJobDataResponse(AviaryCommon::JobData* arg_Data,AviaryCommon::Status* arg_Status,std::string arg_File_name,int arg_File_size,std::string arg_Content); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for data. -+ * @return AviaryCommon::JobData* -+ */ -+ WSF_EXTERN AviaryCommon::JobData* WSF_CALL -+ getData(); -+ -+ /** -+ * Setter for data. -+ * @param arg_Data AviaryCommon::JobData* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setData(AviaryCommon::JobData* arg_Data); -+ -+ /** -+ * Re setter for data -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetData(); -+ -+ -+ -+ /** -+ * Getter for status. -+ * @return AviaryCommon::Status* -+ */ -+ WSF_EXTERN AviaryCommon::Status* WSF_CALL -+ getStatus(); -+ -+ /** -+ * Setter for status. -+ * @param arg_Status AviaryCommon::Status* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setStatus(AviaryCommon::Status* arg_Status); -+ -+ /** -+ * Re setter for status -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetStatus(); -+ -+ -+ -+ /** -+ * Getter for file_name. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getFile_name(); -+ -+ /** -+ * Setter for file_name. -+ * @param arg_File_name std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setFile_name(const std::string arg_File_name); -+ -+ /** -+ * Re setter for file_name -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetFile_name(); -+ -+ -+ -+ /** -+ * Getter for file_size. -+ * @return int* -+ */ -+ WSF_EXTERN int WSF_CALL -+ getFile_size(); -+ -+ /** -+ * Setter for file_size. -+ * @param arg_File_size int* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setFile_size(const int arg_File_size); -+ -+ /** -+ * Re setter for file_size -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetFile_size(); -+ -+ -+ -+ /** -+ * Getter for content. -+ * @return std::string* -+ */ -+ WSF_EXTERN std::string WSF_CALL -+ getContent(); -+ -+ /** -+ * Setter for content. -+ * @param arg_Content std::string* -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setContent(const std::string arg_Content); -+ -+ /** -+ * Re setter for content -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetContent(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether data is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isDataNil(); -+ -+ -+ -+ -+ /** -+ * Check whether status is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isStatusNil(); -+ -+ -+ -+ -+ /** -+ * Check whether file_name is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isFile_nameNil(); -+ -+ -+ -+ -+ /** -+ * Check whether file_size is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isFile_sizeNil(); -+ -+ -+ -+ -+ /** -+ * Check whether content is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isContentNil(); -+ -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetJobDataResponse_om_node node to serialize from -+ * @param GetJobDataResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetJobDataResponse_om_node, axiom_element_t *GetJobDataResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetJobDataResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for data by property number (1) -+ * @return AviaryCommon::JobData -+ */ -+ -+ AviaryCommon::JobData* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for status by property number (2) -+ * @return AviaryCommon::Status -+ */ -+ -+ AviaryCommon::Status* WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for file_name by property number (3) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty3(); -+ -+ -+ -+ -+ /** -+ * Getter for file_size by property number (4) -+ * @return int -+ */ -+ -+ int WSF_CALL -+ getProperty4(); -+ -+ -+ -+ -+ /** -+ * Getter for content by property number (5) -+ * @return std::string -+ */ -+ -+ std::string WSF_CALL -+ getProperty5(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETJOBDATARESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetJobDetails.h b/src/condor_contrib/aviary/include/AviaryQuery_GetJobDetails.h -new file mode 100644 -index 0000000..adcb87a ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetJobDetails.h -@@ -0,0 +1,357 @@ -+ -+ -+ #ifndef AviaryQuery_GETJOBDETAILS_H -+ #define AviaryQuery_GETJOBDETAILS_H -+ -+ /** -+ * GetJobDetails.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetJobDetails class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetJobDetails; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetJobDetails { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::vector* property_Ids; -+ -+ -+ bool isValidIds; -+ bool property_PartialMatches; -+ -+ -+ bool isValidPartialMatches; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetJobDetails -+ */ -+ -+ GetJobDetails(); -+ -+ /** -+ * Destructor GetJobDetails -+ */ -+ ~GetJobDetails(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetJobDetails -+ * @param -+ * @param Ids std::vector* -+ * @param PartialMatches bool -+ * @return newly created GetJobDetails object -+ */ -+ GetJobDetails(std::vector* arg_Ids,bool arg_PartialMatches); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for ids. Deprecated for array types, Use getIdsAt instead -+ * @return Array of AviaryCommon::JobID*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getIds(); -+ -+ /** -+ * Setter for ids.Deprecated for array types, Use setIdsAt -+ * or addIds instead. -+ * @param arg_Ids Array of AviaryCommon::JobID*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIds(std::vector* arg_Ids); -+ -+ /** -+ * Re setter for ids -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetIds(); -+ -+ -+ -+ /** -+ * Getter for partialMatches. -+ * @return bool -+ */ -+ WSF_EXTERN bool WSF_CALL -+ getPartialMatches(); -+ -+ /** -+ * Setter for partialMatches. -+ * @param arg_PartialMatches bool -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setPartialMatches(bool arg_PartialMatches); -+ -+ /** -+ * Re setter for partialMatches -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetPartialMatches(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of ids. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::JobID* of the array -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getIdsAt(int i); -+ -+ /** -+ * Set the ith element of ids. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Ids element to set AviaryCommon::JobID* to the array -+ * @return ith AviaryCommon::JobID* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIdsAt(int i, -+ AviaryCommon::JobID* arg_Ids); -+ -+ -+ /** -+ * Add to ids. -+ * @param arg_Ids element to add AviaryCommon::JobID* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addIds( -+ AviaryCommon::JobID* arg_Ids); -+ -+ /** -+ * Get the size of the ids array. -+ * @return the size of the ids array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofIds(); -+ -+ /** -+ * Remove the ith element of ids. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeIdsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ids is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdsNil(); -+ -+ -+ -+ -+ /** -+ * Check whether partialMatches is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isPartialMatchesNil(); -+ -+ -+ -+ /** -+ * Set partialMatches to Nill (same as using reset) -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setPartialMatchesNil(); -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether ids is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isIdsNilAt(int i); -+ -+ -+ /** -+ * Set ids to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setIdsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetJobDetails_om_node node to serialize from -+ * @param GetJobDetails_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetJobDetails_om_node, axiom_element_t *GetJobDetails_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetJobDetails is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ids by property number (1) -+ * @return Array of AviaryCommon::JobIDs. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for partialMatches by property number (2) -+ * @return bool -+ */ -+ -+ bool WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETJOBDETAILS_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetJobDetailsResponse.h b/src/condor_contrib/aviary/include/AviaryQuery_GetJobDetailsResponse.h -new file mode 100644 -index 0000000..d8bfb23 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetJobDetailsResponse.h -@@ -0,0 +1,300 @@ -+ -+ -+ #ifndef AviaryQuery_GETJOBDETAILSRESPONSE_H -+ #define AviaryQuery_GETJOBDETAILSRESPONSE_H -+ -+ /** -+ * GetJobDetailsResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetJobDetailsResponse class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetJobDetailsResponse; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobDetails.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetJobDetailsResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::vector* property_Jobs; -+ -+ -+ bool isValidJobs; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setJobsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetJobDetailsResponse -+ */ -+ -+ GetJobDetailsResponse(); -+ -+ /** -+ * Destructor GetJobDetailsResponse -+ */ -+ ~GetJobDetailsResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetJobDetailsResponse -+ * @param -+ * @param Jobs std::vector* -+ * @return newly created GetJobDetailsResponse object -+ */ -+ GetJobDetailsResponse(std::vector* arg_Jobs); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for jobs. Deprecated for array types, Use getJobsAt instead -+ * @return Array of AviaryCommon::JobDetails*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getJobs(); -+ -+ /** -+ * Setter for jobs.Deprecated for array types, Use setJobsAt -+ * or addJobs instead. -+ * @param arg_Jobs Array of AviaryCommon::JobDetails*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobs(std::vector* arg_Jobs); -+ -+ /** -+ * Re setter for jobs -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJobs(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of jobs. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::JobDetails* of the array -+ */ -+ WSF_EXTERN AviaryCommon::JobDetails* WSF_CALL -+ getJobsAt(int i); -+ -+ /** -+ * Set the ith element of jobs. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Jobs element to set AviaryCommon::JobDetails* to the array -+ * @return ith AviaryCommon::JobDetails* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobsAt(int i, -+ AviaryCommon::JobDetails* arg_Jobs); -+ -+ -+ /** -+ * Add to jobs. -+ * @param arg_Jobs element to add AviaryCommon::JobDetails* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addJobs( -+ AviaryCommon::JobDetails* arg_Jobs); -+ -+ /** -+ * Get the size of the jobs array. -+ * @return the size of the jobs array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofJobs(); -+ -+ /** -+ * Remove the ith element of jobs. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeJobsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether jobs is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJobsNil(); -+ -+ -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether jobs is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isJobsNilAt(int i); -+ -+ -+ /** -+ * Set jobs to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setJobsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetJobDetailsResponse_om_node node to serialize from -+ * @param GetJobDetailsResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetJobDetailsResponse_om_node, axiom_element_t *GetJobDetailsResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetJobDetailsResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for jobs by property number (1) -+ * @return Array of AviaryCommon::JobDetailss. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETJOBDETAILSRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetJobStatus.h b/src/condor_contrib/aviary/include/AviaryQuery_GetJobStatus.h -new file mode 100644 -index 0000000..aa9142f ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetJobStatus.h -@@ -0,0 +1,357 @@ -+ -+ -+ #ifndef AviaryQuery_GETJOBSTATUS_H -+ #define AviaryQuery_GETJOBSTATUS_H -+ -+ /** -+ * GetJobStatus.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetJobStatus class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetJobStatus; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetJobStatus { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::vector* property_Ids; -+ -+ -+ bool isValidIds; -+ bool property_PartialMatches; -+ -+ -+ bool isValidPartialMatches; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetJobStatus -+ */ -+ -+ GetJobStatus(); -+ -+ /** -+ * Destructor GetJobStatus -+ */ -+ ~GetJobStatus(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetJobStatus -+ * @param -+ * @param Ids std::vector* -+ * @param PartialMatches bool -+ * @return newly created GetJobStatus object -+ */ -+ GetJobStatus(std::vector* arg_Ids,bool arg_PartialMatches); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for ids. Deprecated for array types, Use getIdsAt instead -+ * @return Array of AviaryCommon::JobID*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getIds(); -+ -+ /** -+ * Setter for ids.Deprecated for array types, Use setIdsAt -+ * or addIds instead. -+ * @param arg_Ids Array of AviaryCommon::JobID*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIds(std::vector* arg_Ids); -+ -+ /** -+ * Re setter for ids -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetIds(); -+ -+ -+ -+ /** -+ * Getter for partialMatches. -+ * @return bool -+ */ -+ WSF_EXTERN bool WSF_CALL -+ getPartialMatches(); -+ -+ /** -+ * Setter for partialMatches. -+ * @param arg_PartialMatches bool -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setPartialMatches(bool arg_PartialMatches); -+ -+ /** -+ * Re setter for partialMatches -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetPartialMatches(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of ids. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::JobID* of the array -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getIdsAt(int i); -+ -+ /** -+ * Set the ith element of ids. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Ids element to set AviaryCommon::JobID* to the array -+ * @return ith AviaryCommon::JobID* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIdsAt(int i, -+ AviaryCommon::JobID* arg_Ids); -+ -+ -+ /** -+ * Add to ids. -+ * @param arg_Ids element to add AviaryCommon::JobID* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addIds( -+ AviaryCommon::JobID* arg_Ids); -+ -+ /** -+ * Get the size of the ids array. -+ * @return the size of the ids array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofIds(); -+ -+ /** -+ * Remove the ith element of ids. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeIdsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ids is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdsNil(); -+ -+ -+ -+ -+ /** -+ * Check whether partialMatches is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isPartialMatchesNil(); -+ -+ -+ -+ /** -+ * Set partialMatches to Nill (same as using reset) -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setPartialMatchesNil(); -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether ids is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isIdsNilAt(int i); -+ -+ -+ /** -+ * Set ids to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setIdsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetJobStatus_om_node node to serialize from -+ * @param GetJobStatus_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetJobStatus_om_node, axiom_element_t *GetJobStatus_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetJobStatus is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ids by property number (1) -+ * @return Array of AviaryCommon::JobIDs. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for partialMatches by property number (2) -+ * @return bool -+ */ -+ -+ bool WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETJOBSTATUS_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetJobStatusResponse.h b/src/condor_contrib/aviary/include/AviaryQuery_GetJobStatusResponse.h -new file mode 100644 -index 0000000..d75adb5 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetJobStatusResponse.h -@@ -0,0 +1,300 @@ -+ -+ -+ #ifndef AviaryQuery_GETJOBSTATUSRESPONSE_H -+ #define AviaryQuery_GETJOBSTATUSRESPONSE_H -+ -+ /** -+ * GetJobStatusResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetJobStatusResponse class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetJobStatusResponse; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobStatus.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetJobStatusResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::vector* property_Jobs; -+ -+ -+ bool isValidJobs; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setJobsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetJobStatusResponse -+ */ -+ -+ GetJobStatusResponse(); -+ -+ /** -+ * Destructor GetJobStatusResponse -+ */ -+ ~GetJobStatusResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetJobStatusResponse -+ * @param -+ * @param Jobs std::vector* -+ * @return newly created GetJobStatusResponse object -+ */ -+ GetJobStatusResponse(std::vector* arg_Jobs); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for jobs. Deprecated for array types, Use getJobsAt instead -+ * @return Array of AviaryCommon::JobStatus*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getJobs(); -+ -+ /** -+ * Setter for jobs.Deprecated for array types, Use setJobsAt -+ * or addJobs instead. -+ * @param arg_Jobs Array of AviaryCommon::JobStatus*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobs(std::vector* arg_Jobs); -+ -+ /** -+ * Re setter for jobs -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJobs(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of jobs. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::JobStatus* of the array -+ */ -+ WSF_EXTERN AviaryCommon::JobStatus* WSF_CALL -+ getJobsAt(int i); -+ -+ /** -+ * Set the ith element of jobs. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Jobs element to set AviaryCommon::JobStatus* to the array -+ * @return ith AviaryCommon::JobStatus* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobsAt(int i, -+ AviaryCommon::JobStatus* arg_Jobs); -+ -+ -+ /** -+ * Add to jobs. -+ * @param arg_Jobs element to add AviaryCommon::JobStatus* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addJobs( -+ AviaryCommon::JobStatus* arg_Jobs); -+ -+ /** -+ * Get the size of the jobs array. -+ * @return the size of the jobs array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofJobs(); -+ -+ /** -+ * Remove the ith element of jobs. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeJobsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether jobs is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJobsNil(); -+ -+ -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether jobs is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isJobsNilAt(int i); -+ -+ -+ /** -+ * Set jobs to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setJobsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetJobStatusResponse_om_node node to serialize from -+ * @param GetJobStatusResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetJobStatusResponse_om_node, axiom_element_t *GetJobStatusResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetJobStatusResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for jobs by property number (1) -+ * @return Array of AviaryCommon::JobStatuss. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETJOBSTATUSRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetJobSummary.h b/src/condor_contrib/aviary/include/AviaryQuery_GetJobSummary.h -new file mode 100644 -index 0000000..9751a88 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetJobSummary.h -@@ -0,0 +1,357 @@ -+ -+ -+ #ifndef AviaryQuery_GETJOBSUMMARY_H -+ #define AviaryQuery_GETJOBSUMMARY_H -+ -+ /** -+ * GetJobSummary.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetJobSummary class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetJobSummary; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobID.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetJobSummary { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::vector* property_Ids; -+ -+ -+ bool isValidIds; -+ bool property_PartialMatches; -+ -+ -+ bool isValidPartialMatches; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetJobSummary -+ */ -+ -+ GetJobSummary(); -+ -+ /** -+ * Destructor GetJobSummary -+ */ -+ ~GetJobSummary(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetJobSummary -+ * @param -+ * @param Ids std::vector* -+ * @param PartialMatches bool -+ * @return newly created GetJobSummary object -+ */ -+ GetJobSummary(std::vector* arg_Ids,bool arg_PartialMatches); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for ids. Deprecated for array types, Use getIdsAt instead -+ * @return Array of AviaryCommon::JobID*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getIds(); -+ -+ /** -+ * Setter for ids.Deprecated for array types, Use setIdsAt -+ * or addIds instead. -+ * @param arg_Ids Array of AviaryCommon::JobID*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIds(std::vector* arg_Ids); -+ -+ /** -+ * Re setter for ids -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetIds(); -+ -+ -+ -+ /** -+ * Getter for partialMatches. -+ * @return bool -+ */ -+ WSF_EXTERN bool WSF_CALL -+ getPartialMatches(); -+ -+ /** -+ * Setter for partialMatches. -+ * @param arg_PartialMatches bool -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setPartialMatches(bool arg_PartialMatches); -+ -+ /** -+ * Re setter for partialMatches -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetPartialMatches(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of ids. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::JobID* of the array -+ */ -+ WSF_EXTERN AviaryCommon::JobID* WSF_CALL -+ getIdsAt(int i); -+ -+ /** -+ * Set the ith element of ids. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Ids element to set AviaryCommon::JobID* to the array -+ * @return ith AviaryCommon::JobID* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIdsAt(int i, -+ AviaryCommon::JobID* arg_Ids); -+ -+ -+ /** -+ * Add to ids. -+ * @param arg_Ids element to add AviaryCommon::JobID* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addIds( -+ AviaryCommon::JobID* arg_Ids); -+ -+ /** -+ * Get the size of the ids array. -+ * @return the size of the ids array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofIds(); -+ -+ /** -+ * Remove the ith element of ids. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeIdsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ids is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdsNil(); -+ -+ -+ -+ -+ /** -+ * Check whether partialMatches is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isPartialMatchesNil(); -+ -+ -+ -+ /** -+ * Set partialMatches to Nill (same as using reset) -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setPartialMatchesNil(); -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether ids is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isIdsNilAt(int i); -+ -+ -+ /** -+ * Set ids to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setIdsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetJobSummary_om_node node to serialize from -+ * @param GetJobSummary_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetJobSummary_om_node, axiom_element_t *GetJobSummary_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetJobSummary is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ids by property number (1) -+ * @return Array of AviaryCommon::JobIDs. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for partialMatches by property number (2) -+ * @return bool -+ */ -+ -+ bool WSF_CALL -+ getProperty2(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETJOBSUMMARY_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetJobSummaryResponse.h b/src/condor_contrib/aviary/include/AviaryQuery_GetJobSummaryResponse.h -new file mode 100644 -index 0000000..5946d52 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetJobSummaryResponse.h -@@ -0,0 +1,300 @@ -+ -+ -+ #ifndef AviaryQuery_GETJOBSUMMARYRESPONSE_H -+ #define AviaryQuery_GETJOBSUMMARYRESPONSE_H -+ -+ /** -+ * GetJobSummaryResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetJobSummaryResponse class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetJobSummaryResponse; -+ } -+ -+ -+ -+ #include "AviaryCommon_JobSummary.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetJobSummaryResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::vector* property_Jobs; -+ -+ -+ bool isValidJobs; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setJobsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetJobSummaryResponse -+ */ -+ -+ GetJobSummaryResponse(); -+ -+ /** -+ * Destructor GetJobSummaryResponse -+ */ -+ ~GetJobSummaryResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetJobSummaryResponse -+ * @param -+ * @param Jobs std::vector* -+ * @return newly created GetJobSummaryResponse object -+ */ -+ GetJobSummaryResponse(std::vector* arg_Jobs); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for jobs. Deprecated for array types, Use getJobsAt instead -+ * @return Array of AviaryCommon::JobSummary*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getJobs(); -+ -+ /** -+ * Setter for jobs.Deprecated for array types, Use setJobsAt -+ * or addJobs instead. -+ * @param arg_Jobs Array of AviaryCommon::JobSummary*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobs(std::vector* arg_Jobs); -+ -+ /** -+ * Re setter for jobs -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetJobs(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of jobs. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::JobSummary* of the array -+ */ -+ WSF_EXTERN AviaryCommon::JobSummary* WSF_CALL -+ getJobsAt(int i); -+ -+ /** -+ * Set the ith element of jobs. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Jobs element to set AviaryCommon::JobSummary* to the array -+ * @return ith AviaryCommon::JobSummary* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setJobsAt(int i, -+ AviaryCommon::JobSummary* arg_Jobs); -+ -+ -+ /** -+ * Add to jobs. -+ * @param arg_Jobs element to add AviaryCommon::JobSummary* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addJobs( -+ AviaryCommon::JobSummary* arg_Jobs); -+ -+ /** -+ * Get the size of the jobs array. -+ * @return the size of the jobs array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofJobs(); -+ -+ /** -+ * Remove the ith element of jobs. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeJobsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether jobs is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isJobsNil(); -+ -+ -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether jobs is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isJobsNilAt(int i); -+ -+ -+ /** -+ * Set jobs to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setJobsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetJobSummaryResponse_om_node node to serialize from -+ * @param GetJobSummaryResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetJobSummaryResponse_om_node, axiom_element_t *GetJobSummaryResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetJobSummaryResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for jobs by property number (1) -+ * @return Array of AviaryCommon::JobSummarys. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETJOBSUMMARYRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetSubmissionSummary.h b/src/condor_contrib/aviary/include/AviaryQuery_GetSubmissionSummary.h -new file mode 100644 -index 0000000..0085561 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetSubmissionSummary.h -@@ -0,0 +1,414 @@ -+ -+ -+ #ifndef AviaryQuery_GETSUBMISSIONSUMMARY_H -+ #define AviaryQuery_GETSUBMISSIONSUMMARY_H -+ -+ /** -+ * GetSubmissionSummary.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetSubmissionSummary class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetSubmissionSummary; -+ } -+ -+ -+ -+ #include "AviaryCommon_SubmissionID.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetSubmissionSummary { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::vector* property_Ids; -+ -+ -+ bool isValidIds; -+ bool property_PartialMatches; -+ -+ -+ bool isValidPartialMatches; -+ bool property_IncludeJobSummaries; -+ -+ -+ bool isValidIncludeJobSummaries; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setIdsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetSubmissionSummary -+ */ -+ -+ GetSubmissionSummary(); -+ -+ /** -+ * Destructor GetSubmissionSummary -+ */ -+ ~GetSubmissionSummary(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetSubmissionSummary -+ * @param -+ * @param Ids std::vector* -+ * @param PartialMatches bool -+ * @param IncludeJobSummaries bool -+ * @return newly created GetSubmissionSummary object -+ */ -+ GetSubmissionSummary(std::vector* arg_Ids,bool arg_PartialMatches,bool arg_IncludeJobSummaries); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for ids. Deprecated for array types, Use getIdsAt instead -+ * @return Array of AviaryCommon::SubmissionID*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getIds(); -+ -+ /** -+ * Setter for ids.Deprecated for array types, Use setIdsAt -+ * or addIds instead. -+ * @param arg_Ids Array of AviaryCommon::SubmissionID*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIds(std::vector* arg_Ids); -+ -+ /** -+ * Re setter for ids -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetIds(); -+ -+ -+ -+ /** -+ * Getter for partialMatches. -+ * @return bool -+ */ -+ WSF_EXTERN bool WSF_CALL -+ getPartialMatches(); -+ -+ /** -+ * Setter for partialMatches. -+ * @param arg_PartialMatches bool -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setPartialMatches(bool arg_PartialMatches); -+ -+ /** -+ * Re setter for partialMatches -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetPartialMatches(); -+ -+ -+ -+ /** -+ * Getter for includeJobSummaries. -+ * @return bool -+ */ -+ WSF_EXTERN bool WSF_CALL -+ getIncludeJobSummaries(); -+ -+ /** -+ * Setter for includeJobSummaries. -+ * @param arg_IncludeJobSummaries bool -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIncludeJobSummaries(bool arg_IncludeJobSummaries); -+ -+ /** -+ * Re setter for includeJobSummaries -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetIncludeJobSummaries(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of ids. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::SubmissionID* of the array -+ */ -+ WSF_EXTERN AviaryCommon::SubmissionID* WSF_CALL -+ getIdsAt(int i); -+ -+ /** -+ * Set the ith element of ids. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Ids element to set AviaryCommon::SubmissionID* to the array -+ * @return ith AviaryCommon::SubmissionID* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setIdsAt(int i, -+ AviaryCommon::SubmissionID* arg_Ids); -+ -+ -+ /** -+ * Add to ids. -+ * @param arg_Ids element to add AviaryCommon::SubmissionID* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addIds( -+ AviaryCommon::SubmissionID* arg_Ids); -+ -+ /** -+ * Get the size of the ids array. -+ * @return the size of the ids array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofIds(); -+ -+ /** -+ * Remove the ith element of ids. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeIdsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether ids is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIdsNil(); -+ -+ -+ -+ -+ /** -+ * Check whether partialMatches is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isPartialMatchesNil(); -+ -+ -+ -+ /** -+ * Set partialMatches to Nill (same as using reset) -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setPartialMatchesNil(); -+ -+ -+ /** -+ * Check whether includeJobSummaries is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isIncludeJobSummariesNil(); -+ -+ -+ -+ /** -+ * Set includeJobSummaries to Nill (same as using reset) -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setIncludeJobSummariesNil(); -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether ids is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isIdsNilAt(int i); -+ -+ -+ /** -+ * Set ids to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setIdsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetSubmissionSummary_om_node node to serialize from -+ * @param GetSubmissionSummary_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetSubmissionSummary_om_node, axiom_element_t *GetSubmissionSummary_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetSubmissionSummary is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for ids by property number (1) -+ * @return Array of AviaryCommon::SubmissionIDs. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+ -+ /** -+ * Getter for partialMatches by property number (2) -+ * @return bool -+ */ -+ -+ bool WSF_CALL -+ getProperty2(); -+ -+ -+ -+ -+ /** -+ * Getter for includeJobSummaries by property number (3) -+ * @return bool -+ */ -+ -+ bool WSF_CALL -+ getProperty3(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETSUBMISSIONSUMMARY_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_GetSubmissionSummaryResponse.h b/src/condor_contrib/aviary/include/AviaryQuery_GetSubmissionSummaryResponse.h -new file mode 100644 -index 0000000..36b5a9e ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_GetSubmissionSummaryResponse.h -@@ -0,0 +1,300 @@ -+ -+ -+ #ifndef AviaryQuery_GETSUBMISSIONSUMMARYRESPONSE_H -+ #define AviaryQuery_GETSUBMISSIONSUMMARYRESPONSE_H -+ -+ /** -+ * GetSubmissionSummaryResponse.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * GetSubmissionSummaryResponse class -+ */ -+ -+ namespace AviaryQuery{ -+ class GetSubmissionSummaryResponse; -+ } -+ -+ -+ -+ #include "AviaryCommon_SubmissionSummary.h" -+ -+ #include -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class GetSubmissionSummaryResponse { -+ -+ private: -+ -+ axutil_qname_t* qname; -+ std::vector* property_Submissions; -+ -+ -+ bool isValidSubmissions; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ bool WSF_CALL -+ setSubmissionsNil(); -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class GetSubmissionSummaryResponse -+ */ -+ -+ GetSubmissionSummaryResponse(); -+ -+ /** -+ * Destructor GetSubmissionSummaryResponse -+ */ -+ ~GetSubmissionSummaryResponse(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating GetSubmissionSummaryResponse -+ * @param -+ * @param Submissions std::vector* -+ * @return newly created GetSubmissionSummaryResponse object -+ */ -+ GetSubmissionSummaryResponse(std::vector* arg_Submissions); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ /******** Deprecated for array types, Use 'Getters and Setters for Arrays' instead ***********/ -+ -+ -+ /** -+ * Getter for submissions. Deprecated for array types, Use getSubmissionsAt instead -+ * @return Array of AviaryCommon::SubmissionSummary*s. -+ */ -+ WSF_EXTERN std::vector* WSF_CALL -+ getSubmissions(); -+ -+ /** -+ * Setter for submissions.Deprecated for array types, Use setSubmissionsAt -+ * or addSubmissions instead. -+ * @param arg_Submissions Array of AviaryCommon::SubmissionSummary*s. -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setSubmissions(std::vector* arg_Submissions); -+ -+ /** -+ * Re setter for submissions -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetSubmissions(); -+ -+ /****************************** Get Set methods for Arrays **********************************/ -+ /************ Array Specific Operations: get_at, set_at, add, remove_at, sizeof *****************/ -+ -+ /** -+ * E.g. use of get_at, set_at, add and sizeof -+ * -+ * for(i = 0; i < adb_element->sizeofProperty(); i ++ ) -+ * { -+ * // Getting ith value to property_object variable -+ * property_object = adb_element->getPropertyAt(i); -+ * -+ * // Setting ith value from property_object variable -+ * adb_element->setPropertyAt(i, property_object); -+ * -+ * // Appending the value to the end of the array from property_object variable -+ * adb_element->addProperty(property_object); -+ * -+ * // Removing the ith value from an array -+ * adb_element->removePropertyAt(i); -+ * -+ * } -+ * -+ */ -+ -+ -+ -+ /** -+ * Get the ith element of submissions. -+ * @param i index of the item to be obtained -+ * @return ith AviaryCommon::SubmissionSummary* of the array -+ */ -+ WSF_EXTERN AviaryCommon::SubmissionSummary* WSF_CALL -+ getSubmissionsAt(int i); -+ -+ /** -+ * Set the ith element of submissions. (If the ith already exist, it will be replaced) -+ * @param i index of the item to return -+ * @param arg_Submissions element to set AviaryCommon::SubmissionSummary* to the array -+ * @return ith AviaryCommon::SubmissionSummary* of the array -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setSubmissionsAt(int i, -+ AviaryCommon::SubmissionSummary* arg_Submissions); -+ -+ -+ /** -+ * Add to submissions. -+ * @param arg_Submissions element to add AviaryCommon::SubmissionSummary* to the array -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ addSubmissions( -+ AviaryCommon::SubmissionSummary* arg_Submissions); -+ -+ /** -+ * Get the size of the submissions array. -+ * @return the size of the submissions array. -+ */ -+ WSF_EXTERN int WSF_CALL -+ sizeofSubmissions(); -+ -+ /** -+ * Remove the ith element of submissions. -+ * @param i index of the item to remove -+ * @return true on success, false otherwise. -+ */ -+ WSF_EXTERN bool WSF_CALL -+ removeSubmissionsAt(int i); -+ -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ /* Use 'Checking and Setting NIL values for Arrays' to check and set nil for individual elements */ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether submissions is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isSubmissionsNil(); -+ -+ -+ -+ -+ /*************************** Checking and Setting 'NIL' values in Arrays *****************************/ -+ -+ /** -+ * NOTE: You may set this to remove specific elements in the array -+ * But you can not remove elements, if the specific property is declared to be non-nillable or sizeof(array) < minOccurs -+ */ -+ -+ /** -+ * Check whether submissions is Nill at position i -+ * @param i index of the item to return. -+ * @return true if the value is Nil at position i, false otherwise -+ */ -+ bool WSF_CALL -+ isSubmissionsNilAt(int i); -+ -+ -+ /** -+ * Set submissions to NILL at the position i. -+ * @param i . The index of the item to be set Nill. -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setSubmissionsNilAt(int i); -+ -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param GetSubmissionSummaryResponse_om_node node to serialize from -+ * @param GetSubmissionSummaryResponse_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* GetSubmissionSummaryResponse_om_node, axiom_element_t *GetSubmissionSummaryResponse_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the GetSubmissionSummaryResponse is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for submissions by property number (1) -+ * @return Array of AviaryCommon::SubmissionSummarys. -+ */ -+ -+ std::vector* WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* GETSUBMISSIONSUMMARYRESPONSE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/include/AviaryQuery_QueryRequestType.h b/src/condor_contrib/aviary/include/AviaryQuery_QueryRequestType.h -new file mode 100644 -index 0000000..40de943 ---- /dev/null -+++ b/src/condor_contrib/aviary/include/AviaryQuery_QueryRequestType.h -@@ -0,0 +1,200 @@ -+ -+ -+ #ifndef AviaryQuery_QUERYREQUESTTYPE_H -+ #define AviaryQuery_QUERYREQUESTTYPE_H -+ -+ /** -+ * QueryRequestType.h -+ * -+ * This file was auto-generated from WSDL -+ * by the Apache Axis2/Java version: 1.0 Built on : Mar 02, 2011 (11:54:00 EST) -+ */ -+ -+ /** -+ * QueryRequestType class -+ */ -+ -+ namespace AviaryQuery{ -+ class QueryRequestType; -+ } -+ -+ -+ -+ -+ #include -+ #include -+ #include -+ #include -+ -+namespace AviaryQuery -+{ -+ -+ -+ -+ class QueryRequestType { -+ -+ private: -+ bool property_AllowPartialMatching; -+ -+ -+ bool isValidAllowPartialMatching; -+ -+ -+ /*** Private methods ***/ -+ -+ -+ -+ -+ /******************************* public functions *********************************/ -+ -+ public: -+ -+ /** -+ * Constructor for class QueryRequestType -+ */ -+ -+ QueryRequestType(); -+ -+ /** -+ * Destructor QueryRequestType -+ */ -+ ~QueryRequestType(); -+ -+ -+ -+ -+ /** -+ * Constructor for creating QueryRequestType -+ * @param -+ * @param AllowPartialMatching bool -+ * @return newly created QueryRequestType object -+ */ -+ QueryRequestType(bool arg_AllowPartialMatching); -+ -+ -+ /********************************** Class get set methods **************************************/ -+ -+ -+ -+ /** -+ * Getter for allowPartialMatching. -+ * @return bool -+ */ -+ WSF_EXTERN bool WSF_CALL -+ getAllowPartialMatching(); -+ -+ /** -+ * Setter for allowPartialMatching. -+ * @param arg_AllowPartialMatching bool -+ * @return true on success, false otherwise -+ */ -+ WSF_EXTERN bool WSF_CALL -+ setAllowPartialMatching(bool arg_AllowPartialMatching); -+ -+ /** -+ * Re setter for allowPartialMatching -+ * @return true on success, false -+ */ -+ WSF_EXTERN bool WSF_CALL -+ resetAllowPartialMatching(); -+ -+ -+ -+ /******************************* Checking and Setting NIL values *********************************/ -+ -+ -+ /** -+ * NOTE: set_nil is only available for nillable properties -+ */ -+ -+ -+ -+ /** -+ * Check whether allowPartialMatching is Nill -+ * @return true if the element is Nil, false otherwise -+ */ -+ bool WSF_CALL -+ isAllowPartialMatchingNil(); -+ -+ -+ -+ /** -+ * Set allowPartialMatching to Nill (same as using reset) -+ * @return true on success, false otherwise. -+ */ -+ bool WSF_CALL -+ setAllowPartialMatchingNil(); -+ -+ -+ /**************************** Serialize and De serialize functions ***************************/ -+ /*********** These functions are for use only inside the generated code *********************/ -+ -+ -+ /** -+ * Deserialize the ADB object to an XML -+ * @param dp_parent double pointer to the parent node to be deserialized -+ * @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?) -+ * @param dont_care_minoccurs Dont set errors on validating minoccurs, -+ * (Parent will order this in a case of choice) -+ * @return true on success, false otherwise -+ */ -+ bool WSF_CALL -+ deserialize(axiom_node_t** omNode, bool *isEarlyNodeValid, bool dontCareMinoccurs); -+ -+ -+ -+ /** -+ * Declare namespace in the most parent node -+ * @param parent_element parent element -+ * @param namespaces hash of namespace uri to prefix -+ * @param next_ns_index pointer to an int which contain the next namespace index -+ */ -+ void WSF_CALL -+ declareParentNamespaces(axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ -+ -+ -+ /** -+ * Serialize the ADB object to an xml -+ * @param QueryRequestType_om_node node to serialize from -+ * @param QueryRequestType_om_element parent element to serialize from -+ * @param tag_closed Whether the parent tag is closed or not -+ * @param namespaces hash of namespace uris to prefixes -+ * @param next_ns_index an int which contains the next namespace index -+ * @return axiom_node_t on success,NULL otherwise. -+ */ -+ axiom_node_t* WSF_CALL -+ serialize(axiom_node_t* QueryRequestType_om_node, axiom_element_t *QueryRequestType_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index); -+ -+ /** -+ * Check whether the QueryRequestType is a particle class (E.g. group, inner sequence) -+ * @return true if this is a particle class, false otherwise. -+ */ -+ bool WSF_CALL -+ isParticle(); -+ -+ -+ -+ /******************************* get the value by the property number *********************************/ -+ /************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/ -+ -+ -+ -+ -+ /** -+ * Getter for allowPartialMatching by property number (1) -+ * @return bool -+ */ -+ -+ bool WSF_CALL -+ getProperty1(); -+ -+ -+ -+}; -+ -+} -+ #endif /* QUERYREQUESTTYPE_H */ -+ -+ -diff --git a/src/condor_contrib/aviary/license.txt b/src/condor_contrib/aviary/license.txt -new file mode 100644 -index 0000000..046ad71 ---- /dev/null -+++ b/src/condor_contrib/aviary/license.txt -@@ -0,0 +1,14 @@ -+Copyright 2009-2011 Red Hat, Inc. -+ -+Licensed under the Apache License, Version 2.0 (the "License"); -+you may not use this file except in compliance with the License. -+You may obtain a copy of the License at -+ -+ http://www.apache.org/licenses/LICENSE-2.0 -+ -+Unless required by applicable law or agreed to in writing, software -+distributed under the License is distributed on an "AS IS" BASIS, -+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+See the License for the specific language governing permissions and -+limitations under the License. -+ -diff --git a/src/condor_contrib/aviary/services/job/services.xml b/src/condor_contrib/aviary/services/job/services.xml -new file mode 100644 -index 0000000..ab94581 ---- /dev/null -+++ b/src/condor_contrib/aviary/services/job/services.xml -@@ -0,0 +1,26 @@ -+ -+ -+ -+aviary_job_axis -+AviaryJobServiceService -+ -+ -+job#submit -+ -+ -+ -+job#hold -+ -+ -+ -+job#release -+ -+ -+ -+job#remove -+ -+ -+ -+job#setattr -+ -+ -diff --git a/src/condor_contrib/aviary/services/query/services.xml b/src/condor_contrib/aviary/services/query/services.xml -new file mode 100644 -index 0000000..b516976a ---- /dev/null -+++ b/src/condor_contrib/aviary/services/query/services.xml -@@ -0,0 +1,26 @@ -+ -+ -+ -+aviary_query_axis -+AviaryQueryServiceService -+ -+ -+query#summary -+ -+ -+ -+query#status -+ -+ -+ -+query#details -+ -+ -+ -+query#data -+ -+ -+ -+query#submission -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryConversionMacros.h b/src/condor_contrib/aviary/src/AviaryConversionMacros.h -new file mode 100644 -index 0000000..f809e75 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryConversionMacros.h -@@ -0,0 +1,82 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef AVIARY_CONVERSION_MACROS_H -+#define AVIARY_CONVERSION_MACROS_H -+ -+#define MGMT_DECLARATIONS \ -+ExprTree *expr; \ -+int num; \ -+float flt; \ -+char *str; \ -+(void)expr;(void)num;(void)flt;(void)str; -+ -+ -+#define BASE(attr,type,lookup_var,set_var,extra) \ -+if (ad.Lookup##type(#attr, lookup_var)) { \ -+ m_stats.attr = ((set_var) extra); \ -+} else { \ -+ dprintf(D_FULLDEBUG, "Warning: Could not find " #attr "\n"); \ -+} -+ -+#define OPT_BASE(attr,type,lookup_var,set_var,extra) \ -+if (ad.Lookup##type(#attr, lookup_var)) { \ -+ m_stats.attr = ((set_var) extra); \ -+} else { \ -+ m_stats.attr = ""; \ -+} -+ -+#define STRING(attr) \ -+if (ad.LookupString(#attr, &str)) { \ -+ m_stats.attr = str; \ -+ free(str); \ -+} else { \ -+ dprintf(D_FULLDEBUG, "Warning: Could not find " #attr "\n"); \ -+} -+ -+#define OPT_STRING(attr) \ -+if (ad.LookupString(#attr, &str)) { \ -+ m_stats.attr = str; \ -+ free(str); \ -+} else { \ -+ m_stats.attr = ""; \ -+} -+ -+#define INTEGER(attr) BASE(attr,Integer,num,(uint32_t) num,) -+#define OPT_INTEGER(attr) OPT_BASE(attr,Integer,num,(uint32_t) num,) -+#define DOUBLE(attr) BASE(attr,Float,flt,(double) flt,) -+#define OPT_DOUBLE(attr) OPT_BASE(attr,Float,flt,(double) flt,) -+#define TIME_INTEGER(attr) BASE(attr,Integer,num,(uint64_t) num,* 1000000000) -+#define OPT_TIME_INTEGER(attr) OPT_BASE(attr,Integer,num,(uint64_t) num,* 1000000000) -+ -+#define EXPR(attr) \ -+ EXPR_BASE(attr, \ -+ dprintf(D_FULLDEBUG, "Warning: " #attr " not found\n")) -+ -+#define OPT_EXPR(attr) \ -+ EXPR_BASE(attr, \ -+ m_stats.attr = "") -+ -+#define EXPR_BASE(attr,else_action) \ -+expr = ad.Lookup(#attr); \ -+if (expr) { \ -+ str = const_cast(ExprTreeToString(expr)); \ -+ m_stats.attr = str; \ -+} else { \ -+ dprintf(D_FULLDEBUG, "Warning: " #attr " has no value\n"); \ -+} -+ -+#endif /* AVIARY_CONVERSION_MACROS_H */ -diff --git a/src/condor_contrib/aviary/src/AviaryJobService.cpp b/src/condor_contrib/aviary/src/AviaryJobService.cpp -new file mode 100644 -index 0000000..ee80c5e ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryJobService.cpp -@@ -0,0 +1,356 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+ #include "AviaryJobServiceSkeleton.h" -+ #include "AviaryJobService.h" -+ #include -+ #include -+ #include -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ -+ using namespace AviaryJob; -+ -+ -+ /** Load the service into axis2 engine */ -+ WSF_SERVICE_INIT(AviaryJobService) -+ -+ -+ /** -+ * function to free any soap input headers -+ */ -+ AviaryJobService::AviaryJobService() -+ { -+ skel = wsfGetAviaryJobServiceSkeleton(); -+ } -+ -+ -+ void WSF_CALL -+ AviaryJobService::init() -+ { -+ -+ return; -+ } -+ -+ -+ AviaryJobService::~AviaryJobService() -+ { -+ } -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /* -+ * This method invokes the right service method -+ */ -+ OMElement* WSF_CALL -+ AviaryJobService::invoke(OMElement *omEle, MessageContext *msgCtx) -+ { -+ /* Using the function name, invoke the corresponding method -+ */ -+ -+ axis2_op_ctx_t *operation_ctx = NULL; -+ axis2_op_t *operation = NULL; -+ axutil_qname_t *op_qname = NULL; -+ axis2_char_t *op_name = NULL; -+ axis2_msg_ctx_t *in_msg_ctx = NULL; -+ -+ axiom_soap_envelope_t *req_soap_env = NULL; -+ axiom_soap_header_t *req_soap_header = NULL; -+ axiom_soap_envelope_t *res_soap_env = NULL; -+ axiom_soap_header_t *res_soap_header = NULL; -+ -+ axiom_node_t *ret_node = NULL; -+ axiom_node_t *input_header = NULL; -+ axiom_node_t *output_header = NULL; -+ axiom_node_t *header_base_node = NULL; -+ axis2_msg_ctx_t *msg_ctx = NULL; -+ axiom_node_t* content_node = omEle->getAxiomNode(); -+ -+ -+ AviaryJob::RemoveJobResponse* ret_val1; -+ AviaryJob::RemoveJob* input_val1; -+ -+ AviaryJob::ReleaseJobResponse* ret_val2; -+ AviaryJob::ReleaseJob* input_val2; -+ -+ AviaryJob::SubmitJobResponse* ret_val3; -+ AviaryJob::SubmitJob* input_val3; -+ -+ AviaryJob::HoldJobResponse* ret_val4; -+ AviaryJob::HoldJob* input_val4; -+ -+ AviaryJob::SetJobAttributeResponse* ret_val5; -+ AviaryJob::SetJobAttribute* input_val5; -+ -+ -+ msg_ctx = msgCtx->getAxis2MessageContext(); -+ operation_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, Environment::getEnv()); -+ operation = axis2_op_ctx_get_op(operation_ctx, Environment::getEnv()); -+ op_qname = (axutil_qname_t *)axis2_op_get_qname(operation, Environment::getEnv()); -+ op_name = axutil_qname_get_localpart(op_qname, Environment::getEnv()); -+ -+ if (op_name) -+ { -+ -+ -+ if ( axutil_strcmp(op_name, "removeJob") == 0 ) -+ { -+ -+ -+ input_val1 = -+ -+ new AviaryJob::RemoveJob(); -+ if( AXIS2_FAILURE == input_val1->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryJob::RemoveJob_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryJobServiceSkeleton skel; -+ ret_val1 = skel->removeJob(msgCtx ,input_val1); -+ -+ if ( NULL == ret_val1 ) -+ { -+ -+ delete input_val1; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val1->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val1; -+ -+ delete input_val1; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ if ( axutil_strcmp(op_name, "releaseJob") == 0 ) -+ { -+ -+ -+ input_val2 = -+ -+ new AviaryJob::ReleaseJob(); -+ if( AXIS2_FAILURE == input_val2->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryJob::ReleaseJob_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryJobServiceSkeleton skel; -+ ret_val2 = skel->releaseJob(msgCtx ,input_val2); -+ -+ if ( NULL == ret_val2 ) -+ { -+ -+ delete input_val2; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val2->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val2; -+ -+ delete input_val2; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ if ( axutil_strcmp(op_name, "submitJob") == 0 ) -+ { -+ -+ -+ input_val3 = -+ -+ new AviaryJob::SubmitJob(); -+ if( AXIS2_FAILURE == input_val3->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryJob::SubmitJob_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryJobServiceSkeleton skel; -+ ret_val3 = skel->submitJob(msgCtx ,input_val3); -+ -+ if ( NULL == ret_val3 ) -+ { -+ -+ delete input_val3; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val3->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val3; -+ -+ delete input_val3; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ if ( axutil_strcmp(op_name, "holdJob") == 0 ) -+ { -+ -+ -+ input_val4 = -+ -+ new AviaryJob::HoldJob(); -+ if( AXIS2_FAILURE == input_val4->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryJob::HoldJob_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryJobServiceSkeleton skel; -+ ret_val4 = skel->holdJob(msgCtx ,input_val4); -+ -+ if ( NULL == ret_val4 ) -+ { -+ -+ delete input_val4; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val4->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val4; -+ -+ delete input_val4; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ if ( axutil_strcmp(op_name, "setJobAttribute") == 0 ) -+ { -+ -+ -+ input_val5 = -+ -+ new AviaryJob::SetJobAttribute(); -+ if( AXIS2_FAILURE == input_val5->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryJob::SetJobAttribute_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryJobServiceSkeleton skel; -+ ret_val5 = skel->setJobAttribute(msgCtx ,input_val5); -+ -+ if ( NULL == ret_val5 ) -+ { -+ -+ delete input_val5; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val5->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val5; -+ -+ delete input_val5; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ } -+ -+ AXIS2_LOG_ERROR(Environment::getEnv()->log, AXIS2_LOG_SI, "AviaryJobService service ERROR: invalid OM parameters in request\n"); -+ return NULL; -+ } -+ -+ OMElement* WSF_CALL -+ AviaryJobService::onFault(OMElement* omEle) -+ { -+ axiom_node_t *error_node = NULL; -+ axiom_element_t *error_ele = NULL; -+ axutil_error_codes_t error_code; -+ axiom_node_t *node = omEle->getAxiomNode(); -+ error_code = (axutil_error_codes_t)Environment::getEnv()->error->error_number; -+ -+ if(error_code <= AVIARYJOBSERVICESKELETON_ERROR_NONE || -+ error_code >= AVIARYJOBSERVICESKELETON_ERROR_LAST ) -+ { -+ error_ele = axiom_element_create(Environment::getEnv(), node, "fault", NULL, -+ &error_node); -+ axiom_element_set_text(error_ele, Environment::getEnv(), "AviaryJobService|http://grid.redhat.com/aviary-job/ failed", -+ error_node); -+ } -+ -+ -+ return new OMElement(NULL,error_node); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryJobService.h b/src/condor_contrib/aviary/src/AviaryJobService.h -new file mode 100644 -index 0000000..7e0be8b ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryJobService.h -@@ -0,0 +1,66 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+ #ifndef AVIARYJOBSERVICE_H -+ #define AVIARYJOBSERVICE_H -+ -+#include -+#include -+#include -+ -+using namespace wso2wsf; -+ -+ -+using namespace AviaryJob; -+ -+ -+ -+#define WSF_SERVICE_SKEL_INIT(class_name) \ -+AviaryJobServiceSkeleton* wsfGetAviaryJobServiceSkeleton(){ return new class_name(); } -+ -+AviaryJobServiceSkeleton* wsfGetAviaryJobServiceSkeleton(); -+ -+ -+ -+ class AviaryJobService : public ServiceSkeleton -+ { -+ private: -+ AviaryJobServiceSkeleton *skel; -+ -+ public: -+ -+ union { -+ -+ } fault; -+ -+ -+ WSF_EXTERN WSF_CALL AviaryJobService(); -+ -+ OMElement* WSF_CALL invoke(OMElement *message, MessageContext *msgCtx); -+ -+ OMElement* WSF_CALL onFault(OMElement *message); -+ -+ void WSF_CALL init(); -+ -+ ~AviaryJobService(); -+ }; -+ -+ -+ -+#endif // AVIARYJOBSERVICE_H -+ -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryJobServiceMacro.cpp b/src/condor_contrib/aviary/src/AviaryJobServiceMacro.cpp -new file mode 100644 -index 0000000..76fc6cb ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryJobServiceMacro.cpp -@@ -0,0 +1,44 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+ -+#include "AviaryJobServiceSkeleton.h" -+#include "AviaryJobService.h" -+#include -+#include -+#include -+#include -+ -+using namespace wso2wsf; -+ -+using namespace AviaryJob; -+ -+ -+ -+/** Load the service into engine -+Note:- If you are extending from the Generated Skeleton class,you need is to change the argument provided to the -+macro to your derived class name. -+Example -+If your service is Calculator, you will have the business logic implementation class as CalculatorSkeleton. -+If the extended class is CalculatorSkeletonImpl, then you change the argument to the macro WSF_SERVICE_SKEL_INIT as -+WSF_SERVICE_SKEL_INIT(CalculatorSkeletonImpl). Also include the header file of the derived class, in this case CalculatorSkeletonImpl.h -+ -+*/ -+ -+WSF_SERVICE_SKEL_INIT(AviaryJobServiceSkeleton) -+ -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryJobServiceSkeleton.cpp b/src/condor_contrib/aviary/src/AviaryJobServiceSkeleton.cpp -new file mode 100644 -index 0000000..884b4af ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryJobServiceSkeleton.cpp -@@ -0,0 +1,369 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+// the implementation class for AviaryJob methods -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_config.h" -+#include "condor_attributes.h" -+ -+extern bool qmgmt_all_users_trusted; -+ -+// local includes -+#include "AviaryJobServiceSkeleton.h" -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "Codec.h" -+#include "SchedulerObject.h" -+#include "stl_string_utils.h" -+ -+using namespace std; -+using namespace AviaryJob; -+using namespace AviaryCommon; -+using namespace aviary::codec; -+using namespace aviary::job; -+using namespace compat_classad; -+ -+const char* BASIC_REQ_FORMAT = -+"\ -+( TARGET.Arch %s ) && \ -+( %s ) && \ -+( TARGET.Disk %s ) && \ -+( ( TARGET.Memory * 1024 ) %s ) && \ -+( TARGET.FileSystemDomain %s )"; -+ -+const char* BASIC_OS_FORMAT = "TARGET.OpSys == \"%s\""; -+const char* BASIC_WINOS_FORMAT = "TARGET.OpSys==\"WINNT51\" || TARGET.OpSys==\"WINNT52\" || TARGET.OpSys==\"WINNT60\""; -+const char* REQ_UNDEFINED = " =!= undefined "; -+const char* REQ_GTE_ZERO = " >= 0 "; -+ -+// -+// Utility methods START -+// -+ -+typedef vector CommonAttributeCollection; -+ -+void -+checkForSchedulerID(AviaryCommon::JobID* _jobId, string& _text) -+{ -+ SchedulerObject* schedulerObj = SchedulerObject::getInstance(); -+ if (!(_jobId->getPool() == schedulerObj->getPool()) || -+ !(_jobId->getScheduler() == schedulerObj->getName())) { -+ _text = "WARNING: the pool and scheduler names of the requested jobid were empty or did not match this scheduler!"; -+ } -+} -+ -+void -+buildBasicRequirements(ResourceConstraintVectorType* _constraints, string& _reqs) { -+ // scan through these and build TARGET. like string -+ string arch = REQ_UNDEFINED; -+ string opsys = REQ_UNDEFINED; -+ string disk = REQ_GTE_ZERO; -+ string memory = REQ_GTE_ZERO; -+ string filesystem = REQ_UNDEFINED; -+ for ( ResourceConstraintVectorType::const_iterator it = _constraints->begin(); it != _constraints->end(); -+ it++ ) { -+ ResourceConstraint* rc = *it; -+ ADBResourceConstraintTypeEnum rct = rc->getType()->getResourceConstraintTypeEnum(); -+ switch (rct) { -+ case ResourceConstraintType_ARCH: -+ arch = " == \"" + rc->getValue() + "\""; -+ break; -+ case ResourceConstraintType_OS: -+ if (rc->getValue() == "WINDOWS") { -+ opsys = BASIC_WINOS_FORMAT; -+ } -+ else { -+ sprintf(opsys,BASIC_OS_FORMAT,rc->getValue().c_str()); -+ } -+ break; -+ case ResourceConstraintType_DISK: -+ disk = " >= " + rc->getValue(); -+ break; -+ case ResourceConstraintType_MEMORY: -+ memory = " >= " + rc->getValue(); -+ break; -+ case ResourceConstraintType_FILESYSTEM: -+ filesystem = " == \"" + rc->getValue() + "\""; -+ break; -+ default: -+ dprintf(D_ALWAYS,"Ignoring unknown resource constraint submitted: %s:%s\n", -+ rc->getType()->getResourceConstraintType().c_str(),rc->getValue().c_str()); -+ } -+ } -+ // order is important! see BASIC_REQ_FORMAT above -+ sprintf(_reqs, BASIC_REQ_FORMAT, arch.c_str(), opsys.c_str(), disk.c_str(), memory.c_str(), filesystem.c_str()); -+} -+ -+bool -+isBasicAttribute(const string& attr_name) { -+ return ( -+ attr_name == ATTR_JOB_CMD || -+ attr_name == ATTR_REQUIREMENTS || -+ attr_name == ATTR_OWNER || -+ attr_name == ATTR_JOB_IWD || -+ attr_name == ATTR_JOB_ARGUMENTS1 -+ ); -+} -+ -+void -+addExtraAttributes(const CommonAttributeCollection* extra_attrs, AttributeMapType& attr_map, bool override_basic) { -+ // add in the extras -+ for (CommonAttributeCollection::const_iterator i = extra_attrs->begin();i < extra_attrs->end();i++) { -+ AviaryCommon::Attribute* attr = *i; -+ const string& attr_key = attr->getName(); -+ -+ // Are we overriding our basic attributes? -+ if (!override_basic && isBasicAttribute(attr_key)) { -+ // exclude this attribute from the submission map -+ continue; -+ } -+ -+ const char* attr_value = attr->getValue().c_str(); -+ switch (attr->getType()->getAttributeTypeEnum()) { -+ case AviaryCommon::AttributeType_INTEGER: -+ attr_map[attr_key.c_str()] = -+ new AviaryAttribute(AviaryAttribute::INTEGER_TYPE,attr_value); -+ break; -+ case AviaryCommon::AttributeType_FLOAT: -+ attr_map[attr_key.c_str()] = -+ new AviaryAttribute(AviaryAttribute::FLOAT_TYPE,attr_value); -+ break; -+ case AviaryCommon::AttributeType_STRING: -+ attr_map[attr_key.c_str()] = -+ new AviaryAttribute(AviaryAttribute::STRING_TYPE,attr_value); -+ break; -+ case AviaryCommon::AttributeType_BOOLEAN: -+ case AviaryCommon::AttributeType_EXPRESSION: -+ attr_map[attr_key.c_str()] = -+ new AviaryAttribute(AviaryAttribute::EXPR_TYPE,attr_value); -+ break; -+ // probably shouldn't get here unless axis2 fails us -+ case AviaryCommon::AttributeType_ERROR: -+ case AviaryCommon::AttributeType_UNDEFINED: -+ default: -+ dprintf(D_FULLDEBUG,"Unknown type supplied for attribute '%s=%s'\n", -+ attr_key.c_str(),attr_value); -+ } -+ } -+} -+ -+// -+// Utility methods END -+// -+ -+// -+// Interface implementation START -+// -+ -+ -+AviaryJob::SubmitJobResponse* -+AviaryJobServiceSkeleton::submitJob(wso2wsf::MessageContext* /*outCtx*/ ,AviaryJob::SubmitJob* _submitJob) -+{ -+ AviaryJob::SubmitJobResponse* submitJobResponse = new AviaryJob::SubmitJobResponse(); -+ SchedulerObject* schedulerObj = SchedulerObject::getInstance(); -+ AttributeMapType reqsMap, attrMap; -+ const char* submissionName = NULL; -+ -+ // add the simple stuff first -+ attrMap[ATTR_JOB_CMD] = new AviaryAttribute(AviaryAttribute::STRING_TYPE, _submitJob->getCmd().c_str()); -+ if (!(_submitJob->isArgsNil() || _submitJob->getArgs().empty())) { -+ attrMap[ATTR_JOB_ARGUMENTS1] = new AviaryAttribute(AviaryAttribute::STRING_TYPE, _submitJob->getArgs().c_str()); -+ } -+ attrMap[ATTR_OWNER] = new AviaryAttribute(AviaryAttribute::STRING_TYPE, _submitJob->getOwner().c_str()); -+ attrMap[ATTR_JOB_IWD] = new AviaryAttribute(AviaryAttribute::STRING_TYPE, _submitJob->getIwd().c_str()); -+ if (!(_submitJob->isSubmission_nameNil() || _submitJob->getSubmission_name().empty())) { -+ submissionName = _submitJob->getSubmission_name().c_str(); -+ attrMap[ATTR_JOB_SUBMISSION] = new AviaryAttribute(AviaryAttribute::STRING_TYPE,submissionName); -+ } -+ -+ // build a requirements string and add to it -+ string reqBuilder; -+ if (!(_submitJob->isRequirementsNil() || _submitJob->getRequirements()->empty())) { -+ // build from resource constraints -+ buildBasicRequirements(_submitJob->getRequirements(), reqBuilder); -+ } -+ else { -+ // default -+ reqBuilder = "TRUE"; -+ } -+ attrMap[ATTR_REQUIREMENTS] = new AviaryAttribute(AviaryAttribute::EXPR_TYPE, reqBuilder.c_str()); -+ -+ // need to add extras attrs also -+ // wso2 doesn't seem to make true nil checking easy -+ // might remove the Attributes element -+ CommonAttributeCollection* attrs = NULL; -+ if (!_submitJob->isExtraNil()) { -+ attrs = _submitJob->getExtra(); -+ if (attrs && !attrs->empty()) { -+ if (attrs && !attrs->empty()) { -+ addExtraAttributes(attrs, attrMap,_submitJob->getAllowOverrides()); -+ } -+ } -+ } -+ -+ // invoke submit -+ string jobId, error; -+ // we need this since we don't have a trusted socket to the schedd, -+ // without it basically the schedd won't accept whatever we claim -+ // is Owner and the job will be pseudo-pruned -+ qmgmt_all_users_trusted = true; -+ if (!schedulerObj->submit(attrMap,jobId, error)) { -+ submitJobResponse->setStatus(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("FAIL"),error)); -+ } -+ else { -+ string submissionId; -+ if (submissionName) { -+ submissionId = submissionName; -+ } -+ else { -+ submissionId = schedulerObj->getName(); -+ submissionId.append("#"); -+ submissionId.append(jobId); -+ } -+ submitJobResponse->setId(new AviaryCommon::JobID( -+ jobId,schedulerObj->getPool(),schedulerObj->getName(), -+ new AviaryCommon::SubmissionID(submissionId,_submitJob->getOwner().c_str()))); -+ submitJobResponse->setStatus(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("OK"),"")); -+ } -+ qmgmt_all_users_trusted = false; -+ -+ // clean up -+ for (AttributeMapType::iterator i = attrMap.begin(); attrMap.end() != i; i++) { -+ delete (*i).second; -+ } -+ for (AttributeMapType::iterator i = reqsMap.begin(); reqsMap.end() != i; i++) { -+ delete (*i).second; -+ } -+ -+ return submitJobResponse; -+} -+ -+ -+// TODO: would be nice to template these next 3 -+AviaryJob::HoldJobResponse* -+AviaryJobServiceSkeleton::holdJob(wso2wsf::MessageContext* /*outCtx*/ ,AviaryJob::HoldJob* _holdJob) -+{ -+ AviaryJob::HoldJobResponse* holdJobResponse = new HoldJobResponse; -+ SchedulerObject* schedulerObj = SchedulerObject::getInstance(); -+ string error; -+ -+ AviaryCommon::JobID* jobId = _holdJob->getHoldJob()->getId(); -+ string reason = _holdJob->getHoldJob()->getReason(); -+ string cluster_proc = jobId->getJob(); -+ ControlJobResponse* controlJobResponse = NULL; -+ -+ checkForSchedulerID(jobId, error); -+ if (!schedulerObj->hold(cluster_proc,reason,error)) { -+ dprintf(D_FULLDEBUG, "SchedulerObject Hold failed: %s\n", error.c_str()); -+ controlJobResponse = new ControlJobResponse(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("FAIL"),error)); -+ } -+ else { -+ // in this case, error may hve been the result of the pool/schedd check -+ controlJobResponse = new ControlJobResponse(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("OK"),error)); -+ } -+ -+ holdJobResponse->setHoldJobResponse(controlJobResponse); -+ return holdJobResponse; -+} -+ -+ -+AviaryJob::ReleaseJobResponse* -+AviaryJobServiceSkeleton::releaseJob(wso2wsf::MessageContext* /*outCtx*/ ,AviaryJob::ReleaseJob* _releaseJob) -+{ -+ AviaryJob::ReleaseJobResponse* releaseJobResponse = new ReleaseJobResponse; -+ SchedulerObject* schedulerObj = SchedulerObject::getInstance(); -+ string error; -+ -+ AviaryCommon::JobID* jobId = _releaseJob->getReleaseJob()->getId(); -+ string reason = _releaseJob->getReleaseJob()->getReason(); -+ string cluster_proc = jobId->getJob(); -+ ControlJobResponse* controlJobResponse = NULL; -+ -+ checkForSchedulerID(jobId, error); -+ if (!schedulerObj->release(cluster_proc,reason,error)) { -+ dprintf(D_FULLDEBUG, "SchedulerObject Release failed: %s\n", error.c_str()); -+ controlJobResponse = new ControlJobResponse(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("FAIL"),error)); -+ } -+ else { -+ // in this case, error may hve been the result of the pool/schedd check -+ controlJobResponse = new ControlJobResponse(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("OK"),error)); -+ } -+ -+ releaseJobResponse->setReleaseJobResponse(controlJobResponse); -+ return releaseJobResponse; -+} -+ -+AviaryJob::RemoveJobResponse* -+AviaryJobServiceSkeleton::removeJob(wso2wsf::MessageContext* /*outCtx*/ ,AviaryJob::RemoveJob* _removeJob) -+{ -+ AviaryJob::RemoveJobResponse* removeJobResponse = new RemoveJobResponse; -+ SchedulerObject* schedulerObj = SchedulerObject::getInstance(); -+ string error; -+ -+ AviaryCommon::JobID* jobId = _removeJob->getRemoveJob()->getId(); -+ string reason = _removeJob->getRemoveJob()->getReason(); -+ string cluster_proc = jobId->getJob(); -+ ControlJobResponse* controlJobResponse = NULL; -+ -+ checkForSchedulerID(jobId, error); -+ if (!schedulerObj->remove(cluster_proc,reason,error)) { -+ dprintf(D_FULLDEBUG, "SchedulerObject Remove failed: %s\n", error.c_str()); -+ controlJobResponse = new ControlJobResponse(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("FAIL"),error)); -+ } -+ else { -+ // in this case, error may hve been the result of the pool/schedd check -+ controlJobResponse = new ControlJobResponse(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("OK"),error)); -+ } -+ -+ removeJobResponse->setRemoveJobResponse(controlJobResponse); -+ return removeJobResponse; -+} -+ -+AviaryJob::SetJobAttributeResponse* -+AviaryJobServiceSkeleton::setJobAttribute(wso2wsf::MessageContext* /*outCtx*/ ,AviaryJob::SetJobAttribute* _setJobAttribute) -+{ -+ AviaryJob::SetJobAttributeResponse* setAttrResponse = new SetJobAttributeResponse; -+ SchedulerObject* schedulerObj = SchedulerObject::getInstance(); -+ string error; -+ -+ AviaryCommon::JobID* jobId = _setJobAttribute->getId(); -+ AviaryCommon::Attribute* attr = _setJobAttribute->getAttribute(); -+ string cluster_proc = jobId->getJob(); -+ ControlJobResponse* controlJobResponse = NULL; -+ -+ checkForSchedulerID(jobId, error); -+ if (!schedulerObj->setAttribute(cluster_proc,attr->getName(),attr->getValue(),error)) { -+ dprintf(D_FULLDEBUG, "SchedulerObject SetAttribute failed: %s\n", error.c_str()); -+ controlJobResponse = new ControlJobResponse(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("FAIL"),error)); -+ } -+ else { -+ // in this case, error may hve been the result of the pool/schedd check -+ controlJobResponse = new ControlJobResponse(new AviaryCommon::Status(new AviaryCommon::StatusCodeType("OK"),error)); -+ } -+ -+ setAttrResponse->setSetJobAttributeResponse(controlJobResponse); -+ return setAttrResponse; -+} -diff --git a/src/condor_contrib/aviary/src/AviaryJobServiceSkeleton.h b/src/condor_contrib/aviary/src/AviaryJobServiceSkeleton.h -new file mode 100644 -index 0000000..12bddc3 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryJobServiceSkeleton.h -@@ -0,0 +1,192 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef AVIARYJOBSERVICESKELETON_H -+#define AVIARYJOBSERVICESKELETON_H -+ -+ #include -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+typedef std::vector ResourceConstraintVectorType; -+ -+namespace AviaryJob { -+ -+ -+ /** we have to reserve some error codes for adb and for custom messages */ -+ #define AVIARYJOBSERVICESKELETON_ERROR_CODES_START (AXIS2_ERROR_LAST + 2500) -+ -+ typedef enum -+ { -+ AVIARYJOBSERVICESKELETON_ERROR_NONE = AVIARYJOBSERVICESKELETON_ERROR_CODES_START, -+ -+ AVIARYJOBSERVICESKELETON_ERROR_LAST -+ } AviaryJobServiceSkeleton_error_codes; -+ -+ -+ -+ -+class AviaryJobServiceSkeleton -+{ -+ -+ public: -+ AviaryJobServiceSkeleton(){} -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "removeJob|http://grid.redhat.com/aviary-job/" operation. -+ * -+ * @param _removeJob of the AviaryJob::RemoveJob -+ * -+ * @return AviaryJob::RemoveJobResponse* -+ */ -+ -+ -+ virtual -+ AviaryJob::RemoveJobResponse* removeJob(wso2wsf::MessageContext *outCtx ,AviaryJob::RemoveJob* _removeJob); -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "releaseJob|http://grid.redhat.com/aviary-job/" operation. -+ * -+ * @param _releaseJob of the AviaryJob::ReleaseJob -+ * -+ * @return AviaryJob::ReleaseJobResponse* -+ */ -+ -+ -+ virtual -+ AviaryJob::ReleaseJobResponse* releaseJob(wso2wsf::MessageContext *outCtx ,AviaryJob::ReleaseJob* _releaseJob); -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "submitJob|http://grid.redhat.com/aviary-job/" operation. -+ * -+ * @param _submitJob of the AviaryJob::SubmitJob -+ * -+ * @return AviaryJob::SubmitJobResponse* -+ */ -+ -+ -+ virtual -+ AviaryJob::SubmitJobResponse* submitJob(wso2wsf::MessageContext *outCtx ,AviaryJob::SubmitJob* _submitJob); -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "holdJob|http://grid.redhat.com/aviary-job/" operation. -+ * -+ * @param _holdJob of the AviaryJob::HoldJob -+ * -+ * @return AviaryJob::HoldJobResponse* -+ */ -+ -+ -+ virtual -+ AviaryJob::HoldJobResponse* holdJob(wso2wsf::MessageContext *outCtx ,AviaryJob::HoldJob* _holdJob); -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "setJobAttribute|http://grid.redhat.com/aviary-job/" operation. -+ * -+ * @param _setJobAttribute of the AviaryJob::SetJobAttribute -+ * -+ * @return AviaryJob::SetJobAttributeResponse* -+ */ -+ -+ -+ virtual -+ AviaryJob::SetJobAttributeResponse* setJobAttribute(wso2wsf::MessageContext *outCtx ,AviaryJob::SetJobAttribute* _setJobAttribute); -+ -+ -+ -+ -+ -+ -+}; -+ -+ -+} -+ -+ -+ -+ -+#endif // AVIARYJOBSERVICESKELETON_H -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryQueryService.cpp b/src/condor_contrib/aviary/src/AviaryQueryService.cpp -new file mode 100644 -index 0000000..242c4e0 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryQueryService.cpp -@@ -0,0 +1,358 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+ #include "AviaryQueryServiceSkeleton.h" -+ #include "AviaryQueryService.h" -+ #include -+ #include -+ #include -+ #include -+ #include -+ -+ -+ using namespace wso2wsf; -+ -+ using namespace AviaryQuery; -+ -+ -+ /** Load the service into axis2 engine */ -+ WSF_SERVICE_INIT(AviaryQueryService) -+ -+ -+ /** -+ * function to free any soap input headers -+ */ -+ AviaryQueryService::AviaryQueryService() -+ { -+ skel = wsfGetAviaryQueryServiceSkeleton(); -+ } -+ -+ -+ void WSF_CALL -+ AviaryQueryService::init() -+ { -+ -+ return; -+ } -+ -+ -+ AviaryQueryService::~AviaryQueryService() -+ { -+ } -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /* -+ * This method invokes the right service method -+ */ -+ OMElement* WSF_CALL -+ AviaryQueryService::invoke(OMElement *omEle, MessageContext *msgCtx) -+ { -+ /* Using the function name, invoke the corresponding method -+ */ -+ -+ axis2_op_ctx_t *operation_ctx = NULL; -+ axis2_op_t *operation = NULL; -+ axutil_qname_t *op_qname = NULL; -+ axis2_char_t *op_name = NULL; -+ axis2_msg_ctx_t *in_msg_ctx = NULL; -+ -+ axiom_soap_envelope_t *req_soap_env = NULL; -+ axiom_soap_header_t *req_soap_header = NULL; -+ axiom_soap_envelope_t *res_soap_env = NULL; -+ axiom_soap_header_t *res_soap_header = NULL; -+ -+ axiom_node_t *ret_node = NULL; -+ axiom_node_t *input_header = NULL; -+ axiom_node_t *output_header = NULL; -+ axiom_node_t *header_base_node = NULL; -+ axis2_msg_ctx_t *msg_ctx = NULL; -+ axiom_node_t* content_node = omEle->getAxiomNode(); -+ -+ -+ AviaryQuery::GetJobDataResponse* ret_val1; -+ AviaryQuery::GetJobData* input_val1; -+ -+ AviaryQuery::GetJobStatusResponse* ret_val2; -+ AviaryQuery::GetJobStatus* input_val2; -+ -+ AviaryQuery::GetSubmissionSummaryResponse* ret_val3; -+ AviaryQuery::GetSubmissionSummary* input_val3; -+ -+ AviaryQuery::GetJobDetailsResponse* ret_val4; -+ AviaryQuery::GetJobDetails* input_val4; -+ -+ AviaryQuery::GetJobSummaryResponse* ret_val5; -+ AviaryQuery::GetJobSummary* input_val5; -+ -+ -+ -+ msg_ctx = msgCtx->getAxis2MessageContext(); -+ operation_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, Environment::getEnv()); -+ operation = axis2_op_ctx_get_op(operation_ctx, Environment::getEnv()); -+ op_qname = (axutil_qname_t *)axis2_op_get_qname(operation, Environment::getEnv()); -+ op_name = axutil_qname_get_localpart(op_qname, Environment::getEnv()); -+ -+ if (op_name) -+ { -+ -+ -+ if ( axutil_strcmp(op_name, "getJobData") == 0 ) -+ { -+ -+ -+ input_val1 = -+ -+ new AviaryQuery::GetJobData(); -+ if( AXIS2_FAILURE == input_val1->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryQuery::GetJobData_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryQueryServiceSkeleton skel; -+ ret_val1 = skel->getJobData(msgCtx ,input_val1); -+ -+ if ( NULL == ret_val1 ) -+ { -+ -+ delete input_val1; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val1->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val1; -+ -+ delete input_val1; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ if ( axutil_strcmp(op_name, "getJobStatus") == 0 ) -+ { -+ -+ -+ input_val2 = -+ -+ new AviaryQuery::GetJobStatus(); -+ if( AXIS2_FAILURE == input_val2->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryQuery::GetJobStatus_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryQueryServiceSkeleton skel; -+ ret_val2 = skel->getJobStatus(msgCtx ,input_val2); -+ -+ if ( NULL == ret_val2 ) -+ { -+ -+ delete input_val2; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val2->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val2; -+ -+ delete input_val2; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ if ( axutil_strcmp(op_name, "getSubmissionSummary") == 0 ) -+ { -+ -+ -+ input_val3 = -+ -+ new AviaryQuery::GetSubmissionSummary(); -+ if( AXIS2_FAILURE == input_val3->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryQuery::GetSubmissionSummary_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryQueryServiceSkeleton skel; -+ ret_val3 = skel->getSubmissionSummary(msgCtx ,input_val3); -+ -+ if ( NULL == ret_val3 ) -+ { -+ -+ delete input_val3; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val3->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val3; -+ -+ delete input_val3; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ if ( axutil_strcmp(op_name, "getJobDetails") == 0 ) -+ { -+ -+ -+ input_val4 = -+ -+ new AviaryQuery::GetJobDetails(); -+ if( AXIS2_FAILURE == input_val4->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryQuery::GetJobDetails_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryQueryServiceSkeleton skel; -+ ret_val4 = skel->getJobDetails(msgCtx ,input_val4); -+ -+ if ( NULL == ret_val4 ) -+ { -+ -+ delete input_val4; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val4->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val4; -+ -+ delete input_val4; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ if ( axutil_strcmp(op_name, "getJobSummary") == 0 ) -+ { -+ -+ -+ input_val5 = -+ -+ new AviaryQuery::GetJobSummary(); -+ if( AXIS2_FAILURE == input_val5->deserialize(&content_node, NULL, false)) -+ { -+ -+ AXIS2_ERROR_SET(Environment::getEnv()->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR( Environment::getEnv()->log, AXIS2_LOG_SI, "NULL returned from the AviaryQuery::GetJobSummary_deserialize: " -+ "This should be due to an invalid XML"); -+ return NULL; -+ } -+ -+ //AviaryQueryServiceSkeleton skel; -+ ret_val5 = skel->getJobSummary(msgCtx ,input_val5); -+ -+ if ( NULL == ret_val5 ) -+ { -+ -+ delete input_val5; -+ -+ return NULL; -+ } -+ ret_node = -+ ret_val5->serialize(NULL, NULL, AXIS2_TRUE, NULL, NULL); -+ delete ret_val5; -+ -+ delete input_val5; -+ -+ -+ return new OMElement(NULL,ret_node); -+ -+ -+ /* since this has no output params it just returns NULL */ -+ -+ -+ } -+ -+ -+ } -+ -+ AXIS2_LOG_ERROR(Environment::getEnv()->log, AXIS2_LOG_SI, "AviaryQueryService service ERROR: invalid OM parameters in request\n"); -+ return NULL; -+ } -+ -+ OMElement* WSF_CALL -+ AviaryQueryService::onFault(OMElement* omEle) -+ { -+ axiom_node_t *error_node = NULL; -+ axiom_element_t *error_ele = NULL; -+ axutil_error_codes_t error_code; -+ axiom_node_t *node = omEle->getAxiomNode(); -+ error_code = (axutil_error_codes_t)Environment::getEnv()->error->error_number; -+ -+ if(error_code <= AVIARYQUERYSERVICESKELETON_ERROR_NONE || -+ error_code >= AVIARYQUERYSERVICESKELETON_ERROR_LAST ) -+ { -+ error_ele = axiom_element_create(Environment::getEnv(), node, "fault", NULL, -+ &error_node); -+ axiom_element_set_text(error_ele, Environment::getEnv(), "AviaryQueryService|http://grid.redhat.com/aviary-query/ failed", -+ error_node); -+ } -+ -+ -+ return new OMElement(NULL,error_node); -+ } -+ -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryQueryService.h b/src/condor_contrib/aviary/src/AviaryQueryService.h -new file mode 100644 -index 0000000..18be684 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryQueryService.h -@@ -0,0 +1,67 @@ -+ -+ -+ #ifndef AVIARYQUERYSERVICE_H -+ #define AVIARYQUERYSERVICE_H -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#include -+#include -+#include -+ -+using namespace wso2wsf; -+ -+ -+using namespace AviaryQuery; -+ -+ -+ -+#define WSF_SERVICE_SKEL_INIT(class_name) \ -+AviaryQueryServiceSkeleton* wsfGetAviaryQueryServiceSkeleton(){ return new class_name(); } -+ -+AviaryQueryServiceSkeleton* wsfGetAviaryQueryServiceSkeleton(); -+ -+ -+ -+ class AviaryQueryService : public ServiceSkeleton -+ { -+ private: -+ AviaryQueryServiceSkeleton *skel; -+ -+ public: -+ -+ union { -+ -+ } fault; -+ -+ -+ WSF_EXTERN WSF_CALL AviaryQueryService(); -+ -+ OMElement* WSF_CALL invoke(OMElement *message, MessageContext *msgCtx); -+ -+ OMElement* WSF_CALL onFault(OMElement *message); -+ -+ void WSF_CALL init(); -+ -+ ~AviaryQueryService(); -+ }; -+ -+ -+ -+#endif // AVIARYQUERYSERVICE_H -+ -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryQueryServiceMacro.cpp b/src/condor_contrib/aviary/src/AviaryQueryServiceMacro.cpp -new file mode 100644 -index 0000000..d8cae4c ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryQueryServiceMacro.cpp -@@ -0,0 +1,44 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+ -+#include "AviaryQueryServiceSkeleton.h" -+#include "AviaryQueryService.h" -+#include -+#include -+#include -+#include -+ -+using namespace wso2wsf; -+ -+using namespace AviaryQuery; -+ -+ -+ -+/** Load the service into engine -+Note:- If you are extending from the Generated Skeleton class,you need is to change the argument provided to the -+macro to your derived class name. -+Example -+If your service is Calculator, you will have the business logic implementation class as CalculatorSkeleton. -+If the extended class is CalculatorSkeletonImpl, then you change the argument to the macro WSF_SERVICE_SKEL_INIT as -+WSF_SERVICE_SKEL_INIT(CalculatorSkeletonImpl). Also include the header file of the derived class, in this case CalculatorSkeletonImpl.h -+ -+*/ -+ -+WSF_SERVICE_SKEL_INIT(AviaryQueryServiceSkeleton) -+ -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryQueryServiceSkeleton.cpp b/src/condor_contrib/aviary/src/AviaryQueryServiceSkeleton.cpp -new file mode 100644 -index 0000000..52ec7e0 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryQueryServiceSkeleton.cpp -@@ -0,0 +1,479 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+// the implementation methods for AviaryQueryService methods -+ -+//local includes -+#include "Globals.h" -+#include "JobServerObject.h" -+#include "AviaryQueryServiceSkeleton.h" -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+// condor includes -+#include "stl_string_utils.h" -+#include "proc.h" -+#include "condor_attributes.h" -+ -+// axis includes -+#include "axutil_date_time.h" -+ -+using namespace std; -+using namespace AviaryQuery; -+using namespace AviaryCommon; -+using namespace aviary::query; -+ -+struct cmpid { -+ bool operator()(const char *a, const char *b) const { -+ return strcmp(a, b) < 0; -+ } -+}; -+ -+typedef vector JobIdCollection; -+typedef vector SubmissionIdCollection; -+typedef vector JobStatusCollection; -+typedef vector JobDetailsCollection; -+typedef vector JobSummaryCollection; -+typedef vector SubmissionSummaryCollection; -+typedef set IdCollection; -+ -+// TODO: singleton this... -+extern aviary::soap::Axis2SoapProvider* provider; -+ -+// -+// Utility section START -+// -+ -+// Any key that begins with the '0' char is either the -+// header or a cluster, i.e. not a job -+#define IS_JOB(key) ((key) && '0' != (key)[0]) -+ -+// NOTE #1: unfortunately the Axis2/C generated code is inconsistent in its -+// internal checking of nillable (i.e., minOccurs=0) elements -+// so we have to use default ctors and build the element object using setters -+// otherwise segvs await us in generated code -+ -+// NOTE #2: using template functions since WSO2 codegen won't give us -+// XSD extension->C++ inheritance -+template -+void createGoodJobResponse(JobBase& jb, const char* job_id) { -+ JobServerObject* jso = JobServerObject::getInstance(); -+ JobID* jid = new JobID; -+ jid->setJob(job_id); -+ jid->setPool(jso->getPool()); -+ jid->setScheduler(jso->getName()); -+ jb.setId(jid); -+ Status* js = new Status; -+ js->setCode(new StatusCodeType("OK")); -+ jb.setStatus(js); -+} -+ -+template -+void createBadJobResponse(JobBase& jb, const char* job_id, const AviaryStatus& error) { -+ JobID* jid = new JobID; -+ jid->setJob(job_id); -+ jb.setId(jid); -+ StatusCodeType* jst = new StatusCodeType; -+ jst->setStatusCodeTypeEnum(ADBStatusCodeTypeEnum(error.type)); -+ Status* js = new Status(jst,error.text); -+ jb.setStatus(js); -+} -+ -+// unfortunately no convenience functions from WS02 for dateTime -+axutil_date_time_t* encodeDateTime(const time_t* _time) { -+ struct tm _tm; -+ -+ // need the re-entrant version because axutil_date_time_create -+ // calls time() again and overwrites static tm -+ localtime_r(_time,&_tm); -+ // get our Axis2 env for the allocator -+ const axutil_env_t* _env = provider->getEnv(); -+ -+ axutil_date_time_t* _value = NULL; -+ _value = axutil_date_time_create(_env); -+ -+ if (!_value) -+ { -+ AXIS2_ERROR_SET(_env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); -+ AXIS2_LOG_ERROR(_env->log, AXIS2_LOG_SI, "Out of memory"); -+ return NULL; -+ } -+ -+ // play their game with adjusting the year and month offset -+ axutil_date_time_set_date_time(_value,_env, -+ _tm.tm_year+1900, -+ _tm.tm_mon+1, -+ _tm.tm_mday, -+ _tm.tm_hour, -+ _tm.tm_min, -+ _tm.tm_sec, -+ 0); -+ return _value; -+}; -+ -+void mapFieldsToSummary(const JobSummaryFields& fields, JobSummary* _summary) { -+ -+ // JobID should already been in our summary -+ SubmissionID* sid = new SubmissionID; -+ sid->setName(fields.submission_id); -+ sid->setOwner(fields.owner); -+ _summary->getId()->setSubmission(sid); -+ // do date/time conversion -+ _summary->setQueued(encodeDateTime((const time_t*)&fields.queued)); -+ _summary->setLast_update(encodeDateTime((const time_t*)&fields.last_update)); -+ JobStatusType* jst = new JobStatusType; -+ jst->setJobStatusType(getJobStatusString(fields.status)); -+ _summary->setJob_status(jst); -+ _summary->setCmd(fields.cmd); -+ if (!fields.args1.empty()) { -+ _summary->setArgs1(fields.args1); -+ } -+ if (!fields.args2.empty()) { -+ _summary->setArgs2(fields.args2); -+ } -+ if (!fields.hold_reason.empty()) { -+ _summary->setHeld(fields.hold_reason); -+ } -+ if (!fields.release_reason.empty()) { -+ _summary->setReleased(fields.release_reason); -+ } -+ if (!fields.remove_reason.empty()) { -+ _summary->setRemoved(fields.remove_reason); -+ } -+} -+ -+void mapToXsdAttributes(const aviary::codec::AttributeMapType& _map, AviaryCommon::Attributes* _attrs) { -+ for (AttributeMapIterator i = _map.begin(); _map.end() != i; i++) { -+ AviaryAttribute* codec_attr = (AviaryAttribute*)(*i).second; -+ AviaryCommon::Attribute* attr = new AviaryCommon::Attribute; -+ attr->setName((*i).first); -+ AviaryCommon::AttributeType* attr_type = new AviaryCommon::AttributeType; -+ switch (codec_attr->getType()) { -+ case AviaryAttribute::INTEGER_TYPE: -+ attr_type->setAttributeTypeEnum(AviaryCommon::AttributeType_INTEGER); -+ break; -+ case AviaryAttribute::FLOAT_TYPE: -+ attr_type->setAttributeTypeEnum(AviaryCommon::AttributeType_FLOAT); -+ break; -+ case AviaryAttribute::STRING_TYPE: -+ attr_type->setAttributeTypeEnum(AviaryCommon::AttributeType_STRING); -+ break; -+ case AviaryAttribute::EXPR_TYPE: -+ attr_type->setAttributeTypeEnum(AviaryCommon::AttributeType_EXPRESSION); -+ break; -+ default: -+ attr_type->setAttributeTypeEnum(AviaryCommon::AttributeType_UNDEFINED); -+ } -+ attr->setType(attr_type); -+ attr->setValue(codec_attr->getValue()); -+ _attrs->addAttrs(attr); -+ } -+} -+ -+// -+// Utility section END -+// -+ -+// -+// Interface implementation START -+// -+GetSubmissionSummaryResponse* AviaryQueryServiceSkeleton::getSubmissionSummary(wso2wsf::MessageContext* /*outCtx*/ -+ ,GetSubmissionSummary* _getSubmissionSummary) -+{ -+ GetSubmissionSummaryResponse* getSummaryResponse = new GetSubmissionSummaryResponse; -+ -+ SubmissionCollectionType::const_iterator element = g_submissions.begin(); -+ SubmissionSummaryCollection* submissions = new SubmissionSummaryCollection; -+ -+ SubmissionCollectionType sub_map; -+ -+ if (_getSubmissionSummary->isIdsNil() || _getSubmissionSummary->getIds()->size() == 0) { -+ // no ids supplied...they get them all -+ for (SubmissionCollectionType::iterator i = g_submissions.begin(); g_submissions.end() != i; i++) { -+ sub_map[(*i).first] = (*i).second; -+ } -+ } -+ else { -+ // fast track...client has supplied ids to scan -+ SubmissionIdCollection* id_list = _getSubmissionSummary->getIds(); -+ for (SubmissionIdCollection::iterator sic_it = id_list->begin(); id_list->end() != sic_it; sic_it++) { -+ const char* sid_str = (*sic_it)->getName().c_str(); -+ SubmissionCollectionType::iterator sct_it = g_submissions.find(sid_str); -+ if (sct_it != g_submissions.end()) { -+ sub_map[(*sct_it).first] = (*sct_it).second; -+ } -+ else { -+ // mark this as not matched when returning our results -+ sub_map[(*sct_it).first] = NULL; -+ } -+ } -+ } -+ -+ for (SubmissionCollectionType::iterator i = sub_map.begin(); sub_map.end() != i; i++) { -+ SubmissionSummary* summary = new SubmissionSummary; -+ SubmissionObject *submission = (*i).second; -+ -+ if (submission) { -+ SubmissionID* sid = new SubmissionID; -+ sid->setName(submission->getName()); -+ sid->setOwner(submission->getOwner()); -+ summary->setId(sid); -+ summary->setCompleted(submission->getCompleted().size()); -+ summary->setHeld(submission->getHeld().size()); -+ summary->setIdle(submission->getIdle().size()); -+ summary->setRemoved(submission->getRemoved().size()); -+ summary->setRunning(submission->getRunning().size()); -+ Status* ss = new Status; -+ ss->setCode(new StatusCodeType("OK")); -+ summary->setStatus(ss); -+ -+ if (!_getSubmissionSummary->isIncludeJobSummariesNil() && _getSubmissionSummary->getIncludeJobSummaries()) { -+ // client wants the job summaries also -+ JobSummaryPairCollection jobs; -+ submission->getJobSummaries(jobs); -+ for (JobSummaryPairCollection::const_iterator it = jobs.begin(); jobs.end() != it; it++) { -+ JobSummary* js = new JobSummary; -+ createGoodJobResponse(*js,(*it).first); -+ mapFieldsToSummary(*((*it).second),js); -+ summary->addJobs(js); -+ } -+ } -+ -+ } -+ else { -+ SubmissionID* sid = new SubmissionID; -+ summary->setId(sid); -+ StatusCodeType* sst = new StatusCodeType; -+ sst->setStatusCodeType("NO_MATCH"); -+ Status* ss = new Status(sst,"Unable to locate submission"); -+ summary->setStatus(ss); -+ } -+ submissions->push_back(summary); -+ } -+ -+ getSummaryResponse->setSubmissions(submissions); -+ -+ return getSummaryResponse; -+} -+ -+GetJobStatusResponse* AviaryQueryServiceSkeleton::getJobStatus(wso2wsf::MessageContext* /*outCtx*/ -+ ,GetJobStatus* _getJobStatus) -+{ -+ GetJobStatusResponse* jobStatusResponse = new GetJobStatusResponse; -+ JobServerObject* jso = JobServerObject::getInstance(); -+ JobStatusCollection* job_results = new JobStatusCollection; -+ -+ IdCollection id_set; -+ -+ if (_getJobStatus->isIdsNil() || _getJobStatus->getIds()->size() == 0) { -+ // no ids supplied...they get them all -+ for (JobCollectionType::iterator i = g_jobs.begin(); g_jobs.end() != i; i++) { -+ const char* job_id = (*i).first; -+ if (IS_JOB(job_id)) { -+ id_set.insert(job_id); -+ } -+ } -+ } -+ else { -+ // fast track...client has supplied ids to scan -+ JobIdCollection* id_list = _getJobStatus->getIds(); -+ for (JobIdCollection::iterator i = id_list->begin(); id_list->end() != i; i++) { -+ id_set.insert((*i)->getJob().c_str()); -+ } -+ } -+ -+ for (IdCollection::const_iterator i = id_set.begin(); id_set.end() != i; i++) { -+ JobStatus* js = new JobStatus; -+ const char* job = *i; -+ AviaryStatus status; -+ int job_status = JOB_STATUS_MIN; -+ if (jso->getStatus(job,job_status,status)) { -+ createGoodJobResponse(*js,job); -+ JobStatusType* jst = new JobStatusType; -+ jst->setJobStatusType(getJobStatusString(job_status)); -+ js->setJob_status(jst); -+ } -+ else { -+ // problem...report to client -+ createBadJobResponse(*js,job,status); -+ } -+ job_results->push_back(js); -+ } -+ -+ jobStatusResponse->setJobs(job_results); -+ -+ return jobStatusResponse; -+} -+ -+GetJobSummaryResponse* AviaryQueryServiceSkeleton::getJobSummary(wso2wsf::MessageContext *outCtx ,AviaryQuery::GetJobSummary* _getJobSummary) -+{ -+ GetJobSummaryResponse* jobSummaryResponse = new GetJobSummaryResponse; -+ JobServerObject* jso = JobServerObject::getInstance(); -+ JobSummaryCollection* job_results = new JobSummaryCollection; -+ -+ IdCollection id_set; -+ -+ if (_getJobSummary->isIdsNil() || _getJobSummary->getIds()->size() == 0) { -+ // no ids supplied...they get them all -+ for (JobCollectionType::iterator i = g_jobs.begin(); g_jobs.end() != i; i++) { -+ const char* job_id = (*i).first; -+ if (IS_JOB(job_id)) { -+ id_set.insert(job_id); -+ } -+ } -+ } -+ else { -+ // fast track...client has supplied ids to scan -+ JobIdCollection* id_list = _getJobSummary->getIds(); -+ for (JobIdCollection::iterator i = id_list->begin(); id_list->end() != i; i++) { -+ id_set.insert((*i)->getJob().c_str()); -+ } -+ } -+ -+ for (IdCollection::const_iterator i = id_set.begin(); id_set.end() != i; i++) { -+ JobSummary* js = new JobSummary; -+ const char* job = *i; -+ JobSummaryFields jsf; -+ AviaryStatus status; -+ if (jso->getSummary(job,jsf,status)) { -+ createGoodJobResponse(*js,job); -+ mapFieldsToSummary(jsf,js); -+ } -+ else { -+ // problem...report to client -+ createBadJobResponse(*js, job, status); -+ } -+ job_results->push_back(js); -+ } -+ -+ jobSummaryResponse->setJobs(job_results); -+ -+ return jobSummaryResponse; -+} -+ -+GetJobDetailsResponse* AviaryQueryServiceSkeleton::getJobDetails(wso2wsf::MessageContext* /* outCtx*/ -+ ,GetJobDetails* _getJobDetails) -+{ -+ GetJobDetailsResponse* jobDetailsResponse = new GetJobDetailsResponse; -+ JobServerObject* jso = JobServerObject::getInstance(); -+ JobDetailsCollection* job_results = new JobDetailsCollection; -+ -+ IdCollection id_set; -+ -+ if (_getJobDetails->isIdsNil() || _getJobDetails->getIds()->size() == 0) { -+ // no ids supplied...they get them all -+ for (JobCollectionType::iterator i = g_jobs.begin(); g_jobs.end() != i; i++) { -+ const char* job_id = (*i).first; -+ if (IS_JOB(job_id)) { -+ id_set.insert(job_id); -+ } -+ } -+ } -+ else { -+ // fast track...client has supplied ids to scan -+ JobIdCollection* id_list = _getJobDetails->getIds(); -+ for (JobIdCollection::iterator i = id_list->begin(); id_list->end() != i; i++) { -+ id_set.insert((*i)->getJob().c_str()); -+ } -+ } -+ -+ for (IdCollection::const_iterator i = id_set.begin(); id_set.end() != i; i++) { -+ JobDetails* jd = new JobDetails; -+ const char* job = *i; -+ aviary::codec::AttributeMapType attr_map; -+ AviaryStatus status; -+ if (jso->getJobAd(job,attr_map,status)) { -+ createGoodJobResponse(*jd,job); -+ // load attributes -+ AviaryCommon::Attributes* attrs = new AviaryCommon::Attributes; -+ mapToXsdAttributes(attr_map,attrs); -+ jd->setDetails(attrs); -+ } -+ else { -+ // problem...report to client -+ createBadJobResponse(*jd, job, status); -+ } -+ job_results->push_back(jd); -+ -+ for (aviary::codec::AttributeMapType::iterator i = attr_map.begin();attr_map.end() != i; i++) { -+ delete (*i).second; -+ } -+ } -+ -+ jobDetailsResponse->setJobs(job_results); -+ -+ return jobDetailsResponse; -+} -+ -+// NOTE: getJobData is the rare case (?) where someone wants to pull the job output -+// thus, we don't batch this - just one at a time -+GetJobDataResponse* AviaryQueryServiceSkeleton::getJobData(wso2wsf::MessageContext* /* outCtx */ -+ ,GetJobData* _getJobData) -+{ -+ GetJobDataResponse* jobDataResponse = new GetJobDataResponse; -+ JobServerObject* jso = JobServerObject::getInstance(); -+ -+ const char* job = _getJobData->getData()->getId()->getJob().c_str(); -+ ADBJobDataTypeEnum file_type = _getJobData->getData()->getType()->getJobDataTypeEnum(); -+ JobDataType* jdt = new JobDataType(_getJobData->getData()->getType()->getJobDataType()); -+ AviaryStatus status; -+ status.type = AviaryStatus::FAIL; -+ string fname, content; -+ int fsize; -+ if (jso->fetchJobData(job,UserFileType(file_type),fname,_getJobData->getMax_bytes(),_getJobData->getFrom_end(),fsize,content,status)) { -+ JobID* jid = new JobID; -+ jid->setJob(job); -+ jid->setPool(jso->getPool()); -+ jid->setScheduler(jso->getName()); -+ JobData* jd = new JobData; -+ jd->setId(jid); -+ jd->setType(jdt); -+ jobDataResponse->setData(jd); -+ Status* js = new Status; -+ js->setCode(new StatusCodeType("OK")); -+ jobDataResponse->setStatus(js); -+ -+ // load requested file data -+ jobDataResponse->setContent(content); -+ jobDataResponse->setFile_name(fname); -+ jobDataResponse->setFile_size(fsize); -+ } -+ else { -+ // problem...report to client -+ JobID* jid = new JobID; -+ jid->setJob(job); -+ JobData* jd = new JobData; -+ jd->setId(jid); -+ jd->setType(jdt); -+ jobDataResponse->setData(jd); -+ StatusCodeType* jst = new StatusCodeType; -+ jst->setStatusCodeTypeEnum(ADBStatusCodeTypeEnum(status.type)); -+ Status* js = new Status(jst,status.text); -+ jobDataResponse->setStatus(js); -+ } -+ -+ return jobDataResponse; -+} -+ -diff --git a/src/condor_contrib/aviary/src/AviaryQueryServiceSkeleton.h b/src/condor_contrib/aviary/src/AviaryQueryServiceSkeleton.h -new file mode 100644 -index 0000000..e400201 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryQueryServiceSkeleton.h -@@ -0,0 +1,177 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef AVIARYQUERYSERVICESKELETON_H -+#define AVIARYQUERYSERVICESKELETON_H -+ -+ #include -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ #include -+ -+ -+namespace AviaryQuery { -+ -+ -+ /** we have to reserve some error codes for adb and for custom messages */ -+ #define AVIARYQUERYSERVICESKELETON_ERROR_CODES_START (AXIS2_ERROR_LAST + 2500) -+ -+ typedef enum -+ { -+ AVIARYQUERYSERVICESKELETON_ERROR_NONE = AVIARYQUERYSERVICESKELETON_ERROR_CODES_START, -+ -+ AVIARYQUERYSERVICESKELETON_ERROR_LAST -+ } AviaryQueryServiceSkeleton_error_codes; -+ -+ -+ -+ -+class AviaryQueryServiceSkeleton -+{ -+ public: -+ AviaryQueryServiceSkeleton(){} -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "getJobData|http://grid.redhat.com/aviary-query/" operation. -+ * -+ * @param _getJobData of the AviaryQuery::GetJobData -+ * -+ * @return AviaryQuery::GetJobDataResponse* -+ */ -+ -+ -+ virtual -+ AviaryQuery::GetJobDataResponse* getJobData(wso2wsf::MessageContext *outCtx ,AviaryQuery::GetJobData* _getJobData); -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "getJobStatus|http://grid.redhat.com/aviary-query/" operation. -+ * -+ * @param _getJobStatus of the AviaryQuery::GetJobStatus -+ * -+ * @return AviaryQuery::GetJobStatusResponse* -+ */ -+ -+ -+ virtual -+ AviaryQuery::GetJobStatusResponse* getJobStatus(wso2wsf::MessageContext *outCtx ,AviaryQuery::GetJobStatus* _getJobStatus); -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "getSubmissionSummary|http://grid.redhat.com/aviary-query/" operation. -+ * -+ * @param _getSubmissionSummary of the AviaryQuery::GetSubmissionSummary -+ * -+ * @return AviaryQuery::GetSubmissionSummaryResponse* -+ */ -+ -+ -+ virtual -+ AviaryQuery::GetSubmissionSummaryResponse* getSubmissionSummary(wso2wsf::MessageContext *outCtx ,AviaryQuery::GetSubmissionSummary* _getSubmissionSummary); -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "getJobDetails|http://grid.redhat.com/aviary-query/" operation. -+ * -+ * @param _getJobDetails of the AviaryQuery::GetJobDetails -+ * -+ * @return AviaryQuery::GetJobDetailsResponse* -+ */ -+ -+ -+ virtual -+ AviaryQuery::GetJobDetailsResponse* getJobDetails(wso2wsf::MessageContext *outCtx ,AviaryQuery::GetJobDetails* _getJobDetails); -+ -+ -+ /** -+ * Auto generated method declaration -+ * for "getJobSummary|http://grid.redhat.com/aviary-query/" operation. -+ * -+ * @param _getJobSummary of the AviaryQuery::GetJobSummary -+ * -+ * @return AviaryQuery::GetJobSummaryResponse* -+ */ -+ -+ -+ virtual -+ AviaryQuery::GetJobSummaryResponse* getJobSummary(wso2wsf::MessageContext *outCtx ,AviaryQuery::GetJobSummary* _getJobSummary); -+ -+ -+}; -+ -+ -+} -+ -+ -+ -+ -+#endif // AVIARYQUERYSERVICESKELETON_H -+ -+ -diff --git a/src/condor_contrib/aviary/src/AviaryScheddPlugin.cpp b/src/condor_contrib/aviary/src/AviaryScheddPlugin.cpp -new file mode 100644 -index 0000000..ec1ceaf ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryScheddPlugin.cpp -@@ -0,0 +1,366 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_qmgr.h" -+#include "condor_config.h" -+ -+// local includes -+#include "AviaryScheddPlugin.h" -+#include "Axis2SoapProvider.h" -+#include "SchedulerObject.h" -+ -+// Global from the condor_schedd, it's name -+extern char * Name; -+ -+// Any key that begins with the '0' char is either the -+// header or a cluster, i.e. not a job -+#define IS_JOB(key) ((key) && '0' != (key)[0]) -+ -+using namespace std; -+using namespace aviary::job; -+using namespace aviary::soap; -+ -+// global SchedulerObject -+// TODO: convert to singleton -+Axis2SoapProvider* provider = NULL; -+SchedulerObject* schedulerObj = NULL; -+ -+void -+AviaryScheddPlugin::earlyInitialize() -+{ -+ -+ // Since this plugin is registered with multiple -+ // PluginManagers it may be initialized more than once, -+ // and we don't want that -+ static bool skip = false; -+ if (skip) return; skip = true; -+ -+ // config then env for our all-important axis2 repo dir -+ const char* log_file = "./aviary_job.axis2.log"; -+ string repo_path; -+ char *tmp = NULL; -+ if (tmp = param("WSFCPP_HOME")) { -+ repo_path = tmp; -+ free(tmp); -+ } -+ else if (tmp = getenv("WSFCPP_HOME")) { -+ repo_path = tmp; -+ } -+ else { -+ EXCEPT("No WSFCPP_HOME in config or env"); -+ } -+ -+ int port = param_integer("HTTP_PORT",9090); -+ int level = param_integer("AXIS2_DEBUG_LEVEL",AXIS2_LOG_LEVEL_CRITICAL); -+ -+ // init transport here -+ provider = new Axis2SoapProvider(level,log_file,repo_path.c_str()); -+ string axis_error; -+ if (!provider->init(port,AXIS2_HTTP_DEFAULT_SO_TIMEOUT,axis_error)) { -+ dprintf(D_ALWAYS, "%s\n",axis_error.c_str()); -+ EXCEPT("Failed to initialize Axis2SoapProvider"); -+ } -+ -+ schedulerObj = SchedulerObject::getInstance(); -+ -+ dirtyJobs = new DirtyJobsType(); -+ -+ isHandlerRegistered = false; -+ -+ ReliSock *sock = new ReliSock; -+ if (!sock) { -+ EXCEPT("Failed to allocate transport socket"); -+ } -+ if (!sock->assign(provider->getHttpListenerSocket())) { -+ EXCEPT("Failed to bind transport socket"); -+ } -+ int index; -+ if (-1 == (index = -+ daemonCore->Register_Socket((Stream *) sock, -+ "Aviary Method Socket", -+ (SocketHandlercpp) ( &AviaryScheddPlugin::HandleTransportSocket ), -+ "Handler for Aviary Methods.", -+ this))) { -+ EXCEPT("Failed to register transport socket"); -+ } -+ -+ dprintf(D_ALWAYS,"Axis2 listener on http port: %d\n",port); -+ -+ m_initialized = false; -+} -+ -+void -+AviaryScheddPlugin::initialize() -+{ -+ // Since this plugin is registered with multiple -+ // PluginManagers it may be initialized more than once, -+ // and we don't want that -+ static bool skip = false; -+ if (skip) return; skip = true; -+ -+ // WalkJobQueue(int (*func)(ClassAd *)) -+ ClassAd *ad = GetNextJob(1); -+ while (ad != NULL) { -+ MyString key; -+ PROC_ID id; -+ int value; -+ -+ if (!ad->LookupInteger(ATTR_CLUSTER_ID, id.cluster)) { -+ EXCEPT("%s on job is missing or not an integer", ATTR_CLUSTER_ID); -+ } -+ if (!ad->LookupInteger(ATTR_PROC_ID, id.proc)) { -+ EXCEPT("%s on job is missing or not an integer", ATTR_PROC_ID); -+ } -+ if (!ad->LookupInteger(ATTR_JOB_STATUS, value)) { -+ EXCEPT("%s on job is missing or not an integer", ATTR_JOB_STATUS); -+ } -+ -+ key.sprintf("%d.%d", id.cluster, id.proc); -+ -+ processJob(key.Value(), ATTR_JOB_STATUS, value); -+ -+ FreeJobAd(ad); -+ ad = GetNextJob(0); -+ } -+ -+ m_initialized = true; -+} -+ -+ -+void -+AviaryScheddPlugin::shutdown() -+{ -+ // Since this plugin is registered with multiple -+ // PluginManagers (eg, shadow) it may be shutdown -+ // more than once, and we don't want that -+ static bool skip = false; -+ if (skip) return; skip = true; -+ -+ dprintf(D_FULLDEBUG, "AviaryScheddPlugin: shutting down...\n"); -+ -+ if (schedulerObj) { -+ delete schedulerObj; -+ schedulerObj = NULL; -+ } -+} -+ -+ -+void -+AviaryScheddPlugin::update(int cmd, const ClassAd *ad) -+{ -+ MyString hashKey; -+ -+ switch (cmd) { -+ case UPDATE_SCHEDD_AD: -+ dprintf(D_FULLDEBUG, "Received UPDATE_SCHEDD_AD\n"); -+ schedulerObj->update(*ad); -+ break; -+ default: -+ dprintf(D_FULLDEBUG, "Unsupported command: %s\n", -+ getCollectorCommandString(cmd)); -+ } -+} -+ -+ -+void -+AviaryScheddPlugin::archive(const ClassAd */*ad*/) { }; -+ -+ -+void -+AviaryScheddPlugin::newClassAd(const char */*key*/) { }; -+ -+ -+void -+AviaryScheddPlugin::setAttribute(const char *key, -+ const char *name, -+ const char *value) -+{ -+ if (!m_initialized) return; -+ -+// dprintf(D_FULLDEBUG, "setAttribute: %s[%s] = %s\n", key, name, value); -+ -+ markDirty(key, name, value); -+} -+ -+ -+void -+AviaryScheddPlugin::destroyClassAd(const char *_key) -+{ -+ if (!m_initialized) return; -+ -+// dprintf(D_FULLDEBUG, "destroyClassAd: %s\n", key); -+ -+ if (!IS_JOB(_key)) return; -+ -+ // If we wait to process the deletion the job ad will be gone -+ // and we won't be able to lookup the Submission. So, we must -+ // process the job immediately, but that also means we need to -+ // process all pending changes for the job as well. -+ DirtyJobsType::iterator entry = dirtyJobs->begin(); -+ while (dirtyJobs->end() != entry) { -+ string key = (*entry).first; -+ string name = (*entry).second.first; -+ int value = (*entry).second.second; -+ -+ if (key == _key) { -+ processJob(key.c_str(), name.c_str(), value); -+ -+ // No need to process this entry again later -+ entry = dirtyJobs->erase(entry); -+ } else { -+ entry++; -+ } -+ } -+} -+ -+ -+void -+AviaryScheddPlugin::deleteAttribute(const char */*key*/, -+ const char */*name*/) { } -+ -+int -+AviaryScheddPlugin::HandleTransportSocket(Stream *) -+{ -+ // TODO: respond to a transport callback here? -+ string provider_error; -+ if (!provider->processHttpRequest(provider_error)) { -+ dprintf (D_ALWAYS,"Error processing request: %s\n",provider_error.c_str()); -+ } -+ -+ return KEEP_STREAM; -+} -+ -+void -+AviaryScheddPlugin::processDirtyJobs() -+{ -+ BeginTransaction(); -+ -+ while (!dirtyJobs->empty()) { -+ DirtyJobEntry entry = dirtyJobs->front(); dirtyJobs->pop_front(); -+ string key = entry.first; -+ string name = entry.second.first; -+ int value = entry.second.second; -+ -+ processJob(key.c_str(), name.c_str(), value); -+ } -+ -+ CommitTransaction(); -+ -+ isHandlerRegistered = false; -+} -+ -+ -+bool -+AviaryScheddPlugin::processJob(const char *key, -+ const char *name, -+ int value) -+{ -+ PROC_ID id; -+ ClassAd *jobAd; -+ -+ // Skip any key that doesn't point to an actual job -+ if (!IS_JOB(key)) return false; -+ -+// dprintf(D_FULLDEBUG, "Processing: %s\n", key); -+ -+ id = getProcByString(key); -+ if (id.cluster < 0 || id.proc < 0) { -+ dprintf(D_FULLDEBUG, "Failed to parse key: %s - skipping\n", key); -+ return false; -+ } -+ -+ // Lookup the job ad assocaited with the key. If it is not -+ // present, skip the key -+ if (NULL == (jobAd = ::GetJobAd(id.cluster, id.proc, false))) { -+ dprintf(D_ALWAYS, -+ "NOTICE: Failed to lookup ad for %s - maybe deleted\n", -+ key); -+ return false; -+ } -+ -+ // Store two pieces of information in the Job, 1. the -+ // Submission's name, 2. the Submission's id -+ // -+ // Submissions indexed on their name, the id is present -+ // for reconstruction of the Submission -+ -+ // XXX: Use the jobAd instead of GetAttribute below, gets us $$() expansion -+ -+ MyString submissionName; -+ if (GetAttributeString(id.cluster, id.proc, -+ ATTR_JOB_SUBMISSION, -+ submissionName) < 0) { -+ // Provide a default name for the Submission -+ -+ // If we are a DAG node, we default to our DAG group -+ PROC_ID dagman; -+ if (GetAttributeInt(id.cluster, id.proc, -+ ATTR_DAGMAN_JOB_ID, -+ &dagman.cluster) >= 0) { -+ dagman.proc = 0; -+ -+ if (GetAttributeString(dagman.cluster, dagman.proc, -+ ATTR_JOB_SUBMISSION, -+ submissionName) < 0) { -+ // This can only happen if the DAGMan job was -+ // removed, and we remained, which should not -+ // happen, but could. In such a case we are -+ // orphaned, and we'll make a guess. We'll be -+ // wrong if the DAGMan job didn't use the -+ // default, but it is better to be wrong than -+ // to fail entirely, which is the alternative. -+ submissionName.sprintf("%s#%d", Name, dagman.cluster); -+ } -+ } else { -+ submissionName.sprintf("%s#%d", Name, id.cluster); -+ } -+ -+ MyString tmp; -+ tmp += "\""; -+ tmp += submissionName; -+ tmp += "\""; -+ SetAttribute(id.cluster, id.proc, -+ ATTR_JOB_SUBMISSION, -+ tmp.Value()); -+ } -+} -+ -+void -+AviaryScheddPlugin::markDirty(const char *key, -+ const char *name, -+ const char *value) -+{ -+ if (!IS_JOB(key)) return; -+ if (!(strcasecmp(name, ATTR_JOB_STATUS) == 0 || -+ strcasecmp(name, ATTR_LAST_JOB_STATUS) == 0)) return; -+ -+ DirtyJobStatus status(name, atoi(value)); -+ DirtyJobEntry entry(key, status); -+ dirtyJobs->push_back(DirtyJobEntry(key, DirtyJobStatus(name, atoi(value)))); -+ -+ if (!isHandlerRegistered) { -+ // To test destroyClassAd, set the timeout here to a few -+ // seconds, submit a job and immediately delete it. -+ daemonCore->Register_Timer(0, -+ (TimerHandlercpp) -+ &AviaryScheddPlugin::processDirtyJobs, -+ "Process Dirty", -+ this); -+ isHandlerRegistered = true; -+ } -+} -diff --git a/src/condor_contrib/aviary/src/AviaryScheddPlugin.h b/src/condor_contrib/aviary/src/AviaryScheddPlugin.h -new file mode 100644 -index 0000000..ad247ac ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryScheddPlugin.h -@@ -0,0 +1,93 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef _AVIARYSCHEDDPLUGIN_H -+#define _AVIARYSCHEDDPLUGIN_H -+ -+// c++ includes -+#include -+#include -+ -+// condor includes -+#include "condor_qmgr.h" -+#include "../condor_schedd.V6/ScheddPlugin.h" -+#include "ClassAdLogPlugin.h" -+#include "../condor_daemon_core.V6/condor_daemon_core.h" -+ -+// local includes -+#include "SchedulerObject.h" -+#include "PROC_ID_comparator.h" -+ -+ -+namespace aviary { -+namespace job { -+ -+// BIG NOTE: If Service is not first in the parent list the -+// processDirtyJobs handler will segfault when using the -+// dirtyJobs list -+class AviaryScheddPlugin : public Service, ClassAdLogPlugin, ScheddPlugin -+{ -+ -+public: -+ -+ void earlyInitialize(); -+ -+ void initialize(); -+ -+ void shutdown(); -+ -+ void update(int cmd, const ClassAd *ad); -+ -+ void archive(const ClassAd *ad); -+ -+ void newClassAd(const char */*key*/); -+ -+ void setAttribute(const char *key, -+ const char *name, -+ const char *value); -+ -+ void destroyClassAd(const char *key); -+ -+ void deleteAttribute(const char *key, -+ const char *name); -+ -+private: -+ -+ typedef std::pair DirtyJobStatus; -+ typedef std::pair DirtyJobEntry; -+ typedef std::list DirtyJobsType; -+ DirtyJobsType *dirtyJobs; -+ -+ -+ bool isHandlerRegistered; -+ -+ bool m_initialized; -+ -+ bool m_isPublishing; -+ -+ int HandleTransportSocket(Stream *); -+ -+ void processDirtyJobs(); -+ -+ bool processJob(const char *key, const char *name, int value); -+ -+ void markDirty(const char *key, const char *name, const char *value); -+ -+}; -+ -+}} /* aviary::job */ -+ -+#endif /* _AVIARYSCHEDDPLUGIN_H */ -diff --git a/src/condor_contrib/aviary/src/AviaryScheddPluginInstantiation.cpp b/src/condor_contrib/aviary/src/AviaryScheddPluginInstantiation.cpp -new file mode 100644 -index 0000000..71c40c6 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryScheddPluginInstantiation.cpp -@@ -0,0 +1,35 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#include "condor_common.h" -+ -+#include "AviaryScheddPlugin.h" -+ -+using namespace aviary::job; -+ -+AviaryScheddPlugin *scheddPluginInstance; -+ -+#ifndef WIN32 -+ -+void -+__attribute__ ((constructor)) -+init(void) -+{ -+ scheddPluginInstance = new AviaryScheddPlugin(); -+} -+ -+#endif -+ -diff --git a/src/condor_contrib/aviary/src/AviaryUtils.cpp b/src/condor_contrib/aviary/src/AviaryUtils.cpp -new file mode 100644 -index 0000000..61e0693 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryUtils.cpp -@@ -0,0 +1,130 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_config.h" -+#include "condor_classad.h" -+#include "condor_debug.h" -+#include "compat_classad_util.h" -+#include "condor_qmgr.h" -+#include "get_daemon_name.h" -+ -+// c++ includes -+#include -+ -+// local includes -+#include "AviaryUtils.h" -+ -+using namespace std; -+using namespace compat_classad; -+ -+string -+aviary::util::getPoolName() -+{ -+ string poolName; -+ char *tmp = NULL; -+ -+ tmp = param("COLLECTOR_HOST"); -+ if (!tmp) { -+ tmp = strdup("NO COLLECTOR_HOST, NOT GOOD"); -+ } -+ poolName = tmp; -+ free(tmp); tmp = NULL; -+ -+ return poolName; -+} -+ -+string -+aviary::util::getScheddName() { -+ string scheddName; -+ char* tmp = NULL; -+ -+ tmp = param("SCHEDD_NAME"); -+ if (!tmp) { -+ scheddName = default_daemon_name(); -+ } else { -+ scheddName = build_valid_daemon_name(tmp); -+ free(tmp); tmp = NULL; -+ } -+ -+ return scheddName; -+} -+ -+// cleans up the quoted values from the job log reader -+string aviary::util::trimQuotes(const char* str) { -+ string val = str; -+ -+ size_t endpos = val.find_last_not_of("\\\""); -+ if( string::npos != endpos ) { -+ val = val.substr( 0, endpos+1 ); -+ } -+ size_t startpos = val.find_first_not_of("\\\""); -+ if( string::npos != startpos ) { -+ val = val.substr( startpos ); -+ } -+ -+ return val; -+} -+ -+// validate that an incoming group/user name is -+// alphanumeric, underscores, or a dot separator -+bool aviary::util::isValidGroupUserName(const string& _name, string& _text) { -+ const char* ptr = _name.c_str(); -+ while( *ptr ) { -+ char c = *ptr++; -+ if ( ('a' > c || c > 'z') && -+ ('A' > c || c > 'Z') && -+ ('0' > c || c > '9') && -+ (c != '_' ) && -+ (c != '.' ) ) { -+ _text = "Invalid name for group/user - alphanumeric, underscore and dot characters only"; -+ return false; -+ } -+ } -+ return true; -+} -+ -+// validate that an incoming attribute name is -+// alphanumeric, or underscores -+bool aviary::util::isValidAttributeName(const string& _name, string& _text) { -+ const char* ptr = _name.c_str(); -+ while( *ptr ) { -+ char c = *ptr++; -+ if ( ('a' > c || c > 'z') && -+ ('A' > c || c > 'Z') && -+ ('0' > c || c > '9') && -+ (c != '_' ) ) { -+ _text = "Invalid name for attribute - alphanumeric and underscore characters only"; -+ return false; -+ } -+ } -+ return true; -+} -+ -+bool aviary::util::checkRequiredAttrs(compat_classad::ClassAd& ad, const char* attrs[], string& missing) { -+ bool status = true; -+ int i = 0; -+ -+ while (NULL != attrs[i]) { -+ if (!ad.Lookup(attrs[i])) { -+ missing += " "; missing += attrs[i]; -+ status = false; -+ } -+ i++; -+ } -+ return status; -+} -diff --git a/src/condor_contrib/aviary/src/AviaryUtils.h b/src/condor_contrib/aviary/src/AviaryUtils.h -new file mode 100644 -index 0000000..b13314d ---- /dev/null -+++ b/src/condor_contrib/aviary/src/AviaryUtils.h -@@ -0,0 +1,43 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef _AVIARYUTILS_H -+#define _AVIARYUTILS_H -+ -+// condor includes -+#include "condor_classad.h" -+ -+using namespace std; -+using namespace compat_classad; -+ -+namespace aviary { -+namespace util { -+ -+string getPoolName(); -+ -+string getScheddName(); -+ -+string trimQuotes(const char* value); -+ -+bool isValidGroupUserName(const string& _name, string& _text); -+ -+bool isValidAttributeName(const string& _name, string& _text); -+ -+bool checkRequiredAttrs(ClassAd& ad, const char* attrs[], string& missing); -+ -+}} -+ -+#endif /* _AVIARYUTILS_H */ -diff --git a/src/condor_contrib/aviary/src/Axis2SoapProvider.cpp b/src/condor_contrib/aviary/src/Axis2SoapProvider.cpp -new file mode 100644 -index 0000000..22749b1 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/Axis2SoapProvider.cpp -@@ -0,0 +1,329 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#include -+#include -+#include -+#include -+#include -+#include "Axis2SoapProvider.h" -+ -+// NOTE: these types are not in the public -+// Axis2/C API via headers but we need them; -+// review if there is a newer rev after 1.6 -+ -+// lifted out from http_receiver.c -+typedef struct -+{ -+ axis2_transport_receiver_t http_server; -+ axis2_http_svr_thread_t *svr_thread; -+ int port; -+ axis2_conf_ctx_t *conf_ctx; -+ axis2_conf_ctx_t *conf_ctx_private; -+} axis2_http_server_impl_t; -+ -+#define AXIS2_INTF_TO_IMPL(http_server) \ -+ ((axis2_http_server_impl_t *)(http_server)) -+ -+// lifted out from http_svr_thread.c -+struct axis2_http_svr_thread -+{ -+ int listen_socket; -+ axis2_bool_t stopped; -+ axis2_http_worker_t *worker; -+ int port; -+}; -+ -+typedef struct axis2_http_svr_thd_args -+{ -+ axutil_env_t *env; -+ axis2_socket_t socket; -+ axis2_http_worker_t *worker; -+ axutil_thread_t *thread; -+} axis2_http_svr_thd_args_t; -+ -+using namespace aviary::soap; -+ -+Axis2SoapProvider::Axis2SoapProvider(int _log_level, const char* _log_file, const char* _repo_path) -+{ -+ if (_log_file) { -+ m_log_file = _log_file; -+ } -+ if (_repo_path) { -+ m_repo_path = _repo_path; -+ } -+ m_log_level = axutil_log_levels_t(_log_level); -+ m_env = NULL; -+ m_http_server = NULL; -+ m_svr_thread = NULL; -+ m_initialized = false; -+ m_http_socket_read_timeout = AXIS2_HTTP_DEFAULT_SO_TIMEOUT; -+} -+ -+Axis2SoapProvider::~Axis2SoapProvider() -+{ -+ if (m_http_server) { -+ axis2_transport_receiver_free(m_http_server, m_env); -+ } -+ -+ if (m_env) { -+ axutil_env_free(m_env); -+ } -+ -+ axiom_xml_reader_cleanup(); -+ -+} -+ -+bool -+Axis2SoapProvider::init(int _port, int _read_timeout, std::string& _error) -+{ -+ if (m_log_file.empty() || m_repo_path.empty()) { -+ _error = "Log file or repo path is NULL"; -+ return false; -+ } -+ -+ if (!m_initialized) { -+ axutil_allocator_t* allocator = axutil_allocator_init(NULL); -+ axutil_error_t *error = axutil_error_create(allocator); -+ axutil_log_t *log = axutil_log_create(allocator, NULL, m_log_file.c_str()); -+ -+ // TODO: not sure we need a TP but don't wanted to get tripped up by a NP -+ // deeper in the stack -+ axutil_thread_pool_t *thread_pool = axutil_thread_pool_init(allocator); -+ axiom_xml_reader_init(); -+ m_env = axutil_env_create(allocator); -+ axutil_error_init(); -+ -+ m_env = axutil_env_create_with_error_log_thread_pool(allocator, error, log, thread_pool); -+ m_env->log->level = m_log_level; -+ -+ axis2_status_t status = axutil_file_handler_access(m_repo_path.c_str(), AXIS2_R_OK); -+ -+ if (status != AXIS2_SUCCESS) { -+ _error = m_repo_path; -+ _error += " does not exist or insufficient permissions"; -+ AXIS2_LOG_ERROR(m_env->log, AXIS2_LOG_SI,_error.c_str()); -+ return m_initialized; -+ } -+ -+ m_http_server = axis2_http_server_create_with_file(m_env, m_repo_path.c_str(), _port); -+ if (!m_http_server) { -+ _error = AXIS2_ERROR_GET_MESSAGE(m_env->error); -+ AXIS2_LOG_ERROR(m_env->log, AXIS2_LOG_SI, "HTTP server create failed: %d: %s", -+ m_env->error->error_number,_error.c_str()); -+ return m_initialized; -+ } -+ -+ m_svr_thread = createHttpReceiver(m_env,m_http_server,_error); -+ if (!m_svr_thread) { -+ _error = AXIS2_ERROR_GET_MESSAGE(m_env->error); -+ AXIS2_LOG_ERROR(m_env->log, AXIS2_LOG_SI, "HTTP receiver create failed: %d: %s", -+ m_env->error->error_number,_error.c_str()); -+ return m_initialized; -+ } -+ -+ m_initialized = true; -+ } -+ -+ return m_initialized; -+ -+} -+ -+axis2_http_svr_thread_t* -+Axis2SoapProvider::createHttpReceiver(axutil_env_t* _env, axis2_transport_receiver_t* _server, std::string& _error) -+{ -+ -+ axis2_http_server_impl_t *server_impl = NULL; -+ axis2_http_worker_t *worker = NULL; -+ -+ server_impl = AXIS2_INTF_TO_IMPL(_server); -+ server_impl->svr_thread = axis2_http_svr_thread_create(_env, server_impl->port); -+ -+ // shouldn't bother checking this for ST but we'll play along -+ if(!server_impl->svr_thread) { -+ AXIS2_LOG_ERROR(_env->log, AXIS2_LOG_SI, "unable to create server thread for port %d", -+ server_impl->port); -+ return NULL; -+ } -+ -+ worker = axis2_http_worker_create(_env, server_impl->conf_ctx); -+ if(!worker) { -+ AXIS2_LOG_ERROR(_env->log, AXIS2_LOG_SI, "axis2 http worker creation failed"); -+ axis2_http_svr_thread_free(server_impl->svr_thread, _env); -+ server_impl->svr_thread = NULL; -+ return NULL; -+ } -+ -+ axis2_http_worker_set_svr_port(worker, _env, server_impl->port); -+ axis2_http_svr_thread_set_worker(server_impl->svr_thread, _env, worker); -+ return server_impl->svr_thread; -+ -+} -+ -+SOCKET -+Axis2SoapProvider::getHttpListenerSocket() -+{ -+ SOCKET socket = INVALID_SOCKET; -+ if (m_svr_thread) { -+ socket = m_svr_thread->listen_socket; -+ } -+ return socket; -+} -+ -+bool -+Axis2SoapProvider::processHttpRequest(std::string& _error) -+{ -+ if (!m_initialized) { -+ _error = "Axis2SoapPovider has not been initialized yet"; -+ return false; -+ } -+ else { -+ -+ AXIS2_ENV_CHECK(m_env, AXIS2_FAILURE); -+ -+ int socket = INVALID_SOCKET; -+ axis2_http_svr_thd_args_t *arg_list = NULL; -+ -+ socket = (int)axutil_network_handler_svr_socket_accept(m_env, m_svr_thread->listen_socket); -+ if(!m_svr_thread->worker) -+ { -+ AXIS2_LOG_ERROR(m_env->log, AXIS2_LOG_SI, -+ "Worker not ready yet. Cannot serve the request"); -+ axutil_network_handler_close_socket(m_env, socket); -+ return false; -+ } -+ -+ arg_list = (axis2_http_svr_thd_args_t *)AXIS2_MALLOC(m_env->allocator, sizeof(axis2_http_svr_thd_args_t)); -+ if(!arg_list) -+ { -+ AXIS2_LOG_ERROR(m_env->log, AXIS2_LOG_SI, -+ "Memory allocation error in the svr thread loop"); -+ return false; -+ } -+ -+ arg_list->env = (axutil_env_t *)m_env; -+ arg_list->socket = socket; -+ arg_list->worker = m_svr_thread->worker; -+ -+ // single-threaded for DC -+ invokeHttpWorker(NULL, (void *)arg_list); -+ } -+ -+ return true; -+} -+ -+void *AXIS2_THREAD_FUNC -+Axis2SoapProvider::invokeHttpWorker( -+ axutil_thread_t * thd, -+ void *data) -+{ -+ struct AXIS2_PLATFORM_TIMEB t1, t2; -+ axis2_simple_http_svr_conn_t *svr_conn = NULL; -+ axis2_http_simple_request_t *request = NULL; -+ int millisecs = 0; -+ double secs = 0; -+ axis2_http_worker_t *tmp = NULL; -+ axis2_status_t status = AXIS2_FAILURE; -+ axutil_env_t *env = NULL; -+ axis2_socket_t socket; -+ axutil_env_t *thread_env = NULL; -+ axis2_http_svr_thd_args_t *arg_list = NULL; -+ -+#ifndef WIN32 -+#ifdef AXIS2_SVR_MULTI_THREADED -+ signal(SIGPIPE, SIG_IGN); -+#endif -+#endif -+ -+ if(!data) -+ { -+ return NULL; -+ } -+ arg_list = (axis2_http_svr_thd_args_t *)data; -+ -+ env = arg_list->env; -+ thread_env = axutil_init_thread_env(env); -+ -+ IF_AXIS2_LOG_DEBUG_ENABLED(env->log) -+ { -+ AXIS2_PLATFORM_GET_TIME_IN_MILLIS(&t1); -+ } -+ -+ socket = arg_list->socket; -+ svr_conn = axis2_simple_http_svr_conn_create(thread_env, (int)socket); -+ if(!svr_conn) -+ { -+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "creating simple_http_svr_connection failed"); -+ return NULL; -+ } -+ -+ axis2_simple_http_svr_conn_set_rcv_timeout(svr_conn, thread_env, m_http_socket_read_timeout); -+ -+ /* read HTTPMethod, URL, HTTP Version and http headers. Leave the remaining in the stream */ -+ request = axis2_simple_http_svr_conn_read_request(svr_conn, thread_env); -+ if(!request) -+ { -+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Could not create request"); -+ return NULL; -+ } -+ -+ tmp = arg_list->worker; -+ status = axis2_http_worker_process_request(tmp, thread_env, svr_conn, request); -+ axis2_simple_http_svr_conn_free(svr_conn, thread_env); -+ axis2_http_simple_request_free(request, thread_env); -+ -+ IF_AXIS2_LOG_DEBUG_ENABLED(env->log) -+ { -+ AXIS2_PLATFORM_GET_TIME_IN_MILLIS(&t2); -+ millisecs = t2.millitm - t1.millitm; -+ secs = difftime(t2.time, t1.time); -+ if(millisecs < 0) -+ { -+ millisecs += 1000; -+ secs--; -+ } -+ secs += millisecs / 1000.0; -+ -+#if defined(WIN32) -+ AXIS2_LOG_DEBUG(thread_env->log, AXIS2_LOG_SI, "Request processed..."); -+#else -+ AXIS2_LOG_DEBUG(thread_env->log, AXIS2_LOG_SI, "Request processed in %.3f seconds", secs); -+#endif -+ } -+ -+ if(status == AXIS2_SUCCESS) -+ { -+ AXIS2_LOG_DEBUG(thread_env->log, AXIS2_LOG_SI, "Request served successfully"); -+ } -+ else -+ { -+ AXIS2_LOG_WARNING(thread_env->log, AXIS2_LOG_SI, "Error occurred in processing request "); -+ } -+ -+ // just ST here -+ AXIS2_FREE(thread_env->allocator, arg_list); -+ axutil_free_thread_env(thread_env); -+ thread_env = NULL; -+ -+ return NULL; -+} -+ -+// TODO: need a public axis2_tcp_worker.h for this -+//Axis2SoapProvider::processTcpRequest() { -+// axis2_tcp_worker_process_request(); -+//} -diff --git a/src/condor_contrib/aviary/src/Axis2SoapProvider.h b/src/condor_contrib/aviary/src/Axis2SoapProvider.h -new file mode 100644 -index 0000000..1828ee8 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/Axis2SoapProvider.h -@@ -0,0 +1,80 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#ifndef _AXIS2SOAPPROVIDER_H -+#define _AXIS2SOAPPROVIDER_H -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+// TODO: future tcp support -+//#include -+ -+// borrow what DC does -+#if !defined(WIN32) -+# ifndef SOCKET -+# define SOCKET int -+# endif -+# ifndef INVALID_SOCKET -+# define INVALID_SOCKET -1 -+# endif -+#endif /* not WIN32 */ -+ -+#define DEFAULT_LOG_FILE "./axis2.log" -+#define DEFAULT_REPO_FILE "../axis2.xml" -+#define DEFAULT_PORT 9090 -+ -+// C++ wrapper around a SINGLE-THREADED -+// Axis2/C engine; suitable for integration -+// with DaemonCore socket registration -+// ./configure --enable-multi-thread=no -+ -+namespace aviary { -+namespace soap { -+ -+class Axis2SoapProvider { -+ public: -+ Axis2SoapProvider(int _log_level=AXIS2_LOG_LEVEL_DEBUG, const char* _log_file=DEFAULT_LOG_FILE, const char* _repo_path=DEFAULT_REPO_FILE); -+ ~Axis2SoapProvider(); -+ bool init(int _port, int _read_timeout, std::string& _error); -+ SOCKET getHttpListenerSocket(); -+ bool processHttpRequest(std::string& _error); -+ -+ const axutil_env_t* getEnv() {return m_env;} -+ -+ private: -+ std::string m_log_file; -+ std::string m_repo_path; -+ axutil_log_levels_t m_log_level; -+ axutil_env_t* m_env; -+ axis2_transport_receiver_t* m_http_server; -+ axis2_http_svr_thread_t* m_svr_thread; -+ int m_http_socket_read_timeout; -+ bool m_initialized; -+ -+ axis2_http_svr_thread_t* createHttpReceiver(axutil_env_t* _env, axis2_transport_receiver_t* _server, std::string& _error); -+ void *AXIS2_THREAD_FUNC invokeHttpWorker( axutil_thread_t * thd, void *data ); -+}; -+ -+}} -+ -+#endif // _AXIS2SOAPPROVIDER_H -diff --git a/src/condor_contrib/aviary/src/CMakeLists.txt b/src/condor_contrib/aviary/src/CMakeLists.txt -new file mode 100644 -index 0000000..ea1a512 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/CMakeLists.txt -@@ -0,0 +1,85 @@ -+ ############################################################### -+ # -+ # Copyright (C) 2009-2011, Red Hat, Inc. -+ # -+ # Licensed under the Apache License, Version 2.0 (the "License"); you -+ # may not use this file except in compliance with the License. You may -+ # obtain a copy of the License at -+ # -+ # http://www.apache.org/licenses/LICENSE-2.0 -+ # -+ # Unless required by applicable law or agreed to in writing, software -+ # distributed under the License is distributed on an "AS IS" BASIS, -+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ # See the License for the specific language governing permissions and -+ # limitations under the License. -+ # -+ ############################################################### -+ -+# shouldn't happen if gen code checked-in -+if ( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../codegen" ) -+ message( FATAL_ERROR "run ../gen-xsd-cpp.sh first!") -+endif () -+ -+############################ -+# file target references. -+############################ -+file( GLOB COMMON_GEN_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../codegen/common/src/*.cpp ) -+file( GLOB JOB_GEN_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../codegen/job/src/*.cpp ) -+file( GLOB JOB_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/AviaryJobService*.cpp ) -+file( GLOB QUERY_GEN_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../codegen/query/src/*.cpp ) -+file( GLOB QUERY_SRCS ${CMAKE_CURRENT_SOURCE_DIR} AviaryQueryService*.cpp ) -+ -+file( GLOB SCHED_PLUGIN_SRCS Codec.cpp AviaryUtils.cpp SchedulerObject.cpp -+ PROC_ID_comparator.cpp Axis2SoapProvider.cpp AviaryScheddPlugin*.cpp ) -+ -+file( GLOB JOB_SERVER_SRCS aviary_query_server.cpp Axis2SoapProvider.cpp -+ SubmissionObject.cpp JobServerJobLogConsumer.cpp -+ Job.cpp HistoryFile.cpp HistoryProcessingUtils.cpp Globals.cpp -+ Codec.cpp JobServerObject.cpp AviaryUtils.cpp ) -+ -+############################ -+# schedd plugin -+############################ -+src_target_ref( condor_collector "hashkey" COLLECTOR_REF ) -+src_target_ref( utils "set_user_priv_from_ad" UTILS_REF ) -+ -+add_library (aviary_job_axis SHARED ${COMMON_GEN_SRCS} ${JOB_GEN_SRCS} ${JOB_SRCS} Codec.cpp AviaryUtils.cpp SchedulerObject.cpp ) -+# remove unresolved deps by copying in -lwso2_wsf objects -+target_link_libraries(aviary_job_axis -Wl,--whole-archive -lwso2_wsf -Wl,--no-whole-archive) -+ -+condor_plugin( AviaryScheddPlugin-plugin "${COLLECTOR_REF};${UTILS_REF};${SCHED_PLUGIN_SRCS}" "${C_LIBEXEC}" "${WSO2_FOUND}" ON) -+# remove unresolved deps by copying in -laxis2_engine objects -+target_link_libraries(AviaryScheddPlugin-plugin -Wl,--whole-archive -laxis2_engine -Wl,--no-whole-archive) -+ -+############################ -+# query server (aka ye old job server) -+############################ -+add_library (aviary_query_axis SHARED ${COMMON_GEN_SRCS} ${QUERY_GEN_SRCS} ${QUERY_SRCS} ) -+target_link_libraries (aviary_query_axis ${WSO2_FOUND}) -+ -+condor_exe( aviary_query_server "${JOB_SERVER_SRCS}" -+ "${C_SBIN}" "${CONDOR_LIBS};${PCRE_FOUND};${OPENSSL_FOUND};${COREDUMPER_FOUND};${KRB5_FOUND};${GLOBUS_FOUND};${GCB_FOUND};${WSO2_FOUND}" OFF ) -+ -+############################ -+# install targets && configure our axis2.xml for platform -+############################ -+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../etc/axis2.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/../etc/axis2.xml" @ONLY) -+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/../etc/axis2.xml DESTINATION ${CMAKE_INSTALL_PREFIX} ) -+ -+install (TARGETS aviary_query_axis DESTINATION ${C_SERVICES}/query) -+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/../services/query/services.xml DESTINATION ${C_SERVICES}/query ) -+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/../etc/aviary-common.xsd -+ ${CMAKE_CURRENT_SOURCE_DIR}/../etc/aviary-query.xsd -+ ${CMAKE_CURRENT_SOURCE_DIR}/../etc/aviary-query.wsdl -+ DESTINATION ${C_SERVICES}/query ) -+ -+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../etc/61aviary.config DESTINATION "${C_ETC_EXAMPLES}") -+ -+install (TARGETS aviary_job_axis DESTINATION ${C_SERVICES}/job) -+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/../services/job/services.xml DESTINATION ${C_SERVICES}/job ) -+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/../etc/aviary-common.xsd -+ ${CMAKE_CURRENT_SOURCE_DIR}/../etc/aviary-job.xsd -+ ${CMAKE_CURRENT_SOURCE_DIR}/../etc/aviary-job.wsdl -+ DESTINATION ${C_SERVICES}/job ) -+ -diff --git a/src/condor_contrib/aviary/src/Codec.cpp b/src/condor_contrib/aviary/src/Codec.cpp -new file mode 100644 -index 0000000..0a9b19f ---- /dev/null -+++ b/src/condor_contrib/aviary/src/Codec.cpp -@@ -0,0 +1,144 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_qmgr.h" -+ -+// local includes -+#include "Codec.h" -+#include "AviaryUtils.h" -+ -+using namespace compat_classad; -+using namespace aviary::codec; -+using namespace aviary::util; -+ -+// TODO: defer until linking issues sorted -+//Codec* -+//DefaultCodecFactory::createCodec() { -+// if (!m_codec) { -+// m_codec = new BaseCodec; -+// } -+// return m_codec; -+//} -+ -+BaseCodec::BaseCodec() -+{ -+ // -+} -+ -+BaseCodec::~BaseCodec() -+{ -+ // -+} -+ -+ -+bool -+BaseCodec::addAttributeToMap (ClassAd& ad, const char* name, AttributeMapType& _map) -+{ -+ ExprTree *expr; -+ -+ // All these extra lookups are horrible. They have to -+ // be there because the ClassAd may have multiple -+ // copies of the same attribute name! This means that -+ // the last attribute with a given name will set the -+ // value, but the last attribute tends to be the -+ // attribute with the oldest (wrong) value. How -+ // annoying is that! -+ if (!(expr = ad.Lookup(name))) { -+ dprintf(D_FULLDEBUG, "Warning: failed to lookup attribute '%s' from ad\n", name); -+ return false; -+ } -+ -+ classad::Value value; -+ ad.EvaluateExpr(expr,value); -+ std::string key = name; -+ switch (value.GetType()) { -+ // seems this covers expressions also -+ case classad::Value::BOOLEAN_VALUE: -+ _map[key] = new AviaryAttribute(AviaryAttribute::EXPR_TYPE,trimQuotes(ExprTreeToString(expr)).c_str()); -+ break; -+ case classad::Value::INTEGER_VALUE: -+ _map[key] = new AviaryAttribute(AviaryAttribute::INTEGER_TYPE,ExprTreeToString(expr)); -+ break; -+ case classad::Value::REAL_VALUE: -+ _map[key] = new AviaryAttribute(AviaryAttribute::FLOAT_TYPE,ExprTreeToString(expr)); -+ break; -+ case classad::Value::STRING_VALUE: -+ default: -+ _map[key] = new AviaryAttribute(AviaryAttribute::STRING_TYPE,trimQuotes(ExprTreeToString(expr)).c_str()); -+ } -+ -+ return true; -+} -+ -+bool -+BaseCodec::classAdToMap(ClassAd& ad, AttributeMapType& _map) -+{ -+ ExprTree *expr; -+ const char *name; -+ ad.ResetExpr(); -+ _map.clear(); -+ while (ad.NextExpr(name,expr)) { -+ if (!addAttributeToMap(ad, name, _map)) { -+ return false; -+ } -+ } -+ -+// //debug -+// if (DebugFlags & D_FULLDEBUG) { -+// ad.dPrint(D_FULLDEBUG|D_NOHEADER); -+// } -+ -+ return true; -+} -+ -+ -+bool -+BaseCodec::mapToClassAd(AttributeMapType& _map, ClassAd& ad) -+{ -+ -+ for (AttributeMapIterator entry = _map.begin(); _map.end() != entry; entry++) { -+ const char* name = entry->first.c_str(); -+ AviaryAttribute* value = entry->second; -+ -+ switch (value->getType()) { -+ case AviaryAttribute::INTEGER_TYPE: -+ ad.Assign(name, atoi(value->getValue())); -+ break; -+ case AviaryAttribute::FLOAT_TYPE: -+ ad.Assign(name, atof(value->getValue())); -+ break; -+ case AviaryAttribute::STRING_TYPE: -+ ad.Assign(name, value->getValue()); -+ break; -+ case AviaryAttribute::EXPR_TYPE: -+ ad.AssignExpr(name, value->getValue()); -+ break; -+ default: -+ dprintf(D_FULLDEBUG, "Warning: Unknown/unsupported type in map for attribute '%s'\n", name); -+ } -+ } -+ -+// // debug -+// if (DebugFlags & D_FULLDEBUG) { -+// ad.dPrint(D_FULLDEBUG|D_NOHEADER); -+// } -+ -+ return true; -+} -diff --git a/src/condor_contrib/aviary/src/Codec.h b/src/condor_contrib/aviary/src/Codec.h -new file mode 100644 -index 0000000..2172c9f ---- /dev/null -+++ b/src/condor_contrib/aviary/src/Codec.h -@@ -0,0 +1,127 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#ifndef _CODEC_H -+#define _CODEC_H -+ -+// c++ includes -+#include -+#include -+ -+// condor includes -+#include -+ -+using namespace std; -+using namespace compat_classad; -+ -+namespace aviary { -+namespace codec { -+ -+// universal err struct -+struct AviaryStatus -+{ -+ // keep these aligned with whatever public API -+ // in XSD, JSON, etc. -+ enum StatusType -+ { -+ // don't use "OK" -+ A_OK = 0, -+ FAIL = 1, -+ NO_MATCH = 2, -+ STRING_TYPE = 3, -+ INVALID_OFFSET = 4, -+ UNIMPLEMENTED = 5, -+ UNAVAILABLE = 6 -+ }; -+ -+ StatusType type; -+ string text; -+}; -+ -+class AviaryAttribute -+{ -+public: -+ enum AttributeType -+ { -+ EXPR_TYPE = 0, -+ INTEGER_TYPE = 1, -+ FLOAT_TYPE = 2, -+ STRING_TYPE = 3 -+ }; -+ AviaryAttribute ( AttributeType _type, const char* _value): m_type(_type), m_value(_value) {}; -+ ~AviaryAttribute() { /**/ }; -+ -+ AttributeType getType() const { return m_type; } -+ const char * getValue() const { return m_value.c_str(); } -+ -+private: -+ AttributeType m_type; -+ std::string m_value; -+}; -+ -+typedef map AttributeMapType; -+typedef AttributeMapType::const_iterator AttributeMapIterator; -+ -+// TODO: revisit -+// singleton class for encoding/decoding from/to transport-specific types -+// to a simple type to be used in the impl; -+// intent is to sit above ClassAds but still interact with them; -+// base is suitable for SOAP, but QMF might need subclassing -+// with it's !!descriptors idiom -+class Codec { -+public: -+ virtual bool addAttributeToMap(ClassAd& ad, const char* name, AttributeMapType& _map) = 0; -+ virtual bool classAdToMap(ClassAd &ad, AttributeMapType &_map) = 0; -+ virtual bool mapToClassAd(AttributeMapType &_map, ClassAd &ad) = 0; -+ -+}; -+ -+// TODO: defer until linking issues sorted -+//class CodecFactory { -+// public: -+// virtual Codec* createCodec() = 0; -+// -+// }; -+// -+// class DefaultCodecFactory: public CodecFactory { -+// public: -+// virtual Codec* createCodec(); -+// protected: -+// Codec* m_codec; -+// }; -+ -+class BaseCodec: public Codec { -+public: -+ //friend class DefaultCodecFactory; -+ virtual bool addAttributeToMap(ClassAd& ad, const char* name, AttributeMapType& _map); -+ virtual bool classAdToMap(ClassAd &ad, AttributeMapType &_map); -+ virtual bool mapToClassAd(AttributeMapType &_map, ClassAd &ad); -+ -+//protected: -+ BaseCodec(); -+ ~BaseCodec(); -+ -+private: -+ BaseCodec (const BaseCodec &); -+ BaseCodec& operator= (const BaseCodec &); -+ -+}; -+ -+}} -+ -+#endif // _CODEC_H -diff --git a/src/condor_contrib/aviary/src/Globals.cpp b/src/condor_contrib/aviary/src/Globals.cpp -new file mode 100644 -index 0000000..14e36fb ---- /dev/null -+++ b/src/condor_contrib/aviary/src/Globals.cpp -@@ -0,0 +1,29 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#include "Globals.h" -+ -+namespace aviary { -+namespace query { -+ -+JobCollectionType g_jobs; -+SubmissionCollectionType g_submissions; -+OwnerlessClusterType g_ownerless_clusters; -+OwnerlessSubmissionType g_ownerless_submissions; -+ -+}} -\ No newline at end of file -diff --git a/src/condor_contrib/aviary/src/Globals.h b/src/condor_contrib/aviary/src/Globals.h -new file mode 100644 -index 0000000..2b09add ---- /dev/null -+++ b/src/condor_contrib/aviary/src/Globals.h -@@ -0,0 +1,51 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#ifndef _GLOBALS_H -+#define _GLOBALS_H -+ -+// condor includes -+#include "condor_common.h" -+ -+// c++ includes -+#include -+ -+// local includes -+#include "Job.h" -+#include "JobServerObject.h" -+#include "SubmissionObject.h" -+#include "cmpstr.h" -+ -+using namespace std; -+ -+namespace aviary { -+namespace query { -+ -+typedef map JobCollectionType; -+typedef map SubmissionCollectionType; -+typedef map OwnerlessClusterType; -+typedef map OwnerlessSubmissionType; -+ -+extern JobCollectionType g_jobs; -+extern SubmissionCollectionType g_submissions; -+extern OwnerlessClusterType g_ownerless_clusters; -+extern OwnerlessSubmissionType g_ownerless_submissions; -+ -+}} -+ -+#endif /* _GLOBALS_H */ -diff --git a/src/condor_contrib/aviary/src/HistoryFile.cpp b/src/condor_contrib/aviary/src/HistoryFile.cpp -new file mode 100644 -index 0000000..13f6d0b ---- /dev/null -+++ b/src/condor_contrib/aviary/src/HistoryFile.cpp -@@ -0,0 +1,385 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#include "condor_common.h" -+ -+#include "condor_config.h" -+#include "condor_debug.h" -+ -+#include "condor_attributes.h" -+ -+#include "directory.h" -+ -+#include "HistoryFile.h" -+ -+#include "HistoryProcessingUtils.h" -+ -+#include // dirname -+ -+#include -+ -+#define HISTORY_INDEX_SUFFIX ".idx" -+using std::string; -+ -+ -+HistoryFile::HistoryFile(const string name): -+ m_name(name), -+ m_stat(NULL), -+ m_file(NULL), -+ m_index(NULL) -+{ -+} -+ -+HistoryFile::~HistoryFile() -+{ -+ cleanup(); -+} -+ -+void -+HistoryFile::cleanup() -+{ -+ m_entries.clear(); -+ if (m_file) { fclose(m_file); m_file = NULL; } -+ if (m_index) { fclose(m_index); m_index = NULL; } -+ if (m_stat) { free(m_stat); m_stat = NULL; } -+} -+ -+HistoryFile::HistoryFile(const HistoryFile &base) -+{ -+ m_file = NULL; -+ m_index = NULL; -+ m_stat = NULL; -+ -+ *this = base; -+} -+ -+HistoryFile & -+HistoryFile::operator=(const HistoryFile &base) -+{ -+ if (this != &base) { -+ (*this).m_name = base.m_name; -+ -+ cleanup(); -+ -+ // Don't just copy the stat and FILE* members, initialize them -+ CondorError errstack; -+ if (!init(errstack)) { -+ // XXX: Should throw an exception here -+ dprintf ( D_ALWAYS, "HistoryFile::operator=: %s\n", -+ errstack.getFullText(true)); -+ } -+ } -+ -+ return *this; -+} -+ -+bool -+HistoryFile::init(CondorError &errstack) -+{ -+ StatWrapper stat_wrapper; -+ -+ if (stat_wrapper.Stat(m_name.c_str())) { -+ errstack.pushf("HistoryFile::init", 1, -+ "Failed to stat %s: %d (%s)\n", -+ m_name.c_str(), -+ stat_wrapper.GetErrno(), -+ strerror(stat_wrapper.GetErrno())); -+ return false; -+ } -+ -+ m_stat = (StatStructType *) malloc(sizeof(StatStructType)); -+ ASSERT(m_stat); -+ memcpy(m_stat, stat_wrapper.GetBuf(), sizeof(StatStructType)); -+ if (!S_ISREG(m_stat->st_mode)) { -+ errstack.pushf("HistoryFile::init", 2, -+ "%s: not a regular file\n", -+ m_name.c_str()); -+ return false; -+ } -+ -+ m_file = safe_fopen_wrapper(m_name.c_str(), "r"); -+ if (NULL == m_file) { -+ errstack.pushf("HistoryFile::init", 4, -+ "Failed to fopen %s: %d (%s)\n", -+ m_name.c_str(), errno, strerror(errno)); -+ return false; -+ } -+ -+ // Store the index in history.INO.idx to handle renames -+ MyString tmp; -+ char *buf = strdup(m_name.c_str()); -+ ASSERT(buf); -+ long unsigned int id; -+ ASSERT(getId(id)); -+ tmp.sprintf("%s%shistory.%ld%s", dirname(buf), DIR_DELIM_STRING, id, HISTORY_INDEX_SUFFIX); -+ m_index_name = tmp.Value(); -+ free(buf); -+ -+ const char *mode = "r+"; -+ -+ if (stat_wrapper.Stat(m_index_name.c_str())) { -+ // Not being available is acceptable -+ if (ENOENT != stat_wrapper.GetErrno()) { -+ errstack.pushf("HistoryFile::init", 1, -+ "Failed to stat %s: %d (%s)\n", -+ m_index_name.c_str(), -+ stat_wrapper.GetErrno(), -+ strerror(stat_wrapper.GetErrno())); -+ return false; -+ } -+ -+ mode = "w+"; -+ } -+ -+ const StatStructType *stat = stat_wrapper.GetBuf(); -+ if (!S_ISREG(stat->st_mode)) { -+ errstack.pushf("HistoryFile::init", 2, -+ "%s: not a regular file\n", -+ m_index_name.c_str()); -+ return false; -+ } -+ -+ m_index = safe_fopen_wrapper(m_index_name.c_str(), mode); -+ if (NULL == m_index) { -+ errstack.pushf("HistoryFile::init", 4, -+ "Failed to fopen %s: %d (%s)\n", -+ m_index_name.c_str(), errno, strerror(errno)); -+ return false; -+ } -+ -+ return true; -+} -+ -+bool -+HistoryFile::getId(long unsigned int &id) -+{ -+ if (!m_stat) return false; -+ -+ id = m_stat->st_ino; -+ return true; -+} -+ -+HistoryFile::HistoryEntriesTypeIterators -+HistoryFile::poll(CondorError &/*errstack*/) -+{ -+ // Record the end of the current set of records, used to -+ // return just the newly read records -+ int size = m_entries.size(); -+ -+ // Load from the index -+ CondorError ignored_errstack; -+ if (!pollIndex(ignored_errstack)) { -+ dprintf(D_FULLDEBUG, "%s\n", ignored_errstack.getFullText(true)); -+ } -+ -+ // Seek to the end of the last known record -+ if (!m_entries.empty()) { -+ HistoryEntry entry = m_entries.back(); -+ fseek(m_file, entry.stop, SEEK_SET); -+ } -+ -+ int end, error, empty; -+ end = 0; -+ while (!end) { -+ long int start, stop; -+ -+ start = ftell(m_file); -+ -+ // NOTE: If the ClassAd parsing completes without finding -+ // the delimiter the result is end=1 and empty=0. This -+ // should be sufficient for identifying incomplete -+ // records that are otherwise valid. -+ ClassAd ad(m_file, "***", end, error, empty); -+ -+ stop = ftell(m_file); -+ -+ if (end) continue; -+ if (error) { -+ error = 0; -+ dprintf(D_ALWAYS, "HistoryFile::poll: malformed ad, skipping\n"); -+ continue; -+ } -+ if (empty) { -+ empty = 0; -+ dprintf(D_ALWAYS, "HistoryFile::poll: empty ad, skipping\n"); -+ continue; -+ } -+ -+ int cluster, proc, q_date, status, entered_status; -+ char *global_id = NULL, *cmd = NULL, *args1 = NULL, *args2 = NULL; -+ char *release_reason = NULL, *hold_reason = NULL; -+ char *submission = NULL; -+ char *owner = NULL; -+ if (!ad.LookupInteger(ATTR_CLUSTER_ID, cluster)) { -+ dprintf(D_ALWAYS, "HistoryFile::poll: no %s, skipping\n", -+ ATTR_CLUSTER_ID); -+ continue; -+ } -+ if (!ad.LookupInteger(ATTR_PROC_ID, proc)) { -+ dprintf(D_ALWAYS, "HistoryFile::poll: no %s, skipping\n", -+ ATTR_PROC_ID); -+ continue; -+ } -+ if (!ad.LookupInteger(ATTR_Q_DATE, q_date)) { -+ dprintf(D_ALWAYS, "HistoryFile::poll: no %s, skipping: %d.%d\n", -+ ATTR_Q_DATE, cluster, proc); -+ continue; -+ } -+ if (!ad.LookupInteger(ATTR_JOB_STATUS, status)) { -+ dprintf(D_ALWAYS, "HistoryFile::poll: no %s, skipping: %d.%d\n", -+ ATTR_JOB_STATUS, cluster, proc); -+ continue; -+ } -+ if (!ad.LookupInteger(ATTR_ENTERED_CURRENT_STATUS, entered_status)) { -+ dprintf(D_ALWAYS, "HistoryFile::poll: no %s, skipping: %d.%d\n", -+ ATTR_ENTERED_CURRENT_STATUS, cluster, proc); -+ continue; -+ } -+ if (!ad.LookupString(ATTR_GLOBAL_JOB_ID, &global_id)) { -+ dprintf(D_ALWAYS, "HistoryFile::poll: no %s, skipping: %d.%d\n", -+ ATTR_GLOBAL_JOB_ID, cluster, proc); -+ continue; -+ } -+ if (!ad.LookupString(ATTR_JOB_CMD, &cmd)) { -+ dprintf(D_ALWAYS, "HistoryFile::poll: no %s, skipping: %d.%d\n", -+ ATTR_JOB_CMD, cluster, proc); -+ continue; -+ } -+ ad.LookupString(ATTR_JOB_ARGUMENTS1, &args1); -+ ad.LookupString(ATTR_JOB_ARGUMENTS2, &args2); -+ ad.LookupString(ATTR_RELEASE_REASON, &release_reason); -+ ad.LookupString(ATTR_HOLD_REASON, &hold_reason); -+ ad.LookupString(ATTR_JOB_SUBMISSION, &submission); -+ ad.LookupString(ATTR_OWNER, &owner); -+ -+ // Write an index record -+ fprintf(m_index, -+ "%ld %ld %s %d %d %d %d %d\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -+ start, stop, global_id, -+ cluster, proc, -+ q_date, status, entered_status, -+ submission ? submission : "", -+ owner ? owner : "", -+ cmd, -+ args1 ? args1 : "", -+ args2 ? args2 : "", -+ release_reason ? release_reason : "", -+ hold_reason ? hold_reason : ""); -+ -+ HistoryEntry entry; -+ -+ entry.file = m_name; -+ entry.start = start; -+ entry.stop = stop; -+ entry.id = global_id; -+ entry.cluster = cluster; -+ entry.proc = proc; -+ entry.q_date = q_date; -+ entry.status = status; -+ entry.entered_status = entered_status; -+ if (submission) entry.submission = submission; -+ if (owner) entry.owner = owner; -+ entry.cmd = cmd; -+ if (args1) entry.args1 = args1; -+ if (args2) entry.args2 = args2; -+ if (release_reason) entry.release_reason = release_reason; -+ if (hold_reason) entry.hold_reason = hold_reason; -+ -+ m_entries.push_back(entry); -+ -+ free(global_id);free(cmd);free(args1); free(args2); -+ free(release_reason); free(hold_reason); -+ free(submission); -+ free(owner); -+ } -+ -+ // Return iterators for newly read records -+ return HistoryFile::HistoryEntriesTypeIterators(m_entries.begin() + size, -+ m_entries.end()); -+} -+ -+/** -+ * Index format: -+ * start(%ld) stop(%ld) id(%s) cluster(%d) proc(%d) q_date(%d) status(%d) entered_status(%d) -+ * submission(%s) -+ * cmd(%s) -+ * args1(%s) -+ * args2(%s) -+ * release_reason(%s) -+ * hold_reason(%s) -+ */ -+bool -+HistoryFile::pollIndex(CondorError &errstack) -+{ -+ while (1) { -+ int code; -+ HistoryEntry entry; -+ -+ entry.file = m_name; -+ char *id = NULL; -+ code = fscanf(m_index, "%ld %ld %as %d %d %d %d %d", -+ &entry.start, &entry.stop, &id, -+ &entry.cluster, &entry.proc, -+ &entry.q_date, &entry.status, &entry.entered_status); -+ if (code != 8) { -+ // Ok, at the end of the file, we're done -+ // code check is to handle truncated final entry -+ if (feof(m_index) && code < 0) { -+ break; -+ } -+ -+ // XXX: EINTR? -+ errstack.pushf("HistoryFile::pollIndex", 6, -+ "Failed to fscanf HistoryEntry from %s, " -+ "rc=%d: %d (%s)\n", -+ m_index_name.c_str(), code, errno, strerror(errno)); -+ -+ return false; -+ } -+ -+ MyString buf; -+ -+ buf.readLine(m_index); // consume newline -+ -+#define BUF_SET(dest,attr) \ -+ if (buf.readLine(m_index)) { \ -+ buf.trim(); \ -+ if (!buf.IsEmpty()) { \ -+ dest = buf.Value(); \ -+ } \ -+ } else { \ -+ errstack.pushf("HistoryFile::pollIndex", 7, \ -+ "Failed to read %s's %s from %s\n", \ -+ id, attr, m_index_name.c_str()); \ -+ return false; \ -+ } -+ -+ BUF_SET(entry.submission, ATTR_JOB_SUBMISSION); -+ BUF_SET(entry.owner, ATTR_OWNER); -+ BUF_SET(entry.cmd, ATTR_JOB_CMD); -+ BUF_SET(entry.args1, ATTR_JOB_ARGUMENTS1); -+ BUF_SET(entry.args2, ATTR_JOB_ARGUMENTS2); -+ BUF_SET(entry.release_reason, ATTR_RELEASE_REASON); -+ BUF_SET(entry.hold_reason, ATTR_HOLD_REASON); -+ -+ entry.id = id; -+ free(id); id = NULL; -+ -+ m_entries.push_back(entry); -+ } -+ -+ return true; -+} -diff --git a/src/condor_contrib/aviary/src/HistoryFile.h b/src/condor_contrib/aviary/src/HistoryFile.h -new file mode 100644 -index 0000000..a7b0adc ---- /dev/null -+++ b/src/condor_contrib/aviary/src/HistoryFile.h -@@ -0,0 +1,90 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef _HISTORYFILE_H -+#define _HISTORYFILE_H -+ -+#include -+#include -+ -+using std::string; -+using std::deque; -+using std::pair; -+ -+#include "stat_wrapper.h" -+#include "CondorError.h" -+ -+namespace aviary { -+namespace history { -+ -+struct HistoryEntry -+{ -+ string file; -+ long int start; // ftell stream index for record start -+ long int stop; // ftell stream index for record end -+ string id; -+ int q_date; -+ int cluster; -+ int proc; -+ int status; -+ int entered_status; -+ string submission; -+ string owner; -+ string cmd; -+ string args1; -+ string args2; -+ string release_reason; -+ string hold_reason; -+}; -+ -+class HistoryFile -+{ -+public: -+ typedef deque HistoryEntriesType; -+ typedef HistoryEntriesType::const_iterator HistoryEntriesTypeIterator; -+ typedef pair HistoryEntriesTypeIterators; -+ -+ HistoryFile(const string name); -+ -+ ~HistoryFile(); -+ -+ HistoryFile(const HistoryFile &base); -+ HistoryFile & operator=(const HistoryFile &base); -+ -+ bool init(CondorError &errstack); -+ -+ bool getId(long unsigned int &id); -+ -+ HistoryEntriesTypeIterators poll(CondorError &errstack); -+ -+ void cleanup(); -+ -+private: -+ string m_name; -+ string m_index_name; -+ HistoryEntriesType m_entries; -+ StatStructType *m_stat; -+ FILE *m_file; -+ FILE *m_index; -+ -+ bool pollIndex(CondorError &errstack); -+ -+}; -+ -+}} -+ -+#endif /* _HISTORYFILE_H */ -diff --git a/src/condor_contrib/aviary/src/HistoryProcessingUtils.cpp b/src/condor_contrib/aviary/src/HistoryProcessingUtils.cpp -new file mode 100644 -index 0000000..0936f4d ---- /dev/null -+++ b/src/condor_contrib/aviary/src/HistoryProcessingUtils.cpp -@@ -0,0 +1,265 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_config.h" -+#include "condor_debug.h" -+#include "condor_attributes.h" -+#include "CondorError.h" -+#include "directory.h" -+#include "stat_wrapper.h" -+ -+//local includes -+#include "JobServerJobLogConsumer.h" -+#include "Job.h" -+#include "HistoryProcessingUtils.h" -+#include "HistoryFile.h" -+#include "AviaryUtils.h" -+#include "Globals.h" -+ -+// platform includes -+#include // dirname -+ -+// c++ includes -+#include -+#include -+#include -+ -+using namespace aviary::query; -+ -+#define HISTORY_INDEX_SUFFIX ".idx" -+using namespace std; -+ -+typedef set HistoryFileListType; -+static HistoryFileListType m_historyFiles; -+MyString m_path; -+ -+// force a reset of history processing -+void aviary::history::init_history_files() { -+ m_historyFiles.clear(); -+ processHistoryDirectory(); -+ processOrphanedIndices(); -+ processCurrentHistory(true); -+} -+ -+// Processing jobs from history file must allow for -+// duplicates, such as when current history file is renamed. -+static -+void -+process ( const HistoryEntry &entry ) -+{ -+ MyString key; -+ -+ key.sprintf ( "%d.%d", entry.cluster, entry.proc ); -+ -+ const char* key_cstr = key.StrDup(); -+ -+ HistoryJobImpl *hji = new HistoryJobImpl (entry); -+ -+ JobCollectionType::const_iterator element = g_jobs.find ( key_cstr ); -+ if ( g_jobs.end() != element ) -+ { -+ (*element).second->setImpl(hji); -+ dprintf ( D_FULLDEBUG, "HistoryJobImpl added to '%s'\n", key_cstr ); -+ } -+ else { -+ // live job long gone...could be a restart -+ Job* job = new Job(key_cstr); -+ job->setImpl(hji); -+ g_jobs[key_cstr] = job; -+ dprintf ( D_FULLDEBUG, "HistoryJobImpl created for '%s'\n", key_cstr); -+ } -+ -+ // // debug -+ // fprintf ( stdout, -+ // "%ld %ld %s %d %d %d %d %d %s %s %s %s %s %s %s\n", -+ // entry.start, entry.stop, entry.id.c_str(), -+ // entry.cluster, entry.proc, -+ // entry.q_date, entry.status, entry.entered_status, -+ // entry.submission.c_str(), -+ // entry.owner.c_str(), -+ // entry.cmd.c_str(), -+ // entry.args1.c_str(), -+ // entry.args2.c_str(), -+ // entry.release_reason.c_str(), -+ // entry.hold_reason.c_str() ); -+} -+ -+/** -+ * Process the history directory and maintain the history file map -+ * -+ * Only handle rotated history files, those history.* that are not an -+ * index. For each one that is not in the history file map, create a -+ * new HistoryFile, poll it for entries to process, and add it to the -+ * map. -+ */ -+void -+aviary::history::processHistoryDirectory() -+{ -+ const char *file = NULL; -+ -+ Directory dir ( m_path.Value() ); -+ dir.Rewind(); -+ while ( ( file = dir.Next() ) ) -+ { -+ // Skip all non-history files, e.g. history and history.*.idx -+ if ( strncmp ( file, "history.", 8 ) || -+ !strncmp ( file + ( strlen ( file ) - 4 ), HISTORY_INDEX_SUFFIX, 4 ) ) continue; -+ -+ HistoryFile h_file ( ( m_path + DIR_DELIM_STRING + file ).Value() ); -+ CondorError errstack; -+ if ( !h_file.init ( errstack ) ) -+ { -+ dprintf ( D_ALWAYS, "%s\n", errstack.getFullText() ); -+ return; -+ } -+ errstack.clear(); -+ -+ long unsigned int id; -+ ASSERT ( h_file.getId ( id ) ); -+ HistoryFileListType::iterator entry = m_historyFiles.find ( id ); -+ if ( m_historyFiles.end() == entry ) -+ { -+ HistoryFile::HistoryEntriesTypeIterators ij = h_file.poll ( errstack ); -+ for ( HistoryFile::HistoryEntriesTypeIterator i = ij.first; -+ i != ij.second; -+ i++ ) -+ { -+ process ( ( *i ) ); -+ } -+ -+ m_historyFiles.insert ( id ); -+ } -+ } -+} -+ -+/** -+ * Process orphaned index files, those that exist but do not have a -+ * corresponding history file. -+ * -+ * Process all .idx files looking for the corresponding HistoryFile in -+ * the history file map. -+ */ -+void -+aviary::history::processOrphanedIndices() -+{ -+ const char *file = NULL; -+ -+ Directory dir ( m_path.Value() ); -+ dir.Rewind(); -+ while ( ( file = dir.Next() ) ) -+ { -+ // Skip all non-history index files, e.g. history and history.* -+ if ( strncmp ( file, "history.", 8 ) || -+ strncmp ( file + ( strlen ( file ) - 4 ), HISTORY_INDEX_SUFFIX, 4 ) ) continue; -+ -+ // XXX: This is ugly because it indicates we know details -+ // of how HistoryFile implements index files. -+ -+ // The index file is "history.%ld.idx" where %ld is the id -+ // of the history file the index is for. -+ -+ long unsigned int id; -+ int count = sscanf ( file, "history.%ld.idx", &id ); -+ if ( 1 != count ) -+ { -+ dprintf ( D_ALWAYS, "Error parsing %s, skipping.\n", file ); -+ continue; -+ } -+ -+ HistoryFileListType::iterator entry = m_historyFiles.find ( id ); -+ if ( m_historyFiles.end() == entry ) -+ { -+ // The index is dangling, remove it. -+ if ( !dir.Remove_Current_File() ) -+ { -+ dprintf ( D_ALWAYS, "Failed to remove: %s\n", file ); -+ } -+ } -+ } -+} -+ -+/** -+ * Process the current history file. -+ * -+ * 1) check to see if it is properly initialized, recording id (inode) -+ * 2) stat the current history file -+ * 3) poll for new entries and process them -+ * 4) detect rotations -+ */ -+void -+aviary::history::processCurrentHistory(bool force_reset) -+{ -+ static MyString currentHistoryFilename = m_path + DIR_DELIM_STRING + "history"; -+ static HistoryFile currentHistory ( currentHistoryFilename.Value() ); -+ -+ CondorError errstack; -+ -+ if (force_reset) { -+ currentHistory.cleanup(); -+ } -+ -+ // (1) -+ long unsigned int id; -+ if ( !currentHistory.getId ( id ) || force_reset) -+ { -+ if ( !currentHistory.init ( errstack ) ) -+ { -+ dprintf ( D_ALWAYS, "%s\n", errstack.getFullText() ); -+ return; -+ } -+ ASSERT ( currentHistory.getId ( id ) ); -+ m_historyFiles.insert ( id ); -+ } -+ -+ // (2) -+ // Stat before poll to handle race of: poll + write + rotate + stat -+ StatWrapper stat_wrapper; -+ if ( stat_wrapper.Stat ( currentHistoryFilename ) ) -+ { -+ dprintf ( D_ALWAYS, "Failed to stat %s: %d (%s)\n", -+ currentHistoryFilename.Value(), -+ stat_wrapper.GetErrno(), strerror ( stat_wrapper.GetErrno() ) ); -+ return; -+ } -+ const StatStructType *stat = stat_wrapper.GetBuf(); -+ ASSERT ( currentHistory.getId ( id ) ); -+ -+ // (3) -+ errstack.clear(); -+ HistoryFile::HistoryEntriesTypeIterators poll = currentHistory.poll ( errstack ); -+ for ( HistoryFile::HistoryEntriesTypeIterator i = poll.first; -+ i != poll.second; -+ i++ ) -+ { -+ process ( ( *i ) ); -+ } -+ -+ // (4) -+ // If different the file has rotated -+ if ( id != stat->st_ino ) -+ { -+ currentHistory = HistoryFile ( currentHistoryFilename.Value() ); -+ if ( !currentHistory.init ( errstack ) ) -+ { -+ dprintf ( D_ALWAYS, "%s\n", errstack.getFullText() ); -+ return; -+ } -+ ASSERT ( currentHistory.getId ( id ) ); -+ m_historyFiles.insert ( id ); -+ } -+} -diff --git a/src/condor_contrib/aviary/src/HistoryProcessingUtils.h b/src/condor_contrib/aviary/src/HistoryProcessingUtils.h -new file mode 100644 -index 0000000..c16531a ---- /dev/null -+++ b/src/condor_contrib/aviary/src/HistoryProcessingUtils.h -@@ -0,0 +1,34 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef _HISTORYPROCESSINGUTILS_H -+#define _HISTORYPROCESSINGUTILS_H -+ -+#include "Job.h" -+#include "AviaryUtils.h" -+ -+namespace aviary { -+namespace history { -+ -+void init_history_files(); -+void processHistoryDirectory(); -+void processOrphanedIndices(); -+void processCurrentHistory(bool force_reset = false); -+bool populateMapFromClassAd ( ClassAd& ad, AttributeMapType& _map ); -+ -+}} -+ -+#endif /* _HISTORYPROCESSINGUTILS_H */ -diff --git a/src/condor_contrib/aviary/src/Job.cpp b/src/condor_contrib/aviary/src/Job.cpp -new file mode 100644 -index 0000000..89716d6 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/Job.cpp -@@ -0,0 +1,691 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_debug.h" -+#include "condor_attributes.h" -+//#include "condor_parser.h" -+#include "compat_classad.h" -+#include "proc.h" -+#include "stl_string_utils.h" -+ -+// c++ includes -+#include -+ -+// local includes -+#include "Globals.h" -+#include "AviaryUtils.h" -+ -+using namespace std; -+using namespace compat_classad; -+using namespace aviary::query; -+using namespace aviary::util; -+ -+// Any key that begins with the '0' char is either the -+// header or a cluster, i.e. not a job -+#define IS_JOB(key) ((key) && '0' != (key)[0]) -+ -+// summary attributes -+ const char *ATTRS[] = {ATTR_CLUSTER_ID, -+ ATTR_PROC_ID, -+ ATTR_GLOBAL_JOB_ID, -+ ATTR_Q_DATE, -+ ATTR_ENTERED_CURRENT_STATUS, -+ ATTR_JOB_STATUS, -+ ATTR_JOB_CMD, -+ ATTR_JOB_ARGUMENTS1, -+ ATTR_JOB_ARGUMENTS2, -+ ATTR_RELEASE_REASON, -+ ATTR_HOLD_REASON, -+ ATTR_JOB_SUBMISSION, -+ ATTR_OWNER, -+ NULL -+ }; -+ -+// TODO: C++ utils which may very well exist elsewhere :-) -+template -+bool from_string ( T& t, -+ const string& s, -+ ios_base& ( *f ) ( ios_base& ) ) -+{ -+ istringstream iss ( s ); -+ return ! ( iss >> f >> t ).fail(); -+} -+ -+template -+string to_string ( T t, ios_base & ( *f ) ( ios_base& ) ) -+{ -+ ostringstream oss; -+ oss << f << t; -+ return oss.str(); -+} -+ -+////////////// -+// LiveJobImpl -+////////////// -+LiveJobImpl::LiveJobImpl (const char* cluster_proc, ClusterJobImpl* parent) -+{ -+ m_job = NULL; -+ m_parent = NULL; -+ m_summary_ad = NULL; -+ m_full_ad = new ClassAd(); -+ if ( parent) -+ { -+ m_parent = parent; -+ m_parent->incrementRef(); -+ m_full_ad->ChainToAd ( parent->m_full_ad ); -+ } -+ -+ dprintf ( D_FULLDEBUG, "LiveJobImpl created for '%s'\n", cluster_proc); -+} -+ -+LiveJobImpl::~LiveJobImpl() -+{ -+ // unchain our parent first -+ if (m_full_ad) { -+ m_full_ad->Unchain(); -+ delete m_full_ad; -+ m_full_ad = NULL; -+ } -+ -+ if (m_summary_ad) { -+ delete m_summary_ad; -+ m_summary_ad = NULL; -+ } -+ -+ if (m_parent) { -+ m_parent->decrementRef(); -+ } -+ -+ dprintf ( D_FULLDEBUG, "LiveJobImpl destroyed: key '%s'\n", m_job->getKey()); -+} -+ -+bool -+LiveJobImpl::get ( const char *_name, const AviaryAttribute *&_attribute ) const -+{ -+ // our job ad is chained so lookups will -+ // encompass our parent ad as well as the child -+ -+ // parse the type -+ ExprTree *expr = NULL; -+ if ( ! ( expr = m_full_ad->Lookup ( _name ) ) ) -+ { -+ dprintf ( D_FULLDEBUG, -+ "warning: failed to lookup attribute %s in job '%s'\n", _name, m_job->getKey() ); -+ return false; -+ } -+ // decode the type -+ classad::Value value; -+ m_full_ad->EvaluateExpr(expr,value); -+ switch ( value.GetType() ) -+ { -+ case classad::Value::INTEGER_VALUE: -+ { -+ int i; -+ if ( !m_full_ad->LookupInteger ( _name, i ) ) -+ { -+ return false; -+ } -+ const char* int_str = to_string ( i,dec ).c_str(); -+ _attribute = new AviaryAttribute ( AviaryAttribute::INTEGER_TYPE, int_str ); -+ return true; -+ } -+ case classad::Value::REAL_VALUE: -+ { -+ float f; -+ if ( !m_full_ad->LookupFloat ( _name, f ) ) -+ { -+ return false; -+ } -+ const char* float_str = to_string ( f,dec ).c_str(); -+ _attribute = new AviaryAttribute ( AviaryAttribute::FLOAT_TYPE, float_str ); -+ return true; -+ } -+ case classad::Value::STRING_VALUE: -+ { -+ MyString str; -+ if ( !m_full_ad->LookupString ( _name, str ) ) -+ { -+ return false; -+ } -+ _attribute = new AviaryAttribute ( AviaryAttribute::STRING_TYPE, str.Value() ); -+ return true; -+ } -+ default: -+ { -+ ExprTree* tree = NULL; -+ if ( ! ( tree = m_full_ad->Lookup ( _name ) ) ) -+ { -+ return false; -+ } -+ const char* rhs; -+ rhs = ExprTreeToString( expr ); -+ _attribute = new AviaryAttribute ( AviaryAttribute::EXPR_TYPE, rhs ); -+ return true; -+ } -+ } -+ -+ return false; -+} -+ -+int LiveJobImpl::getStatus() const -+{ -+ const AviaryAttribute* attr = NULL; -+ -+ if ( !this->get ( ATTR_JOB_STATUS, attr ) ) -+ { -+ // assume we might get cluster jobs here also -+ return JOB_STATUS_MIN; -+ } -+ -+ return strtol ( attr->getValue(), ( char ** ) NULL, 10 ); -+} -+ -+void -+LiveJobImpl::set ( const char *_name, const char *_value ) -+{ -+ -+ if ( strcasecmp ( _name, ATTR_JOB_SUBMISSION ) == 0 ) -+ { -+ string val = trimQuotes( _value ); -+ // grab the cluster from our key -+ PROC_ID id = getProcByString(m_job->getKey()); -+ if (m_job) { -+ m_job->setSubmission ( val.c_str(), id.cluster ); -+ } -+ } -+ -+ // our status is changing...decrement for old one -+ if ( strcasecmp ( _name, ATTR_JOB_STATUS ) == 0 ) -+ { -+ if ( m_job ) -+ { -+ m_job->setStatus(this->getStatus()); -+ m_job->decrementSubmission (); -+ } -+ } -+ -+ if ( strcasecmp ( _name, ATTR_OWNER ) == 0 ) -+ { -+ // need to leave an owner for this job -+ // to be picked up soon -+ // if we are in here, we don't have m_submission -+ PROC_ID id = getProcByString(m_job->getKey()); -+ string val = trimQuotes( _value ); -+ g_ownerless_clusters[id.cluster] = val; -+ m_job->updateSubmission(id.cluster,val.c_str()); -+ } -+ -+ // parse the type -+ ExprTree *expr; -+ if ( ParseClassAdRvalExpr ( _value, expr ) ) -+ { -+ dprintf ( D_ALWAYS, -+ "error: parsing %s[%s] = %s, skipping\n", -+ m_job->getKey(), _name, _value ); -+ return; -+ } -+ // add this value to the classad -+ classad::Value value; -+ expr->Evaluate(value); -+ switch ( value.GetType() ) -+ { -+ case classad::Value::INTEGER_VALUE: -+ int i; -+ from_string ( i, string ( _value ), dec ); -+ m_full_ad->Assign ( _name, i ); -+ break; -+ case classad::Value::REAL_VALUE: -+ float f; -+ from_string ( f, string ( _value ), dec ); -+ m_full_ad->Assign ( _name, f ); -+ break; -+ case classad::Value::STRING_VALUE: -+ m_full_ad->Assign ( _name, _value ); -+ break; -+ default: -+ m_full_ad->AssignExpr ( _name, _value ); -+ break; -+ } -+ delete expr; expr = NULL; -+ -+ // our status has changed...increment for new one -+ if ( strcasecmp ( _name, ATTR_JOB_STATUS ) == 0 ) -+ { -+ if ( m_job ) -+ { -+ m_job->setStatus(this->getStatus()); -+ m_job->incrementSubmission (); -+ } -+ } -+} -+ -+void -+LiveJobImpl::remove ( const char *_name ) -+{ -+ // seems we implode if we don't unchain first -+ classad::ClassAd* cp = m_full_ad->GetChainedParentAd(); -+ m_full_ad->Delete ( _name ); -+ m_full_ad->ChainToAd(cp); -+} -+ -+const ClassAd* LiveJobImpl::getSummary () -+{ -+ if (!m_summary_ad) { -+ m_summary_ad = new ClassAd(); -+ m_summary_ad->ResetExpr(); -+ int i = 0; -+ while (NULL != ATTRS[i]) { -+ const AviaryAttribute* attr = NULL; -+ if (this->get(ATTRS[i],attr)) { -+ switch (attr->getType()) { -+ case AviaryAttribute::FLOAT_TYPE: -+ m_summary_ad->Assign(ATTRS[i], atof(attr->getValue())); -+ break; -+ case AviaryAttribute::INTEGER_TYPE: -+ m_summary_ad->Assign(ATTRS[i], atol(attr->getValue())); -+ break; -+ case AviaryAttribute::EXPR_TYPE: -+ case AviaryAttribute::STRING_TYPE: -+ default: -+ m_summary_ad->Assign(ATTRS[i], attr->getValue()); -+ } -+ } -+ delete attr; -+ i++; -+ } -+ } -+ -+ return m_summary_ad; -+} -+ -+const ClassAd* LiveJobImpl::getFullAd () const -+{ -+ return m_full_ad; -+} -+ -+///////////////// -+// ClusterJobImpl -+///////////////// -+ClusterJobImpl::ClusterJobImpl(const char* key): LiveJobImpl(key, NULL) -+{ -+ m_ref_count = 0; -+} -+ -+ClusterJobImpl::~ClusterJobImpl() -+{ -+ dprintf ( D_FULLDEBUG, "ClusterJobImpl destroyed: key '%s'\n", m_job->getKey()); -+} -+ -+void -+ClusterJobImpl::incrementRef() -+{ -+ m_ref_count++; -+} -+ -+void -+ClusterJobImpl::decrementRef() -+{ -+ --m_ref_count; -+} -+ -+///////////////// -+// HistoryJobImpl -+///////////////// -+HistoryJobImpl::HistoryJobImpl ( const HistoryEntry& _he): -+ m_he(_he) -+{ -+ m_job = NULL; -+ g_ownerless_clusters[_he.cluster] = _he.owner; -+ dprintf ( D_FULLDEBUG, "HistoryJobImpl created for '%d.%d'\n", _he.cluster, _he.proc ); -+} -+ -+HistoryJobImpl::~HistoryJobImpl () -+{ -+ dprintf ( D_FULLDEBUG, "HistoryJobImpl destroyed: key '%s'\n", m_job->getKey()); -+} -+ -+int HistoryJobImpl::getStatus() const -+{ -+ return m_he.status; -+} -+ -+int HistoryJobImpl::getCluster() const -+{ -+ return m_he.cluster; -+} -+ -+const char* HistoryJobImpl::getSubmissionId() const -+{ -+ return m_he.submission.c_str(); -+} -+ -+void HistoryJobImpl::getSummary ( ClassAd& _ad ) const -+{ -+ _ad.ResetExpr(); -+ // use HistoryEntry data only -+ _ad.Assign(ATTR_GLOBAL_JOB_ID,m_he.id.c_str()); -+ _ad.Assign(ATTR_CLUSTER_ID,m_he.cluster); -+ _ad.Assign(ATTR_PROC_ID,m_he.proc); -+ _ad.Assign(ATTR_Q_DATE,m_he.q_date); -+ _ad.Assign(ATTR_JOB_STATUS,m_he.status); -+ _ad.Assign(ATTR_ENTERED_CURRENT_STATUS,m_he.entered_status); -+ _ad.Assign(ATTR_JOB_SUBMISSION,m_he.submission.c_str()); -+ _ad.Assign(ATTR_OWNER,m_he.owner.c_str()); -+ _ad.Assign(ATTR_JOB_CMD,m_he.cmd.c_str()); -+ -+ // beyond here these may be empty so don't -+ // automatically add to summary -+ if (!m_he.args1.empty()) { -+ _ad.Assign(ATTR_JOB_ARGUMENTS1,m_he.args1.c_str()); -+ } -+ if (!m_he.args2.empty()) { -+ _ad.Assign(ATTR_JOB_ARGUMENTS2,m_he.args2.c_str()); -+ } -+ if (!m_he.release_reason.empty()) { -+ _ad.Assign(ATTR_RELEASE_REASON,m_he.release_reason.c_str()); -+ } -+ if (!m_he.hold_reason.empty()) { -+ _ad.Assign(ATTR_HOLD_REASON,m_he.hold_reason.c_str()); -+ } -+ -+} -+ -+// specialization: this GetFullAd has to retrieve its classad attributes -+// from the history file based on index pointers -+void -+ HistoryJobImpl::getFullAd ( ClassAd& _ad) const -+{ -+ // fseek to he.start -+ // ClassAd method to deserialize from a file with "***" -+ -+ FILE * hFile; -+ int end = 0; -+ int error = 0; -+ int empty = 0; -+ string _text; -+ -+ // TODO: move the ClassAd/file deserialize back to HistoryFile??? -+ const char* fName = m_he.file.c_str(); -+ if ( ! ( hFile = safe_fopen_wrapper ( fName, "r" ) ) ) -+ { -+ sprintf(_text,"unable to open history file '%s'", m_he.file.c_str()); -+ dprintf ( D_ALWAYS, "%s\n",_text.c_str()); -+ _ad.Assign("JOB_AD_ERROR",_text.c_str()); -+ return; -+ } -+ if ( fseek ( hFile , m_he.start , SEEK_SET ) ) -+ { -+ sprintf(_text,"bad seek in '%s' at index %d", m_he.file.c_str(),m_he.start); -+ dprintf ( D_ALWAYS, "%s\n",_text.c_str()); -+ _ad.Assign("JOB_AD_ERROR",_text.c_str()); -+ return; -+ } -+ -+ ClassAd myJobAd ( hFile, "***", end, error, empty ); -+ fclose ( hFile ); -+ -+ // debug logging and error to i/f for now -+ // we might not have our original history file anymore -+ if ( error ) -+ { -+ sprintf(_text,"malformed ad for job '%s' in file '%s'",m_job->getKey(), m_he.file.c_str()); -+ dprintf ( D_FULLDEBUG, "%s\n", _text.c_str()); -+ _ad.Assign("JOB_AD_ERROR",_text.c_str()); -+ return; -+ } -+ if ( empty ) -+ { -+ sprintf(_text,"empty ad for job '%s' in '%s'", m_job->getKey(),m_he.file.c_str()); -+ dprintf ( D_FULLDEBUG,"%s\n", _text.c_str()); -+ _ad.Assign("JOB_AD_ERROR",_text.c_str()); -+ return; -+ } -+ -+ if (!_ad.CopyFrom(myJobAd)) { -+ sprintf(_text,"problem copying contents of history ClassAd for '%s'",m_job->getKey()); -+ dprintf ( D_ALWAYS, "%s\n",_text.c_str()); -+ _ad.Assign("JOB_AD_ERROR",_text.c_str()); -+ } -+ -+} -+ -+////// -+// Job -+////// -+Job::Job(const char* _key): m_submission(NULL), m_live_job(NULL), m_history_job(NULL), m_key(_key) -+{ -+ dprintf (D_FULLDEBUG,"Job::Job of '%s'\n", m_key); -+} -+ -+Job::~Job() { -+ // Destroy will be safe way to -+ // cleanup -+ -+ dprintf (D_FULLDEBUG,"Job::~Job of '%s'\n", m_key); -+ -+ this->decrementSubmission(); -+ -+ delete m_live_job; -+ delete m_history_job; -+ -+ delete [] m_key; -+ // submissions are shared and can't be deleted here -+} -+ -+void Job::setImpl (LiveJobImpl* lji) -+{ -+ lji->setJob(this); -+ // probably shouldn't happen -+ if (m_live_job) { -+ delete m_live_job; -+ } -+ m_live_job = lji; -+ -+ // status of a live job always has precedence -+ // so decrement if the history job got in ahead of it -+ if (m_history_job) { -+ m_status = m_history_job->getStatus(); -+ m_submission->decrement(this); -+ } -+ m_status = m_live_job->getStatus(); -+} -+ -+void Job::setImpl (HistoryJobImpl* hji) -+{ -+ hji->setJob(this); -+ // probably shouldn't happen -+ if (m_history_job) { -+ delete m_history_job; -+ } -+ m_history_job = hji; -+ -+ // stay away from extra inc/decs if the live job is still doing its thing -+ if (!m_submission) { -+ m_status = m_history_job->getStatus(); -+ setSubmission(m_history_job->getSubmissionId(),m_history_job->getCluster()); -+ } -+ -+ // call Destroy to see if we can clean up the live job -+ this->destroy(); -+} -+ -+void Job::setStatus(int status) -+{ -+ m_status = status; -+} -+ -+const char* Job::getKey() const -+{ -+ return m_key; -+} -+ -+void Job::set ( const char *_name, const char *_value ) { -+ if (m_live_job) { -+ m_live_job->set(_name,_value); -+ } -+ // ignore for history jobs -+} -+ -+void Job::remove ( const char *_name ) { -+ if (m_live_job) { -+ m_live_job->remove(_name); -+ } -+ // ignore for history jobs -+} -+ -+void Job::incrementSubmission() { -+ if (m_submission) { -+ m_submission->increment(this); -+ } -+} -+ -+void Job::decrementSubmission() { -+ if (m_submission) { -+ m_submission->decrement(this); -+ } -+} -+ -+void -+Job::updateSubmission ( int cluster, const char* owner ) -+{ -+ OwnerlessSubmissionType::const_iterator it = g_ownerless_submissions.find ( cluster ); -+ if ( g_ownerless_submissions.end() != it ) { -+ SubmissionObject* submission = (*it).second; -+ submission->setOwner(owner); -+ g_ownerless_submissions.erase(cluster); -+ } -+} -+ -+void -+Job::setSubmission ( const char* _subName, int cluster ) -+{ -+ const char* owner = NULL; -+ -+ // need to see if someone has left us an owner -+ OwnerlessClusterType::const_iterator it = g_ownerless_clusters.find ( cluster ); -+ if ( g_ownerless_clusters.end() != it ) -+ { -+ owner = ( *it ).second.c_str() ; -+ } -+ -+ SubmissionCollectionType::const_iterator element = g_submissions.find ( _subName ); -+ SubmissionObject *submission; -+ if ( g_submissions.end() == element ) -+ { -+ submission = new SubmissionObject ( _subName, owner ); -+ g_submissions[strdup ( _subName ) ] = submission; -+ } -+ else -+ { -+ submission = ( *element ).second; -+ } -+ m_submission = submission; -+ -+ m_submission->increment(this); -+ -+ if (owner) { -+ // ensure that the submission has an owner -+ m_submission->setOwner ( owner ); -+ g_ownerless_clusters.erase ( cluster ); -+ } -+ else { -+ // add it to our list to be updated for owner -+ g_ownerless_submissions[cluster] = m_submission; -+ } -+ -+} -+ -+bool ClusterJobImpl::destroy() -+{ -+ return m_ref_count == 0; -+} -+ -+bool -+LiveJobImpl::destroy() -+{ -+ return ((this->getStatus() == COMPLETED) || (this->getStatus() == REMOVED)); -+} -+ -+bool -+Job::destroy() -+{ -+ -+ bool live_destroy = (m_live_job && m_live_job->destroy()); -+ -+ if (m_history_job && live_destroy) { -+ // must be a proc -+ delete m_live_job; -+ m_live_job = NULL; -+ return false; -+ } -+ -+ // hint to caller -+ return live_destroy; -+} -+ -+// space v. speed tradeoff here - we want to keep the size of the job server down -+// since we may have to support millions of jobs in memory -+void Job::getFullAd ( ClassAd& _ad) const -+{ -+ // history ads are always reconstructed -+ // so we deep copy the live job ad to be consistent -+ // on the interface -+ -+ if (m_live_job) { -+ _ad = *(m_live_job->getFullAd()); -+ } -+ else { -+ m_history_job->getFullAd(_ad); -+ } -+ -+} -+ -+// poke a hole for live job ad chaining -+const ClassAd* Job::getClassAd() const -+{ -+ const ClassAd* ad_ptr = NULL; -+ if (m_live_job) { -+ ad_ptr = m_live_job->getFullAd(); -+ } -+ return ad_ptr; -+ -+} -+ -+void Job::getSummary ( ClassAd& _ad) const -+{ -+ //same thing as full ad -+ if (m_live_job) { -+ _ad.CopyFrom(*m_live_job->getSummary()); -+ } -+ else { -+ m_history_job->getSummary(_ad); -+ } -+} -+ -+int Job::getStatus() const -+{ -+ return m_status; -+} -+ -+JobImpl* Job::getImpl() { -+ // only will provide live job impl -+ // if it's NULL the caller needs to deal -+ return m_live_job; -+} -diff --git a/src/condor_contrib/aviary/src/Job.h b/src/condor_contrib/aviary/src/Job.h -new file mode 100644 -index 0000000..453d941 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/Job.h -@@ -0,0 +1,160 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#ifndef _JOB_H -+#define _JOB_H -+ -+// c++ includes -+#include -+#include -+#include -+#include -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_debug.h" -+#include "condor_classad.h" -+ -+// local includes -+#include "Codec.h" -+#include "HistoryFile.h" -+#include "cmpstr.h" -+ -+using std::string; -+using std::map; -+using std::set; -+using std::vector; -+ -+using namespace aviary::codec; -+using namespace aviary::history; -+ -+namespace aviary { -+namespace query { -+ -+class SubmissionObject; -+class Job; -+ -+// interface class for job impls -+class JobImpl -+{ -+public: -+ Job* getJob() { return m_job; } -+ void setJob(Job* _job) { m_job = _job; } -+ -+protected: -+ Job* m_job; -+ JobImpl() {}; -+}; -+ -+class ClusterJobImpl; -+ -+// Job delegate that encapsulates the job active in the queue -+class LiveJobImpl: public JobImpl -+{ -+ public: -+ LiveJobImpl ( const char*, ClusterJobImpl* ); -+ virtual ~LiveJobImpl(); -+ int getStatus () const; -+ const ClassAd* getSummary (); -+ const ClassAd* getFullAd () const; -+ void set ( const char* , const char* ); -+ bool get ( const char * , const AviaryAttribute *& ) const; -+ void remove ( const char* ); -+ -+ virtual bool destroy(); -+ -+ private: -+ ClusterJobImpl* m_parent; -+ ClassAd* m_full_ad; -+ ClassAd* m_summary_ad; -+}; -+ -+class ClusterJobImpl: public LiveJobImpl -+{ -+public: -+ ClusterJobImpl(const char*); -+ ~ClusterJobImpl(); -+ void incrementRef(); -+ void decrementRef(); -+ bool destroy(); -+ -+private: -+ int m_ref_count; -+}; -+ -+// Job delegate that encapsulates the archived job history -+// and can derive the attributes of its associated class ad -+class HistoryJobImpl: public JobImpl -+{ -+ public: -+ HistoryJobImpl (const HistoryEntry&); -+ ~HistoryJobImpl(); -+ int getStatus () const; -+ void getSummary ( ClassAd& ) const; -+ void getFullAd ( ClassAd& ) const; -+ int getCluster() const; -+ const char* getSubmissionId () const; -+ -+ private: -+ HistoryEntry m_he; -+}; -+ -+// the public face of jobs -+// not for subclassing - clients (generally) shouldn't be -+// burdened with the live/history distinction -+class Job -+{ -+ public: -+ Job(const char*); -+ ~Job(); -+ -+ const char * getKey() const; -+ -+ int getStatus () const; -+ void setStatus(int); -+ -+ void getSummary (ClassAd&) const; -+ void getFullAd (ClassAd&) const; -+ const ClassAd* getClassAd() const; -+ -+ void set ( const char* , const char* ); -+ void remove ( const char* ); -+ -+ void setSubmission ( const char*, int ); -+ void updateSubmission ( int, const char* ); -+ void incrementSubmission(); -+ void decrementSubmission(); -+ -+ void setImpl(LiveJobImpl*); -+ void setImpl(HistoryJobImpl*); -+ JobImpl* getImpl(); -+ -+ bool destroy(); -+ -+ private: -+ SubmissionObject *m_submission; -+ // live job to start, history job when ready -+ LiveJobImpl* m_live_job; -+ HistoryJobImpl* m_history_job; -+ const char* m_key; -+ int m_status; -+}; -+ -+}} -+ -+#endif /* _JOB_H */ -diff --git a/src/condor_contrib/aviary/src/JobServerJobLogConsumer.cpp b/src/condor_contrib/aviary/src/JobServerJobLogConsumer.cpp -new file mode 100644 -index 0000000..4172562 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/JobServerJobLogConsumer.cpp -@@ -0,0 +1,226 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_debug.h" -+//#include "condor_exprtype.h" -+#include "condor_attributes.h" -+//#include "condor_astbase.h" -+//#include "condor_parser.h" -+#include "condor_qmgr.h" -+#include "ClassAdLogReader.h" -+ -+// local includes -+#include "JobServerJobLogConsumer.h" -+#include "Globals.h" -+#include "HistoryProcessingUtils.h" -+ -+using namespace aviary::query; -+using namespace aviary::history; -+ -+#define IS_JOB(key) ((key) && '0' != (key)[0]) -+ -+JobServerJobLogConsumer::JobServerJobLogConsumer(): m_reader(NULL) -+{ } -+ -+JobServerJobLogConsumer::~JobServerJobLogConsumer() -+{ } -+ -+void -+JobServerJobLogConsumer::Reset() -+{ -+ // When deleting jobs, to avoid problems with jobs referencing -+ // deleted clusters, we must be sure to delete the clusters -+ // last -+ -+ dprintf(D_FULLDEBUG, "JobServerJobLogConsumer::Reset() - deleting jobs and submissions\n"); -+ -+ for (JobCollectionType::iterator i = g_jobs.begin(); -+ g_jobs.end() != i; i++) { -+ // Skip clusters for now -+ if ('0' != (*i).second->getKey()[0]) { -+ delete (*i).second; -+ g_jobs.erase(i); -+ } -+ } -+ -+ for (JobCollectionType::iterator i = g_jobs.begin(); -+ g_jobs.end() != i; i++) { -+ delete (*i).second; -+ g_jobs.erase(i); -+ } -+ -+ for (SubmissionCollectionType::iterator i = g_submissions.begin(); -+ g_submissions.end() != i; i++) { -+ delete (*i).second; -+ g_submissions.erase(i); -+ } -+ -+ // due to the shared use of g_jobs -+ // a JobLogReader->Reset() might cause -+ // us to reload our history -+ init_history_files(); -+ -+} -+ -+bool -+JobServerJobLogConsumer::NewClassAd(const char *_key, -+ const char */*type*/, -+ const char */*target*/) -+{ -+ -+ dprintf(D_FULLDEBUG, "JobServerJobLogConsumer::NewClassAd processing _key='%s'\n", _key); -+ -+ // ignore the marker -+ if (strcmp(_key,"0.0") == 0) { -+ return true; -+ } -+ -+ const char* key_dup = strdup(_key); -+ -+ if ('0' == _key[0]) { -+ // Cluster ad -+ if (g_jobs.end() == g_jobs.find(_key)) { -+ Job* new_cluster_job = new Job(key_dup); -+ new_cluster_job->setImpl(new ClusterJobImpl(key_dup)); -+ g_jobs[key_dup] = new_cluster_job; -+ } -+ } else { -+ // Proc ad -+ -+ // first see if some other proc job is here -+ // ie history -+ if (g_jobs.end() != g_jobs.find(_key)) { -+ return true; -+ } -+ -+ PROC_ID proc = getProcByString(_key); -+ MyString cluster_key; -+ -+ cluster_key.sprintf("0%d.-1", proc.cluster); -+ -+ const char *cluster_dup = cluster_key.StrDup(); -+ JobCollectionType::const_iterator element = g_jobs.find(cluster_dup); -+ ClusterJobImpl* cluster_impl = NULL; -+ -+ if (g_jobs.end() == element) { -+ // didn't find an existing cluster job so create a new one -+ Job* new_cluster_job = new Job(cluster_dup); -+ cluster_impl = new ClusterJobImpl(cluster_dup); -+ new_cluster_job->setImpl(cluster_impl); -+ g_jobs[cluster_dup] = new_cluster_job; -+ } else { -+ // found an existing cluster job - we'll assume it is the cluster parent -+ cluster_impl = static_cast((*element).second->getImpl()); -+ } -+ -+ Job* new_proc_job = new Job(key_dup); -+ new_proc_job->setImpl(new LiveJobImpl(key_dup, cluster_impl)); -+ g_jobs[key_dup] = new_proc_job; -+ -+ } -+ -+ return true; -+} -+ -+bool -+JobServerJobLogConsumer::DestroyClassAd(const char *_key) -+{ -+ -+ // ignore the marker -+ if (strcmp(_key,"0.0") == 0) { -+ return true; -+ } -+ -+ dprintf ( D_FULLDEBUG, "JobServerJobLogConsumer::DestroyClassAd - key '%s'\n", _key); -+ JobCollectionType::iterator g_element = g_jobs.find(_key); -+ -+ if (g_jobs.end() == g_element) { -+ dprintf(D_ALWAYS, -+ "error reading %s: no such job found for key '%s'\n", -+ m_reader->GetClassAdLogFileName(), _key); -+ return false; -+ } -+ -+ Job* job = (*g_element).second; -+ // Destroy will figure out the submission decrement -+ if (job->destroy()) { -+ delete job; -+ job = NULL; -+ g_jobs.erase(g_element); -+ } -+ -+ return true; -+} -+ -+bool -+JobServerJobLogConsumer::SetAttribute(const char *_key, -+ const char *_name, -+ const char *_value) -+{ -+ -+ // ignore the marker -+ if (strcmp(_key,"0.0") == 0) { -+ return true; -+ } -+ -+ if (0 == strcmp(_name,"NextClusterNum") ) { -+ // skip over these -+ //dprintf(D_FULLDEBUG, "%s: skipping job entry '%s' for '%s = %s'\n", -+ // m_reader->GetJobLogFileName(), _key, _name, _value); -+ return true; -+ } -+ -+ JobCollectionType::const_iterator g_element = g_jobs.find(_key); -+ -+ if (g_jobs.end() == g_element) { -+ dprintf(D_ALWAYS, -+ "error reading %s : no such job '%s' for '%s = %s'\n", -+ m_reader->GetClassAdLogFileName(), -+ _key, _name, _value); -+ return false; -+ } -+ -+ (*g_element).second->set(_name, _value); -+ -+ return true; -+} -+ -+bool -+JobServerJobLogConsumer::DeleteAttribute(const char *_key, -+ const char *_name) -+{ -+ // ignore the marker -+ if (strcmp(_key,"0.0") == 0) { -+ return true; -+ } -+ -+ JobCollectionType::const_iterator g_element = g_jobs.find(_key); -+ -+ if (g_jobs.end() == g_element) { -+ dprintf(D_ALWAYS, -+ "error reading %s: no such job '%s' for 'delete %s'\n", -+ m_reader->GetClassAdLogFileName(), _key, _name); -+ return false; -+ } -+ -+ (*g_element).second->remove(_name); -+ -+ return true; -+} -diff --git a/src/condor_contrib/aviary/src/JobServerJobLogConsumer.h b/src/condor_contrib/aviary/src/JobServerJobLogConsumer.h -new file mode 100644 -index 0000000..22703ed ---- /dev/null -+++ b/src/condor_contrib/aviary/src/JobServerJobLogConsumer.h -@@ -0,0 +1,62 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#ifndef _JOBSERVERJOBLOGCONSUMER_H -+#define _JOBSERVERJOBLOGCONSUMER_H -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_debug.h" -+#include "ClassAdLogReader.h" -+ -+// local includes -+#include "Job.h" -+#include "SubmissionObject.h" -+ -+// c++ includes -+#include -+#include -+#include -+ -+using namespace std; -+ -+class JobServerJobLogConsumer: public ClassAdLogConsumer -+{ -+public: -+ JobServerJobLogConsumer(); -+ ~JobServerJobLogConsumer(); -+ -+ void Reset(); -+ bool NewClassAd(const char *key, -+ const char *type, -+ const char *target); -+ bool DestroyClassAd(const char *key); -+ bool SetAttribute(const char *key, -+ const char *name, -+ const char *value); -+ bool DeleteAttribute(const char *key, -+ const char *name); -+ void SetJobLogReader(ClassAdLogReader *_reader) { m_reader = _reader; } -+ -+ -+private: -+ -+ ClassAdLogReader *m_reader; -+}; -+ -+#endif /* _JOBSERVERJOBLOGCONSUMER_H */ -diff --git a/src/condor_contrib/aviary/src/JobServerObject.cpp b/src/condor_contrib/aviary/src/JobServerObject.cpp -new file mode 100644 -index 0000000..ee76024 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/JobServerObject.cpp -@@ -0,0 +1,374 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+//condor includes -+#include "condor_common.h" -+#include "condor_config.h" -+#include "condor_attributes.h" -+#include "condor_debug.h" -+#include "condor_qmgr.h" -+#include "set_user_priv_from_ad.h" -+#include "stat_info.h" -+#include "stl_string_utils.h" -+ -+// C++ includes -+// enable for debugging classad to ostream -+// watch out for unistd clash -+//#include -+ -+//local includes -+#include "JobServerObject.h" -+#include "AviaryConversionMacros.h" -+#include "AviaryUtils.h" -+#include "Codec.h" -+#include "JobServerJobLogConsumer.h" -+#include "Globals.h" -+ -+using namespace std; -+using namespace aviary::query; -+using namespace aviary::util; -+using namespace aviary::codec; -+ -+JobServerObject* JobServerObject::m_instance = NULL; -+ -+JobServerObject::JobServerObject () -+{ -+ m_name = getScheddName(); -+ m_pool = getPoolName(); -+ m_codec = new BaseCodec; -+} -+ -+JobServerObject::~JobServerObject() -+{ -+ delete m_codec; -+} -+ -+JobServerObject* JobServerObject::getInstance() -+{ -+ if (!m_instance) { -+ m_instance = new JobServerObject(); -+ } -+ return m_instance; -+} -+ -+void -+JobServerObject::update ( const ClassAd &ad ) -+{ -+ MGMT_DECLARATIONS; -+ -+ m_stats.Pool = getPoolName(); -+ STRING ( CondorPlatform ); -+ STRING ( CondorVersion ); -+ TIME_INTEGER ( DaemonStartTime ); -+// TIME_INTEGER(JobQueueBirthdate); -+ STRING ( Machine ); -+// INTEGER(MaxJobsRunning); -+ INTEGER ( MonitorSelfAge ); -+ DOUBLE ( MonitorSelfCPUUsage ); -+ DOUBLE ( MonitorSelfImageSize ); -+ INTEGER ( MonitorSelfRegisteredSocketCount ); -+ INTEGER ( MonitorSelfResidentSetSize ); -+ TIME_INTEGER ( MonitorSelfTime ); -+ STRING ( MyAddress ); -+ //TIME_INTEGER(MyCurrentTime); -+ STRING ( Name ); -+// INTEGER(NumUsers); -+ STRING ( PublicNetworkIpAddr ); -+// INTEGER(TotalHeldJobs); -+// INTEGER(TotalIdleJobs); -+// INTEGER(TotalJobAds); -+// INTEGER(TotalRemovedJobs); -+// INTEGER(TotalRunningJobs); -+ -+ m_stats.System = m_stats.Machine; -+} -+ -+Job* -+getValidKnownJob(const char* key, AviaryStatus &_status) { -+ -+ // #1: is it even a proper "cluster.proc"? -+ PROC_ID id = getProcByString(key); -+ if (id.cluster < 0 || id.proc < 0) { -+ sprintf (_status.text, "Invalid job id '%s'",key); -+ dprintf(D_FULLDEBUG, "%s\n", _status.text.c_str()); -+ _status.type = AviaryStatus::FAIL; -+ return NULL; -+ } -+ -+ // #2 is it anywhere in our job map? -+ JobCollectionType::const_iterator element = g_jobs.find(key); -+ if ( g_jobs.end() == element ) { -+ sprintf (_status.text, "Unknown local job id '%s'",key); -+ dprintf(D_FULLDEBUG, "%s\n", _status.text.c_str()); -+ _status.type = AviaryStatus::NO_MATCH; -+ return NULL; -+ } -+ -+ return (*element).second; -+} -+ -+bool JobServerObject::getStatus(const char* key, int& job_status, AviaryStatus &_status) { -+ Job* job = NULL; -+ if (!(job = getValidKnownJob(key,_status))) { -+ return false; -+ } -+ -+ job_status = job->getStatus(); -+ -+ _status.type = AviaryStatus::A_OK; -+ return true; -+} -+ -+bool JobServerObject::getSummary(const char* key, JobSummaryFields& _summary, AviaryStatus &_status) { -+ Job* job = NULL; -+ if (!(job = getValidKnownJob(key,_status))) { -+ return false; -+ } -+ -+ ClassAd classAd; -+ job->getSummary ( classAd ); -+ // little cheat for ad problems with history lookups -+ string str; -+ if ( classAd.LookupString("JOB_AD_ERROR", str) ) -+ { -+ sprintf(_status.text,"Error obtaining ClassAd for job '%s'; ",key); -+ _status.text += str; -+ dprintf(D_ALWAYS,"%s\n",_status.text.c_str()); -+ return false; -+ } -+ -+ // return the limited attributes -+ classAd.LookupString(ATTR_JOB_CMD,_summary.cmd); -+ classAd.LookupString(ATTR_JOB_ARGUMENTS1,_summary.args1); -+ classAd.LookupString(ATTR_JOB_ARGUMENTS2,_summary.args2); -+ classAd.LookupString(ATTR_HOLD_REASON,_summary.hold_reason); -+ classAd.LookupString(ATTR_RELEASE_REASON,_summary.release_reason); -+ classAd.LookupString(ATTR_REMOVE_REASON,_summary.remove_reason); -+ classAd.LookupString(ATTR_JOB_SUBMISSION,_summary.submission_id); -+ classAd.LookupString(ATTR_OWNER,_summary.owner); -+ classAd.LookupInteger(ATTR_Q_DATE,_summary.queued); -+ classAd.LookupInteger(ATTR_ENTERED_CURRENT_STATUS,_summary.last_update); -+ _summary.status = job->getStatus(); -+ -+ _status.type = AviaryStatus::A_OK; -+ return true; -+} -+ -+bool -+JobServerObject::getJobAd ( const char* key, AttributeMapType& _map, AviaryStatus &_status) -+{ -+ Job* job = NULL; -+ if (!(job = getValidKnownJob(key,_status))) { -+ return false; -+ } -+ // call Job::getFullAd and use utils to populate the map -+ ClassAd classAd; -+ job->getFullAd ( classAd ); -+ // little cheat for ad problems with history lookups -+ string str; -+ if ( classAd.LookupString("JOB_AD_ERROR", str) ) -+ { -+ sprintf(_status.text,"Error obtaining ClassAd for job '%s'; ",key); -+ _status.text += str; -+ dprintf(D_ALWAYS,"%s\n",_status.text.c_str()); -+ } -+ -+ // return all the attributes in the ClassAd -+ if ( !m_codec->classAdToMap ( classAd, _map ) ) -+ { -+ sprintf(_status.text,"Error mapping info for job '%s'; ",key); -+ dprintf(D_ALWAYS,"%s\n",_status.text.c_str()); -+ return false; -+ } -+ -+ // debug -+// if (DebugFlags & D_FULLDEBUG) { -+// classAd.dPrint(D_FULLDEBUG|D_NOHEADER); -+// std::ostringstream oss; -+// oss << _map; -+// dprintf(D_FULLDEBUG|D_NOHEADER, oss.str().c_str()); -+// } -+ -+ _status.type = AviaryStatus::A_OK; -+ return true; -+} -+ -+bool -+JobServerObject::fetchJobData(const char* key, -+ const UserFileType ftype, -+ std::string& fname, -+ int max_bytes, -+ bool from_end, -+ int& fsize, -+ std::string &data, -+ AviaryStatus &_status) -+{ -+ int32_t start; -+ int32_t end; -+ priv_state prev_priv_state; -+ int fd = -1; -+ int count; -+ int length; -+ int whence; -+ char *buffer; -+ bool fetched; -+ Job* job = NULL; -+ -+ if (!(job =getValidKnownJob(key,_status))) { -+ return false; -+ } -+ -+ -+ ClassAd ad; -+ string str; -+ job->getFullAd ( ad ); -+ if ( ad.LookupString("JOB_AD_ERROR", str) ) { -+ sprintf(_status.text,"Error checking ClassAd for user priv on job '%s'; ",key); -+ _status.text += str; -+ dprintf(D_ALWAYS,"%s\n",_status.text.c_str()); -+ return false; -+ } -+ -+ // find out what the actual file is from classad lookup -+ switch (ftype) { -+ case ERR: -+ if ( !ad.LookupString(ATTR_JOB_ERROR, fname) ) { -+ sprintf (_status.text, "No error file for job '%s'",key); -+ dprintf(D_ALWAYS,"%s\n", _status.text.c_str()); -+ return false; -+ } -+ break; -+ case LOG: -+ if ( !ad.LookupString(ATTR_ULOG_FILE, fname) ) { -+ sprintf (_status.text, "No log file for job '%s'",key); -+ dprintf(D_ALWAYS,"%s\n", _status.text.c_str()); -+ return false; -+ } -+ break; -+ case OUT: -+ if ( !ad.LookupString(ATTR_JOB_OUTPUT, fname) ) { -+ sprintf (_status.text, "No output file for job '%s'",key); -+ dprintf(D_ALWAYS,"%s\n", _status.text.c_str()); -+ return false; -+ } -+ break; -+ default: -+ // ruh-roh...asking for a file type we don't know about -+ sprintf (_status.text, "Unknown file type for job '%s'",key); -+ dprintf(D_ALWAYS,"%s\n", _status.text.c_str()); -+ return false; -+ } -+ -+ StatInfo the_file(fname.c_str()); -+ if (the_file.Error()) { -+ sprintf (_status.text, "Error opening requested file '%s', error %d",fname.c_str(),the_file.Errno()); -+ dprintf(D_ALWAYS,"%s\n", _status.text.c_str()); -+ return false; -+ } -+ -+ fsize = the_file.GetFileSize(); -+ -+ // we calculate these based on file size -+ if (from_end) { -+ end = fsize; -+ start = end - max_bytes; -+ } -+ else { -+ start = 0; -+ end = max_bytes; -+ } -+ -+ // start >= 0, end >= 0 :: lseek(start, SEEK_SET), read(end - start) -+ // end < start :: error, attempt to read backwards -+ // start >= 0, end < 0 :: error, don't know length -+ // start < 0, end > 0 :: attempt to read off end of file, end = 0 -+ // start < 0, end <= 0 :: lseek(start, SEEK_END), read(abs(start - end)) -+ // end < start :: error, attempt to read backwards -+ -+ // TODO: redundant checks given above -+ if ((start >= 0 && end >= 0 && end < start) || -+ (start >= 0 && end < 0) || -+ (start < 0 && end <= 0 && end < start)) { -+ _status.text = "Invalid start and end values"; -+ return false; -+ } -+ -+ // Instead of reading off the end of the file, read to the -+ // end of it -+ if (start < 0 && end > 0) { -+ end = 0; -+ } -+ -+ if (start >= 0) { -+ whence = SEEK_SET; -+ length = end - start; -+ } else { -+ whence = SEEK_END; -+ length = abs(start - end); -+ } -+ -+ // TODO: Sanity check that length isn't too big? -+ buffer = new char[length + 1]; -+ -+ prev_priv_state = set_user_priv_from_ad(ad); -+ -+ if (-1 != (fd = safe_open_wrapper(fname.c_str(), -+ O_RDONLY | _O_BINARY, -+ 0))) { -+ // If we are seeking from the end of the file, it is -+ // possible that we will try to seek off the front of the -+ // file. To avoid this, we check the file's size and set -+ // the max length that we are able to seek -+ if (SEEK_END == whence) { -+ struct stat buf; -+ if (-1 != fstat(fd, &buf)) { -+ if (buf.st_size < abs(start)) { -+ start = -buf.st_size; -+ } -+ } // if fstat fails, we just continue having made an effort -+ } -+ -+ if (-1 != lseek(fd, start, whence)) { -+ if (-1 == (count = full_read(fd, buffer, length))) { -+ _status.text = "Failed to read from " + fname; -+ fetched = false; -+ } else { -+ // Terminate the string. -+ buffer[count] = '\0'; -+ -+ data = buffer; -+ fetched = true; -+ } -+ -+ close(fd); // assume closed on failure? -+ } else { -+ _status.text = "Failed to seek in " + fname; -+ fetched = false; -+ } -+ } else { -+ _status.text = "Failed to open " + fname; -+ fetched = false; -+ } -+ -+ set_priv(prev_priv_state); -+ -+ delete [] buffer; -+ -+ if (fetched) { -+ _status.type = AviaryStatus::A_OK; -+ } -+ return fetched; -+} -diff --git a/src/condor_contrib/aviary/src/JobServerObject.h b/src/condor_contrib/aviary/src/JobServerObject.h -new file mode 100644 -index 0000000..d305270 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/JobServerObject.h -@@ -0,0 +1,124 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef _JOBSERVEROBJECT_H -+#define _JOBSERVEROBJECT_H -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_classad.h" -+ -+// local includes -+#include "Codec.h" -+ -+struct a; -+struct a; -+struct a; -+struct a; -+using namespace std; -+using namespace compat_classad; -+using namespace aviary::codec; -+ -+namespace aviary { -+namespace query { -+ -+struct JobServerStats { -+ // Properties -+ string CondorPlatform; -+ string CondorVersion; -+ int64_t DaemonStartTime; -+ string Pool; -+ string System; -+ uint32_t MaxJobsRunning; -+ string Machine; -+ string MyAddress; -+ string Name; -+ string PublicNetworkIpAddr; -+ -+ // Statistics -+ uint32_t MonitorSelfAge; -+ double MonitorSelfCPUUsage; -+ double MonitorSelfImageSize; -+ uint32_t MonitorSelfRegisteredSocketCount; -+ uint32_t MonitorSelfResidentSetSize; -+ int64_t MonitorSelfTime; -+ uint32_t NumUsers; -+}; -+ -+enum UserFileType { -+ ERR = 0, -+ LOG = 1, -+ OUT = 2 -+}; -+ -+struct JobSummaryFields { -+ int status; -+ string cmd; -+ string args1; -+ string args2; -+ int queued; -+ int last_update; -+ string hold_reason; -+ string release_reason; -+ string remove_reason; -+ string submission_id; -+ string owner; -+}; -+ -+typedef pair JobSummaryPair; -+typedef vector JobSummaryPairCollection; -+ -+class JobServerObject -+{ -+public: -+ -+ void update(const ClassAd &ad); -+ -+ bool getStatus(const char* id, int& status, AviaryStatus &_status); -+ bool getSummary(const char* key, JobSummaryFields& _summary, AviaryStatus &_status); -+ bool getJobAd(const char* id, AttributeMapType& _map, AviaryStatus &_status); -+ bool fetchJobData(const char* key, -+ const UserFileType ftype, -+ std::string& fname, -+ int max_bytes, -+ bool from_end, -+ int& fsize, -+ std::string &data, -+ AviaryStatus &_status); -+ -+ ~JobServerObject(); -+ static JobServerObject* getInstance(); -+ -+ const char* getName() { return m_name.c_str(); } -+ const char* getPool() { return m_pool.c_str(); } -+ -+private: -+ JobServerObject(); -+ JobServerObject(JobServerObject const&); -+ JobServerObject& operator=(JobServerObject const&); -+ -+ string m_name; -+ string m_pool; -+ JobServerStats m_stats; -+ Codec* m_codec; -+ -+ static JobServerObject* m_instance; -+ -+}; -+ -+}} /* aviary::query */ -+ -+#endif /* _JOBSERVEROBJECT_H */ -diff --git a/src/condor_contrib/aviary/src/PROC_ID_comparator.cpp b/src/condor_contrib/aviary/src/PROC_ID_comparator.cpp -new file mode 100644 -index 0000000..6eb94ba ---- /dev/null -+++ b/src/condor_contrib/aviary/src/PROC_ID_comparator.cpp -@@ -0,0 +1,41 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_debug.h" -+#include "proc.h" -+ -+// local includes -+#include "PROC_ID_comparator.h" -+ -+using namespace aviary::util; -+ -+bool -+PROC_ID_comparator::operator()(const std::string &lhs, const std::string &rhs) -+{ -+ PROC_ID lhs_id, rhs_id; -+ -+ // !!! The EXCEPT macro is "#define EXCEPT \", so we must -+ // !!! enclose it in { }'s else we'll always EXCEPT -+ -+ if (!StrToProcId(lhs.c_str(), lhs_id)) { EXCEPT("Invalid LHS PROC_ID %s", lhs.c_str()); } -+ if (!StrToProcId(rhs.c_str(), rhs_id)) { EXCEPT("Invalid RHS PROC_ID %s", rhs.c_str()); } -+ -+ return -+ (lhs_id.cluster < rhs_id.cluster) || -+ ((lhs_id.cluster == rhs_id.cluster) && (lhs_id.proc < rhs_id.proc)); -+} -diff --git a/src/condor_contrib/aviary/src/PROC_ID_comparator.h b/src/condor_contrib/aviary/src/PROC_ID_comparator.h -new file mode 100644 -index 0000000..4a45d1c ---- /dev/null -+++ b/src/condor_contrib/aviary/src/PROC_ID_comparator.h -@@ -0,0 +1,32 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef _PROC_ID_COMPARATOR_H -+#define _PROC_ID_COMPARATOR_H -+ -+#include -+ -+namespace aviary { -+namespace util { -+ -+struct PROC_ID_comparator -+{ -+ bool operator()(const std::string &lhs, const std::string &rhs); -+}; -+ -+}}; -+ -+#endif /* _PROC_ID_COMPARATOR_H */ -diff --git a/src/condor_contrib/aviary/src/SchedulerObject.cpp b/src/condor_contrib/aviary/src/SchedulerObject.cpp -new file mode 100644 -index 0000000..5f48c97 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/SchedulerObject.cpp -@@ -0,0 +1,363 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_config.h" -+#include "condor_attributes.h" -+#include "condor_debug.h" -+#include "condor_qmgr.h" -+#include "../condor_schedd.V6/scheduler.h" -+ -+// local includes -+#include "AviaryUtils.h" -+#include "AviaryConversionMacros.h" -+#include "SchedulerObject.h" -+#include "Codec.h" -+ -+// Global Scheduler object, used for needReschedule -+extern Scheduler scheduler; -+extern char * Name; -+ -+using namespace aviary::job; -+using namespace aviary::util; -+using namespace aviary::codec; -+ -+SchedulerObject* SchedulerObject::m_instance = NULL; -+ -+SchedulerObject::SchedulerObject() -+{ -+ m_pool = getPoolName(); -+ m_name = getScheddName(); -+ m_codec = new BaseCodec(); -+} -+ -+SchedulerObject::~SchedulerObject() -+{ -+ delete m_codec; -+} -+ -+SchedulerObject* SchedulerObject::getInstance() -+{ -+ if (!m_instance) { -+ m_instance = new SchedulerObject(); -+ } -+ return m_instance; -+} -+ -+void -+SchedulerObject::update(const ClassAd &ad) -+{ -+ MGMT_DECLARATIONS; -+ -+ m_stats.Pool = getPoolName(); -+ STRING(CondorPlatform); -+ STRING(CondorVersion); -+ TIME_INTEGER(DaemonStartTime); -+ TIME_INTEGER(JobQueueBirthdate); -+ STRING(Machine); -+ INTEGER(MaxJobsRunning); -+ INTEGER(MonitorSelfAge); -+ DOUBLE(MonitorSelfCPUUsage); -+ DOUBLE(MonitorSelfImageSize); -+ INTEGER(MonitorSelfRegisteredSocketCount); -+ INTEGER(MonitorSelfResidentSetSize); -+ TIME_INTEGER(MonitorSelfTime); -+ STRING(MyAddress); -+ //TIME_INTEGER(MyCurrentTime); -+ STRING(Name); -+ INTEGER(NumUsers); -+ STRING(MyAddress); -+ INTEGER(TotalHeldJobs); -+ INTEGER(TotalIdleJobs); -+ INTEGER(TotalJobAds); -+ INTEGER(TotalRemovedJobs); -+ INTEGER(TotalRunningJobs); -+ m_stats.System = m_stats.Machine; -+ -+ // debug -+ if (DebugFlags & D_FULLDEBUG) { -+ const_cast(&ad)->dPrint(D_FULLDEBUG|D_NOHEADER); -+ } -+} -+ -+ -+bool -+SchedulerObject::submit(AttributeMapType &jobAdMap, std::string &id, std::string &text) -+{ -+ int cluster; -+ int proc; -+ -+ if (!m_codec) { -+ text = "Codec has not been initialized"; -+ return false; -+ } -+ -+ // our mandatory set of attributes for a submit -+ const char* required[] = { -+ ATTR_JOB_CMD, -+ ATTR_REQUIREMENTS, -+ ATTR_OWNER, -+ ATTR_JOB_IWD, -+ NULL -+ }; -+ -+ // 1. Create transaction -+ BeginTransaction(); -+ -+ // 2. Create cluster -+ if (-1 == (cluster = NewCluster())) { -+ AbortTransaction(); -+ text = "Failed to create new cluster"; -+ return false; -+ } -+ -+ // 3. Create proc -+ if (-1 == (proc = NewProc(cluster))) { -+ AbortTransaction(); -+ text = "Failed to create new proc"; -+ return false; -+ } -+ -+ // 4. Submit job ad -+ -+ // Schema: (vanilla job) -+ // Schedd demands - Owner, JobUniverse -+ // To run - JobStatus, Requirements -+ -+ // Schedd excepts if no Owner -+ // Schedd prunes on startup if no Owner or JobUniverse -+ // Schedd won't run job without JobStatus -+ // Job cannot match without Requirements -+ // Shadow rejects jobs without an Iwd -+ // Shadow: Job has no CondorVersion, assuming pre version 6.3.3 -+ // Shadow: Unix Vanilla job is pre version 6.3.3, setting 'TransferFiles = "NEVER"' -+ // Starter won't run job without Cmd -+ // Starter needs a valid Owner (local account name) if not using nobody -+ // condor_q requires ClusterId (int), ProcId (int), QDate (int), RemoteUserCpu (float), JobStatus (int), JobPrio (int), ImageSize (int), Owner (str) and Cmd (str) -+ -+ // Schema: (vm job) -+ // ShouldTransferFiles - unset by default, must be set -+ -+ ClassAd ad; -+ int universe; -+ -+ // ShouldTransferFiles - unset by default, must be set -+ // shadow will try to setup local transfer sandbox otherwise -+ // without good priv -+ ad.Assign(ATTR_SHOULD_TRANSFER_FILES, "NO"); -+ -+ if (!m_codec->mapToClassAd(jobAdMap, ad)) { -+ AbortTransaction(); -+ text = "Failed to parse job ad"; -+ return false; -+ } -+ -+ std::string missing; -+ if (!checkRequiredAttrs(ad, required, missing)) { -+ AbortTransaction(); -+ text = "Job ad is missing required attributes: " + missing; -+ return false; -+ } -+ -+ // EARLY SET: These attribute are set early so the incoming ad -+ // has a change to override them. -+ ::SetAttribute(cluster, proc, ATTR_JOB_STATUS, "1"); // 1 = idle -+ -+ // Junk that condor_q wants, but really shouldn't be necessary -+ ::SetAttribute(cluster, proc, ATTR_JOB_REMOTE_USER_CPU, "0.0"); // float -+ ::SetAttribute(cluster, proc, ATTR_JOB_PRIO, "0"); // int -+ ::SetAttribute(cluster, proc, ATTR_IMAGE_SIZE, "0"); // int -+ -+ if (!ad.LookupInteger(ATTR_JOB_UNIVERSE, universe)) { -+ char* uni_str = param("DEFAULT_UNIVERSE"); -+ if (!uni_str) { -+ universe = CONDOR_UNIVERSE_VANILLA; -+ } -+ else { -+ universe = CondorUniverseNumber(uni_str); -+ } -+ ::SetAttributeInt(cluster, proc, ATTR_JOB_UNIVERSE, universe ); -+ } -+ // more stuff - without these our idle stats are whack -+ if ( universe != CONDOR_UNIVERSE_MPI && universe != CONDOR_UNIVERSE_PVM ) { -+ ::SetAttribute(cluster, proc, ATTR_MAX_HOSTS, "1"); // int -+ ::SetAttribute(cluster, proc, ATTR_MIN_HOSTS, "1"); // int -+ } -+ ::SetAttribute(cluster, proc, ATTR_CURRENT_HOSTS, "0"); // int -+ -+ ExprTree *expr; -+ const char *name; -+ std::string value; -+ ad.ResetExpr(); -+ while (ad.NextExpr(name,expr)) { -+ -+ // All these extra lookups are horrible. They have to -+ // be there because the ClassAd may have multiple -+ // copies of the same attribute name! This means that -+ // the last attribute with a given name will set the -+ // value, but the last attribute tends to be the -+ // attribute with the oldest (wrong) value. How -+ // annoying is that! -+ if (!(expr = ad.Lookup(name))) { -+ dprintf(D_ALWAYS, "Failed to lookup %s\n", name); -+ -+ AbortTransaction(); -+ text = "Failed to parse job ad attribute"; -+ return false; -+ } -+ -+ value = ExprTreeToString(expr); -+ ::SetAttribute(cluster, proc, name, value.c_str()); -+ } -+ -+ // LATE SET: These attributes are set late, after the incoming -+ // ad, so they override whatever the incoming ad set. -+ char buf[22]; // 22 is max size for an id, 2^32 + . + 2^32 + \0 -+ snprintf(buf, 22, "%d", cluster); -+ ::SetAttribute(cluster, proc, ATTR_CLUSTER_ID, buf); -+ snprintf(buf, 22, "%d", proc); -+ ::SetAttribute(cluster, proc, ATTR_PROC_ID, buf); -+ snprintf(buf, 22, "%d", time(NULL)); -+ ::SetAttribute(cluster, proc, ATTR_Q_DATE, buf); -+ -+ // Could check for some invalid attributes, e.g -+ // JobUniverse <= CONDOR_UNIVERSE_MIN or >= CONDOR_UNIVERSE_MAX -+ -+ // 5. Commit transaction -+ CommitTransaction(); -+ -+ -+ // 6. Reschedule -+ scheduler.needReschedule(); -+ -+ -+ // 7. Return identifier -+ // TODO: dag ids? -+ MyString tmp; -+ //tmp.sprintf("%s#%d.%d", Name, cluster, proc); -+ // we have other API compositions for job id and submission id -+ // so let's return raw cluster.proc -+ tmp.sprintf("%d.%d", cluster, proc); -+ id = tmp.Value(); -+ -+ return true; -+} -+ -+bool -+SchedulerObject::setAttribute(std::string key, -+ std::string name, -+ std::string value, -+ std::string &text) -+{ -+ PROC_ID id = getProcByString(key.c_str()); -+ if (id.cluster < 0 || id.proc < 0) { -+ dprintf(D_FULLDEBUG, "SetAttribute: Failed to parse id: %s\n", key.c_str()); -+ text = "Invalid Id"; -+ return false; -+ } -+ -+ if (!isValidAttributeName(name,text)) { -+ return false; -+ } -+ -+ // All values are strings in the eyes of -+ // ::SetAttribute. Their type is inferred when read from -+ // the ClassAd log. It is important that the incoming -+ // value is properly quoted to differentiate between EXPR -+ // and STRING. -+ if (::SetAttribute(id.cluster, -+ id.proc, -+ name.c_str(), -+ value.c_str())) { -+ text = "Failed to set attribute " + name + " to " + value; -+ return false; -+ } -+ -+ return true; -+} -+ -+bool -+SchedulerObject::hold(std::string key, std::string &reason, std::string &text) -+{ -+ PROC_ID id = getProcByString(key.c_str()); -+ if (id.cluster < 0 || id.proc < 0) { -+ dprintf(D_FULLDEBUG, "Hold: Failed to parse id: %s\n", key.c_str()); -+ text = "Invalid Id"; -+ return false; -+ } -+ -+ if (!holdJob(id.cluster, -+ id.proc, -+ reason.c_str(), -+ true, // Always perform this action within a transaction -+ true, // Always notify the shadow of the hold -+ false, // Do not email the user about this action -+ false, // Do not email admin about this action -+ false // This is not a system related (internal) hold -+ )) { -+ text = "Failed to hold job"; -+ return false; -+ } -+ -+ return true; -+} -+ -+bool -+SchedulerObject::release(std::string key, std::string &reason, std::string &text) -+{ -+ PROC_ID id = getProcByString(key.c_str()); -+ if (id.cluster < 0 || id.proc < 0) { -+ dprintf(D_FULLDEBUG, "Release: Failed to parse id: %s\n", key.c_str()); -+ text = "Invalid Id"; -+ return false; -+ } -+ -+ if (!releaseJob(id.cluster, -+ id.proc, -+ reason.c_str(), -+ true, // Always perform this action within a transaction -+ false, // Do not email the user about this action -+ false // Do not email admin about this action -+ )) { -+ text = "Failed to release job"; -+ return false; -+ } -+ -+ return true; -+} -+ -+bool -+SchedulerObject::remove(std::string key, std::string &reason, std::string &text) -+{ -+ PROC_ID id = getProcByString(key.c_str()); -+ if (id.cluster < 0 || id.proc < 0) { -+ dprintf(D_FULLDEBUG, "Remove: Failed to parse id: %s\n", key.c_str()); -+ text = "Invalid Id"; -+ return false; -+ } -+ -+ if (!abortJob(id.cluster, -+ id.proc, -+ reason.c_str(), -+ true // Always perform within a transaction -+ )) { -+ text = "Failed to remove job"; -+ return false; -+ } -+ -+ return true; -+} -diff --git a/src/condor_contrib/aviary/src/SchedulerObject.h b/src/condor_contrib/aviary/src/SchedulerObject.h -new file mode 100644 -index 0000000..670218e ---- /dev/null -+++ b/src/condor_contrib/aviary/src/SchedulerObject.h -@@ -0,0 +1,100 @@ -+/* -+ * Copyright 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef _SCHEDULEROBJECT_H -+#define _SCHEDULEROBJECT_H -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_classad.h" -+ -+// local includes -+#include "Codec.h" -+#include "AviaryUtils.h" -+ -+using namespace std; -+using namespace aviary::util; -+using namespace aviary::codec; -+ -+namespace aviary { -+namespace job { -+ -+struct SchedulerStats { -+ // Properties -+ string CondorPlatform; -+ string CondorVersion; -+ int64_t DaemonStartTime; -+ string Pool; -+ string System; -+ int64_t JobQueueBirthdate; -+ uint32_t MaxJobsRunning; -+ string Machine; -+ string MyAddress; -+ string Name; -+ -+ // Statistics -+ uint32_t MonitorSelfAge; -+ double MonitorSelfCPUUsage; -+ double MonitorSelfImageSize; -+ uint32_t MonitorSelfRegisteredSocketCount; -+ uint32_t MonitorSelfResidentSetSize; -+ int64_t MonitorSelfTime; -+ uint32_t NumUsers; -+ uint32_t TotalHeldJobs; -+ uint32_t TotalIdleJobs; -+ uint32_t TotalJobAds; -+ uint32_t TotalRemovedJobs; -+ uint32_t TotalRunningJobs; -+}; -+ -+class SchedulerObject { -+public: -+ -+ -+ void update(const ClassAd &ad); -+ bool submit(AttributeMapType& jobAdMap, string& id, string& text); -+ bool setAttribute(string id, -+ string name, -+ string value, -+ string &text); -+ bool hold(string id, string &reason, string &text); -+ bool release(string id, string &reason, string &text); -+ bool remove(string id, string &reason, string &text); -+ -+ static SchedulerObject* getInstance(); -+ -+ const char* getPool() {return m_pool.c_str(); } -+ const char* getName() {return m_name.c_str(); } -+ -+ ~SchedulerObject(); -+ -+private: -+ SchedulerObject(); -+ SchedulerObject(SchedulerObject const&); -+ SchedulerObject& operator=(SchedulerObject const&); -+ -+ string m_pool; -+ string m_name; -+ Codec* m_codec; -+ SchedulerStats m_stats; -+ static SchedulerObject* m_instance; -+ -+}; -+ -+ -+}} /* aviary::job */ -+ -+#endif /* _SCHEDULEROBJECT_H */ -diff --git a/src/condor_contrib/aviary/src/SubmissionObject.cpp b/src/condor_contrib/aviary/src/SubmissionObject.cpp -new file mode 100644 -index 0000000..32d19f2 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/SubmissionObject.cpp -@@ -0,0 +1,221 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_config.h" -+#include "condor_debug.h" -+#include "condor_attributes.h" -+#include "proc.h" -+ -+// local includes -+#include "SubmissionObject.h" -+#include "JobServerObject.h" -+#include "AviaryUtils.h" -+ -+using namespace std; -+using namespace aviary::query; -+using namespace aviary::codec; -+using namespace aviary::util; -+ -+SubmissionObject::SubmissionObject ( -+ const char *_name, -+ const char *_owner ) : -+ ownerSet ( false ) -+{ -+ m_name = _name; -+ if ( _owner ) -+ { -+ setOwner ( _owner ); -+ } -+ else -+ { -+ setOwner ( "Unknown" ); -+ ownerSet = false; -+ } -+ -+ m_codec = new BaseCodec; -+ -+ dprintf ( D_FULLDEBUG, "Created new SubmissionObject '%s' for '%s'\n", _name, _owner); -+} -+ -+SubmissionObject::~SubmissionObject() -+{ -+ dprintf ( D_FULLDEBUG, "SubmissionObject::~SubmissionObject for '%s'\n", m_name.c_str()); -+ delete m_codec; -+} -+ -+void -+SubmissionObject::increment ( const Job *job ) -+{ -+ int status = job->getStatus(); -+ -+ dprintf ( D_FULLDEBUG, "SubmissionObject::increment '%s' on '%s'\n", getJobStatusString(status), job->getKey()); -+ -+ switch ( status ) -+ { -+ case IDLE: -+ m_idle.insert ( job ); -+ break; -+ case RUNNING: -+ m_running.insert ( job ); -+ break; -+ case REMOVED: -+ m_removed.insert ( job ); -+ break; -+ case COMPLETED: -+ m_completed.insert ( job ); -+ break; -+ case HELD: -+ m_held.insert ( job ); -+ break; -+ default: -+ dprintf ( D_ALWAYS, "error: Unknown %s of %d on %s\n", -+ ATTR_JOB_STATUS, status, job->getKey() ); -+ break; -+ } -+} -+ -+void -+SubmissionObject::decrement ( const Job *job ) -+{ -+ int status = job->getStatus(); -+ -+ dprintf ( D_FULLDEBUG, "SubmissionObject::decrement '%s' on '%s'\n", getJobStatusString(status), job->getKey()); -+ -+ switch ( status ) -+ { -+ case IDLE: -+ m_idle.erase ( job ); -+ break; -+ case RUNNING: -+ m_running.erase ( job ); -+ break; -+ case REMOVED: -+ m_removed.erase ( job ); -+ break; -+ case COMPLETED: -+ m_completed.erase ( job ); -+ break; -+ case HELD: -+ m_held.erase ( job ); -+ break; -+ default: -+ dprintf ( D_ALWAYS, "error: Unknown %s of %d on %s\n", -+ ATTR_JOB_STATUS, status, job->getKey() ); -+ break; -+ } -+} -+ -+ -+const SubmissionObject::JobSet & -+SubmissionObject::getIdle() -+{ -+ return m_idle; -+} -+ -+const SubmissionObject::JobSet & -+SubmissionObject::getRunning() -+{ -+ return m_running; -+} -+ -+const SubmissionObject::JobSet & -+SubmissionObject::getRemoved() -+{ -+ return m_removed; -+} -+ -+const SubmissionObject::JobSet & -+SubmissionObject::getCompleted() -+{ -+ return m_completed; -+} -+ -+const SubmissionObject::JobSet & -+SubmissionObject::getHeld() -+{ -+ return m_held; -+} -+ -+void -+SubmissionObject::setOwner ( const char *_owner ) -+{ -+ if (_owner && !ownerSet ) -+ { -+ m_owner = _owner; -+ ownerSet = true; -+ } -+} -+ -+JobSummaryPair makeJobPair(const Job* job) { -+ JobServerObject* jso = JobServerObject::getInstance(); -+ const char* job_cp = job->getKey(); -+ JobSummaryFields* jsf = new JobSummaryFields; -+ AviaryStatus status; -+ // TODO: should check this return val i suppose -+ jso->getSummary(job_cp, *jsf, status); -+ return make_pair(job_cp,jsf); -+} -+ -+void -+SubmissionObject::getJobSummaries ( JobSummaryPairCollection &jobs) -+{ -+ -+ // id, timestamp (which?), command, args, ins, outs, state, message -+ // id, time queued, time entered current state, state, command, args, hold reason, release reason -+ -+ // find all the jobs in their various states... -+ -+ //1) Idle -+ for ( SubmissionObject::JobSet::const_iterator i = getIdle().begin(); -+ getIdle().end() != i; i++ ) -+ { -+ jobs.push_back(makeJobPair(*i)); -+ } -+ -+ //2) Running -+ for ( SubmissionObject::JobSet::const_iterator i = getRunning().begin(); -+ getRunning().end() != i; -+ i++ ) -+ { -+ jobs.push_back(makeJobPair(*i)); -+ } -+ -+ //3) Removed -+ for ( SubmissionObject::JobSet::const_iterator i = getRemoved().begin(); -+ getRemoved().end() != i; i++ ) -+ { -+ jobs.push_back(makeJobPair(*i)); -+ } -+ -+ //4) Completed -+ for ( SubmissionObject::JobSet::const_iterator i = getCompleted().begin(); -+ getCompleted().end() != i; i++ ) -+ { -+ jobs.push_back(makeJobPair(*i)); -+ } -+ -+ //5) Held -+ for ( SubmissionObject::JobSet::const_iterator i = getHeld().begin(); -+ getHeld().end() != i; i++ ) -+ { -+ jobs.push_back(makeJobPair(*i)); -+ } -+ -+} -diff --git a/src/condor_contrib/aviary/src/SubmissionObject.h b/src/condor_contrib/aviary/src/SubmissionObject.h -new file mode 100644 -index 0000000..2b0f7a6 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/SubmissionObject.h -@@ -0,0 +1,88 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#ifndef _SUBMISSIONOBJECT_H -+#define _SUBMISSIONOBJECT_H -+ -+// c++ includes -+#include -+#include -+#include -+ -+// coondor includes -+#include "condor_common.h" -+ -+// local includes -+#include "Job.h" -+#include "JobServerObject.h" -+ -+using std::string; -+using std::map; -+using std::set; -+ -+namespace aviary { -+namespace query { -+ -+struct cmpjob { -+ bool operator()(const Job *a, const Job *b) const { -+ return strcmp(a->getKey(), b->getKey()) < 0; -+ } -+}; -+ -+class SubmissionObject -+{ -+public: -+ friend class Job; -+ typedef set JobSet; -+ -+ SubmissionObject( const char *name, const char *owner); -+ ~SubmissionObject(); -+ -+ const JobSet & getIdle(); -+ const JobSet & getRunning(); -+ const JobSet & getRemoved(); -+ const JobSet & getCompleted(); -+ const JobSet & getHeld(); -+ -+ void setOwner(const char *owner); -+ const char* getOwner() { return m_owner.c_str(); } -+ const char* getName() { return m_name.c_str(); } -+ void getJobSummaries(JobSummaryPairCollection& _jobs); -+ -+protected: -+ void increment(const Job *job); -+ void decrement(const Job *job); -+ -+private: -+ JobSet m_idle; -+ JobSet m_running; -+ JobSet m_removed; -+ JobSet m_completed; -+ JobSet m_held; -+ -+ bool ownerSet; -+ -+ string m_name; -+ string m_owner; -+ Codec* m_codec; -+ -+}; -+ -+}} -+ -+#endif /* _SUBMISSIONOBJECT_H */ -diff --git a/src/condor_contrib/aviary/src/aviary_query_server.cpp b/src/condor_contrib/aviary/src/aviary_query_server.cpp -new file mode 100644 -index 0000000..1231a27 ---- /dev/null -+++ b/src/condor_contrib/aviary/src/aviary_query_server.cpp -@@ -0,0 +1,279 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+// condor includes -+#include "condor_common.h" -+#include "condor_daemon_core.h" -+#include "condor_debug.h" -+#include "condor_attributes.h" -+#include "get_daemon_name.h" -+#include "subsystem_info.h" -+#include "condor_config.h" -+#include "stat_info.h" -+#include "JobLogMirror.h" -+ -+// local includes -+#include "Axis2SoapProvider.h" -+#include "JobServerJobLogConsumer.h" -+#include "JobServerObject.h" -+#include "HistoryProcessingUtils.h" -+#include "Globals.h" -+ -+// about self -+DECL_SUBSYSTEM("QUERY_SERVER", SUBSYSTEM_TYPE_DAEMON ); // used by Daemon Core -+ -+using namespace std; -+using namespace aviary::query; -+using namespace aviary::soap; -+using namespace aviary::history; -+ -+ClassAd *ad = NULL; -+Axis2SoapProvider* provider = NULL; -+JobLogMirror *mirror = NULL; -+JobServerJobLogConsumer *consumer = NULL; -+JobServerObject *job_server = NULL; -+ -+extern MyString m_path; -+ -+void init_classad(); -+void Dump(); -+int HandleTransportSocket(Service *, Stream *); -+int HandleResetSignal(Service *, int); -+void ProcessHistoryTimer(Service*); -+ -+//------------------------------------------------------------- -+ -+int main_init(int /* argc */, char * /* argv */ []) -+{ -+ dprintf(D_ALWAYS, "main_init() called\n"); -+ -+ // setup the job log consumer -+ consumer = new JobServerJobLogConsumer(); -+ mirror = new JobLogMirror(consumer); -+ mirror->init(); -+ -+ // config then env for our all-important axis2 repo dir -+ const char* log_file = "./aviary_query.axis2.log"; -+ string repo_path; -+ char *tmp = NULL; -+ if (tmp = param("WSFCPP_HOME")) { -+ repo_path = tmp; -+ free(tmp); -+ } -+ else if (tmp = getenv("WSFCPP_HOME")) { -+ repo_path = tmp; -+ } -+ else { -+ EXCEPT("No WSFCPP_HOME in config or env"); -+ } -+ -+ int port = param_integer("HTTP_PORT",9091); -+ int level = param_integer("AXIS2_DEBUG_LEVEL",AXIS2_LOG_LEVEL_CRITICAL); -+ -+ // init transport here -+ provider = new Axis2SoapProvider(level,log_file,repo_path.c_str()); -+ -+ std::string axis_error; -+ if (!provider->init(port,AXIS2_HTTP_DEFAULT_SO_TIMEOUT,axis_error)) { -+ dprintf(D_ALWAYS, "%s\n",axis_error.c_str()); -+ EXCEPT("Failed to initialize Axis2SoapProvider"); -+ } -+ -+ init_classad(); -+ -+ ReliSock *sock = new ReliSock; -+ if (!sock) { -+ EXCEPT("Failed to allocate transport socket"); -+ } -+ -+ if (!sock->assign(provider->getHttpListenerSocket())) { -+ EXCEPT("Failed to bind transport socket"); -+ } -+ int index; -+ if (-1 == (index = -+ daemonCore->Register_Socket((Stream *) sock, -+ "Transport method socket", -+ (SocketHandler) -+ HandleTransportSocket, -+ "Handler for transport invocations"))) { -+ EXCEPT("Failed to register transport socket"); -+ } -+ -+ job_server = JobServerObject::getInstance(); -+ -+ dprintf(D_ALWAYS,"Axis2 listener on http port: %d\n",port); -+ -+ // before doing any job history processing, set the location of the files -+ // TODO: need to test mal-HISTORY values: HISTORY=/tmp/somewhere -+ const char* tmp2 = param ( "HISTORY" ); -+ StatInfo si( tmp2 ); -+ tmp2 = si.DirPath (); -+ if ( !tmp2 ) -+ { -+ dprintf ( D_ALWAYS, "warning: No HISTORY defined - Aviary Query Server will not process history jobs\n" ); -+ } -+ else -+ { -+ m_path = tmp2; -+ dprintf ( D_FULLDEBUG, "HISTORY path is %s\n",tmp2 ); -+ // register a timer for processing of historical job files -+ if (-1 == (index = -+ daemonCore->Register_Timer( -+ 0, -+ param_integer("HISTORY_INTERVAL",120), -+ (TimerHandler)ProcessHistoryTimer, -+ "Timer for processing job history files" -+ ))) { -+ EXCEPT("Failed to register history timer"); -+ } -+ } -+ -+ // useful for testing job coalescing -+ // and potentially just useful -+ if (-1 == (index = -+ daemonCore->Register_Signal(SIGUSR1, -+ "Forced Reset Signal", -+ (SignalHandler) -+ HandleResetSignal, -+ "Handler for Reset signals"))) { -+ EXCEPT("Failed to register Reset signal"); -+ } -+ -+ return TRUE; -+} -+ -+void -+init_classad() -+{ -+ if ( ad ) { -+ delete ad; -+ } -+ ad = new ClassAd(); -+ -+ ad->SetMyTypeName("QueryServer"); -+ ad->SetTargetTypeName("Daemon"); -+ -+ char* default_name = default_daemon_name(); -+ if( ! default_name ) { -+ EXCEPT( "default_daemon_name() returned NULL" ); -+ } -+ ad->Assign(ATTR_NAME, default_name); -+ delete [] default_name; -+ -+ ad->Assign(ATTR_MY_ADDRESS, my_ip_string()); -+ -+ // Initialize all the DaemonCore-provided attributes -+ daemonCore->publish( ad ); -+ -+} -+ -+//------------------------------------------------------------- -+ -+int -+main_config() -+{ -+ dprintf(D_ALWAYS, "main_config() called\n"); -+ -+ return TRUE; -+} -+ -+//------------------------------------------------------------- -+ -+void Stop() -+{ -+ if (param_boolean("DUMP_STATE", false)) { -+ Dump(); -+ } -+ -+ delete job_server; -+ -+ DC_Exit(0); -+} -+ -+//------------------------------------------------------------- -+ -+int main_shutdown_fast() -+{ -+ dprintf(D_ALWAYS, "main_shutdown_fast() called\n"); -+ -+ Stop(); -+ -+ DC_Exit(0); -+ return TRUE; // to satisfy c++ -+} -+ -+//------------------------------------------------------------- -+ -+int main_shutdown_graceful() -+{ -+ dprintf(D_ALWAYS, "main_shutdown_graceful() called\n"); -+ -+ Stop(); -+ -+ DC_Exit(0); -+ return TRUE; // to satisfy c++ -+} -+ -+//------------------------------------------------------------- -+ -+void -+main_pre_dc_init( int /* argc */, char* /* argv */ [] ) -+{ -+ // dprintf isn't safe yet... -+} -+ -+ -+void -+main_pre_command_sock_init( ) -+{ -+} -+ -+ -+int -+HandleTransportSocket(Service *, Stream *) -+{ -+ // respond to a transport callback here -+ std::string provider_error; -+ if (!provider->processHttpRequest(provider_error)) { -+ dprintf (D_ALWAYS,"Error processing request: %s\n",provider_error.c_str()); -+ } -+ -+ return KEEP_STREAM; -+} -+ -+int -+HandleResetSignal(Service *, int) -+{ -+ consumer->Reset(); -+ -+ return TRUE; -+} -+ -+void ProcessHistoryTimer(Service*) { -+ dprintf(D_FULLDEBUG, "ProcessHistoryTimer() called\n"); -+ processHistoryDirectory(); -+ processOrphanedIndices(); -+ processCurrentHistory(); -+} -+ -+ -+void -+Dump() -+{ -+ dprintf(D_ALWAYS|D_NOHEADER, "DUMP called\n"); -+} -diff --git a/src/condor_contrib/aviary/src/cmpstr.h b/src/condor_contrib/aviary/src/cmpstr.h -new file mode 100644 -index 0000000..a4b2fbe ---- /dev/null -+++ b/src/condor_contrib/aviary/src/cmpstr.h -@@ -0,0 +1,28 @@ -+/*************************************************************** -+ * -+ * Copyright (C) 2009-2011 Red Hat, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); you -+ * may not use this file except in compliance with the License. You may -+ * obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ ***************************************************************/ -+ -+#ifndef _CMPSTR_H -+#define _CMPSTR_H -+ -+struct cmpstr { -+ bool operator()(const char *a, const char *b) const { -+ return strcmp(a, b) < 0; -+ } -+}; -+ -+#endif /* _CMPSTR_H */ -diff --git a/src/condor_contrib/aviary/test/jobcontrol.py b/src/condor_contrib/aviary/test/jobcontrol.py -new file mode 100755 -index 0000000..a7c051f ---- /dev/null -+++ b/src/condor_contrib/aviary/test/jobcontrol.py -@@ -0,0 +1,57 @@ -+#!/usr/bin/env python -+# -*- coding: utf-8 -*- -+# -+# Copyright 2009-2011 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+ -+# uses Suds - https://fedorahosted.org/suds/ -+from suds import * -+from suds.client import Client -+from sys import exit, argv, stdin -+import time -+ -+# change these for other default locations and ports -+job_wsdl = 'file:/var/lib/condor/aviary/services/job/aviary-job.wsdl' -+ -+cmds = ['holdJob', 'releaseJob', 'removeJob'] -+ -+cmdarg = len(argv) > 1 and argv[1] -+cproc = len(argv) > 2 and argv[2] -+job_url = len(argv) > 3 and argv[3] or "http://localhost:9090/services/job/" -+ -+if cmdarg not in cmds: -+ print "error unknown command: ", cmdarg -+ print "available commands are: ",cmds -+ exit(1) -+ -+client = Client(job_wsdl); -+job_url += cmdarg -+client.set_options(location=job_url) -+ -+# set up our JobID -+jobId = client.factory.create('ns0:JobID') -+jobId.job = cproc -+ -+try: -+ func = getattr(client.service, cmdarg, None) -+ if callable(func): -+ result = func(jobId,"test") -+except Exception, e: -+ print "unable to access scheduler at: ", job_url -+ print e -+ exit(1) -+ -+if result.code != "OK": -+ print result.code,"; ", result.text -diff --git a/src/condor_contrib/aviary/test/jobquery.py b/src/condor_contrib/aviary/test/jobquery.py -new file mode 100755 -index 0000000..f311c38 ---- /dev/null -+++ b/src/condor_contrib/aviary/test/jobquery.py -@@ -0,0 +1,68 @@ -+#!/usr/bin/env python -+# -*- coding: utf-8 -*- -+# -+# Copyright 2009-2011 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+ -+# uses Suds - https://fedorahosted.org/suds/ -+import logging -+from suds import * -+from suds.client import Client -+from sys import exit, argv, stdin -+import time -+ -+# enable these to see the SOAP messages -+#logging.basicConfig(level=logging.INFO) -+#logging.getLogger('suds.client').setLevel(logging.DEBUG) -+ -+# change these for other default locations and ports -+job_wsdl = 'file:/var/lib/condor/aviary/services/query/aviary-query.wsdl' -+ -+cmds = ['getJobStatus', 'getJobSummary', 'getJobDetails'] -+ -+cmdarg = len(argv) > 1 and argv[1] -+cproc = len(argv) > 2 and argv[2] -+job_url = len(argv) > 3 and argv[3] or "http://localhost:9091/services/query/" -+ -+if cmdarg not in cmds: -+ print "error unknown command: ", cmdarg -+ print "available commands are: ",cmds -+ exit(1) -+ -+client = Client(job_wsdl); -+job_url += cmdarg -+client.set_options(location=job_url) -+ -+# enable to see service schema -+#print client -+ -+# set up our JobID -+if cproc: -+ jobId = client.factory.create("ns0:JobID") -+ jobId.job = cproc -+else: -+ # returns all jobs -+ jobId = None -+ -+try: -+ func = getattr(client.service, cmdarg, None) -+ if callable(func): -+ result = func(jobId) -+except Exception, e: -+ print "invocation failed: ", job_url -+ print e -+ exit(1) -+ -+print result -diff --git a/src/condor_contrib/aviary/test/setattr.py b/src/condor_contrib/aviary/test/setattr.py -new file mode 100755 -index 0000000..175210c ---- /dev/null -+++ b/src/condor_contrib/aviary/test/setattr.py -@@ -0,0 +1,54 @@ -+#!/usr/bin/env python -+# -*- coding: utf-8 -*- -+# -+# Copyright 2009-2011 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+ -+# uses Suds - https://fedorahosted.org/suds/ -+from suds import * -+from suds.client import Client -+from sys import exit, argv, stdin -+import time -+ -+# change these for other default locations and ports -+job_wsdl = 'file:/var/lib/condor/aviary/services/job/aviary-job.wsdl' -+ -+cproc = len(argv) > 1 and argv[1] -+attr_name = len(argv) > 2 and argv[2] -+attr_value = len(argv) > 3 and argv[3] -+job_url = len(argv) > 4 and argv[4] or "http://localhost:9090/services/job/setJobAttribute" -+ -+client = Client(job_wsdl); -+client.set_options(location=job_url) -+ -+# set up our JobID -+jobId = client.factory.create('ns0:JobID') -+jobId.job = cproc -+ -+# set up the Attribute -+aviary_attr = client.factory.create('ns0:Attribute') -+aviary_attr.name = attr_name -+aviary_attr.type = "STRING"; -+aviary_attr.value = '"'+attr_value+'"' -+ -+try: -+ result = client.service.setJobAttribute(jobId, aviary_attr) -+except Exception, e: -+ print "unable to access scheduler at: ", job_url -+ print e -+ exit(1) -+ -+if result.code != "OK": -+ print result.code,"; ", result.text -diff --git a/src/condor_contrib/aviary/test/submissions.py b/src/condor_contrib/aviary/test/submissions.py -new file mode 100755 -index 0000000..1f03d63 ---- /dev/null -+++ b/src/condor_contrib/aviary/test/submissions.py -@@ -0,0 +1,55 @@ -+#!/usr/bin/env python -+# -*- coding: utf-8 -*- -+# -+# Copyright 2009-2011 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+ -+# uses Suds - https://fedorahosted.org/suds/ -+import logging -+from suds import * -+from suds.client import Client -+from sys import exit, argv -+ -+# enable these to see the SOAP messages -+#logging.basicConfig(level=logging.INFO) -+#logging.getLogger('suds.client').setLevel(logging.DEBUG) -+ -+query_wsdl = 'file:/var/lib/condor/aviary/services/query/aviary-query.wsdl' -+ -+sub_name = len(argv) > 1 and argv[1] -+query_url = len(argv) > 2 and argv[2] or 'http://localhost:9091/services/query/getSubmissionSummary' -+ -+client = Client(query_wsdl); -+client.set_options(location=query_url) -+ -+# enable to see service schema -+#print client -+ -+# set up our ID -+if sub_name: -+ subId = client.factory.create("ns0:SubmissionID") -+ subId.name = sub_name -+else: -+ # returns all jobs -+ subId = None -+ -+try: -+ submissions = client.service.getSubmissionSummary(subId) -+except Exception, e: -+ print "invocation failed: ", query_url -+ print e -+ exit(1) -+ -+print submissions -diff --git a/src/condor_contrib/aviary/test/submit.py b/src/condor_contrib/aviary/test/submit.py -new file mode 100755 -index 0000000..a4bfabe ---- /dev/null -+++ b/src/condor_contrib/aviary/test/submit.py -@@ -0,0 +1,89 @@ -+#!/usr/bin/env python -+# -*- coding: utf-8 -*- -+# -+# Copyright 2009-2011 Red Hat, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+ -+# uses Suds - https://fedorahosted.org/suds/ -+from suds import * -+from suds.client import Client -+from sys import exit, argv -+import time, pwd, os -+ -+uid = pwd.getpwuid(os.getuid())[0] -+if not uid: -+ uid = "condor" -+ -+quiet = False -+ -+# change these for other default locations and ports -+job_wsdl = 'file:/var/lib/condor/aviary/services/job/aviary-job.wsdl' -+job_url = 'http://localhost:9090/services/job/submitJob' -+ -+for arg in argv[1:]: -+ if arg == '-q': -+ quiet = True -+ if "http://" in arg: -+ url = arg -+ -+client = Client(job_wsdl); -+client.set_options(location=job_url) -+ -+if not quiet: -+ print client -+ -+# add specific requirements here -+req1 = client.factory.create("ns0:ResourceConstraint") -+req1.type = 'OS' -+req1.value = 'LINUX' -+reqs = [ req1 ] -+ -+# add extra Condor-specific or custom job attributes here -+extra1 = client.factory.create("ns0:Attribute") -+extra1.name = 'RECIPE' -+extra1.type = 'STRING' -+extra1.value = 'SECRET_SAUCE' -+extras = [ extra1 ] -+ -+try: -+ result = client.service.submitJob( \ -+ # the executable command -+ '/bin/sleep', \ -+ # some arguments for the command -+ '120', \ -+ # the submitter name -+ uid, \ -+ # initial working directory wwhere job will execute -+ '/tmp', \ -+ # an arbitrary string identifying the target submission group -+ 'python_test_submit', \ -+ # special resource requirements -+ reqs, \ -+ # additional attributes -+ extras -+ ) -+except Exception, e: -+ print "invocation failed at: ", job_url -+ print e -+ exit(1) -+ -+if result.status.code != "OK": -+ print result.status.code,"; ", result.status.text -+ exit(1) -+ -+if not quiet: -+ print result -+else: -+ print result.id.job; -diff --git a/src/condor_contrib/condor_dbq/author.txt b/src/condor_contrib/condor_dbq/author.txt -new file mode 100644 -index 0000000..e34989f ---- /dev/null -+++ b/src/condor_contrib/condor_dbq/author.txt -@@ -0,0 +1,3 @@ -+author: James Kupsch -+organization: University of Wisconsin-Madison -+e-mail: kupsch@cs.wisc.edu -diff --git a/src/condor_contrib/condor_dbq/condor_dbq.pl b/src/condor_contrib/condor_dbq/condor_dbq.pl -new file mode 100755 -index 0000000..dd07292 ---- /dev/null -+++ b/src/condor_contrib/condor_dbq/condor_dbq.pl -@@ -0,0 +1,1792 @@ -+#!/usr/bin/perl -w -+ -+################################################################ -+# -+# Copyright (C) 2009-2010, Condor Team, Computer Sciences Department, -+# University of Wisconsin-Madison, WI. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); you -+# may not use this file except in compliance with the License. You may -+# obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+################################################################ -+ -+ -+use strict; -+use DBI; -+use Getopt::Long; -+use Carp; -+ -+ -+my $condorQCmd = "condor_q"; -+my $condorSubmitCmd = "condor_submit"; -+ -+my $condorAttrPrefix = 'CDBQ_'; -+my $cdbqIdAttr = "${condorAttrPrefix}ID"; -+my $cdbqSysAttr = "${condorAttrPrefix}SYS"; -+ -+ -+package CondorUserLog; -+ -+sub new -+{ -+ my $invocant = shift; -+ -+ my $class = ref($invocant) || $invocant; -+ my $self = { -+ filename => undef, -+ fh => undef, -+ buf => '', -+ bufOffset => 0, -+ fileOffset => 0, -+ readChunkSize => 1024, -+ dev => undef, -+ ino => undef, -+ fileErrMsg => undef, -+ fileErrNum => 0, -+ lastUpdateTime => 0, -+ @_ -+ }; -+ -+ die "filename required" unless defined $self->{filename}; -+ -+ if (defined $self->{offset}) { -+ $self->{bufOffset} = $self->{fileOffset} = $self->{offset}; -+ delete $self->{offset}; -+ } -+ -+ bless $self, $class; -+ return $self; -+} -+ -+ -+sub FileExists -+{ -+ my $self = shift; -+ -+ return -f $self->{filename}; -+} -+ -+ -+sub Open -+{ -+ my $self = shift; -+ -+ if (!defined $self->{fh}) { -+ my $fh; -+ my $errMsg = ''; -+ my $errNum = 0; -+ -+ my $r = open $fh, "<", $self->{filename}; -+ if ($r) { -+ binmode $fh; -+ $r = seek $fh, $self->{fileOffset}, 0; -+ if ($r) { -+ $self->{fh} = $fh; -+ } else { -+ $errMsg = "seek: $!"; -+ $errNum = 0 + $!; -+ close $fh -+ } -+ } else { -+ $errMsg = "open: $!"; -+ $errNum = 0 + $!; -+ } -+ -+ $self->{fileErrMsg} = $errMsg; -+ $self->{fileErrNum} = $errNum; -+ } -+ -+ return $self->{fh}; -+} -+ -+ -+sub Close -+{ -+ my $self = shift; -+ -+ if (defined $self->{fh}) { -+ my $r = close $self->{fh}; -+ $self->{fh} = undef if $r; -+ return $r; -+ } -+ -+ return 0; -+} -+ -+ -+sub SetPosition -+{ -+ my $self = shift; -+ my $pos = shift; -+ -+ $self->{buf} = ''; -+ $self->{bufOffset} = $self->{fileOffset} = $pos; -+ -+ my $r = seek $self->{fh}, $pos, 0; -+ if (!$r) { -+ $self->Close; -+ } -+} -+ -+ -+sub DESTROY -+{ -+ my $self = shift; -+ -+ $self->Close; -+} -+ -+ -+sub ReadFileChunk -+{ -+ my $self = shift; -+ -+ my $fh = $self->Open; -+ -+ return unless defined $fh; -+ -+ my $fileSize = -s $fh; -+ my $fileOffset = $self->{fileOffset}; -+ -+ if ($fileOffset > $fileSize) { -+ $self->{fileErrMsg} -+ = "File truncated size=$fileSize, last read=$fileOffset"; -+ $self->{fileErrNum} = -1; -+ return; -+ } -+ -+ my $fileBytesRemaining = $fileSize - $fileOffset; -+ my $readSize = $self->{readChunkSize}; -+ $readSize = $fileBytesRemaining if $fileBytesRemaining < $readSize; -+ -+ return 0 if $readSize == 0; -+ -+ my $buf; -+ my $bytesRead = read $fh, $buf, $readSize; -+ -+ if ($bytesRead != $readSize) { -+ seek $fh, 0, 1; -+ $self->{fileErrMsg} -+ = "Read truncated wanted=$readSize, read=$bytesRead"; -+ $self->{fileErrNum} = -1; -+ return; -+ } -+ -+ $self->{buf} .= $buf; -+ $self->{fileOffset} += $bytesRead; -+ -+ return $bytesRead; -+} -+ -+ -+# -+# returns (record, recordOffset, nextRecordOffset) if record found -+# ( ) if no record available -+# (undef , recordOffset, undef, errMsg, errNum) if error -+# -+sub GetNextRecord -+{ -+ my $self = shift; -+ -+ while (1) { -+ my ($r, $delim, $rest) = split /^(\.{3}\r?\n)/m, $self->{buf}, 2; -+ my $recordPos = $self->{bufOffset}; -+ -+ if (defined $delim) { -+ # found record -+ $self->{buf} = $rest; -+ $self->{bufOffset} += length($r) + length($delim); -+ -+ return ($r, $recordPos, $self->{bufOffset}); -+ } else { -+ my $amount = $self->ReadFileChunk; -+ -+ if (!defined $amount) { -+ # error occurred -+ return (undef, $recordPos, undef, -+ $self->{fileErrMsg}, $self->{fileErrNum}); -+ } elsif ($amount == 0) { -+ # no record found -+ return; -+ } -+ } -+ } -+} -+ -+ -+ -+ -+package CondorWork; -+ -+ -+sub new -+{ -+ my $invocant = shift; -+ -+ my $class = ref($invocant) || $invocant; -+ my $self = { -+ workId => undef, -+ filename => undef, -+ userLog => undef, -+ nextPos => 0, -+ logErrMsg => undef, -+ logErrNum => undef, -+ totalJobs => 0, -+ completeJobs => 0, -+ jobs => {}, -+ @_ -+ }; -+ -+ die "filename required" unless defined $self->{filename}; -+ -+ die "workId required" unless defined $self->{workId}; -+ -+ $self->{userLog} = new CondorUserLog( -+ filename => $self->{filename}, -+ offset => $self->{nextPos} -+ ); -+ -+ bless $self, $class; -+ return $self; -+} -+ -+ -+my $eventRE = qr/^(\d+)\s+ # state -+ \((\d+)\.(\d+)\.(\d+)\)\s+ # cluster,proc.subproc -+ (\d+)\/(\d+)\s+ # MM DD -+ (\d+):(\d+):(\d+)\s+ # hh:mm:ss -+ (.*)$/sx; # info -+ -+my $normalTermRE = qr/Normal termination \(return value (\d+)\)/; -+ -+my $abnormalTermRE = qr/Abnormal termination \(signal (\d+)\)/; -+ -+# states in this array should go in the database -+# true value indicates state is terminal: 5 (terminated) and 9 (removed) -+my %states = map {$_ => ($_ == 5 || $_ == 9)} qw( 0 1 2 4 5 7 9 10 11 12 13); -+ -+ -+sub Print -+{ -+ my $self = shift; -+ -+ print "----- CondorWork -------\n"; -+ my @keyNames = qw(workId filename nextPos logErrMsg logErrNum -+ totalJobs completeJobs); -+ foreach my $k (@keyNames) { -+ my $v = $self->{$k}; -+ $v = "" unless defined $v; -+ printf "%15s %s\n", $k, $v; -+ } -+ printf "%15s %s\n", "jobsSeen", scalar(keys %{$self->{jobs}}); -+ print "------------------------\n"; -+} -+ -+ -+sub RestoreJobs -+{ -+ my $self = shift; -+ my $jobs = shift; -+ -+ %{$self->{jobs}} = %$jobs; -+} -+ -+ -+sub MakeCondorId -+{ -+ return join '.', @_; -+} -+ -+ -+sub IsTerminalState -+{ -+ my $state = shift; -+ return exists($states{$state}) && $states{$state}; -+} -+ -+ -+sub SetPosition -+{ -+ my $self = shift; -+ my $pos = shift; -+ -+ $self->{userLog}->SetPosition($pos); -+} -+ -+ -+sub NumIncompleteJobs -+{ -+ my $self = shift; -+ -+ return $self->{totalJobs} - $self->{completeJobs}; -+} -+ -+ -+sub ParseRecordToEvent -+{ -+ my ($record, $recordPos, $nextPos, $logErrMsg, $logErrNum) = @_; -+ my %e; -+ -+ if (!defined $recordPos) { -+ %e = ( -+ type => 'none' -+ ); -+ } elsif (!defined $record) { -+ %e = ( -+ type => 'error', -+ recordPos => $recordPos, -+ errMsg => $logErrMsg, -+ errNum => $logErrNum, -+ ); -+ } elsif ($record =~ $eventRE) { -+ %e = ( -+ type => 'event', -+ state => 0 + $1, -+ cluster => 0 + $2, -+ proc => 0 + $3, -+ subproc => 0 + $4, -+ mon => 0 + $5, -+ day => 0 + $6, -+ hr => 0 + $7, -+ min => 0 + $8, -+ sec => 0 + $9, -+ info => $10, -+ exitSignal => undef, -+ exitCode => undef, -+ recordPos => $recordPos, -+ nextPos => $nextPos -+ ); -+ -+ # guess at adjusting the year, since the year isn't in the record :( -+ # 1 month ahead is the future -+ # everything else is in the past -+ my ($mo, $yr) = (localtime time)[4, 5]; -+ ++$mo; -+ $yr += 1900; -+ ++$yr if ($mo == 12 && $e{mo} == 1); -+ --$yr if ($mo + 1 < $e{mon}); -+ $e{yr} = $yr; -+ -+ $e{terminal} = IsTerminalState($e{state}); -+ -+ # get how it terminated if state is 5 -+ if ($e{state} == 5) { -+ if ($e{info} =~ $normalTermRE) { -+ $e{exitCode} = 0 + $1; -+ } elsif ($e{info} =~ $abnormalTermRE) { -+ $e{exitSignal} = 0 + $1; -+ } -+ } -+ -+ # only certain states get updated in the database -+ $e{recordState} = exists $states{$e{state}}; -+ -+ # create id to use for printing and key values -+ $e{id} = MakeCondorId(@e{qw(cluster proc subproc)}); -+ -+ # create ts in database format -+ $e{ts} = "$e{yr}-$e{mon}-$e{day} $e{hr}:$e{min}:$e{sec}"; -+ } else { -+ %e = ( -+ type => 'error', -+ recordPos => $recordPos, -+ errMsg => "invalid record format at offset $recordPos" -+ ); -+ } -+ -+ return \%e; -+} -+ -+ -+sub GetNextEvent -+{ -+ my $self = shift; -+ -+ my $userLog = $self->{userLog}; -+ -+ my $event = ParseRecordToEvent($userLog->GetNextRecord()); -+ -+ return $event; -+} -+ -+ -+sub GetNewEvents -+{ -+ my $self = shift; -+ -+ my $errMsg; -+ my $errNum; -+ my $nextPos; -+ -+ my %jobs; -+ -+ while (1) { -+ my $e = $self->GetNextEvent; -+ my $type = $e->{type}; -+ -+ last if $type eq 'none'; -+ -+ if ($type eq 'event') { -+ $nextPos = $e->{nextPos}; -+ -+ next unless $e->{recordState}; -+ -+ my $id = $e->{id}; -+ $jobs{$id} = $e unless exists $jobs{$id} && $jobs{$id}->{terminal}; -+ } elsif ($type eq 'error') { -+ if (scalar(keys %jobs) == 0) { -+ $errMsg = $e->{errMsg}; -+ $errNum = $e->{errNum}; -+ } -+ -+ $self->SetPosition($e->{recordPos}); -+ -+ last; -+ } else { -+ die "unknown event type ($type)"; -+ } -+ } -+ -+ return (\%jobs, $errMsg, $errNum, $nextPos); -+} -+ -+ -+sub AddCondorIdsFromLog -+{ -+ my $self = shift; -+ my $jobs = shift; -+ -+ while (1) { -+ my $e = $self->GetNextEvent; -+ -+ if ($e->{type} eq 'event') { -+ $jobs->{$e->{id}} = 1; -+ } else { -+ last; -+ } -+ } -+} -+ -+ -+sub PrintEvent -+{ -+ my $e = shift; -+ -+ my @attrs = qw( type recordPos nextPos state id cluster proc subproc -+ yr mon day hr min sec ts info terminal -+ exitSignal exitCode recordState errMsg errNum ); -+ -+ print "-------------\n"; -+ foreach my $k (@attrs) { -+ next unless exists $e->{$k}; -+ my $v = $e->{$k}; -+ $v = "" unless defined $v; -+ printf "%-14s: %s\n", $k, $v; -+ } -+ print "-------------\n"; -+} -+ -+ -+sub RemoveAlreadyTerminatedJobEvents -+{ -+ my $self = shift; -+ my $newJobs = shift; -+ my $currentJobs = $self->{jobs}; -+ -+ foreach my $j (keys %$newJobs) { -+ delete $newJobs->{$j} if exists $currentJobs->{$j} && $currentJobs->{$j}; -+ } -+} -+ -+ -+sub ApplyJobUpdates -+{ -+ my $self = shift; -+ my ($newJobs, $errMsg, $errNum, $nextPos) = @_; -+ my $currentJobs = $self->{jobs}; -+ my $completeJobs = $self->{completeJobs}; -+ -+ $self->{errMsg} = $errMsg; -+ $self->{errNum} = $errNum; -+ $self->{nextPos} = $nextPos; -+ -+ foreach my $j (keys %$newJobs) { -+ my $jobComplete = $newJobs->{$j}->{terminal}; -+ $currentJobs->{$j} = $jobComplete; -+ ++$completeJobs if $jobComplete; -+ } -+ -+ $self->{completeJobs} = $completeJobs; -+} -+ -+ -+sub ProcessNewEvents -+{ -+ my $self = shift; -+ my ($dbh, $insertJobSth, $updateJobSth, $updateWorkJobsSth, -+ $updateWorkCompleteSth, $updateWorkJobsErrorSth) = @_; -+ -+ my $currentJobs = $self->{jobs}; -+ my $id = $self->{id}; -+ my $success = 1; -+ my $completeJobs = $self->{completeJobs}; -+ -+ my ($newJobs, $errMsg, $errNum, $nextPos) = $self->GetNewEvents; -+ -+ if (scalar keys %$newJobs) { -+ $self->RemoveAlreadyTerminatedJobEvents($newJobs); -+ my $workId = $self->{workId}; -+ -+ $dbh->begin_work; -+ -+ foreach my $jobId (keys %$newJobs) { -+ my $job = $newJobs->{$jobId}; -+ -+ if (defined $currentJobs->{$jobId}) { -+ # existing job -+ my @attrs = qw(state info ts exitCode exitSignal -+ cluster proc subproc); -+ -+ my $rows = $updateJobSth->execute(@{$job}{@attrs}, $workId); -+ if (!defined $rows || $rows != 1) { -+ my $dbErr = $dbh->errstr; -+ $success = 0; -+ main::LogAndExit("Update work record failed id=$id: $dbErr\n", 1); -+ } -+ } else { -+ # new job -+ my @attrs = qw(state info ts ts -+ cluster proc subproc); -+ -+ my $rows = $insertJobSth->execute(@{$job}{@attrs}, $workId); -+ if (!defined $rows || $rows != 1) { -+ my $dbErr = $dbh->errstr; -+ $success = 0; -+ main::LogAndExit("Insert work record failed id=$id: $dbErr\n", 1); -+ } -+ } -+ -+ $currentJobs->{$jobId} = $job->{terminal}; -+ ++$completeJobs if $job->{terminal}; -+ } -+ -+ my $updateWorkSth; -+ if ($completeJobs >= $self->{totalJobs}) { -+ # all jobs for work are done -+ $updateWorkSth = $updateWorkCompleteSth; -+ } else { -+ # still jobs to complete -+ $updateWorkSth = $updateWorkJobsSth; -+ } -+ -+ my $rows = $updateWorkSth->execute($nextPos, $completeJobs, $workId); -+ if (!defined $rows && $rows != 1) { -+ my $dbErr = $dbh->errstr; -+ $success = 0; -+ main::LogAndExit("update work record failed id=$id: $dbErr\n", 1); -+ } -+ -+ if ($success) { -+ $dbh->commit; -+ } else { -+ $dbh->rollback; -+ } -+ } elsif (defined $errMsg || defined $errNum) { -+ my $rows = $updateWorkJobsErrorSth->execute($nextPos, $errMsg, $errNum, $id); -+ if (!defined $rows || $rows != 1) { -+ my $dbErr = $dbh->errstr; -+ $success = 0; -+ main::LogAndExit("Updating work record failed id=$id: $dbErr\n", 1); -+ } -+ } -+ -+ $self->ApplyJobUpdates($newJobs, $errMsg, $errNum, $nextPos); -+} -+ -+ -+ -+package CondorActiveWork; -+ -+ -+sub new -+{ -+ my $invocant = shift; -+ -+ my $class = ref($invocant) || $invocant; -+ my $self = { -+ work => {}, -+ numIncompleteJobs => 0 -+ }; -+ -+ bless $self, $class; -+ return $self; -+} -+ -+ -+sub AddWork -+{ -+ my $self = shift; -+ my ($workId, $filename, $totalJobs, @remain) = @_; -+ -+ my $work = new CondorWork( workId => $workId, -+ filename => $filename, -+ totalJobs => $totalJobs, -+ @remain); -+ -+ $self->{work}->{$workId} = $work; -+ $self->{numIncompleteJobs} += $totalJobs; -+} -+ -+ -+sub NumWork -+{ -+ my $self = shift; -+ return scalar keys %{$self->{work}}; -+} -+ -+ -+sub NumIncompleteJobs -+{ -+ my $self = shift; -+ return $self->{numIncompleteJobs}; -+} -+ -+ -+sub ProcessWork -+{ -+ my $self = shift; -+ my @dbArgs = @_; -+ my $work = $self->{work}; -+ -+ foreach my $id (keys %$work) { -+ my $w = $work->{$id}; -+ my $prevNumIncompleteJobs = $w->NumIncompleteJobs; -+ my $r = $w->ProcessNewEvents(@dbArgs); -+ my $curNumIncompleteJobs = $w->NumIncompleteJobs; -+ $self->{numIncompleteJobs} -= $prevNumIncompleteJobs - $curNumIncompleteJobs; -+ delete $work->{$id} if $curNumIncompleteJobs == 0; -+ } -+} -+ -+ -+my $condorQRe = qr/\s*^(?:(\d+)\s+)?(\d+)\s+(\d+)\s*$/; -+ -+sub CheckIfWorkSubmitted -+{ -+ my $self = shift; -+ my ($workId, $filename) = @_; -+ my %jobs; -+ -+ my @cmd = ( -+ $condorQCmd, -+ '-format', '%d ', 'subprocid', -+ '-format', '%d ', 'procid', -+ '-format', '%d\n', 'clusterid', -+ '-constraint', "$cdbqIdAttr == $workId" -+ ); -+ -+ my ($exitCode, $exitSignal, $out, $err) = main::ExecuteCommand(\@cmd, ''); -+ -+ if ($exitCode != 0 || $exitSignal != 0) { -+ $out = '' unless defined $out; -+ $err = '' unless defined $err; -+ main::LogAndExit("$condorQCmd failed to recover" -+ . "$cdbqIdAttr=$workId\n$out\n---\n$err\n", 1); -+ } -+ -+ foreach my $line (split /\n/, $out) { -+ next if $line =~ /^\s*$/; -+ my ($sp, $p, $c) = ($line =~ /$condorQRe/); -+ $sp = 0 unless defined $sp; -+ main::LogAndExit("$condorQCmd produced invalid line: $line", 1) -+ unless defined $c; -+ -+ my $condorId = CondorWork::MakeCondorId($c, $p, $sp); -+ $jobs{$condorId} = 1; -+ } -+ -+ my $work = new CondorWork(filename => $filename, workId => $workId); -+ $work->AddCondorIdsFromLog(\%jobs); -+ -+ return scalar(keys %jobs); -+} -+ -+ -+sub RecoverChosenWork -+{ -+ my $self = shift; -+ my ($getChosenWorkSth, $submitSuccessSth, $revertChosenSth) = @_; -+ -+ my %jobsSeen; -+ my $numJobs = scalar keys %jobsSeen; -+ my $cluster; -+ -+ my %work; -+ $getChosenWorkSth->execute(); -+ while (my @data = $getChosenWorkSth->fetchrow_array()) { -+ my ($workId, $filename) = @data; -+ $work{$workId} = $filename; -+ } -+ $getChosenWorkSth->finish(); -+ -+ foreach my $workId (keys %work) { -+ my $numJobs = $self->CheckIfWorkSubmitted($workId, $work{$workId}); -+ if ($numJobs > 0) { -+ my $rows = $submitSuccessSth->execute(undef, undef, $numJobs, $workId); -+ if (!defined $rows || $rows != 1) { -+ LogAndExit("Error: Updating db for successful submit", 1); -+ } -+ } else { -+ my $rows = $revertChosenSth->execute($workId); -+ if (!defined $rows || $rows != 1) { -+ LogAndExit("Error: Updating db for successful submit", 1); -+ } -+ } -+ } -+} -+ -+ -+sub RestoreStateFromDatabase -+{ -+ my $self = shift; -+ -+ my $getInBatchWorkSth = shift; -+ my $getInBatchJobsSth = shift; -+ my $activeWork = $self->{work}; -+ -+ $getInBatchWorkSth->execute(); -+ while (my @data = $getInBatchWorkSth->fetchrow_array()) { -+ my ($workId, $filename, $nextPos, $logErrMsg, $logErrNum, -+ $totalJobs, $completeJobs) = @data; -+ my $work = new CondorWork( -+ workId => $workId, -+ filename => $filename, -+ nextPos => $nextPos, -+ logErrMsg => $logErrMsg, -+ logErrNum => $logErrNum, -+ totalJobs => $totalJobs, -+ completeJobs => $completeJobs -+ ); -+ $activeWork->{$workId} = $work; -+ $self->{numIncompleteJobs} += $totalJobs - $completeJobs; -+ print "Restore $workId totalJobs=$totalJobs completeJobs=$completeJobs\n"; -+ } -+ $getInBatchWorkSth->finish(); -+ -+ my %jobs; -+ $getInBatchJobsSth->execute(); -+ while (my @data = $getInBatchJobsSth->fetchrow_array()) { -+ my ($workId, $cluster, $proc, $subproc, $state) = @data; -+ my $condorId = CondorWork::MakeCondorId($cluster, $proc, $subproc); -+ $jobs{$workId}{$condorId} = CondorWork::IsTerminalState($state); -+ } -+ $getInBatchJobsSth->finish(); -+ -+ foreach my $workId (keys %jobs) { -+ print "Restore $workId seen-jobs=", scalar(keys %{$jobs{$workId}}), "\n"; -+ $activeWork->{$workId}->RestoreJobs($jobs{$workId}); -+ } -+} -+ -+ -+sub Recover -+{ -+ my $self = shift; -+ my ($getInBatchWorkSth, $getInBatchJobsSth, $getChosenWorkSth, -+ $submitSuccessSth, $revertChosenSth) = @_; -+ -+ $self->RecoverChosenWork($getChosenWorkSth, -+ $submitSuccessSth, $revertChosenSth); -+ $self->RestoreStateFromDatabase($getInBatchWorkSth, $getInBatchJobsSth); -+} -+ -+ -+ -+package main; -+ -+ -+my $tablePrefix = ''; -+my $workTable = $tablePrefix . 'work'; -+my $jobsTable = $tablePrefix . 'jobs'; -+ -+my %options; -+my %sqlStmts; -+ -+my %defaultDbInfoFiles = ( -+ admin => 'db.admin.conf', -+ submit => 'db.submit.conf', -+ worker => 'db.worker.conf' -+ ); -+ -+ -+sub InitializeSqlStmts -+{ -+ %sqlStmts = ( -+ -+ createWorkTable => qq{ -+CREATE TABLE $workTable ( -+ work_data TEXT NOT NULL, -+ create_ts TIMESTAMP NOT NULL DEFAULT current_timestamp, -+ id BIGINT PRIMARY KEY, -+ -- DEFAULT NEXTVAL('${workTable}_seq') handled by trigger -+ insert_user TEXT NOT NULL DEFAULT user, -+ state TEXT NOT NULL DEFAULT 'initial', -+ -- values: initial chosen in_batch complete failed -+ cdbq_user TEXT, -+ batch_sys TEXT, -+ cmd_stdout TEXT, -+ cmd_stderr TEXT, -+ cmd_exit_code INTEGER, -+ cmd_exit_signal INTEGER, -+ log_file TEXT, -+ next_pos INTEGER, -+ total_jobs INTEGER, -+ complete_jobs INTEGER, -+ log_err_msg TEXT, -+ log_err_num INTEGER, -+ update_ts TIMESTAMP, -+ user_id INTEGER, -+ user_text TEXT -+) -+ }, -+ -+ createJobsTable => qq{ -+CREATE TABLE $jobsTable ( -+ work_id BIGINT REFERENCES $workTable ON DELETE CASCADE, -+ cluster INTEGER NOT NULL, -+ proc INTEGER NOT NULL, -+ subproc INTEGER NOT NULL, -+ state INTEGER NOT NULL, -+ info TEXT NOT NULL, -+ record_ts TIMESTAMP NOT NULL, -+ create_ts TIMESTAMP NOT NULL, -+ update_ts TIMESTAMP NOT NULL, -+ exit_code INTEGER, -+ exit_signal INTEGER, -+ -+ PRIMARY KEY (work_id, cluster, proc, subproc) -+) -+ }, -+ -+ createWorkSeq => "CREATE SEQUENCE ${workTable}_seq", -+ -+ createWorkFunction => qq{ -+CREATE OR REPLACE FUNCTION ${workTable}_trigger() RETURNS trigger AS -+\$\$ -+BEGIN -+ IF TG_OP = 'INSERT' THEN -+ NEW.create_ts = current_timestamp; -+ NEW.id = NEXTVAL('${workTable}_seq'); -+ NEW.cdbq_user = NULL; -+ NEW.state = 'initial'; -+ NEW.insert_user = user; -+ ELSIF TG_OP = 'UPDATE' THEN -+ IF OLD.state = 'initial' THEN -+ NEW.cdbq_user = user; -+ NEW.state = 'chosen'; -+ ELSIF OLD.cdbq_user <> user THEN -+ RAISE EXCEPTION 'user ''\%\%'' not allowed to update $workTable id=%%', -+ user, OLD.id; -+ END IF; -+ NEW.create_ts = OLD.create_ts; -+ NEW.id = OLD.id; -+ END IF; -+ -+ RETURN NEW; -+END -+\$\$ LANGUAGE plpgsql -+ }, -+ -+ createWorkTrigger => qq{ -+CREATE TRIGGER ${workTable}_trigger -+ BEFORE INSERT OR UPDATE -+ ON $workTable -+ FOR EACH ROW EXECUTE PROCEDURE ${workTable}_trigger() -+ }, -+ -+ -+ createJobsFunction => q{ -+CREATE OR REPLACE FUNCTION jobs_trigger() RETURNS trigger AS -+$$ -+BEGIN -+ IF TG_OP = 'DELETE' THEN -+ IF OLD.state <> 5 AND OLD.state <> 9 THEN -+ RAISE EXCEPTION 'job ''%%'' still in batch system', OLD.work_id; -+ END IF; -+ -+ RETURN OLD; -+ END IF; -+ -+ RETURN NEW; -+END -+$$ LANGUAGE plpgsql -+ }, -+ -+ createJobsTrigger => qq{ -+CREATE TRIGGER jobs_trigger -+ BEFORE DELETE -+ ON $jobsTable -+ FOR EACH ROW EXECUTE PROCEDURE jobs_trigger() -+ }, -+ -+ createSubmitUser => 'CREATE USER %s PASSWORD \'%s\'', -+ -+ grantSubmitUserWorkTable => "GRANT SELECT, INSERT ON $workTable TO \%s", -+ -+ grantSubmitUserJobsTable => "GRANT SELECT ON $jobsTable TO \%s", -+ -+ grantSubmitUserWorkSeq => "GRANT USAGE on ${workTable}_seq TO \%s", -+ -+ createExecuteUser => 'CREATE USER %s PASSWORD \'%s\'', -+ -+ grantExecuteUserWorkTable => "GRANT SELECT, UPDATE ON $workTable TO \%s", -+ -+ grantExecuteUserJobsTable => "GRANT SELECT, INSERT, UPDATE ON $jobsTable TO \%s", -+ -+ revokePublicSchemaCreate => qq( -+REVOKE -+ CREATE -+ ON SCHEMA public -+ FROM public -+ CASCADE -+ ), -+ -+ createLangPlpgsql => "create language plpgsql", -+ -+ updateWorkToChosen => qq{ -+UPDATE $workTable -+ SET batch_sys = ?, state = 'chosen', log_file = ? || '/work.' || id || '.log' -+ WHERE id in -+ (SELECT id -+ FROM $workTable -+ WHERE state = 'initial' -+ ORDER BY id -+ LIMIT $options{grabamount}) -+ }, -+ -+ selectChosenWork => qq{ -+SELECT id, work_data, log_file -+ FROM $workTable -+ WHERE state = 'chosen' AND batch_sys = ? -+ ORDER BY id -+ }, -+ -+ updateWorkToInBatch => qq{ -+UPDATE $workTable -+ SET state = 'in_batch', -+ cmd_exit_code = 0, cmd_exit_signal = 0, -+ cmd_stdout = ?, cmd_stderr = ?, -+ total_jobs = ?, complete_jobs = 0 -+ WHERE id = ? -+ }, -+ -+ updateWorkToTmpFailed => qq{ -+UPDATE $workTable -+ SET state = 'initial', -+ cmd_exit_code = ?, cmd_exit_signal = 0, -+ cmd_stdout = ?, cmd_stderr = ? -+ WHERE id = ? -+ }, -+ -+ updateWorkToFailed => qq{ -+UPDATE $workTable -+ SET state = 'failed', -+ cmd_exit_code = ?, cmd_exit_signal = ?, -+ cmd_stdout = ?, cmd_stderr = ? -+ WHERE id = ? -+ }, -+ -+ insertJob => qq{ -+INSERT INTO $jobsTable -+ (state, info, record_ts, create_ts, update_ts, -+ cluster, proc, subproc, work_id) -+ VALUES (?, ?, ?, ?, current_timestamp, ?, ?, ?, ?) -+ }, -+ -+ updateJob => qq{ -+UPDATE $jobsTable -+ SET state = ?, info = ?, record_ts = ?, exit_code = ?, exit_signal = ?, -+ update_ts = current_timestamp -+ WHERE cluster = ? AND proc = ? AND subproc = ? AND work_id = ? -+ }, -+ -+ updateWorkJobs => qq( -+UPDATE $workTable -+ SET next_pos = ?, complete_jobs = ?, update_ts = current_timestamp -+ WHERE id = ? -+ ), -+ -+ updateWorkComplete => qq( -+UPDATE $workTable -+ SET state = 'complete', next_pos = ?, complete_jobs = ?, -+ update_ts = current_timestamp -+ WHERE id = ? -+ ), -+ -+ updateWorkJobsError => qq( -+UPDATE $workTable -+ SET next_pos = ?, log_err_msg = ?, log_err_num = ?, -+ update_ts = current_timestamp -+ WHERE id = ? -+ ), -+ -+ getChosenWork => qq( -+SELECT id, log_file -+ FROM $workTable -+ WHERE state = 'chosen' -+ ), -+ -+ updateWorkToInitial => qq( -+UPDATE $workTable -+ SET state = 'initial' -+ WHERE id = ? -+ ), -+ -+ updateAllChosenWorkToInitial => qq( -+UPDATE $workTable -+ SET state = 'initial' -+ WHERE state = 'chosen' -+ ), -+ -+ getInBatchWork => qq( -+SELECT id, log_file, next_pos, log_err_msg, log_err_num, -+ total_jobs, complete_jobs -+ FROM $workTable -+ WHERE state = 'in_batch' -+ ), -+ -+ getInBatchJobs => qq( -+SELECT $workTable.id, $jobsTable.cluster, proc, subproc, $jobsTable.state -+ FROM $workTable, $jobsTable -+ WHERE $workTable.state = 'in_batch' AND id = work_id -+ ORDER BY id -+ ) -+ -+ ); -+} -+ -+ -+sub GetDbConnectionInfo -+{ -+ my ($dbInfoDir, $dbInfoFile, $dbInfoType) = @_; -+ -+ my $defaultDbInfoFile = $defaultDbInfoFiles{$dbInfoType}; -+ -+ die "unknown dbinfotype=$dbInfoType" unless defined $defaultDbInfoFile; -+ -+ $dbInfoFile = "$dbInfoDir/$defaultDbInfoFile" if $dbInfoFile eq ''; -+ -+ if ($dbInfoFile eq '-') { -+ open DBINFOFILE, '-' -+ or LogAndExit("open db info file '-' failed: $!", 1); -+ } else { -+ open DBINFOFILE, '<', $dbInfoFile -+ or LogAndExit("open db info file '$dbInfoFile' failed: $!", 1); -+ } -+ -+ my $dataSource = ; -+ my $user = ; -+ my $password =; -+ -+ close DBINFOFILE or LogAndExit("close db info file '$dbInfoFile' failed: $!", 1); -+ -+ LogAndExit("db info file '$dbInfoFile' is empty", 1) unless defined $dataSource; -+ chomp $dataSource; -+ LogAndExit("db info file '$dbInfoFile' missing user", 1) unless defined $user; -+ LogAndExit("db info file '$dbInfoFile' bad user '$user' is non-alphanumeric", 1) unless $user =~ /^\w+$/; -+ chomp $user; -+ chomp $password if defined $password; -+ -+ return ($dataSource, $user, $password); -+} -+ -+ -+sub ConnectToDb -+{ -+ my ($dbInfoDir, $dbInfoFile, $dbInfoType) = @_; -+ my ($dataSource, $user, $password) -+ = GetDbConnectionInfo($dbInfoDir, $dbInfoFile, $dbInfoType); -+ -+ my %dbAttrs = (AutoCommit => 1, PrintError => 0, PrintWarn => 0); -+ my $dbh = DBI->connect($dataSource, $user, $password, \%dbAttrs) or die; -+ -+ return $dbh; -+} -+ -+ -+sub ExecuteDbOperation -+{ -+ my ($dbh, $options, $stmtId, @params) = @_; -+ -+ die "unknown db stmt '$stmtId'" unless defined $sqlStmts{$stmtId}; -+ -+ my $stmt = sprintf $sqlStmts{$stmtId}, @params; -+ -+ if ($options->{noexecute}) { -+ $stmt =~ s/\s*$//; -+ print "\n$stmt;\n"; -+ } else { -+ my $rows = $dbh->do($stmt); -+ unless (defined $rows) { -+ my $dbErr = $dbh->errstr; -+ LogAndExit("Db stmt failed: $dbErr\n$stmt", 1); -+ } -+ } -+} -+ -+ -+my %preparedStmtCache; -+ -+sub GetPreparedStmt -+{ -+ my ($dbh, $stmtId) = @_; -+ my $sth; -+ -+ if (exists $preparedStmtCache{$stmtId}) { -+ $sth = $preparedStmtCache{$stmtId}; -+ } else { -+ die "unknown db stmt '$stmtId'" unless defined $sqlStmts{$stmtId}; -+ -+ my $stmt = $sqlStmts{$stmtId}; -+ -+ $sth = $dbh->prepare($stmt) or die "prepare failed '$stmt'"; -+ } -+ -+ return $sth; -+} -+ -+ -+sub DoCreateLangPlpgsql -+{ -+ my ($dbh, $options) = @_; -+ -+ ExecuteDbOperation($dbh, $options, 'createLangPlpgsql'); -+} -+ -+ -+sub DoRevokePublicSchemaCreate -+{ -+ my ($dbh, $options) = @_; -+ -+ ExecuteDbOperation($dbh, $options, 'revokePublicSchemaCreate'); -+} -+ -+ -+sub DoInitDb -+{ -+ my ($dbh, $options) = @_; -+ -+ ExecuteDbOperation($dbh, $options, 'createWorkTable'); -+ ExecuteDbOperation($dbh, $options, 'createJobsTable'); -+ ExecuteDbOperation($dbh, $options, 'createWorkSeq'); -+ -+ ExecuteDbOperation($dbh, $options, 'createWorkFunction'); -+ ExecuteDbOperation($dbh, $options, 'createWorkTrigger'); -+ -+ ExecuteDbOperation($dbh, $options, 'createJobsFunction'); -+ ExecuteDbOperation($dbh, $options, 'createJobsTrigger'); -+} -+ -+ -+sub DoCreateSubmitUser -+{ -+ -+ my ($dbh, $options) = @_; -+ -+ my $dbInfoFile = $options->{createsubmituser}; -+ my $dbInfoDir = $options->{dbinfodir}; -+ my ($dataSource, $user, $password) -+ = GetDbConnectionInfo($dbInfoDir, $dbInfoFile, 'submit'); -+ -+ ExecuteDbOperation($dbh, $options, 'createSubmitUser', $user, $password); -+ ExecuteDbOperation($dbh, $options, 'grantSubmitUserWorkTable', $user); -+ ExecuteDbOperation($dbh, $options, 'grantSubmitUserJobsTable', $user); -+ ExecuteDbOperation($dbh, $options, 'grantSubmitUserWorkSeq', $user); -+} -+ -+ -+sub DoCreateWorkUser -+{ -+ -+ my ($dbh, $options) = @_; -+ -+ my $dbInfoFile = $options->{createworkuser}; -+ my $dbInfoDir = $options->{dbinfodir}; -+ my ($dataSource, $user, $password) -+ = GetDbConnectionInfo($dbInfoDir, $dbInfoFile, 'worker'); -+ -+ ExecuteDbOperation($dbh, $options, 'createExecuteUser', $user, $password); -+ ExecuteDbOperation($dbh, $options, 'grantExecuteUserWorkTable', $user); -+ ExecuteDbOperation($dbh, $options, 'grantExecuteUserJobsTable', $user); -+} -+ -+ -+my $progVersion = '1.0b3'; -+ -+my $progName = $0; -+$progName =~ s/.*[\\\/]//; -+ -+ -+sub Log -+{ -+ my $data = shift; -+ -+ print STDERR "$data\n"; -+} -+ -+ -+sub LogAndExit -+{ -+ my ($data, $code) = @_; -+ -+ Log $data; -+ -+ exit $code; -+} -+ -+ -+ -+ -+sub Usage -+{ -+ print STDERR < '', -+ dbinfodir => '.', -+ logdir => '.', -+ sleepamount => 10, -+ maxwork => 0, -+ maxjobs => 0, -+ grabamount => 10, -+ id => '', -+ initdb => 0, -+ createlang => 0, -+ revokepublic => 0, -+ createsubmituser => undef, -+ createworkuser => undef, -+ submit => undef, -+ noexecute => 0, -+ help => 0, -+ version => 0 -+ ); -+ -+ my @options = ( -+ "dbinfofile|f=s", -+ "dbinfodir|a=s", -+ "logdir|d=s", -+ "sleepamount=i", -+ "maxwork=i", -+ "maxjobs=i", -+ "grabamount=i", -+ "id=s", -+ "initdb!", -+ "createlang!", -+ "revokepublic!", -+ "createsubmituser:s", -+ "createworkuser:s", -+ "submit=s", -+ "noexecute|n!", -+ "help|h!", -+ "version|v!" -+ ); -+ -+ my $ok = GetOptions(\%options, @options); -+ if (!$ok || $options{help}) { -+ Usage(); -+ exit !$ok; -+ } -+ -+ if ($options{version}) { -+ print "$progName: $progVersion\n"; -+ exit 0; -+ } -+ -+ $options{id} = `hostname` if $options{id} eq ''; -+ chomp $options{id}; -+ -+ if (!-d $options{logdir}) { -+ print STDERR "User log directory '$options{logdir}' does not exist\n"; -+ exit 1; -+ } -+} -+ -+ -+sub Initialize -+{ -+ ProcessOptions(); -+ InitializeSqlStmts(); -+} -+ -+ -+sub CheckCondorSubmitRunning -+{ -+ my $cmd = "$condorQCmd 2>&1 >/dev/null"; -+ `$cmd`; -+ -+ return $? == 0; -+} -+ -+ -+sub GetFileContents -+{ -+ my ($filename) = @_; -+ -+ local $/; -+ if ($filename eq '-') { -+ open INFILE, '-' or LogAndExit("open '-': $!", 1); -+ } else { -+ open INFILE, '<', $filename or LogAndExit("open < '$filename': $!", 1); -+ } -+ my $data = ; -+ close INFILE or LogAndExit("close $filename: $!", 1); -+ -+ return $data; -+} -+ -+ -+sub ShellQuoteArg -+{ -+ my $data = shift; -+ -+ $data =~ s/'/'\\''/g; -+ $data = "'$data'" if $data =~ tr|A-Za-z0-9/-_||c; -+ -+ return $data; -+} -+ -+ -+sub ExecuteCommand -+{ -+ my ($cmdToExec, $inData, $timeout) = @_; -+ -+ $inData = '' unless defined $inData; -+ -+ use IPC::Open3; -+ use Fcntl; -+ use Errno qw{:POSIX}; -+ -+ local $SIG{PIPE} = 'IGNORE'; -+ -+ local (*CMDIN, *CMDOUT, *CMDERR); -+ -+ # The following block of code should just be -+ # -+ # my $cmdPid = open3(\*CMDIN, \*CMDOUT, \*CMDERR, @$cmdToExec); -+ # -+ # A bug in open3 causes die to be called in the event that exec fails -+ # which has the side effect of running all the destructors, which -+ # closes all of our database handles. open3 should only ever throw -+ # an exception in the child and only if the exec fails, so try and -+ # catch it and exit immediately to work around the open3 bug. -+ # -+ my $cmdPid; -+ eval { -+ $cmdPid = open3(\*CMDIN, \*CMDOUT, \*CMDERR, @$cmdToExec); -+ }; -+ if ($@) { -+ print STDERR "ExecuteCommand: exec failed: '" . join("', '", @$cmdToExec), "'"; -+ eval { require POSIX; POSIX::_exit(255); }; -+ exit 255; -+ } -+ -+ my $cmdinFlags = fcntl(CMDIN, F_GETFL, 0); -+ fcntl(CMDIN, F_SETFL, $cmdinFlags | O_NONBLOCK); -+ -+ my $inFileno = fileno(CMDIN); -+ my $outFileno = fileno(CMDOUT); -+ my $errFileno = fileno(CMDERR); -+ -+ my $outData = ''; -+ my $outLen = 0; -+ my $errData = ''; -+ my $errLen = 0; -+ -+ my $inLen = length($inData); -+ my $inOffset = 0; -+ -+ my $openFds = 3; -+ -+ if ($inLen == 0) { -+ $inFileno = -1; -+ --$openFds; -+ close(CMDIN) or die "close CMDIN: $!"; -+ } -+ -+ while ($openFds > 0) { -+ my $readVec = ''; -+ my $writeVec = ''; -+ -+ vec($readVec, $outFileno, 1) = 1 unless $outFileno == -1; -+ vec($readVec, $errFileno, 1) = 1 unless $errFileno == -1; -+ vec($writeVec, $inFileno, 1) = 1 unless $inFileno == -1; -+ -+ my $numFds = select($readVec, $writeVec, undef, $timeout); -+ if ($numFds == -1) { -+ if ($!{EINTR} || $!{EAGAIN}) { -+ redo; -+ } else { -+ die "select failed: $!"; -+ } -+ } elsif ($numFds == 0) { -+ kill 9, $cmdPid; -+ waitpid $cmdPid, 0; -+ die "select timeout expired, retrying"; -+ } -+ -+ if (vec($readVec, $outFileno, 1)) { -+ my $bytesRead = sysread(CMDOUT, $outData, 1024, $outLen); -+ if (defined $bytesRead) { -+ if ($bytesRead > 0) { -+ $outLen += $bytesRead; -+ } elsif ($bytesRead == 0) { -+ $outFileno = -1; -+ --$openFds; -+ close(CMDOUT) or die "close CMDOUT: $!"; -+ } -+ } else { -+ if (!$!{EINTR} && !$!{EAGAIN}) { -+ kill 9, $cmdPid; -+ waitpid $cmdPid, 0; -+ die "sysread CMDOUT: $!"; -+ } -+ } -+ } -+ -+ if (vec($readVec, $errFileno, 1)) { -+ my $bytesRead = sysread(CMDERR, $errData, 1024, $errLen); -+ if (defined $bytesRead) { -+ if ($bytesRead > 0) { -+ $errLen += $bytesRead; -+ } elsif ($bytesRead == 0) { -+ $errFileno = -1; -+ --$openFds; -+ close(CMDERR) or die "close CMDERR: $!"; -+ } -+ } else { -+ if (!$!{EINTR} && !$!{EAGAIN}) { -+ kill 9, $cmdPid; -+ waitpid $cmdPid, 0; -+ die "sysread CMDERR: $!"; -+ } -+ } -+ } -+ -+ if (vec($writeVec, $inFileno, 1)) { -+ my $bytesToWrite = $inLen - $inOffset; -+ my $bytesWritten = syswrite(CMDIN, $inData, $bytesToWrite, $inOffset); -+ if (defined $bytesWritten) { -+ if ($bytesWritten > 0) { -+ $inOffset += $bytesWritten; -+ if ($inOffset >= $inLen) { -+ $inFileno = -1; -+ --$openFds; -+ close(CMDIN) or die "close CMDIN: $!"; -+ } -+ } -+ } else { -+ if ($!{EPIPE}) { -+ $inFileno = -1; -+ --$openFds; -+ close(CMDIN) or die "close CMDIN: $!"; -+ } elsif (!$!{EINTR} && !$!{EAGAIN}) { -+ kill 9, $cmdPid; -+ waitpid $cmdPid, 0; -+ die "sysread CMDERR: $!"; -+ } -+ } -+ } -+ } -+ -+ waitpid $cmdPid, 0; -+ -+ my $exitCode = $? >> 8; -+ my $signalValue = $? & 127; -+ -+ return ($exitCode, $signalValue, $outData, $errData); -+} -+ -+ -+my $scheddDownRE = qr/^ERROR: Can't find address of local schedd/m; -+my $parseScheddNumAndCluster = qr/^(\d+) job\(s\) submitted to cluster \d+/m; -+ -+sub SubmitToCondor -+{ -+ my ($sysId, $workId, $subFile, $logFile) = @_; -+ -+ my @cmd = ($condorSubmitCmd, -+ '-a', "log = $logFile", -+ '-a', "+$cdbqIdAttr = $workId", -+ '-a', "+$cdbqSysAttr = \"$sysId\"" -+ ); -+ my ($exitCode, $exitSignal, $out, $err) = ExecuteCommand(\@cmd, $subFile); -+ -+ my $isTmpErr -+ = ($exitSignal == 0 && $exitCode != 0 && $err =~ /$scheddDownRE/); -+ -+ my $numJobs = 0; -+ while ($out =~ /$parseScheddNumAndCluster/g) { -+ $numJobs += $1; -+ } -+ -+ return ($exitCode, $exitSignal, $out, $err, $isTmpErr, $numJobs); -+} -+ -+ -+sub DoAdminCmds -+{ -+ my ($options) = @_; -+ -+ my $dbh = ConnectToDb($options->{dbinfodir}, $options->{dbinfofile}, 'admin'); -+ -+ if ($options->{createlang}) { -+ DoCreateLangPlpgsql($dbh, $options); -+ } -+ -+ if ($options->{revokepublic}) { -+ DoRevokePublicSchemaCreate($dbh, $options); -+ } -+ -+ if ($options->{initdb}) { -+ DoInitDb($dbh, $options); -+ } -+ -+ if (defined $options->{createsubmituser}) { -+ DoCreateSubmitUser($dbh, $options); -+ } -+ -+ if (defined $options->{createworkuser}) { -+ DoCreateWorkUser($dbh, $options); -+ } -+ -+ $dbh->disconnect() or die; -+} -+ -+ -+sub DoSubmit -+{ -+ my ($options) = @_; -+ -+ my $dbh = ConnectToDb($options->{dbinfodir}, $options->{dbinfofile}, 'submit'); -+ -+ my $submit = GetFileContents($options->{submit}); -+ -+ if ($options->{noexecute}) { -+ $submit =~ s/'/''/g; -+ print "\nINSERT INTO $workTable (work_data) VALUES ('$submit');\n"; -+ } else { -+ my $stmt = "INSERT INTO $workTable (work_data) VALUES (?);"; -+ my $rows = $dbh->do($stmt, undef, $submit); -+ unless (defined $rows) { -+ my $dbErr = $dbh->errstr; -+ LogAndExit("Db stmt failed: $dbErr\n$stmt", 1); -+ } -+ } -+ -+ $dbh->disconnect() or die; -+} -+ -+ -+sub DoGrabWork -+{ -+ my ($options, $dbh, $sth) = @_; -+ -+ my $id = $options->{id}; -+ my $logDir = $options->{logdir}; -+ -+ my $rows = $sth->execute($id, $logDir); -+ if (!defined $rows) { -+ LogAndExit("GrabWork failed", 1); -+ } -+} -+ -+ -+sub DoSubmitWork -+{ -+ my ($activeWork, $options, $dbh, $chosenWorkSth, $submitSuccessSth, -+ $submitFailSth, $submitTmpFailSth, -+ $updateAllChosenWorkToInitialSth) = @_; -+ -+ my $id = $options->{id}; -+ my $maxJobs = $options->{maxjobs}; -+ my $maxWork = $options->{maxwork}; -+ -+ my @work; -+ -+ $chosenWorkSth->execute($id); -+ -+ while (my @data = $chosenWorkSth->fetchrow_array()) { -+ my $w = {work_id => $data[0], work_data => $data[1], log_file => $data[2]}; -+ -+ push @work, $w; -+ } -+ $chosenWorkSth->finish(); -+ -+ while (@work) { -+ my $w = shift @work; -+ my $workId = $w->{work_id}; -+ my $workData = $w->{work_data}; -+ my $logFile = $w->{log_file}; -+ -+ if (($maxJobs > 0 && $activeWork->NumIncompleteJobs >= $maxJobs) -+ || ($maxWork > 0 && $activeWork->NumWork >= $maxWork)) { -+ my $rows = $updateAllChosenWorkToInitialSth->execute(); -+ print "revert rows = $rows\n"; -+ if (!defined $rows || $rows == 0) { -+ LogAndExit("Error: Reverting all chosen work to initial", 1); -+ } -+ last; -+ } -+ -+ # set a temporary error here -+ die "$logFile exists" if -e $logFile; -+ -+ my ($exitCode, $exitSignal, $out, $err, $isTmpErr, $numJobs) -+ = SubmitToCondor($id, $workId, $workData, $logFile); -+ -+ $err .= "Unable to extract number of jobs from submission output\n" -+ unless $exitSignal != 0 || $exitCode != 0 || defined $numJobs; -+ -+ if ($exitSignal == 0 && $exitCode == 0 && defined $numJobs) { -+ my $rows = $submitSuccessSth->execute($out, $err, $numJobs, $workId); -+ if (!defined $rows || $rows != 1) { -+ LogAndExit("Error: Updating db for successful submit", 1); -+ } -+ $activeWork->AddWork($workId, $logFile, $numJobs); -+ } elsif ($isTmpErr) { -+ my $rows = $submitTmpFailSth->execute($exitCode, -+ $out, $err, $workId); -+ if (!defined $rows || $rows != 1) { -+ LogAndExit("Error: Updating db for temporary failed submit", 1); -+ } -+ } else { -+ my $rows = $submitFailSth->execute($exitCode, $exitSignal, -+ $out, $err, $workId); -+ if (!defined $rows || $rows != 1) { -+ print $dbh->errstr, "\n"; -+ LogAndExit("Error: Updating db for failed submit", 1); -+ } -+ } -+ } -+} -+ -+ -+sub DoProcessQueue -+{ -+ my ($options) = @_; -+ -+ my $id = $options{id}; -+ my $sleepAmount = $options{sleepamount}; -+ my $maxWork = $options{maxwork}; -+ my $maxJobs = $options{maxjobs}; -+ -+ my $dbh = ConnectToDb($options->{dbinfodir}, $options->{dbinfofile}, 'worker'); -+ -+ my $grabSth = GetPreparedStmt($dbh, 'updateWorkToChosen'); -+ my $chosenWorkSth = GetPreparedStmt($dbh, 'selectChosenWork'); -+ my $submitSuccessSth = GetPreparedStmt($dbh, 'updateWorkToInBatch'); -+ my $submitFailSth = GetPreparedStmt($dbh, 'updateWorkToFailed'); -+ my $submitTmpFailSth = GetPreparedStmt($dbh, 'updateWorkToTmpFailed'); -+ my $updateAllChosenWorkToInitialSth = GetPreparedStmt($dbh, 'updateAllChosenWorkToInitial'); -+ my $insertJobSth = GetPreparedStmt($dbh, 'insertJob'); -+ my $updateJobSth = GetPreparedStmt($dbh, 'updateJob'); -+ my $updateWorkJobsSth = GetPreparedStmt($dbh, 'updateWorkJobs'); -+ my $updateWorkCompleteSth = GetPreparedStmt($dbh, 'updateWorkComplete'); -+ my $updateWorkJobsErrorSth = GetPreparedStmt($dbh, 'updateWorkJobsError'); -+ my $getInBatchWorkSth = GetPreparedStmt($dbh, 'getInBatchWork'); -+ my $getInBatchJobsSth = GetPreparedStmt($dbh, 'getInBatchJobs'); -+ my $getChosenWorkSth = GetPreparedStmt($dbh, 'getChosenWork'); -+ my $revertChosenSth = GetPreparedStmt($dbh, 'updateWorkToInitial'); -+ -+ my $activeWork = new CondorActiveWork; -+ -+ $activeWork->Recover($getInBatchWorkSth, $getInBatchJobsSth, -+ $getChosenWorkSth, $submitSuccessSth, $revertChosenSth); -+ -+ my $done = 0; -+ while (!$done) { -+ if (($maxJobs == 0 || $activeWork->NumIncompleteJobs < $maxJobs) -+ && ($maxWork == 0 || $activeWork->NumWork < $maxWork)) { -+ DoGrabWork($options, $dbh, $grabSth); -+ -+ DoSubmitWork($activeWork, $options, $dbh, $chosenWorkSth, -+ $submitSuccessSth, $submitFailSth, $submitTmpFailSth, -+ $updateAllChosenWorkToInitialSth); -+ } -+ -+ $activeWork->ProcessWork($dbh, -+ $insertJobSth, $updateJobSth, $updateWorkJobsSth, -+ $updateWorkCompleteSth, $updateWorkJobsErrorSth); -+ -+ sleep $sleepAmount; -+ } -+ -+ $dbh->disconnect() or die; -+} -+ -+ -+sub Main -+{ -+ my $processQueue = 1; -+ -+ Initialize(); -+ -+ if ( $options{initdb} -+ || $options{createlang} -+ || $options{revokepublic} -+ || defined $options{createsubmituser} -+ || defined $options{createworkuser} -+ ) { -+ DoAdminCmds(\%options); -+ $processQueue = 0; -+ } -+ -+ if ($options{submit}) { -+ DoSubmit(\%options); -+ $processQueue = 0; -+ } -+ -+ if ($processQueue) { -+ DoProcessQueue(\%options); -+ } -+} -+ -+ -+Main(); -diff --git a/src/condor_contrib/condor_dbq/condor_dbq.pl.man.tex b/src/condor_contrib/condor_dbq/condor_dbq.pl.man.tex -new file mode 100644 -index 0000000..a61c19a ---- /dev/null -+++ b/src/condor_contrib/condor_dbq/condor_dbq.pl.man.tex -@@ -0,0 +1,471 @@ -+\begin{ManPage}{\label{man-condor-dbq.pl}\Condor{dbq.pl}}{1} -+{Provides a relational database management system interface to Condor. -+Condor submit file contents are inserted into a table, \Condor{dbq.pl} -+submits the job to Condor, and updates a table with the status of the -+work to allow the monitoring of its progress.} -+\Synopsis -+ -+\SynProg{\Condor{dbq.pl}} -+\oOptArg{{-}{-}dbinfofile}{dbinfofile} -+\oOptArg{{-}{-}dbinfodir}{dbinfodir} -+\oOptArg{{-}{-}logdir}{logfiledir} -+\oOptArg{{-}{-}sleepamount}{seconds} -+\oOptArg{{-}{-}maxwork}{numofwork} -+\oOptArg{{-}{-}maxjobs}{numofjobs} -+\oOptArg{{-}{-}grabamount}{numjobs} -+ -+\SynProg{\Condor{dbq.pl}} -+\oOpt{{-}{-}initdb} -+\oOpt{{-}{-}createlang} -+\oOpt{{-}{-}revokepublic} -+\oOptArg{{-}{-}createsubmituser}{[dbinfofile]} -+\oOptArg{{-}{-}createworkuser}{[dbinfofile]} -+\oOptArg{{-}{-}submit}{submitfile} -+\oOpt{{-}{-}noexecute} -+ -+\SynProg{\Condor{dbq.pl}} -+\oOpt{{-}{-}help} -+ -+\SynProg{\Condor{dbq.pl}} -+\oOpt{{-}{-}version} -+ -+ -+\Description -+\Condor{dbq.pl} provides a relational database interface to submit Condor -+jobs, and monitor their progress as they are executed. -+The user submits work to the system by inserting a row into a database table. -+The user can query the \Condor{dbq.pl} tables to monitor the progress of their -+work. -+ -+\Condor{dbq.pl} is careful to submit each piece of work into Condor exactly -+once. -+\Condor{dbq.pl} can be stopped at any time. Upon restart it will recover its -+state and resume operation. -+ -+ -+\Condor{dbq.pl} has two main modes of operation. The first, its normal -+mode, performs the role of taking jobs from the database, submitting them -+to Condor and updating the results of their execution. -+The second mode performs administrative tasks on the database including -+creating the necessary tables and accounts to use \Condor{dbq.pl}. -+ -+In the normal mode of operation, \Condor{dbq.pl} alternates between polling -+the database for new work to submit to Condor, and monitoring the submitted -+work's user logs for new events. -+The database is updated to reflect the current state of the system. -+There are several options described in the Options Section that can be used to -+throttle \Condor{dbq.pl} -+ -+The submission data for each work is in the same format allowed by -+\Condor{submit}. -+The only limitation is that the user can not specify a user log using the -+\emph{log} attribute as \Condor{dbq.pl} will override this attribute with -+its own value. -+\Condor{dbq.pl} uses \Condor{submit} to perform the submission into Condor. -+The only changes made to the submission are the user log is overridden, and -+attributes with a prefix of \emph{CDBQ\_} are added. -+For correct operation, work submitted to this \Condor{schedd} outside of -+\Condor{dbq.pl} must not add attributes or modify atttibutes with a prefix of -+\emph{CDBQ\_}. -+ -+\Condor{dbq.pl} operates by using two tables. -+The \emph{work} table represents each piece of work. -+The \emph{jobs} table represents the individual jobs once the work is submitted -+to Condor. -+Other than inserting the work initially, users should only query the tables, -+and should not otherwise update values unless specified below. A description -+of the fields and types of each table are described next. -+ -+\begin{description} -+\item[work table] -+ Each row represents a piece of work to be executed by Condor. -+ The table's attribute names, their SQL types and descriptions are as follows: -+ -+ \begin{description} -+ \item[work\_data TEXT] -+ Stores the Condor submit file data. -+ This is the only attribute that needs to be set when inserting a -+ new piece of work. -+ \item[create\_ts TIMESTAMP] -+ Database timestamp when record was created. -+ \item[id BIGINT] -+ Unique id for this record. -+ \item[insert\_user TEXT] -+ Database user that inserted this record. -+ \item[state TEXT] -+ The state of the piece of work in the system. -+ The possible values are as follows: -+ \begin{description} -+ \item[initial] -+ Job has not yet been submitted to Condor. -+ \item[chosen] -+ Job is about to be submitted to Condor. -+ \item[in\_batch] -+ Job has successfully been submitted to Condor, but has not -+ yet completed. -+ \item[complete] -+ All the jobs of this work have completed successfully or -+ have beeen removed. -+ \item[failed] -+ The work has failed due to a permanent error. -+ \end{description} -+ \item[cdbq\_user TEXT] -+ Database user that inserted this record into Condor. -+ NULL if \Condor{submit} not executed. -+ \item[cmd\_stdout TEXT] -+ Standard out of \Condor{submit} after submitting this job. -+ NULL if \Condor{submit} not executed. -+ \item[cmd\_stderr TEXT] -+ Standard error of \Condor{submit} after submitting this job. -+ NULL if \Condor{submit} not executed. -+ \item[cmd\_exit\_code INTEGER] -+ Exit code of \Condor{submit}. -+ 0 is success, other values indicate failure. -+ NULL if \Condor{submit} not executed. -+ \item[cmd\_exit\_signal INTEGER] -+ Signal causing this \Condor{submit} to fail. -+ 0 is non-signal exit, other values represent the signal number. -+ NULL if \Condor{submit} not executed. -+ \item[log\_file TEXT] -+ Path to Condor's user log file for this work. -+ \item[next\_pos INTEGER] -+ Offset between last and next event record to read. -+ \item[total\_jobs INTEGER] -+ Total number of jobs that are represented by this work. -+ \item[complete\_jobs INTEGER] -+ Total number of jobs that have completed or been removed. -+ \item[log\_err\_msg TEXT] -+ Last error message caused by accessing the user log file. -+ \item[log\_err\_num INTEGER] -+ Last error number caused by accessing the user log file. -+ \item[update\_ts TIMESTAMP] -+ Database timestamp when record was last updated. -+ \item[user\_id INTEGER] -+ For use by the user to store an integer value. -+ \item[user\_text TEXT] -+ For use by the user to store a text value. -+ \end{description} -+ -+\item[jobs table:] -+ Each row repreents a job of a piece of work. -+ These rows are inserted once the work has been submitted to the Condor system -+ and Condor has written a submitted event to the user log file. -+ The table's attribute names, their SQL types and descriptions are as follows: -+ -+ \begin{description} -+ \item[work\_id BIGINT] -+ Id from the \emph{work} table. -+ \item[cluster INTEGER] -+ Condor cluster id of this job. -+ \item[proc INTEGER] -+ Condor process id of this job. -+ \item[subproc INTEGER] -+ Condor subprocess id of this job. -+ \item[state INTEGER] -+ Condor user log record event type of the last event seen for this job. -+ \item[info TEXT] -+ Additional information from the last log record seen for this job. -+ \item[record\_ts TIMESTAMP] -+ User log timestamp from the last log record event processed. -+ \item[create\_ts TIMESTAMP] -+ Database timestamp when job was first seen. -+ \item[update\_ts TIMESTAMP] -+ Database timestamp when record was last updated. -+ \item[exit\_code INTEGER] -+ Exit code of of this job. -+ 0 is success, other values indicate failure. -+ NULL if job not yet complete. -+ \item[exit\_signal INTEGER] -+ Signal causing this job to fail. -+ 0 is non-signal exit, other values represent the signal number. -+ NULL if job not yet complete. -+ \end{description} -+\end{description} -+ -+The other functions of \Condor{dbq.pl} perform administrative tasks on the -+database. -+These include inserting a new record into the work table given a Condor submit -+file, and creating the tables and accounts required by \Condor{dbq.pl}. -+If any of this functionality is requested, only the administrative tasks are -+performed; the normal processing of work is not started. -+ -+If \Opt{{-}{-}noexecute} is used with any of the administrative functions, -+the SQL statements are printed to standard out instead of being executing. -+This is useful to review the statements for security purposes, or to modify -+them before creating the database objects. -+ -+The \OptArg{{-}{-}submit}{filename} option is used to insert a work record into -+the system using the contents of \emph{filename} for the Condor submit file -+data. If \emph{filename} is `-', the program reads the Condor submit file from -+standard in. -+ -+The \Opt{{-}{-}initdb} option causes the tables and other database objects to -+be created. -+ -+The \Opt{{-}{-}createlang} option creates the plpgsql language to allow the -+trigger functions created by \Opt{{-}{-}initdb} to be used. -+This is not necessary if the database administrator created the language for -+use when the database was created. -+ -+The \Opt{{-}{-}revokepublic} option prevents the database users from creating -+object new tables in the database in the `public' schema that PostgreSQL grants -+by default to all users. -+If the user accounts do not need to create tables this option should be used to -+revoke this unnecessary privilege. -+ -+The \OptArg{{-}{-}createsubmituser}{[dbinfofile]} option creates a database user -+that can be used to submit jobs. -+The username and password for this account is obtained from the db information -+file specified, or using the default location for submit db information file -+if none is specified. -+This account has privileges to insert work into the work table, and read -+values from both tables. -+ -+The \OptArg{{-}{-}createworkuser}{[dbinfofile]} option creates a database user -+that can be used by \Condor{dbq.pl} to perform its normal operation. -+The username and password for this account is obtained from the db information -+file specified, or using the default location for worker db information file -+if none is specified. -+This account has privileges to update existing records in the work table, and -+to insert and update records in the jobs table. -+ -+There are three types of database accounts required by \Condor{dbq.pl}. -+The first is an administrative database account that can create database -+accounts, tables and other objects. -+The administrative account requires database privileges to create tables and -+users in the database. -+This account is used by the administrative commands except the submit function. -+ -+The second account type is used to insert work records into the database by the -+\Opt{{-}{-}submit} option. -+This account requires privileges to insert records into the work table. -+The account can be created using the \Opt{{-}{-}createsubmituser}, which also -+grants access to select records from the two tables allowing this account to -+used to both submit work and to monitor its progress. -+Multiple acconts of this type may be used. -+ -+The final account type is used to perform the actual work of the system. -+This account requires privileges to update records in the work table and to -+both insert and update records in the jobs table. -+The account can be created using the \Opt{{-}{-}createworkuser}. -+ -+The account information describing an account is stored in a database -+information file that contains three lines: the perl DBI string describing the -+database, the username, and the password. -+As these files contain sensitive information, only the operating system -+accounts used to run the \Condor{dbq.pl} should be able to read the database -+account information files. -+By default, a separate db information file is used to store each of the three -+accounts with the program selecting the credential information based on the -+selected operation. -+These files are stored in a directory specified by \Opt{{-}{-}dbinfodir}, and are -+named db.admin.conf, db.submit.conf, and db.work.conf for the administrative, -+submit and work accounts respectively. -+If this scheme is used the correct account will be used without having to -+specify the account information file. -+If an account information file is missing \Condor{dbq.pl} will fail if an -+operation is selected that requires the missing account information file. -+ -+ -+\begin{Options} -+ \OptItem{\OptArg{{-}{-}dbinfofile}{dbinfofile}}{ -+ Db information file containing the DBI connection string, username and -+ password one to a line. -+ If not specified this file defaults to files in the \Opt{{-}{-}dbinfodir} -+ directory with the names db.work.conf, db.submit.conf, or db.admin.conf, -+ based on the functionality requested being process the queue, submit a job, -+ or perform administrative database functions respectively. -+ The default value is the current directory. -+ } -+ \OptItem{\OptArg{{-}{-}dbinfodir}{dbinfodir}}{ -+ Directory to look for default database information files when -+ \Opt{{-}{-}dbinfofile} is not specified. -+ } -+ \OptItem{\OptArg{{-}{-}logdir}{logfiledir}}{ -+ Directory name to place the Condor user log files generated by the Condor -+ system. -+ The default value is the current directory. -+ } -+ \OptItem{\OptArg{{-}{-}sleepamount}{seconds}}{ -+ Amount of time to sleep between each iteration of polling the database -+ system for new work and processing new events in the Condor user logs. -+ The default value is 10 seconds. -+ } -+ \OptItem{\OptArg{{-}{-}maxwork}{numofwork}}{ -+ Maximum number of inprogress work in the Condor system. -+ If there is less work in the Condor system, new work will be submitted if -+ available. -+ } -+ \OptItem{\OptArg{{-}{-}maxjobs}{numofjobs}}{ -+ Maximum number of incomplete jobs in the Condor system. -+ If there are fewer jobs, new work will be submitted if available. -+ } -+ \OptItem{\OptArg{{-}{-}grabamount}{numofwork}}{ -+ Maximum amount of work to pull from the database system to insert into the -+ Condor system per iteration. -+ The default value is 10 work records. -+ } -+ -+ \OptItem{\Opt{{-}{-}initdb}}{ -+ Create the tables and other associated database objects required by the -+ condor\_dbq system. -+ } -+ \OptItem{\Opt{{-}{-}createlang}}{ -+ Causes the plpgsql language to created in the database. -+ } -+ \OptItem{\Opt{{-}{-}revokepublic}}{ -+ Revokes the default ability of database users to create new tables in the -+ `public' schema in the database. -+ } -+ \OptItem{\OptArg{{-}{-}createsubmituser}{[dbinfofile]}}{ -+ Create a database account that has proper permissions to insert a work -+ submission to the database. -+ The username and paosword for the account is taken from the db information -+ file specified or the default submit db information file is used if none is -+ specified. -+ } -+ \OptItem{\OptArg{{-}{-}createworkuser}{[dbinfofile]}}{ -+ Create a database account that has proper permissions to allow condor\_dbq -+ to process the queue. -+ The username and paosword for the account is taken from the db information -+ file specified or the default worker db information file is used if none is -+ specified. -+ } -+ \OptItem{\OptArg{{-}{-}submit}{submitfile}}{ -+ Insert a row in the database containing the contents of \Arg{submitfile}. -+ A \Arg{submitfile} value of `-' will read the submit file from standard -+ in. -+ } -+ \OptItem{\Opt{{-}{-}noexecute}}{ -+ Do not execute any of the administrative database commands. -+ Just print them out to standard out. -+ } -+ -+ \OptItem{\Opt{{-}{-}help}}{ -+ Print a help message and exit. -+ } -+ -+ \OptItem{\Opt{{-}{-}version}}{ -+ Print the version and exit. -+ } -+\end{Options} -+ -+ -+\Examples -+ -+This section will present a complete introduction to using \Condor{dbq.pl} -+including setup of the environment, creation of the database accounts and -+tables, inserting work, and querying results. -+This example assumes the database `condor\_dbq\_db' is already created, and -+accessible on the same host via TCP/IP on the standard port. -+It also assumes that the administrative database account, -+`condor\_dbq\_admin\_user,' exists with the password -+`condor\_dbq\_admin\_password,' and that this account has the ability to create -+new database users and tables in the `condor\_dbq\_db' database. -+The example code is written in the bash shell. -+ -+Create a secure directory to store the db information files. -+ -+\begin{verbatim} -+mkdir condor_dbq_conf -+chmod 0700 condor_dbq_conf -+\end{verbatim} -+ -+Create the database account information files for a PostgreSQL database -+named condor\_dbq\_db: -+ -+\begin{verbatim} -+cat > condor_dbq_conf/db.admin.conf < condor_dbq_conf/db.submit.conf < condor_dbq_conf/db.worker.conf < my.submit <> endobj xref 39 394 0000000016 00000 n -+0000008500 00000 n -+0000008672 00000 n -+0000008797 00000 n -+0000009029 00000 n -+0000009098 00000 n -+0000009132 00000 n -+0000009174 00000 n -+0000010396 00000 n -+0000011383 00000 n -+0000012593 00000 n -+0000013699 00000 n -+0000014852 00000 n -+0000016028 00000 n -+0000017188 00000 n -+0000018171 00000 n -+0000018338 00000 n -+0000018420 00000 n -+0000018512 00000 n -+0000018595 00000 n -+0000018700 00000 n -+0000018781 00000 n -+0000018876 00000 n -+0000018963 00000 n -+0000019018 00000 n -+0000019134 00000 n -+0000019233 00000 n -+0000019349 00000 n -+0000019506 00000 n -+0000019595 00000 n -+0000019688 00000 n -+0000019839 00000 n -+0000019983 00000 n -+0000020085 00000 n -+0000020237 00000 n -+0000020343 00000 n -+0000020435 00000 n -+0000020582 00000 n -+0000020700 00000 n -+0000020816 00000 n -+0000020948 00000 n -+0000021037 00000 n -+0000021171 00000 n -+0000021311 00000 n -+0000021451 00000 n -+0000021601 00000 n -+0000021742 00000 n -+0000021867 00000 n -+0000021998 00000 n -+0000022130 00000 n -+0000022224 00000 n -+0000022354 00000 n -+0000022446 00000 n -+0000022604 00000 n -+0000022693 00000 n -+0000022790 00000 n -+0000022925 00000 n -+0000023028 00000 n -+0000023142 00000 n -+0000023300 00000 n -+0000023397 00000 n -+0000023500 00000 n -+0000023656 00000 n -+0000023771 00000 n -+0000023892 00000 n -+0000024040 00000 n -+0000024146 00000 n -+0000024259 00000 n -+0000024438 00000 n -+0000024562 00000 n -+0000024698 00000 n -+0000024842 00000 n -+0000024961 00000 n -+0000025056 00000 n -+0000025208 00000 n -+0000025306 00000 n -+0000025438 00000 n -+0000025579 00000 n -+0000025697 00000 n -+0000025797 00000 n -+0000025940 00000 n -+0000026058 00000 n -+0000026202 00000 n -+0000026354 00000 n -+0000026454 00000 n -+0000026606 00000 n -+0000026725 00000 n -+0000026827 00000 n -+0000026947 00000 n -+0000027125 00000 n -+0000027267 00000 n -+0000027393 00000 n -+0000027523 00000 n -+0000027637 00000 n -+0000027763 00000 n -+0000027891 00000 n -+0000028011 00000 n -+0000028139 00000 n -+0000028251 00000 n -+0000028381 00000 n -+0000028520 00000 n -+0000028642 00000 n -+0000028761 00000 n -+0000028890 00000 n -+0000029018 00000 n -+0000029163 00000 n -+0000029278 00000 n -+0000029402 00000 n -+0000029532 00000 n -+0000029644 00000 n -+0000029756 00000 n -+0000029862 00000 n -+0000029976 00000 n -+0000030081 00000 n -+0000030218 00000 n -+0000030332 00000 n -+0000030445 00000 n -+0000030556 00000 n -+0000030700 00000 n -+0000030799 00000 n -+0000030917 00000 n -+0000031082 00000 n -+0000031191 00000 n -+0000031299 00000 n -+0000031433 00000 n -+0000031551 00000 n -+0000031665 00000 n -+0000031826 00000 n -+0000031949 00000 n -+0000032078 00000 n -+0000032222 00000 n -+0000032353 00000 n -+0000032465 00000 n -+0000032602 00000 n -+0000032715 00000 n -+0000032838 00000 n -+0000032987 00000 n -+0000033114 00000 n -+0000033226 00000 n -+0000033407 00000 n -+0000033513 00000 n -+0000033648 00000 n -+0000033784 00000 n -+0000033893 00000 n -+0000033999 00000 n -+0000034168 00000 n -+0000034280 00000 n -+0000034381 00000 n -+0000034539 00000 n -+0000034651 00000 n -+0000034749 00000 n -+0000034890 00000 n -+0000035011 00000 n -+0000035139 00000 n -+0000035277 00000 n -+0000035380 00000 n -+0000035484 00000 n -+0000035631 00000 n -+0000035778 00000 n -+0000035882 00000 n -+0000036004 00000 n -+0000036148 00000 n -+0000036281 00000 n -+0000036391 00000 n -+0000036548 00000 n -+0000036690 00000 n -+0000036824 00000 n -+0000036969 00000 n -+0000037126 00000 n -+0000037282 00000 n -+0000037429 00000 n -+0000037577 00000 n -+0000037715 00000 n -+0000037877 00000 n -+0000038017 00000 n -+0000038165 00000 n -+0000038310 00000 n -+0000038456 00000 n -+0000038595 00000 n -+0000038734 00000 n -+0000038879 00000 n -+0000039023 00000 n -+0000039163 00000 n -+0000039304 00000 n -+0000039446 00000 n -+0000039587 00000 n -+0000039728 00000 n -+0000039868 00000 n -+0000040006 00000 n -+0000040148 00000 n -+0000040291 00000 n -+0000040432 00000 n -+0000040568 00000 n -+0000040708 00000 n -+0000040845 00000 n -+0000040958 00000 n -+0000041073 00000 n -+0000041229 00000 n -+0000041339 00000 n -+0000041458 00000 n -+0000041597 00000 n -+0000041727 00000 n -+0000041871 00000 n -+0000042001 00000 n -+0000042119 00000 n -+0000042233 00000 n -+0000042354 00000 n -+0000042498 00000 n -+0000042618 00000 n -+0000042739 00000 n -+0000042863 00000 n -+0000043017 00000 n -+0000043145 00000 n -+0000043261 00000 n -+0000043373 00000 n -+0000043481 00000 n -+0000043590 00000 n -+0000043728 00000 n -+0000043841 00000 n -+0000043960 00000 n -+0000044095 00000 n -+0000044229 00000 n -+0000044393 00000 n -+0000044548 00000 n -+0000044687 00000 n -+0000044815 00000 n -+0000044934 00000 n -+0000045054 00000 n -+0000045180 00000 n -+0000045314 00000 n -+0000045459 00000 n -+0000045590 00000 n -+0000045731 00000 n -+0000045866 00000 n -+0000046001 00000 n -+0000046117 00000 n -+0000046253 00000 n -+0000046395 00000 n -+0000046517 00000 n -+0000046660 00000 n -+0000046792 00000 n -+0000046915 00000 n -+0000047018 00000 n -+0000047122 00000 n -+0000047237 00000 n -+0000047393 00000 n -+0000047491 00000 n -+0000047600 00000 n -+0000047736 00000 n -+0000047844 00000 n -+0000047953 00000 n -+0000048107 00000 n -+0000048219 00000 n -+0000048341 00000 n -+0000048497 00000 n -+0000048607 00000 n -+0000048721 00000 n -+0000048839 00000 n -+0000048955 00000 n -+0000049083 00000 n -+0000049209 00000 n -+0000049358 00000 n -+0000049473 00000 n -+0000049599 00000 n -+0000049712 00000 n -+0000049829 00000 n -+0000049944 00000 n -+0000050066 00000 n -+0000050172 00000 n -+0000050275 00000 n -+0000050388 00000 n -+0000050501 00000 n -+0000050614 00000 n -+0000050705 00000 n -+0000050819 00000 n -+0000050937 00000 n -+0000051039 00000 n -+0000051173 00000 n -+0000051281 00000 n -+0000051415 00000 n -+0000051525 00000 n -+0000051666 00000 n -+0000051810 00000 n -+0000051927 00000 n -+0000052045 00000 n -+0000052208 00000 n -+0000052316 00000 n -+0000052420 00000 n -+0000052539 00000 n -+0000052659 00000 n -+0000052776 00000 n -+0000052893 00000 n -+0000053014 00000 n -+0000053137 00000 n -+0000053278 00000 n -+0000053421 00000 n -+0000053558 00000 n -+0000053681 00000 n -+0000053821 00000 n -+0000053914 00000 n -+0000054007 00000 n -+0000054111 00000 n -+0000054255 00000 n -+0000054366 00000 n -+0000054518 00000 n -+0000054682 00000 n -+0000054805 00000 n -+0000054949 00000 n -+0000055100 00000 n -+0000055239 00000 n -+0000055383 00000 n -+0000055519 00000 n -+0000055641 00000 n -+0000055772 00000 n -+0000055890 00000 n -+0000056001 00000 n -+0000056118 00000 n -+0000056223 00000 n -+0000056328 00000 n -+0000056436 00000 n -+0000056546 00000 n -+0000056653 00000 n -+0000056773 00000 n -+0000056889 00000 n -+0000057010 00000 n -+0000057126 00000 n -+0000057246 00000 n -+0000057360 00000 n -+0000057476 00000 n -+0000057599 00000 n -+0000057702 00000 n -+0000057805 00000 n -+0000057912 00000 n -+0000058016 00000 n -+0000058115 00000 n -+0000058217 00000 n -+0000058322 00000 n -+0000058423 00000 n -+0000058526 00000 n -+0000058628 00000 n -+0000058736 00000 n -+0000058844 00000 n -+0000058949 00000 n -+0000059050 00000 n -+0000059155 00000 n -+0000059256 00000 n -+0000059356 00000 n -+0000059461 00000 n -+0000059568 00000 n -+0000059666 00000 n -+0000059775 00000 n -+0000059872 00000 n -+0000059974 00000 n -+0000060079 00000 n -+0000060181 00000 n -+0000060291 00000 n -+0000060394 00000 n -+0000060494 00000 n -+0000060590 00000 n -+0000060689 00000 n -+0000060789 00000 n -+0000060889 00000 n -+0000060986 00000 n -+0000061084 00000 n -+0000061189 00000 n -+0000061290 00000 n -+0000061397 00000 n -+0000061496 00000 n -+0000061598 00000 n -+0000061700 00000 n -+0000061803 00000 n -+0000061906 00000 n -+0000062007 00000 n -+0000062108 00000 n -+0000062218 00000 n -+0000062322 00000 n -+0000062427 00000 n -+0000062533 00000 n -+0000062635 00000 n -+0000062739 00000 n -+0000062844 00000 n -+0000062942 00000 n -+0000063042 00000 n -+0000063147 00000 n -+0000063256 00000 n -+0000063359 00000 n -+0000063491 00000 n -+0000063583 00000 n -+0000063693 00000 n -+0000063807 00000 n -+0000063910 00000 n -+0000064020 00000 n -+0000064131 00000 n -+0000008176 00000 n -+trailer <<96C4DE4AF4E2484098D79C6703EB75C0>]>> startxref 0 %%EOF 432 0 obj <>stream -+x�b```f`P������Q� ��