├── .settings ├── org.eclipse.jdt.core.prefs └── org.eclipse.m2e.core.prefs ├── .travis.yml ├── README.md ├── pom.xml └── src └── main ├── assembly └── release.xml ├── java └── com │ └── tomecode │ └── utils │ └── Utils.java └── resources ├── osbCustomizer.cmd ├── osbCustomizer.py ├── osbCustomizer.sh ├── sample01 ├── sample01.jar └── sample01.properties ├── sample02 ├── sample02.jar └── sample02.properties ├── sample03 ├── sample03.jar └── sample03.properties ├── sample04 ├── sample04.jar └── sample04.properties ├── sample05 ├── sample05.jar └── sample05.properties ├── sample06 ├── sample06.jar └── sample06.properties ├── sample07 ├── sample07.jar └── sample07.properties ├── sample08 ├── sample08.jar └── sample08.properties ├── sample09 ├── sample09.jar └── sample09.properties ├── sample10 ├── sample10.jar └── sample10.properties ├── sample11 ├── sample11.jar └── sample11.properties ├── sample12 ├── sample12.jar └── sample12.properties ├── sample13 ├── sample13.jar └── sample13.properties ├── sample14 ├── sample14.jar └── sample14.properties ├── sample15 ├── sample15.jar └── sample15.properties ├── sample16 ├── sample16.jar └── sample16.properties ├── sample17 ├── sample17.jar └── sample17.properties ├── sample18 ├── sample18.jar └── sample18.properties ├── sample19 ├── sample19.jar └── sample19.properties └── sample20 ├── sample20.jar └── sample20.properties /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 3 | org.eclipse.jdt.core.compiler.compliance=1.5 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.source=1.5 6 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OSB-Config-WLST-Configurator 2 | =================== 3 | 4 | 5 | The OSB-Config-WLST-Configurator is a simple the WLST script that contains several features for a more detailed customization of SBConfig Jar file, before deploying to the OSB. The WLST script to read existing SBConfig jar and modify (customize) it according to the settings in the properties and generate a new SBConfig JAR. The WLST script allow you change e.g.: enpoint URI, enable or disble transactions, transport level security, timeout, retry count, etc. 6 | 7 | ![OSB-Config-WLST-Configurator](http://osb-config-wlst-configurator.tomecode.com/OSB-Config-WLST-Configurator.png) 8 | 9 | 10 | **OSB-Config-WLST-Configurator supports customization of the following OSB resources:** 11 | * Proxy Service 12 | * Business Service 13 | * (Static) Service Account 14 | * SMTP 15 | * JNDI 16 | * UDDI 17 | * Proxy Server 18 | * Alert Destination 19 | * Service (Key) Provider 20 | * GlobalOperationSettings 21 | * MQConnection 22 | 23 | **OSB-Config-WLST-Configurator supports customization of the following OSB transports:** 24 | * LOCAL 25 | * HTTP 26 | * JMS 27 | * MQ 28 | * FTP 29 | * SFTP 30 | * EMAIL 31 | * SB 32 | 33 | For more information about [OSB-Config-WLST-Configurator](http://osb-config-wlst-configurator.tomecode.com/), please visit [wiki pages](https://github.com/tomecode/OSB-Config-WLST-Configurator/wiki/OSB-Config-WLST-Configurator) or download latest [OSB-Config-WLST-Configurator release](https://github.com/tomecode/OSB-Config-WLST-Configurator/releases). 34 | 35 | [![Build Status](https://travis-ci.org/TrentBartlem/OSB-Config-WLST-Configurator.svg?branch=master)](https://travis-ci.org/TrentBartlem/OSB-Config-WLST-Configurator) 36 | 37 | 38 | This project is member of [OSB utilities](https://github.com/tomecode/osb-utilities) 39 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.tomecode 5 | osb-wlst-customization 6 | 1.0.0 7 | OSB-Config-WLST-Configurator 8 | OSB-Config-WLST-Configurator 9 | 10 | 11 | 12 | TomeCode 13 | TomeCode.com 14 | http://tomecode.com/ 15 | http://osb-config-wlst-configurator.tomecode.com/ 16 | 17 | 18 | 19 | 20 | OSB-Config-WLST-Configurator-${project.version} 21 | 22 | 23 | src/main/resources 24 | 25 | *.* 26 | 27 | true 28 | 29 | 30 | 31 | 32 | 33 | org.apache.maven.plugins 34 | maven-assembly-plugin 35 | 2.4 36 | 37 | 38 | src/main/assembly/release.xml 39 | 40 | 41 | 42 | 43 | install 44 | 45 | attached 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/assembly/release.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | release 7 | 8 | zip 9 | 10 | 11 | false 12 | 13 | 14 | 15 | 16 | *.jar 17 | 18 | target/ 19 | OSB-Config-WLST-Configurator 20 | 21 | 22 | src/main/resources/ 23 | OSB-Config-WLST-Configurator 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/tomecode/utils/Utils.java: -------------------------------------------------------------------------------- 1 | package com.tomecode.utils; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.util.jar.JarEntry; 5 | import java.util.jar.JarInputStream; 6 | 7 | /** 8 | * Utils 9 | * 10 | * @author Tomas.FRASTIA - tomecode.com 11 | * 12 | */ 13 | public final class Utils { 14 | 15 | public static final byte[] readJarEntryToBytes(JarInputStream jis, JarEntry entry) throws Exception { 16 | byte[] buffer = new byte[1024]; 17 | int nrBytesRead; 18 | 19 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 20 | while ((nrBytesRead = jis.read(buffer)) > 0) { 21 | baos.write(buffer, 0, nrBytesRead); 22 | } 23 | 24 | return baos.toByteArray(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/osbCustomizer.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | SET OSB_HOME=D:\Oracle\Middleware11gPS6\Oracle_OSB1ps6 4 | SET WL_HOME=D:\Oracle\Middleware11gPS6\wlserver_10.3 5 | @REM CALL "%WL_HOME%\server\bin\setWLSEnv.cmd" 6 | 7 | SET CLASSPATH=%WL_HOME%\server\lib\weblogic.jar 8 | @REM SET CLASSPATH=%CLASSPATH%;%OSB_HOME%\common\lib\customizer.jar 9 | SET CLASSPATH=%CLASSPATH%;%OSB_HOME%\lib\sb-kernel-api.jar 10 | SET CLASSPATH=%CLASSPATH%;%OSB_HOME%\lib\sb-kernel-common.jar 11 | SET CLASSPATH=%CLASSPATH%;%OSB_HOME%\lib\sb-kernel-impl.jar 12 | SET CLASSPATH=%CLASSPATH%;%OSB_HOME%\lib\sb-kernel-resources.jar 13 | SET CLASSPATH=%CLASSPATH%;%OSB_HOME%\lib\sb-kernel-wls.jar 14 | SET CLASSPATH=%CLASSPATH%;%OSB_HOME%\lib\sb-transports-http-wls.jar 15 | SET CLASSPATH=%CLASSPATH%;%OSB_HOME%\lib\sb-transports-main.jar 16 | SET CLASSPATH=%CLASSPATH%;%~p0\* 17 | 18 | 19 | SETLOCAL enabledelayedexpansion 20 | 21 | for %%i in (%OSB_HOME%\lib\modules\*.jar) do call :AddToPath %%i 22 | for %%i in (%OSB_HOME%\modules\*.jar) do call :AddToPath %%i 23 | for %%i in (%OSB_HOME%\lib\transports\mq*.jar) do call :AddToPath %%i 24 | for %%i in (%OSB_HOME%\lib\transports\ftp*.jar) do call :AddToPath %%i 25 | for %%i in (%OSB_HOME%\lib\transports\file*.jar) do call :AddToPath %%i 26 | for %%i in (%OSB_HOME%\lib\transports\sftp*.jar) do call :AddToPath %%i 27 | for %%i in (%OSB_HOME%\lib\transports\email*.jar) do call :AddToPath %%i 28 | for %%i in (%OSB_HOME%\lib\transports\sb*.jar) do call :AddToPath %%i 29 | 30 | 31 | java -Dfile.encoding=UTF-8 -Dweblogic.wlstHome=%temp%\osbCustomizer\ weblogic.WLST -i osbCustomizer.py %* 32 | 33 | :AddToPath 34 | SET CLASSPATH=%CLASSPATH%;%1 35 | GOTO :EOF -------------------------------------------------------------------------------- /src/main/resources/osbCustomizer.py: -------------------------------------------------------------------------------- 1 | #################################################################### 2 | # 3 | # Author: Tomas (Tome) Frastia 4 | # Web: http://www.TomeCode.com 5 | # Version: ${project.version} 6 | # Description: 7 | # Copyright (c): Tomas (Tome) Frastia | TomeCode.com 8 | # 9 | # Changelog: 10 | # 1.1.15 Sets wlst exitcode on failure so calling script can detect failed deployment 11 | # 1.1.14 Added ability to configure http business service throttling when no throttling entry exists in business service source 12 | # 1.1.13 Added ability to configure http business service throttling 13 | # 1.1.11 Changed session name 14 | # 1.1.10 Prints version 15 | # 1.1.9 Added support for failure if tokens remain uncustomised 16 | # 1.1.8 Added support for work managers on http bizrefs. 17 | # 1.1.7 Updated for sb inbound services 18 | # 1.1.6 Fixed bug preventing customisation of multiple files at once 19 | # 1.1.5 Updated to properly support proxy service inbound properties 20 | # 1.1.4 Added ability to change biz from sb transport to http transport 21 | # 1.1.3 Added ability to do token replacement 22 | # 1.1.2 Added more customisation fields 23 | # 1.1.1 Added toggle to replace the original sbconfig jar rather than create a new one. Disabled by default. 24 | # 1.1.0 25 | # Customize: MQConnection 26 | # Proxy Service and Business Service with transport: MQ, MQConnection, FTP, FILE, SFTP, EMAIL, SB 27 | # Bug fixes and improvements 28 | # 1.0.0 29 | # New customization core 30 | # Customize: authentication for: SSLClientAuthenticationType, CustomTokenAuthenticationType for HTTP/Proxy 31 | # ProxyServer, AlertDestination, ServiceProvider 32 | # (Static) ServiceAccount 33 | # RetryCount and RetryInterval in HTTP/Proxy 34 | # Enable or disable deployment to OSB 35 | # Bug fixes 36 | # 0.0.2 37 | # Bug fixes 38 | # 0.0.2 39 | # Bug fixes 40 | # 0.0.1 41 | # Customize: Proxy Service and Business Service with transport: JMS and HTTP 42 | #################################################################### 43 | 44 | import sys, traceback 45 | import os 46 | import os.path 47 | import time 48 | import shutil 49 | import glob 50 | import fnmatch 51 | import re 52 | 53 | from xml.dom import minidom 54 | from javax.xml.namespace import QName 55 | 56 | from java.io import ByteArrayInputStream 57 | from java.io import ByteArrayOutputStream 58 | from java.io import FileOutputStream 59 | from java.util.jar import JarInputStream 60 | from java.util.jar import JarOutputStream 61 | from java.util.jar import JarEntry 62 | 63 | from com.tomecode.utils import Utils 64 | 65 | from com.bea.wli.sb.services import ServiceAccountDocument 66 | from com.bea.wli.sb.services import ServiceDefinition 67 | from com.bea.wli.sb.services import StaticServiceAccount 68 | from com.bea.wli.sb.services import ServiceProviderEntry 69 | 70 | from com.bea.wli.sb.transports import EndPointConfiguration 71 | from com.bea.wli.sb.transports import URIType 72 | from com.bea.wli.sb.transports import FilePathType 73 | 74 | from com.bea.wli.sb.transports.http import AuthenticationConfigurationType 75 | from com.bea.wli.sb.transports.http import SSLClientAuthenticationType 76 | from com.bea.wli.sb.transports.http import CustomTokenAuthenticationType 77 | from com.bea.wli.sb.transports.http import HttpBasicAuthenticationType 78 | from com.bea.wli.sb.transports.http import HttpEndPointConfiguration 79 | from com.bea.wli.sb.transports.http import HttpInboundPropertiesType 80 | from com.bea.wli.sb.transports.http import HttpOutboundPropertiesType 81 | from com.bea.wli.sb.transports.http import HttpRequestMethodEnum 82 | from com.bea.wli.sb.transports.http import SessionStickinessType 83 | 84 | from com.bea.wli.sb.transports.mq import MQInboundProperties 85 | from com.bea.wli.sb.transports.mq import MQEndPointConfiguration 86 | from com.bea.wli.sb.transports.mq import MQMessageTypeEnum 87 | 88 | from com.bea.wli.sb.transports.ftp import FtpEndPointConfiguration 89 | from com.bea.wli.sb.transports.ftp import FtpInboundPropertiesType 90 | from com.bea.wli.sb.transports.ftp import FilePollInfo 91 | 92 | from com.bea.wli.sb.transports.file import FileEndPointConfiguration 93 | from com.bea.wli.sb.transports.file import FileInBoundProperties 94 | 95 | from com.bea.wli.sb.transports.sftp import SftpEndPointConfiguration 96 | 97 | from com.bea.wli.sb.transports.email import EmailEndPointConfiguration 98 | 99 | from com.bea.wli.sb.transports.sb import SBEndPointConfiguration 100 | 101 | from com.bea.wli.sb.transports.jms import JmsEndPointConfiguration 102 | from com.bea.wli.sb.transports.jms import JmsResponsePatternEnum 103 | from com.bea.wli.sb.transports.jms import JmsMessageTypeEnum 104 | 105 | from com.bea.wli.sb.uddi import UDDIRegistryEntry 106 | 107 | from com.bea.wli.sb.security.accesscontrol.config import PolicyContainerType 108 | from com.bea.wli.sb.security.accesscontrol.config import ProviderPolicyContainerType 109 | 110 | from com.bea.wli.sb.services.security.config import XPathSelectorType 111 | 112 | from com.bea.wli.sb.resources.proxyserver.config import ProxyServerDocument 113 | from com.bea.wli.sb.resources.proxyserver.config import ProxyServerParams 114 | 115 | 116 | from com.bea.wli.sb.services.security.config import XPathSelectorType 117 | 118 | from com.bea.wli.sb.util import Refs 119 | 120 | from com.bea.wli.sb.resources.config import SmtpServerEntry 121 | from com.bea.wli.sb.resources.config import JndiProviderEntry 122 | from com.bea.wli.sb.resources.config import ServiceAccountUserPassword 123 | from com.bea.wli.sb.resources.config import UserPassword 124 | from com.bea.wli.sb.resources.config import MqConnectionEntry 125 | from com.bea.wli.sb.resources.config import MqTcpModeType 126 | 127 | from com.bea.wli.sb.management.importexport import ALSBImportOperation 128 | from com.bea.wli.sb.management.configuration import SessionManagementMBean 129 | from com.bea.wli.sb.management.configuration import ServiceConfigurationMBean 130 | from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean 131 | from com.bea.wli.sb.management.query import ProxyServiceQuery 132 | 133 | from com.bea.wli.domain.config import OperationalSettings 134 | 135 | from com.bea.wli.config.customization import Customization 136 | 137 | from com.bea.wli.monitoring.alert import AlertDestination 138 | 139 | #=================================================================== 140 | LOG_CUST_FILE = ' --> ' 141 | LOG_CUST_FUNCTION = ' --> ' 142 | LOG_NOT_FOUND_FUNCTION = ' ##> Error Not found: ' 143 | #=================================================================== 144 | 145 | NOT_FOUND_CUSTOMIZATION=[] 146 | 147 | #=================================================================== 148 | # Jar Entry 149 | #=================================================================== 150 | class OsbJarEntry: 151 | name='' 152 | directory=False 153 | data=None 154 | extension=None 155 | 156 | def __init__(self,n,d,b): 157 | self.name=n 158 | self.directory=d 159 | self.data=b 160 | #get extensio name 161 | self.extension=os.path.splitext(self.name)[1][1:] 162 | 163 | def getName(self): 164 | return self.name 165 | 166 | def getData(self): 167 | return self.data 168 | 169 | def setData(self, d): 170 | self.data=d 171 | 172 | def getExtension(self): 173 | return self.extension.lower() 174 | 175 | 176 | def findOsbJarEntry(indexName,osbJarEntries): 177 | for entry in osbJarEntries: 178 | if entry.getName()==indexName: 179 | return entry 180 | 181 | return None 182 | 183 | def findOsbJarEntries(indexName,osbJarEntries): 184 | if "*" in indexName: 185 | regex = fnmatch.translate(indexName) 186 | return [entry for entry in osbJarEntries if re.match(regex, entry.getName())] 187 | else: 188 | return [entry for entry in osbJarEntries if entry.getName()==indexName] 189 | 190 | 191 | #=================================================================== 192 | # Parse sbconfig file 193 | #=================================================================== 194 | def parseOsbJar(data): 195 | osbJarEntries=[] 196 | jis = None 197 | jis = JarInputStream(ByteArrayInputStream(data)) 198 | 199 | entry = jis.getNextJarEntry() 200 | while (entry != None): 201 | if (entry.isDirectory()): 202 | osbJarEntries.append(OsbJarEntry(entry.toString(), entry.isDirectory(), None)) 203 | else: 204 | osbJarEntries.append(OsbJarEntry(entry.toString(), entry.isDirectory(), Utils.readJarEntryToBytes(jis,entry))) 205 | entry = jis.getNextJarEntry() 206 | 207 | jis.close() 208 | return osbJarEntries 209 | 210 | def convertToTuple(values): 211 | list=[] 212 | if '' in str(type(values)): 213 | list.append(str(values)) 214 | else: 215 | for val in values: 216 | list.append(val) 217 | return list 218 | 219 | 220 | def isDict(val): 221 | return ('' in str(type(val))) 222 | 223 | def reverseDict(val): 224 | if val==None: 225 | return [] 226 | if not isinstance(val,dict): 227 | return [] 228 | list=val.keys() 229 | list.reverse() 230 | return list 231 | 232 | #=================================================================== 233 | # Generating a new sbconfig file 234 | #=================================================================== 235 | def generateNewSBConfig(osbJarEntries): 236 | baos = ByteArrayOutputStream() 237 | jos = None 238 | try: 239 | jos = JarOutputStream(baos) 240 | for entry in osbJarEntries: 241 | jarEntry = JarEntry(entry.getName()) 242 | jos.putNextEntry(jarEntry) 243 | if entry.getData() != None: 244 | jos.write(entry.getData(), 0, len(entry.getData())) 245 | jos.closeEntry() 246 | except Exception, err: 247 | print traceback.format_exc() 248 | jos.close() 249 | return baos.toByteArray() 250 | 251 | 252 | #=================================================================== 253 | # Read binary file (Sbconfig) 254 | #=================================================================== 255 | def readBinaryFile(fileName): 256 | file = open(fileName, 'rb') 257 | bytes = file.read() 258 | return bytes 259 | 260 | #=================================================================== 261 | # Write binary file (Sbconfig) 262 | #=================================================================== 263 | def writeToFile(fName, data): 264 | fos = FileOutputStream(fName) 265 | fos.write(data) 266 | fos.flush() 267 | fos.close() 268 | 269 | 270 | def saveNewSbConfigNoFS(sbFileName,data, replaceFile): 271 | index=sbFileName.rfind('.') 272 | if (replaceFile): 273 | newSbFileName = sbFileName 274 | oldSbFileName= sbFileName[0:index] + '-' + time.strftime('%Y%m%d_%H%M%S')+'.jar.old' 275 | print ' Moving old sbconfig to: ' + oldSbFileName 276 | shutil.copy2(sbFileName, oldSbFileName) 277 | else: 278 | newSbFileName= sbFileName[0:index] + '-' + time.strftime('%Y%m%d_%H%M%S')+'.jar' 279 | print ' New customizated sbconfig is: ' + newSbFileName 280 | 281 | writeToFile(newSbFileName,data) 282 | return newSbFileName 283 | 284 | #-------------------------------------------------------------------------------- 285 | #-------------------------------------------------------------------------------- 286 | #-------------------------------------------------------------------------------- 287 | #-------------------------------------------------------------------------------- 288 | #-------------------------------------------------------------------------------- 289 | #-------------------------------------------------------------------------------- 290 | 291 | 292 | 293 | #=================================================================== 294 | # Connect to the Admin Server 295 | #=================================================================== 296 | def connectToOSB(): 297 | print ' ' 298 | print '------------------------------------' 299 | print ' --- Connecting to OSB server ' 300 | if 'Url' in SB_SERVER: 301 | uri = SB_SERVER['Url'] 302 | else: 303 | uri = 't3://' + SB_SERVER['ListenAddress'] + ':' + str(SB_SERVER['ListenPort']) 304 | try: 305 | connect(SB_SERVER['Username'],SB_SERVER['Password'],uri) 306 | domainRuntime() 307 | return True 308 | except WLSTException: 309 | print ' --- No server is running at '+ uri+ ' !\n Deploy cancelled!' 310 | return False 311 | 312 | 313 | #=================================================================== 314 | # Utility function to load a session MBeans 315 | #=================================================================== 316 | def createOSBSession(): 317 | sessionName = "BulkDeploy_" + str(System.currentTimeMillis()) 318 | sessionMBean = findService(SessionManagementMBean.NAME, SessionManagementMBean.TYPE) 319 | sessionMBean.createSession(sessionName) 320 | print ' ..OSB Session Created: ' + sessionName 321 | return sessionMBean, sessionName 322 | 323 | def createImportProject(ALSBConfigurationMBean): 324 | alsbJarInfo = ALSBConfigurationMBean.getImportJarInfo() 325 | alsbImportPlan = alsbJarInfo.getDefaultImportPlan() 326 | #alsbImportPlan.setPassphrase(None) 327 | alsbImportPlan.setPreserveExistingAccessControlPolicies(False) 328 | alsbImportPlan.setPreserveExistingCredentials(False) 329 | alsbImportPlan.setPreserveExistingOperationalValues(False) 330 | alsbImportPlan.setPreserveExistingEnvValues(False) 331 | alsbImportPlan.setPreserveExistingSecurityAndPolicyConfig(False) 332 | return ALSBConfigurationMBean.importUploaded(alsbImportPlan) 333 | 334 | def uploadSbConfigToOSB(ALSBConfigurationMBean, sbConfigJar): 335 | ALSBConfigurationMBean.uploadJarFile(readBinaryFile(sbConfigJar)) 336 | print ' ..Uploaded: ' + sbConfigJar 337 | importResult= createImportProject(ALSBConfigurationMBean) 338 | 339 | def showVersionSummary(): 340 | print 'Server: ' + version 341 | print 'Java..: ' + sys.platform 342 | print 'Jython: ' + sys.version 343 | 344 | def deployToOsb(files): 345 | 346 | if 'SB_SERVER' in globals(): 347 | print ' Deploying to OSB: '+ ', '.join(files) 348 | 349 | try: 350 | if connectToOSB()== True: 351 | showVersionSummary() 352 | #create new session 353 | sessionMBean, sessionName = createOSBSession() 354 | 355 | ALSBConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean") 356 | 357 | #simple import without customization 358 | for file in files: 359 | uploadSbConfigToOSB(ALSBConfigurationMBean,file) 360 | 361 | print ' ..Commiting session, please wait, this can take a while...' 362 | sessionMBean.activateSession(sessionName, "Import from wlst") 363 | print ' ..Session was successfully committed!' 364 | print ' ' 365 | except java.lang.Exception, e: 366 | print ' Import to OSB: Failed, please see logs...' + '\n ', e 367 | dumpStack() 368 | if sessionMBean != None: 369 | sessionMBean.discardSession(sessionName) 370 | print 'Session discarded.' 371 | print 'Setting exitcode to 5' 372 | exit(exitcode=5) 373 | else: 374 | print 'Deployment to OSB is disabled' 375 | 376 | 377 | #### ############################################################################################################################################### 378 | #### ############################################################################################################################################### 379 | #### 380 | #### Customization functions 381 | #### 382 | #### ############################################################################################################################################### 383 | #### ############################################################################################################################################### 384 | 385 | def getJmsEndPointConfiguration(serviceDefinition): 386 | JmsEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 387 | return JmsEndPointConfiguration 388 | 389 | 390 | def getCommonOutboundProperties(serviceDefinition): 391 | endPointConfiguration=serviceDefinition.getEndpointConfig() 392 | outboundProperties= endPointConfiguration.getOutboundProperties() 393 | if outboundProperties == None: 394 | outboundProperties= endPointConfiguration.addNewOutboundProperties() 395 | return outboundProperties 396 | 397 | def getJmsInboundProperties(serviceDefinition): 398 | jmsEndPointConfiguration=getJmsEndPointConfiguration(serviceDefinition) 399 | jmsInboundProperties= jmsEndPointConfiguration.getInboundProperties() 400 | if jmsInboundProperties == None: 401 | jmsInboundProperties= jmsEndPointConfiguration.addNewInboundProperties() 402 | return jmsInboundProperties 403 | 404 | 405 | def changeEndpointUri(endpoints,serviceDefinition): 406 | endpointConfiguration = serviceDefinition.getEndpointConfig() 407 | if len(endpointConfiguration.getURIArray()) >= 1: 408 | #uris=URIType[0] 409 | endpointConfiguration.setURIArray([]) 410 | 411 | for uri in endpoints: 412 | endpointConfiguration.addNewURI().setValue(uri) 413 | 414 | def getTransactions(serviceDefinition): 415 | transactions=serviceDefinition.getCoreEntry().getTransactions() 416 | if transactions==None: 417 | return serviceDefinition.getCoreEntry().addNewTransactions() 418 | return transactions 419 | 420 | def getThrottling(serviceDefinition): 421 | throttling=serviceDefinition.getCoreEntry().getThrottling() 422 | if throttling==None: 423 | return serviceDefinition.getCoreEntry().addNewThrottling() 424 | return throttling 425 | 426 | def getHttpInboundProperties(serviceDefinition): 427 | httpEndPointConfiguration = getHttpEndPointConfiguration(serviceDefinition) 428 | httpInboundProperties= httpEndPointConfiguration.getInboundProperties() 429 | if httpInboundProperties == None: 430 | httpInboundProperties= httpEndPointConfiguration.addNewInboundProperties() 431 | return httpInboundProperties 432 | 433 | def getHttpOutboundProperties(serviceDefinition): 434 | httpEndPointConfiguration = getHttpEndPointConfiguration(serviceDefinition) 435 | outboundProperties= httpEndPointConfiguration.getOutboundProperties() 436 | if outboundProperties == None: 437 | outboundProperties= httpEndPointConfiguration.addNewOutboundProperties() 438 | return outboundProperties 439 | 440 | def getHttpEndPointConfiguration(serviceDefinition): 441 | providerSpecific=serviceDefinition.getEndpointConfig().getProviderSpecific() 442 | providerSpecific = providerSpecific.changeType(HttpEndPointConfiguration.type) 443 | return providerSpecific 444 | 445 | def findKeyPairForServiceProvider(serviceProviderEntry, prupose): 446 | if serviceProviderEntry.getCredentials()!=None: 447 | keyPairArray=serviceProviderEntry.getCredentials().getKeyPairArray() 448 | if keyPairArray!= None: 449 | for keyPair in keyPairArray: 450 | if prupose in keyPair.getPurpose(): 451 | return keyPair 452 | 453 | return None 454 | 455 | 456 | def getMqOutboundProperties(serviceDefinition): 457 | MQEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 458 | outboundProperties= MQEndPointConfiguration.getOutboundProperties() 459 | if outboundProperties == None: 460 | outboundProperties= MQEndPointConfiguration.addNewOutboundProperties() 461 | return outboundProperties 462 | 463 | 464 | def getFtpOutboundProperties(serviceDefinition): 465 | FtpEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 466 | outboundProperties= FtpEndPointConfiguration.getOutboundProperties() 467 | if outboundProperties == None: 468 | outboundProperties= FtpEndPointConfiguration.addNewOutboundProperties() 469 | return outboundProperties 470 | 471 | 472 | def getFtpPrefixSufix(outboundProperties): 473 | if outboundProperties.getDestinationFileName()==None: 474 | outboundProperties.addNewDestinationFileName() 475 | if outboundProperties.getDestinationFileName().getPrefixSuffix()==None: 476 | outboundProperties.getDestinationFileName().addNewPrefixSuffix() 477 | return outboundProperties.getDestinationFileName().getPrefixSuffix() 478 | 479 | def getFileOutboundProperties(serviceDefinition): 480 | FileEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 481 | outboundProperties= FileEndPointConfiguration.getOutboundProperties() 482 | if outboundProperties == None: 483 | outboundProperties= FileEndPointConfiguration.addNewOutboundProperties() 484 | return outboundProperties 485 | 486 | 487 | def getMqInboundProperties(serviceDefinition): 488 | MQEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 489 | inboundProperties=MQEndPointConfiguration.selectChildren(QName("http://www.bea.com/wli/sb/transports/mq", "inbound-properties"))[0] 490 | mqInboundProperties = MQInboundProperties.Factory.parse(inboundProperties.toString()) 491 | return inboundProperties, mqInboundProperties 492 | 493 | def getFtpInboundProperties(serviceDefinition): 494 | FtpEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 495 | inboundProperties=FtpEndPointConfiguration.selectChildren(QName("http://www.bea.com/wli/sb/transports/ftp", "inbound-properties"))[0] 496 | ftpInboundProperties = FtpInboundPropertiesType.Factory.parse(inboundProperties.toString()) 497 | return inboundProperties, ftpInboundProperties 498 | 499 | 500 | def getFileInboundProperties(serviceDefinition): 501 | FileEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 502 | inboundProperties=FileEndPointConfiguration.selectChildren(QName("http://www.bea.com/wli/sb/transports/file", "inbound-properties"))[0] 503 | fileInBoundProperties = FileInBoundProperties.Factory.parse(inboundProperties.toString()) 504 | return inboundProperties, fileInBoundProperties 505 | 506 | def getSftpInboundProperties(serviceDefinition): 507 | SftpEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 508 | inboundProperties= SftpEndPointConfiguration.getInboundProperties() 509 | if inboundProperties == None: 510 | inboundProperties= SftpEndPointConfiguration.addNewInboundProperties() 511 | return inboundProperties 512 | 513 | def getSftpOutboundProperties(serviceDefinition): 514 | SftpEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 515 | outboundProperties= SftpEndPointConfiguration.getOutboundProperties() 516 | if outboundProperties == None: 517 | outboundProperties= SftpEndPointConfiguration.addNewOutboundProperties() 518 | return outboundProperties 519 | 520 | def getEmailEndPointConfiguration(serviceDefinition): 521 | EmailEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 522 | return EmailEndPointConfiguration 523 | 524 | def getEmailInboundProperties(serviceDefinition): 525 | EmailEndPointConfiguration = getEmailEndPointConfiguration(serviceDefinition) 526 | inboundProperties= EmailEndPointConfiguration.getInboundProperties() 527 | if inboundProperties == None: 528 | inboundProperties= EmailEndPointConfiguration.addNewInboundProperties() 529 | return inboundProperties 530 | 531 | def getEmailOutboundProperties(serviceDefinition): 532 | EmailEndPointConfiguration = getEmailEndPointConfiguration(serviceDefinition) 533 | outboundProperties= EmailEndPointConfiguration.getOutboundProperties() 534 | if outboundProperties == None: 535 | outboundProperties= EmailEndPointConfiguration.addNewOutboundProperties() 536 | return outboundProperties 537 | 538 | def getSBEndPointConfiguration(serviceDefinition): 539 | providerSpecific=serviceDefinition.getEndpointConfig().getProviderSpecific() 540 | providerSpecific = providerSpecific.changeType(SBEndPointConfiguration.type) 541 | return providerSpecific 542 | 543 | def getSbInboundProperties(serviceDefinition): 544 | SBEndPointConfiguration = getSBEndPointConfiguration(serviceDefinition) 545 | inboundProperties= SBEndPointConfiguration.getInboundProperties() 546 | if inboundProperties == None: 547 | inboundProperties= SBEndPointConfiguration.addNewInboundProperties() 548 | return inboundProperties 549 | 550 | def getSbOutboundProperties(serviceDefinition): 551 | SBEndPointConfiguration = getSBEndPointConfiguration(serviceDefinition) 552 | outboundProperties= SBEndPointConfiguration.getOutboundProperties() 553 | if outboundProperties == None: 554 | outboundProperties= SBEndPointConfiguration.addNewOutboundProperties() 555 | return outboundProperties 556 | 557 | #=================================================================== 558 | # Create a policy expression 559 | #=================================================================== 560 | def createPolicyExpression(policyConfig): 561 | expression = '' 562 | provider ='' 563 | 564 | if 'Provider' in reverseDict(policyConfig): 565 | print LOG_CUST_FILE+ 'Policy: Provider' 566 | provider=policyConfig['Provider'] 567 | if 'Users' in policyConfig: 568 | print LOG_CUST_FILE+ 'Policy: Users' 569 | for user in convertToTuple(policyConfig['Users']): 570 | expression += '| Usr('+ str(user) + ')' 571 | 572 | if 'Groups' in policyConfig: 573 | print LOG_CUST_FILE+ 'Policy: Groups' 574 | for group in convertToTuple(policyConfig['Groups']): 575 | expression += '| Grp('+ str(group) + ')' 576 | 577 | if 'Roles' in policyConfig: 578 | print LOG_CUST_FILE+ 'Policy: Roles' 579 | for role in convertToTuple(policyConfig['Roles']): 580 | expression += '| Rol('+ str(role) + ')' 581 | 582 | 583 | expression=expression.strip() 584 | if expression.startswith('|'): 585 | expression=expression[2:len(expression)] 586 | return expression,provider 587 | 588 | #=================================================================== 589 | # Setup policy expression in service 590 | #=================================================================== 591 | def setupPolicyExpression(serviceDefinition, policyExpression, provider): 592 | 593 | if len(policyExpression.strip())!=0 and len(provider.strip())!=0: 594 | security = getSecurityFromServiceDefinition(serviceDefinition) 595 | 596 | accessControlPolicyBindingType = security.getAccessControlPolicies() 597 | if accessControlPolicyBindingType==None: 598 | accessControlPolicyBindingType = security.addNewAccessControlPolicies() 599 | 600 | transportLevelPolicy = accessControlPolicyBindingType.getTransportLevelPolicy() 601 | if accessControlPolicyBindingType.getTransportLevelPolicy() == None: 602 | transportLevelPolicy = accessControlPolicyBindingType.addNewTransportLevelPolicy() 603 | 604 | 605 | policyContainerType = ProviderPolicyContainerType.Factory.newInstance() 606 | policy = policyContainerType.addNewPolicy() 607 | policy.setProviderId(provider) 608 | policy.setPolicyExpression(policyExpression) 609 | 610 | transportLevelPolicy.set(policyContainerType) 611 | else: 612 | policyContainerType = transportLevelPolicy 613 | policyContainerType.getPolicyArray()[0].setProviderId(provider) 614 | policyContainerType.getPolicyArray()[0].setPolicyExpression(policyExpression) 615 | 616 | def getSecurityFromServiceDefinition(serviceDefinition): 617 | security = serviceDefinition.getCoreEntry().getSecurity() 618 | if security == None: 619 | security = serviceDefinition.getCoreEntry().addNewSecurity() 620 | return security 621 | 622 | def prepareCustomTokenAuthentication(security): 623 | customTokenAuthentication=security.getCustomTokenAuthentication() 624 | if customTokenAuthentication==None: 625 | #customTokenAuthentication.unsetCustomTokenAuthentication() 626 | customTokenAuthentication=security.addNewCustomTokenAuthentication() 627 | return customTokenAuthentication 628 | 629 | #### ############################################################################################################################################### 630 | #### ############################################################################################################################################### 631 | #### 632 | #### Customization Start 633 | #### 634 | #### ############################################################################################################################################### 635 | #### ############################################################################################################################################### 636 | 637 | 638 | #=================================================================== 639 | # Customize: Global Operation Settings 640 | #=================================================================== 641 | 642 | def globaloperationalsettings_operations_monitoring(entry, val): 643 | entry.setMonitoring(val) 644 | 645 | def globaloperationalsettings_operations_slaalerting(entry, val): 646 | entry.setSlaAlerting(val) 647 | 648 | def globaloperationalsettings_operations_pipelinealerting(entry, val): 649 | entry.setPipelineAlerting(val) 650 | 651 | def globaloperationalsettings_operations_resultcaching(entry, val): 652 | entry.setResultCaching(val) 653 | 654 | def globaloperationalsettings_operations_reporting(entry, val): 655 | entry.setReporting(val) 656 | 657 | def globaloperationalsettings_operations_logging(entry, val): 658 | entry.setLogging(val) 659 | 660 | #=================================================================== 661 | # Customize: Service Account: Static 662 | #=================================================================== 663 | 664 | def serviceaccount_serviceaccount_description(entry, val): 665 | serviceAccount = entry.getServiceAccount() 666 | serviceAccount.setDescription(val) 667 | 668 | def serviceaccount_serviceaccount_password(entry, val): 669 | serviceAccountUserPassword = entry.getServiceAccount().getStaticAccount() 670 | serviceAccountUserPassword.setPassword(val) 671 | 672 | def serviceaccount_serviceaccount_username(entry, val): 673 | serviceAccountUserPassword = entry.getServiceAccount().getStaticAccount() 674 | serviceAccountUserPassword.setUsername(val) 675 | 676 | #=================================================================== 677 | # Customize: UDDI 678 | #=================================================================== 679 | 680 | def uddi_uddiregistry_loadtmodels(entry, val): 681 | entry.setLoadtModels(val) 682 | 683 | def uddi_uddiregistry_autoimport(entry, val): 684 | entry.setAutoImport(val) 685 | 686 | def uddi_uddiregistry_password(entry, val): 687 | entry.setPassword(val) 688 | 689 | def uddi_uddiregistry_publishurl(entry, val): 690 | entry.setPublishUrl(val) 691 | 692 | def uddi_uddiregistry_subscriptionurl(entry, val): 693 | entry.setSubscriptionUrl(val) 694 | 695 | def uddi_uddiregistry_username(entry, val): 696 | entry.setUsername(val) 697 | 698 | def uddi_uddiregistry_securityurl(entry, val): 699 | entry.setSecurityUrl(val) 700 | 701 | def uddi_uddiregistry_url(entry, val): 702 | entry.setUrl(val) 703 | 704 | def uddi_uddiregistry_description(entry, val): 705 | entry.setDescription(val) 706 | 707 | #=================================================================== 708 | # Customize: JNDI 709 | #=================================================================== 710 | 711 | def jndi_foreignjndiprovider_cachevalues(entry, val): 712 | entry.setCacheValues(val) 713 | 714 | def jndi_foreignjndiprovider_requesttimeout(entry, val): 715 | entry.setRequestTimeout(val) 716 | 717 | def jndi_foreignjndiprovider_providerurl(entry, val): 718 | entry.setProviderUrl(val) 719 | 720 | def jndi_foreignjndiprovider_username(entry, val): 721 | entry.getUserPassword().setUsername(val) 722 | 723 | def jndi_foreignjndiprovider_password(entry, val): 724 | entry.getUserPassword().setPassword(val) 725 | 726 | def jndi_foreignjndiprovider_description(entry, val): 727 | entry.setDescription(val) 728 | 729 | 730 | #=================================================================== 731 | # Customize: SMTP 732 | #=================================================================== 733 | 734 | def smtp_smtpserver_description(entry, val): 735 | entry.setDescription(val) 736 | 737 | def smtp_smtpserver_isdefault(entry, val): 738 | entry.setIsDefault(val) 739 | 740 | def smtp_smtpserver_portnumber(entry, val): 741 | entry.setPortNumber(val) 742 | 743 | def smtp_smtpserver_serverurl(entry, val): 744 | entry.setServerURL(val) 745 | 746 | def smtp_smtpserver_username(entry, val): 747 | entry.setUsername(val) 748 | 749 | def smtp_smtpserver_password(entry, val): 750 | entry.setPassword(val) 751 | 752 | #=================================================================== 753 | # Customize: Proxy Server 754 | #=================================================================== 755 | 756 | def proxyserver_proxyserver_description(entry, val): 757 | entry.getProxyServer().setDescription(val) 758 | 759 | def proxyserver_proxyserver_username(entry, val): 760 | entry.getProxyServer().setUsername(val) 761 | 762 | def proxyserver_proxyserver_password(entry, val): 763 | entry.getProxyServer().setPassword(val) 764 | 765 | def proxyserver_proxyserver_servertable(entry, val): 766 | entry.getProxyServer().getServerTable().setServerArray(None) 767 | list=[] 768 | for v in val: 769 | param = ProxyServerParams.Factory.newInstance() 770 | param.setHost(v) 771 | params=val[v] 772 | for p in params: 773 | if p =='Port': 774 | param.setPort(params[p]) 775 | print LOG_CUST_FUNCTION + 'Port' 776 | elif p =='SslPort': 777 | param.setSslPort(params[p]) 778 | print LOG_CUST_FUNCTION + 'SslPort' 779 | else: 780 | print 'Property is not supported' 781 | 782 | list.append(param) 783 | entry.getProxyServer().getServerTable().setServerArray(list) 784 | 785 | 786 | #=================================================================== 787 | # Customize: Proxy Service: LOCAL 788 | #=================================================================== 789 | 790 | def local_proxyservice_sametxforresponse(entry, val): 791 | getTransactions(entry).setSameTxForResponse(val) 792 | 793 | def local_proxyservice_description(entry, val): 794 | entry.getCoreEntry().setDescription(val) 795 | 796 | def local_proxyservice_monitoring(entry, val): 797 | return True # parent group 798 | 799 | def local_proxyservice_logging(entry, val): 800 | return True # parent group 801 | 802 | def local_proxyservice_slaalerting(entry, val): 803 | return True # parent group 804 | 805 | def local_proxyservice_pipelinealerting(entry, val): 806 | return True # parent group 807 | 808 | def local_proxyservice_monitoring_isenabled(entry, val): 809 | entry.getCoreEntry().getMonitoring().setIsEnabled(val) 810 | 811 | def local_proxyservice_monitoring_aggregationinterval(entry, val): 812 | entry.getCoreEntry().getMonitoring().setAggregationInterval(val) 813 | 814 | def local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val): 815 | entry.getCoreEntry().getMonitoring().setPipelineMonitoringLevel(val) 816 | 817 | def local_proxyservice_reporting(entry, val): 818 | entry.getCoreEntry().setReporting(val) 819 | 820 | def local_proxyservice_logging_isenabled(entry, val): 821 | entry.getCoreEntry().getLogging().setIsEnabled(val) 822 | 823 | def local_proxyservice_logging_loglevel(entry, val): 824 | entry.getCoreEntry().getLogging().setLogLevel(val) 825 | 826 | def local_proxyservice_slaalerting_isenabled(entry, val): 827 | entry.getCoreEntry().getSlaAlerting().setIsEnabled(val) 828 | 829 | def local_proxyservice_slaalerting_alertlevel(entry, val): 830 | entry.getCoreEntry().getSlaAlerting().setAlertLevel(val) 831 | 832 | def local_proxyservice_pipelinealerting_isenabled(entry, val): 833 | entry.getCoreEntry().getPipelineAlerting().setIsEnabled(val) 834 | 835 | def local_proxyservice_pipelinealerting_alertlevel(entry, val): 836 | entry.getCoreEntry().getPipelineAlerting().setAlertLevel(val) 837 | 838 | def local_proxyservice_isrequired(entry, val): 839 | getTransactions(entry).setIsRequired(val) 840 | 841 | #=================================================================== 842 | # Customize: Proxy Service: Transport Type: HTTP 843 | #=================================================================== 844 | 845 | def http_proxyservice_description(entry, val): 846 | entry.getCoreEntry().setDescription(val) 847 | 848 | def http_proxyservice_monitoring(entry, val): 849 | return True 850 | 851 | def http_proxyservice_logging(entry, val): 852 | return True 853 | 854 | def http_proxyservice_slaalerting(entry, val): 855 | return True 856 | 857 | def http_proxyservice_pipelinealerting(entry, val): 858 | return True 859 | 860 | def http_proxyservice_monitoring_isenabled(entry, val): 861 | local_proxyservice_monitoring_isenabled(entry, val) 862 | 863 | def http_proxyservice_monitoring_aggregationinterval(entry, val): 864 | local_proxyservice_monitoring_aggregationinterval(entry, val) 865 | 866 | def http_proxyservice_monitoring_pipelinemonitoringlevel(entry, val): 867 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 868 | 869 | def http_proxyservice_reporting(entry, val): 870 | local_proxyservice_reporting(entry, val) 871 | 872 | def http_proxyservice_logging_isenabled(entry, val): 873 | local_proxyservice_logging_isenabled(entry, val) 874 | 875 | def http_proxyservice_logging_loglevel(entry, val): 876 | local_proxyservice_logging_loglevel(entry, val) 877 | 878 | def http_proxyservice_slaalerting_isenabled(entry, val): 879 | local_proxyservice_slaalerting_isenabled(entry, val) 880 | 881 | def http_proxyservice_slaalerting_alertlevel(entry, val): 882 | local_proxyservice_slaalerting_alertlevel(entry, val) 883 | 884 | def http_proxyservice_pipelinealerting_isenabled(entry, val): 885 | local_proxyservice_pipelinealerting_isenabled(entry, val) 886 | 887 | def http_proxyservice_pipelinealerting_alertlevel(entry, val): 888 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 889 | 890 | def http_proxyservice_retrycount(entry, val): 891 | getCommonOutboundProperties(entry).setRetryCount(val) 892 | 893 | def http_proxyservice_retryinterval(entry, val): 894 | getCommonOutboundProperties(entry).setRetryInterval(val) 895 | 896 | def http_proxyservice_usehttps(entry, val): 897 | getHttpInboundProperties(entry).setUseHttps(val) 898 | 899 | def http_proxyservice_endpointuri(entry, val): 900 | changeEndpointUri(convertToTuple(val),entry) 901 | 902 | def http_proxyservice_requestencoding(entry, val): 903 | getHttpEndPointConfiguration(entry).setRequestEncoding(val) 904 | 905 | def http_proxyservice_responseencoding(entry, val): 906 | getHttpEndPointConfiguration(entry).setResponseEncoding(val) 907 | 908 | def http_proxyservice_dispatchpolicy(entry, val): 909 | getHttpEndPointConfiguration(entry).setDispatchPolicy(val) 910 | 911 | def http_proxyservice_isrequired(entry, val): 912 | getTransactions(entry).setIsRequired(val) 913 | 914 | def http_proxyservice_sametxforresponse(entry, val): 915 | getTransactions(entry).setSameTxForResponse(val) 916 | 917 | def http_proxyservice_policy(entry, val): 918 | policyExpression, provider=createPolicyExpression(val) 919 | setupPolicyExpression(entry, policyExpression, provider) 920 | 921 | def http_proxyservice_authentication(entry, val): 922 | return True 923 | 924 | def http_proxyservice_authentication_basicauthentication(entry, val): 925 | getHttpInboundProperties(entry).setClientAuthentication(HttpBasicAuthenticationType.Factory.newInstance()) 926 | 927 | def http_proxyservice_authentication_customtokenauthentication(entry, val): 928 | httpInboundProperties= getHttpInboundProperties(entry) 929 | customTokenAuthenticationType = CustomTokenAuthenticationType.Factory.newInstance() 930 | 931 | for v in val: 932 | if 'TokenType' in v: 933 | customTokenAuthenticationType.setTokenType(val[v]) 934 | elif 'HeaderName' in v: 935 | customTokenAuthenticationType.setHeaderName(val[v]) 936 | httpInboundProperties.setClientAuthentication(customTokenAuthenticationType) 937 | 938 | def http_proxyservice_authentication_sslclientauthentication(entry, val): 939 | getHttpInboundProperties(entry).setClientAuthentication(SSLClientAuthenticationType.Factory.newInstance()) 940 | 941 | def http_proxyservice_authentication_none(entry, val): 942 | getHttpInboundProperties(entry).setClientAuthentication(None) 943 | 944 | def http_proxyservice_security(entry, val): 945 | return True 946 | 947 | def http_proxyservice_security_customauthentication(entry, val): 948 | return True 949 | 950 | def http_proxyservice_security_customauthentication_contextproperties(entry, val): 951 | security=getSecurityFromServiceDefinition(entry) 952 | customTokenAuthentication=prepareCustomTokenAuthentication(security) 953 | 954 | userDefinedContext=customTokenAuthentication.getUserDefinedContext() 955 | if userDefinedContext!=None: 956 | customTokenAuthentication.unsetUserDefinedContext() 957 | userDefinedContext=customTokenAuthentication.addNewUserDefinedContext() 958 | 959 | for v in val: 960 | property=userDefinedContext.addNewProperty() 961 | property.setName(v) 962 | valueSelector=property.addNewValueSelector() 963 | valueSelector.setVariable('header') 964 | valueSelector.setXpath(val[v]) 965 | print ' --> set ContextProperty: ' + v 966 | 967 | def http_proxyservice_security_customauthentication_authenticationtype(entry, val): 968 | return True 969 | 970 | def http_proxyservice_security_customauthentication_authenticationtype_none(entry, val): 971 | return 'TODO: not implemented' 972 | 973 | def http_paroxyservice_security_customauthentication_authenticationtype_customusernameandpassword(entry, val): 974 | security=getSecurityFromServiceDefinition(entry) 975 | customTokenAuthentication=prepareCustomTokenAuthentication(security) 976 | 977 | usernamePassword=customTokenAuthentication.getUsernamePassword() 978 | if usernamePassword==None: 979 | usernamePassword=customTokenAuthentication.addNewUsernamePassword() 980 | 981 | passwordSelector=usernamePassword.getPasswordSelector() 982 | if passwordSelector==None: 983 | passwordSelector=usernamePassword.addNewPasswordSelector() 984 | 985 | usernameSelector=usernamePassword.getUsernameSelector() 986 | if usernameSelector==None: 987 | usernameSelector=usernamePassword.addNewUsernameSelector() 988 | 989 | usernameSelector.setVariable('header') 990 | usernameSelector.setXpath(val['UsernameXpath']) 991 | 992 | passwordSelector.setVariable('header') 993 | passwordSelector.setXpath(val['PasswordXpath']) 994 | 995 | def http_proxyservice_security_customauthentication_authenticationtype_customtoken(entry, val): 996 | security=getSecurityFromServiceDefinition(entry) 997 | customTokenAuthentication=prepareCustomTokenAuthentication(security) 998 | 999 | customToken=customTokenAuthentication.getCustomToken() 1000 | if customToken==None: 1001 | customToken=customTokenAuthentication.addNewCustomToken() 1002 | 1003 | tokenSelector=customToken.getTokenSelector() 1004 | if tokenSelector==None: 1005 | customToken.setTokenSelector(XPathSelectorType.Factory.newInstance()) 1006 | tokenSelector=customToken.getTokenSelector() 1007 | 1008 | tokenSelector.setVariable('header') 1009 | tokenSelector.setXpath(val['Xpath']) 1010 | 1011 | def http_proxyservice_security_customauthentication_authenticationtype_customusernameandpassword(entry, val): 1012 | security=getSecurityFromServiceDefinition(entry) 1013 | customTokenAuthentication=prepareCustomTokenAuthentication(security) 1014 | #customTokenAuthentication.unsetCustomToken() 1015 | 1016 | usernamePassword=customTokenAuthentication.getUsernamePassword() 1017 | if usernamePassword==None: 1018 | usernamePassword=customTokenAuthentication.addNewUsernamePassword() 1019 | 1020 | passwordSelector=usernamePassword.getPasswordSelector() 1021 | if passwordSelector==None: 1022 | passwordSelector=usernamePassword.addNewPasswordSelector() 1023 | 1024 | usernameSelector=usernamePassword.getUsernameSelector() 1025 | if usernameSelector==None: 1026 | usernameSelector=usernamePassword.addNewUsernameSelector() 1027 | 1028 | usernameSelector.setVariable('header') 1029 | usernameSelector.setXpath(val['UsernameXpath']) 1030 | 1031 | passwordSelector.setVariable('header') 1032 | passwordSelector.setXpath(val['PasswordXpath']) 1033 | 1034 | 1035 | #=================================================================== 1036 | # Customize: Proxy Service: Transport Type: JMS 1037 | #=================================================================== 1038 | 1039 | def jms_proxyservice_retrycount(entry, val): 1040 | getJmsInboundProperties(entry).setRetryCount(val) 1041 | 1042 | def jms_proxyservice_endpointuri(entry, val): 1043 | changeEndpointUri(convertToTuple(val),entry) 1044 | 1045 | def jms_proxyservice_dispatchpolicy(entry, val): 1046 | getJmsEndPointConfiguration(entry).setDispatchPolicy(val) 1047 | 1048 | def jms_proxyservice_requestencoding(entry, val): 1049 | getJmsEndPointConfiguration(entry).setRequestEncoding(val) 1050 | 1051 | def jms_proxyservice_jnditimeout(entry, val): 1052 | getJmsEndPointConfiguration(entry).setJndiTimeout(val) 1053 | 1054 | def jms_proxyservice_usessl(entry, val): 1055 | getJmsEndPointConfiguration(entry).setIsSecure(val) 1056 | 1057 | def jms_proxyservice_isxarequired(entry, val): 1058 | getJmsInboundProperties(entry).setXARequired(val) 1059 | 1060 | def jms_proxyservice_errordestination(entry, val): 1061 | getJmsInboundProperties(entry).setErrorDestination(val) 1062 | 1063 | def jms_proxyservice_messageselector(entry, val): 1064 | getJmsInboundProperties(entry).setMessageSelector(val) 1065 | 1066 | def jms_proxyservice_retryinterval(entry, val): 1067 | getJmsInboundProperties(entry).setRetryInterval(val) 1068 | 1069 | def jms_proxyservice_isresponserequired(entry, val): 1070 | getJmsInboundProperties(entry).setResponseRequired(val) 1071 | 1072 | def jms_proxyservice_isrequired(entry, val): 1073 | getTransactions(entry).setIsRequired(val) 1074 | 1075 | def jms_proxyservice_sametxforresponse(entry, val): 1076 | getTransactions(entry).setSameTxForResponse(val) 1077 | 1078 | def jms_proxyservice_destinationtypequeue(entry, val): 1079 | lookupCustomizationFunction(sys._getframe().f_code.co_name, val, entry) 1080 | 1081 | def jms_proxyservice_destinationtypequeue_responsepattern(entry, val): 1082 | if val == 'JMS_CORRELATION_ID': 1083 | getJmsInboundProperties(entry).setResponsePattern(JmsResponsePatternEnum.JMS_CORRELATION_ID) 1084 | else: 1085 | getJmsInboundProperties(entry).setResponsePattern(JmsResponsePatternEnum.JMS_MESSAGE_ID) 1086 | 1087 | def jms_proxyservice_destinationtypequeue_responseuri(entry, val): 1088 | getJmsInboundProperties(entry).setResponseURI(val) 1089 | 1090 | def jms_proxyservice_destinationtypequeue_responseencoding(entry, val): 1091 | getJmsEndPointConfiguration(entry).setResponseEncoding(val) 1092 | 1093 | def jms_proxyservice_destinationtypequeue_responsemessagetype(entry, val): 1094 | if val == 'BYTES': 1095 | getJmsInboundProperties(entry).setResponseMessageType(JmsMessageTypeEnum.BYTES) 1096 | else: 1097 | getJmsInboundProperties(entry).setResponseMessageType(JmsMessageTypeEnum.TEXT) 1098 | 1099 | def jms_proxyservice_description(entry, val): 1100 | entry.getCoreEntry().setDescription(val) 1101 | 1102 | def jms_proxyservice_monitoring(entry, val): 1103 | return True 1104 | 1105 | def jms_proxyservice_logging(entry, val): 1106 | return True 1107 | 1108 | def jms_proxyservice_slaalerting(entry, val): 1109 | return True 1110 | 1111 | def jms_proxyservice_pipelinealerting(entry, val): 1112 | return True 1113 | 1114 | def jms_proxyservice_monitoring_isenabled(entry, val): 1115 | local_proxyservice_monitoring_isenabled(entry, val) 1116 | 1117 | def jms_proxyservice_monitoring_aggregationinterval(entry, val): 1118 | local_proxyservice_monitoring_aggregationinterval(entry, val) 1119 | 1120 | def jms_proxyservice_monitoring_pipelinemonitoringlevel(entry, val): 1121 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 1122 | 1123 | def jms_proxyservice_reporting(entry, val): 1124 | local_proxyservice_reporting(entry, val) 1125 | 1126 | def jms_proxyservice_logging_isenabled(entry, val): 1127 | local_proxyservice_logging_isenabled(entry, val) 1128 | 1129 | def jms_proxyservice_logging_loglevel(entry, val): 1130 | local_proxyservice_logging_loglevel(entry, val) 1131 | 1132 | def jms_proxyservice_slaalerting_isenabled(entry, val): 1133 | local_proxyservice_slaalerting_isenabled(entry, val) 1134 | 1135 | def jms_proxyservice_slaalerting_alertlevel(entry, val): 1136 | local_proxyservice_slaalerting_alertlevel(entry, val) 1137 | 1138 | def jms_proxyservice_pipelinealerting_isenabled(entry, val): 1139 | local_proxyservice_pipelinealerting_isenabled(entry, val) 1140 | 1141 | def jms_proxyservice_pipelinealerting_alertlevel(entry, val): 1142 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 1143 | 1144 | def jms_proxyservice_policy(entry, val): 1145 | policyExpression, provider=createPolicyExpression(val) 1146 | setupPolicyExpression(entry, policyExpression, provider) 1147 | 1148 | #=================================================================== 1149 | # Customize: BusinessService: Transport Type: HTTP 1150 | #=================================================================== 1151 | 1152 | def http_businessservice_description(entry, val): 1153 | entry.getCoreEntry().setDescription(val) 1154 | 1155 | def http_businessservice_monitoring(entry, val): 1156 | return True 1157 | 1158 | def http_businessservice_logging(entry, val): 1159 | return True 1160 | 1161 | def http_businessservice_slaalerting(entry, val): 1162 | return True 1163 | 1164 | def http_businessservice_pipelinealerting(entry, val): 1165 | return True 1166 | 1167 | def http_businessservice_throttling(entry, val): 1168 | return True 1169 | 1170 | def http_businessservice_throttling_enabled(entry, val): 1171 | getThrottling(entry).setEnabled(val) 1172 | 1173 | def http_businessservice_throttling_capacity(entry, val): 1174 | getThrottling(entry).setCapacity(val) 1175 | 1176 | def http_businessservice_throttling_maxqueuelength(entry, val): 1177 | getThrottling(entry).setMaxQueueLength(val) 1178 | 1179 | def http_businessservice_throttling_timetolive(entry, val): 1180 | getThrottling(entry).setTimeToLive(val) 1181 | 1182 | def http_businessservice_monitoring_isenabled(entry, val): 1183 | local_proxyservice_monitoring_isenabled(entry, val) 1184 | 1185 | def http_businessservice_monitoring_aggregationinterval(entry, val): 1186 | local_proxyservice_monitoring_aggregationinterval(entry, val) 1187 | 1188 | def http_businessservice_monitoring_pipelinemonitoringlevel(entry, val): 1189 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 1190 | 1191 | def http_businessservice_reporting(entry, val): 1192 | local_proxyservice_reporting(entry, val) 1193 | 1194 | def http_businessservice_logging_isenabled(entry, val): 1195 | local_proxyservice_logging_isenabled(entry, val) 1196 | 1197 | def http_businessservice_logging_loglevel(entry, val): 1198 | local_proxyservice_logging_loglevel(entry, val) 1199 | 1200 | def http_businessservice_slaalerting_isenabled(entry, val): 1201 | local_proxyservice_slaalerting_isenabled(entry, val) 1202 | 1203 | def http_businessservice_slaalerting_alertlevel(entry, val): 1204 | local_proxyservice_slaalerting_alertlevel(entry, val) 1205 | 1206 | def http_businessservice_pipelinealerting_isenabled(entry, val): 1207 | local_proxyservice_pipelinealerting_isenabled(entry, val) 1208 | 1209 | def http_businessservice_pipelinealerting_alertlevel(entry, val): 1210 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 1211 | 1212 | 1213 | def http_businessservice_endpointuri(entry, val): 1214 | changeEndpointUri(convertToTuple(val),entry) 1215 | 1216 | def http_businessservice_readtimeout(entry, val): 1217 | getHttpOutboundProperties(entry).setTimeout(val) 1218 | 1219 | def http_businessservice_requestencoding(entry, val): 1220 | getHttpEndPointConfiguration(entry).setRequestEncoding(val) 1221 | 1222 | def http_businessservice_responseencoding(entry, val): 1223 | getHttpEndPointConfiguration(entry).setResponseEncoding(val) 1224 | 1225 | def http_businessservice_dispatchpolicy(entry, val): 1226 | getHttpEndPointConfiguration(entry).setDispatchPolicy(val) 1227 | 1228 | def http_businessservice_connectiontimeout(entry, val): 1229 | getHttpOutboundProperties(entry).setConnectionTimeout(val) 1230 | 1231 | def http_businessservice_requestmethod(entry, val): 1232 | getHttpOutboundProperties(entry).setRequestMethod(HttpRequestMethodEnum.Enum.forString(val)) 1233 | 1234 | def http_businessservice_followredirects(entry, val): 1235 | getHttpOutboundProperties(entry).setFollowRedirects(val) 1236 | 1237 | def http_businessservice_chunkedstreamingmode(entry, val): 1238 | getHttpOutboundProperties(entry).setChunkedStreamingMode(val) 1239 | 1240 | def http_businessservice_sessionsctikiness(entry, val): 1241 | if getHttpOutboundProperties(entry).getSessionSctikiness() == None: 1242 | getHttpOutboundProperties(entry).addNewSessionSctikiness() 1243 | getHttpOutboundProperties(entry).getSessionSctikiness().changeType(SessionStickinessType.type) 1244 | 1245 | getHttpOutboundProperties(entry).getSessionSctikiness().setEnabled(val) 1246 | # assumed to always be JSESSIONID 1247 | getHttpOutboundProperties(entry).getSessionSctikiness().setSessionIdName('JSESSIONID') 1248 | 1249 | def http_businessservice_providerid(entry, val): 1250 | endPointConfiguration=entry.getEndpointConfig() 1251 | if val.lower() == 'sb' and endPointConfiguration.getProviderId() != 'sb': 1252 | # change from http to sb as requested 1253 | endPointConfiguration.setProviderId('sb') 1254 | endPointConfiguration.unsetProviderSpecific() 1255 | providerSpec = endPointConfiguration.addNewProviderSpecific() 1256 | providerSpec = providerSpec.changeType(SBEndPointConfiguration.type) 1257 | providerSpec.addNewOutboundProperties() 1258 | 1259 | # set some defaults 1260 | sb_businessservice_timeout(entry, 15) 1261 | sb_businessservice_retryinterval(entry, 30) 1262 | else: 1263 | # not supported 1264 | return True 1265 | 1266 | 1267 | #=================================================================== 1268 | # Customize: Alert Destination 1269 | #=================================================================== 1270 | 1271 | def alertdestination_alertdestination_description(entry, val): 1272 | entry.setDescription(val) 1273 | 1274 | def alertdestination_alertdestination_alertlogging(entry, val): 1275 | entry.setAlertToConsole(val) 1276 | 1277 | def alertdestination_alertdestination_reporting(entry, val): 1278 | entry.setAlertToReportingDataSet(val) 1279 | 1280 | def alertdestination_alertdestination_snmptrap(entry, val): 1281 | entry.setAlertToSNMP(val) 1282 | 1283 | #=================================================================== 1284 | # Cutomize: Service Provider 1285 | #=================================================================== 1286 | 1287 | def serviceprovider_serviceprovider_description(entry, val): 1288 | entry.setDescription(val) 1289 | 1290 | def serviceprovider_serviceprovider_ssl(entry, val): 1291 | return True 1292 | 1293 | def serviceprovider_serviceprovider_encryption(entry, val): 1294 | return True 1295 | 1296 | def serviceprovider_serviceprovider_digitalsignature(entry, val): 1297 | return True 1298 | 1299 | def serviceprovider_serviceprovider_ssl_alias(entry, val): 1300 | serviceprovider_serviceprovider_by_prupose(entry, val, 'SSL', 'Alias') 1301 | 1302 | def serviceprovider_serviceprovider_ssl_password(entry, val): 1303 | serviceprovider_serviceprovider_by_prupose(entry, val, 'SSL', 'Password') 1304 | 1305 | def serviceprovider_serviceprovider_encryption_alias(entry, val): 1306 | serviceprovider_serviceprovider_by_prupose(entry, val, 'Encryption', 'Alias') 1307 | 1308 | def serviceprovider_serviceprovider_encryption_password(entry, val): 1309 | serviceprovider_serviceprovider_by_prupose(entry, val, 'Encryption', 'Password') 1310 | 1311 | def serviceprovider_serviceprovider_digitalsignature_alias(entry, val): 1312 | serviceprovider_serviceprovider_by_prupose(entry, val, 'DigitalSignature', 'Password') 1313 | 1314 | def serviceprovider_serviceprovider_digitalsignature_password(entry, val): 1315 | serviceprovider_serviceprovider_by_prupose(entry, val, 'DigitalSignature', 'Password') 1316 | 1317 | def serviceprovider_serviceprovider_by_prupose(entry, val, prupose, attr): 1318 | keyPair=findKeyPairForServiceProvider(entry,prupose) 1319 | if keyPair !=None: 1320 | if 'Password' in attr: 1321 | keyPair.setPassword(val) 1322 | elif 'Alias' in attr: 1323 | keyPair.setAlias(val) 1324 | else: 1325 | print LOG_CUST_FILE+ 'Warning: '+val+' property is not supported' 1326 | 1327 | #=================================================================== 1328 | # Customize: MQConnection 1329 | #=================================================================== 1330 | 1331 | def mqconnection_mqconnection_xaenabled(entry, val): 1332 | entry.setMqXaEnabled(val) 1333 | 1334 | def mqconnection_mqconnection_mqconnectionmaxwait(entry, val): 1335 | entry.setMqConnMaxWait(val) 1336 | 1337 | def mqconnection_mqconnection_mqconnectionpoolsize(entry, val): 1338 | entry.setMqConnPoolSize(val) 1339 | 1340 | def mqconnection_mqconnection_mqconnectiontimeout(entry, val): 1341 | entry.setMqConnTimeout(val) 1342 | 1343 | def mqconnection_mqconnection_mqversion(entry, val): 1344 | entry.setMqVersion(val) 1345 | 1346 | #=================================================================== 1347 | # Customize: MQConnection - Connection Type:BindingsMode 1348 | #=================================================================== 1349 | 1350 | def mqconnection_mqconnection_bindingmode(entry, val): 1351 | return True 1352 | 1353 | def mqconnection_mqconnection_bindingmode_mqqueuemanagername(entry, val): 1354 | entry.getBindingsMode().setQueueManagerName(val) 1355 | 1356 | def mqconnection_mqconnection_tcpmode(entry, val): 1357 | return True 1358 | 1359 | #=================================================================== 1360 | # Customize: MQConnection - Connection Type:TcpMode 1361 | #=================================================================== 1362 | 1363 | def mqconnection_mqconnection_tcpmode_mqqueuemanagername(entry, val): 1364 | entry.getTcpMode().setQueueManagerName(val) 1365 | 1366 | def mqconnection_mqconnection_tcpmode_mqqueuemanagerchannelname(entry, val): 1367 | entry.getTcpMode().setQueueManagerChannelName(val) 1368 | 1369 | def mqconnection_mqconnection_tcpmode_mqportnumber(entry, val): 1370 | entry.getTcpMode().setPort(val) 1371 | 1372 | def mqconnection_mqconnection_tcpmode_mqhostname(entry, val): 1373 | entry.getTcpMode().setHost(val) 1374 | 1375 | def mqconnection_mqconnection_tcpmode_queuemanagerccsid(entry, val): 1376 | entry.getTcpMode().setQueueManagerCcsid(val) 1377 | 1378 | #=================================================================== 1379 | # Customize: BusinessService: Transport Type: MQ 1380 | #=================================================================== 1381 | 1382 | def mq_businessservice_endpointuri(entry, val): 1383 | changeEndpointUri(convertToTuple(val),entry) 1384 | 1385 | def mq_businessservice_retrycount(entry, val): 1386 | getCommonOutboundProperties(entry).setRetryCount(val) 1387 | 1388 | def mq_businessservice_retryinterval(entry, val): 1389 | getCommonOutboundProperties(entry).setRetryInterval(val) 1390 | 1391 | def mq_businessservice_messagetype(entry, val): 1392 | if 'Bytes' ==val: 1393 | getMqOutboundProperties(entry).setMessageType(MQMessageTypeEnum.BYTES) 1394 | elif 'Text' ==val: 1395 | getMqOutboundProperties(entry).setMessageType(MQMessageTypeEnum.TEXT) 1396 | else: 1397 | print LOG_CUST_FILE+ 'Warning: '+val+' property is not supported for message type' 1398 | 1399 | 1400 | def mq_businessservice_responsetimeout(entry, val): 1401 | getMqOutboundProperties(entry).setResponseTimeout(val) 1402 | 1403 | def mq_businessservice_autogeneratecorrelationvalue(entry, val): 1404 | getMqOutboundProperties(entry).setAutoGenCorrelationValue(val) 1405 | 1406 | def mq_businessservice_mqresponseuri(entry,val): 1407 | getMqOutboundProperties(entry).setResponseURI(val) 1408 | 1409 | def mq_businessservice_pollinginterval(entry, val): 1410 | getMqOutboundProperties(entry).setPollingInterval(val) 1411 | 1412 | def mq_businessservice_processrfh2headers(entry, val): 1413 | getMqOutboundProperties(entry).setProcessRfh2(val) 1414 | 1415 | 1416 | #=================================================================== 1417 | # Customize: ProxyService: Transport Type: MQ 1418 | #=================================================================== 1419 | 1420 | def mq_proxyservice_endpointuri(entry, val): 1421 | changeEndpointUri(convertToTuple(val),entry) 1422 | 1423 | def mq_proxyservice_mqresponseuri(entry, val): 1424 | inboundProperties, mqInboundProperties=getMqInboundProperties(entry) 1425 | mqInboundProperties.setResponseURI(val) 1426 | inboundProperties.set(mqInboundProperties) 1427 | 1428 | def mq_proxyservice_responsemessagetype(entry, val): 1429 | inboundProperties, mqInboundProperties=getMqInboundProperties(entry) 1430 | if 'Bytes' ==val: 1431 | mqInboundProperties.setResponseMessageType(MQMessageTypeEnum.BYTES) 1432 | elif 'Text' ==val: 1433 | mqInboundProperties.setResponseMessageType(MQMessageTypeEnum.TEXT) 1434 | print LOG_CUST_FILE+ 'Warning: '+val+' property is not supported for message type' 1435 | inboundProperties.set(mqInboundProperties) 1436 | 1437 | def mq_proxyservice_retrycount(entry, val): 1438 | inboundProperties, mqInboundProperties=getMqInboundProperties(entry) 1439 | mqInboundProperties.setRetryCount(val) 1440 | inboundProperties.set(mqInboundProperties) 1441 | 1442 | def mq_proxyservice_pollinginterval(entry, val): 1443 | inboundProperties, mqInboundProperties=getMqInboundProperties(entry) 1444 | mqInboundProperties.setPollingInterval(val) 1445 | inboundProperties.set(mqInboundProperties) 1446 | 1447 | #=================================================================== 1448 | # Customize: ProxyService: Transport Type: FTP 1449 | #=================================================================== 1450 | 1451 | def ftp_proxyservice_endpointuri(entry, val): 1452 | changeEndpointUri(convertToTuple(val),entry) 1453 | 1454 | def ftp_proxyservice_readlimit(entry, val): 1455 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1456 | ftpInboundProperties.setReadLimit(val) 1457 | inboundProperties.set(ftpInboundProperties) 1458 | 1459 | def ftp_proxyservice_directstreaming(entry, val): 1460 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1461 | ftpInboundProperties.setDirectStreaming(val) 1462 | inboundProperties.set(ftpInboundProperties) 1463 | 1464 | def ftp_proxyservice_timeout(entry,val): 1465 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1466 | ftpInboundProperties.setTimeout(val) 1467 | inboundProperties.set(ftpInboundProperties) 1468 | 1469 | def getFtpInboundProperties(serviceDefinition): 1470 | FtpEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 1471 | inboundProperties=FtpEndPointConfiguration.selectChildren(QName("http://www.bea.com/wli/sb/transports/ftp", "inbound-properties"))[0] 1472 | ftpInboundProperties = FtpInboundPropertiesType.Factory.parse(inboundProperties.toString()) 1473 | return inboundProperties, ftpInboundProperties 1474 | 1475 | def ftp_proxyservice_recursivescan(entry, val): 1476 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1477 | ftpInboundProperties.setRecursiveScan(val) 1478 | inboundProperties.set(ftpInboundProperties) 1479 | 1480 | def ftp_proxyservice_downloaddirectory(entry, val): 1481 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1482 | filePath=FilePathType.Factory.newInstance() 1483 | filePath.setValue(val) 1484 | ftpInboundProperties.setDownloadDirectory(filePath) 1485 | inboundProperties.set(ftpInboundProperties) 1486 | 1487 | def ftp_proxyservice_pollinginterval(entry, val): 1488 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1489 | pollInfo=FilePollInfo.Factory.newInstance() 1490 | pollInfo.setIntervalMilliseconds(val) 1491 | ftpInboundProperties.setPollInfo(pollInfo) 1492 | inboundProperties.set(ftpInboundProperties) 1493 | 1494 | def ftp_proxyservice_passbyreference(entry, val): 1495 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1496 | ftpInboundProperties.setDirectStreaming(val) 1497 | inboundProperties.set(ftpInboundProperties) 1498 | 1499 | def ftp_proxyservice_filemask(entry, val): 1500 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1501 | ftpInboundProperties.setFileMask(val) 1502 | inboundProperties.set(ftpInboundProperties) 1503 | 1504 | #=================================================================== 1505 | # Customize: BusinessService: Transport Type: FTP 1506 | #=================================================================== 1507 | 1508 | def ftp_businessservice_endpointuri(entry, val): 1509 | changeEndpointUri(convertToTuple(val),entry) 1510 | 1511 | def ftp_businessservice_timeout(entry, val): 1512 | getFtpOutboundProperties(entry).setTimeout(val) 1513 | 1514 | def ftp_businessservice_prefix(entry, val): 1515 | getFtpPrefixSufix(getFtpOutboundProperties(entry)).setPrefix(val) 1516 | 1517 | def ftp_businessservice_suffix(entry, val): 1518 | getFtpPrefixSufix(getFtpOutboundProperties(entry)).setSuffix(val) 1519 | 1520 | def ftp_businessservice_retrycount(entry, val): 1521 | getCommonOutboundProperties(entry).setRetryCount(val) 1522 | 1523 | def ftp_businessservice_retryinterval(entry, val): 1524 | getCommonOutboundProperties(entry).setRetryInterval(val) 1525 | 1526 | 1527 | def file_proxyservice_endpointuri(entry, val): 1528 | changeEndpointUri(convertToTuple(val),entry) 1529 | 1530 | def file_proxyservice_sortbyarrival(entry, val): 1531 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1532 | fileInBoundProperties.setSortByArrival(val) 1533 | inboundProperties.set(fileInBoundProperties) 1534 | 1535 | def file_proxyservice_readlimit(entry, val): 1536 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1537 | fileInBoundProperties.setReadLimit(val) 1538 | inboundProperties.set(fileInBoundProperties) 1539 | 1540 | def file_proxyservice_stagedir(entry, val): 1541 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1542 | if fileInBoundProperties.getStageDir()==None: 1543 | fileInBoundProperties.addNewStageDir() 1544 | fileInBoundProperties.getStageDir().setValue(val) 1545 | inboundProperties.set(fileInBoundProperties) 1546 | 1547 | def file_proxyservice_scansubdirectories(entry, val): 1548 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1549 | fileInBoundProperties.setScanSubDirectories(val) 1550 | inboundProperties.set(fileInBoundProperties) 1551 | 1552 | def file_proxyservice_archivedir(entry, val): 1553 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1554 | if fileInBoundProperties.getArchiveDir()==None: 1555 | fileInBoundProperties.addNewArchiveDir() 1556 | fileInBoundProperties.getArchiveDir().setValue(val) 1557 | inboundProperties.set(fileInBoundProperties) 1558 | 1559 | def file_proxyservice_errordir(entry, val): 1560 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1561 | if fileInBoundProperties.getErrorDir()==None: 1562 | fileInBoundProperties.addNewErrorDir() 1563 | fileInBoundProperties.getErrorDir().setValue(val) 1564 | inboundProperties.set(fileInBoundProperties) 1565 | 1566 | def file_proxyservice_pollinginterval(entry, val): 1567 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1568 | fileInBoundProperties.setPollingInterval(val) 1569 | inboundProperties.set(fileInBoundProperties) 1570 | 1571 | def file_proxyservice_filemask(entry, val): 1572 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1573 | fileInBoundProperties.setFileMask(val) 1574 | inboundProperties.set(fileInBoundProperties) 1575 | 1576 | #=================================================================== 1577 | # Customize: BusinessService: Transport Type: FTP 1578 | #=================================================================== 1579 | 1580 | def file_businessservice_endpointuri(entry, val): 1581 | changeEndpointUri(convertToTuple(val),entry) 1582 | 1583 | def file_businessservice_suffix(entry, val): 1584 | getFileOutboundProperties(entry).setSuffix(val) 1585 | 1586 | def file_businessservice_prefix(entry, val): 1587 | getFileOutboundProperties(entry).setPrefix(val) 1588 | 1589 | def file_businessservice_retrycount(entry, val): 1590 | getCommonOutboundProperties(entry).setRetryCount(val) 1591 | 1592 | def file_businessservice_retryinterval(entry, val): 1593 | getCommonOutboundProperties(entry).setRetryInterval(val) 1594 | 1595 | #=================================================================== 1596 | # Customize: ProxyService: Transport Type: SFTP 1597 | #=================================================================== 1598 | 1599 | def sftp_proxyservice_endpointuri(entry, val): 1600 | changeEndpointUri(convertToTuple(val),entry) 1601 | 1602 | def sftp_proxyservice_retrycount(entry, val): 1603 | getSftpInboundProperties(entry).setRetryCount(val) 1604 | def sftp_proxyservice_sortbyarrival(entry, val): 1605 | getSftpInboundProperties(entry).setSortByArrival(val) 1606 | 1607 | def sftp_proxyservice_readlimit(entry, val): 1608 | getSftpInboundProperties(entry).setReadLimit(val) 1609 | 1610 | def sftp_proxyservice_directstreaming(entry, val): 1611 | getSftpInboundProperties(entry).setDirectStreaming(val) 1612 | 1613 | def sftp_proxyservice_archivedir(entry, val): 1614 | if getSftpInboundProperties(entry).getArchiveDirectory()==None: 1615 | getSftpInboundProperties(entry).addNewArchiveDirectory() 1616 | getSftpInboundProperties(entry).getArchiveDirectory().setValue(val) 1617 | 1618 | def sftp_proxyservice_timeout(entry, val): 1619 | getSftpInboundProperties(entry).setTimeout(val) 1620 | 1621 | def sftp_proxyservice_errordir(entry, val): 1622 | if getSftpInboundProperties(entry).getErrorDirectory()==None: 1623 | getSftpInboundProperties(entry).addNewErrorDirectory() 1624 | getSftpInboundProperties(entry).getErrorDirectory().setValue(val) 1625 | 1626 | def sftp_proxyservice_recursivescan(entry, val): 1627 | getSftpInboundProperties(entry).setRecursiveScan(val) 1628 | 1629 | def sftp_proxyservice_pollinginterval(entry, val): 1630 | if getSftpInboundProperties(entry).getPollInfo()==None: 1631 | getSftpInboundProperties(entry).addNewPollInfo() 1632 | getSftpInboundProperties(entry).getPollInfo().setIntervalMilliseconds(val) 1633 | 1634 | def sftp_proxyservice_filemask(entry , val): 1635 | getSftpInboundProperties(entry).setFileMask(val) 1636 | 1637 | def sftp_proxyservice_downloaddir(entry , val): 1638 | if getSftpInboundProperties(entry).getDownloadDirectory()==None: 1639 | getSftpInboundProperties(entry).addNewDownloadDirectory() 1640 | getSftpInboundProperties(entry).getDownloadDirectory().setValue(val) 1641 | 1642 | #=================================================================== 1643 | # Customize: BusinessService: Transport Type: SFTP 1644 | #=================================================================== 1645 | 1646 | def sftp_businessservice_endpointuri(entry, val): 1647 | changeEndpointUri(convertToTuple(val),entry) 1648 | 1649 | def sftp_businessservice_prefix(entry, val): 1650 | getFtpPrefixSufix(getSftpOutboundProperties(entry)).setPrefix(val) 1651 | 1652 | def sftp_businessservice_suffix(entry, val): 1653 | getFtpPrefixSufix(getSftpOutboundProperties(entry)).setSuffix(val) 1654 | 1655 | def sftp_businessservice_retrycount(entry, val): 1656 | getCommonOutboundProperties(entry).setRetryCount(val) 1657 | 1658 | def sftp_businessservice_retryinterval(entry, val): 1659 | getCommonOutboundProperties(entry).setRetryInterval(val) 1660 | 1661 | #=================================================================== 1662 | # Customize: ProxyService: Transport Type: EMAIL 1663 | #=================================================================== 1664 | 1665 | def email_proxyservice_endpointuri(entry, val): 1666 | changeEndpointUri(convertToTuple(val),entry) 1667 | 1668 | def email_proxyservice_ssluse(entry, val): 1669 | getEmailEndPointConfiguration(entry).setUseSsl(val) 1670 | 1671 | def email_proxyservice_readlimit(entry, val): 1672 | getEmailInboundProperties(entry).setReadLimit(val) 1673 | 1674 | def email_proxyservice_passbyreference(entry, val): 1675 | getEmailInboundProperties(entry).setPassByReference(val) 1676 | 1677 | def email_proxyservice_pollinginterval(entry, val): 1678 | getEmailInboundProperties(entry).setPollingInterval(val) 1679 | 1680 | def email_proxyservice_imapmovefolder(entry, val): 1681 | getEmailInboundProperties(entry).setImapMoveFolder(val) 1682 | 1683 | def email_proxyservice_archivedir(entry, val): 1684 | if getEmailInboundProperties(entry).getArchiveDirectory()==None: 1685 | getEmailInboundProperties(entry).addNewArchiveDirectory() 1686 | getEmailInboundProperties(entry).getArchiveDirectory().setValue(val) 1687 | 1688 | def email_proxyservice_errordir(entry, val): 1689 | if getEmailInboundProperties(entry).getErrorDirectory()==None: 1690 | getEmailInboundProperties(entry).addNewErrorDirectory() 1691 | getEmailInboundProperties(entry).getErrorDirectory().setValue(val) 1692 | 1693 | def email_proxyservice_downloaddir(entry, val): 1694 | if getEmailInboundProperties(entry).getDownloadDirectory()==None: 1695 | getEmailInboundProperties(entry).addNewDownloadDirectory() 1696 | getEmailInboundProperties(entry).getDownloadDirectory().setValue(val) 1697 | 1698 | #=================================================================== 1699 | # Customize: BusinessService: Transport Type: EMAIL 1700 | #=================================================================== 1701 | 1702 | def email_businessservice_endpointuri(entry, val): 1703 | changeEndpointUri(convertToTuple(val),entry) 1704 | 1705 | def email_businessservice_ssluse(entry, val): 1706 | getEmailEndPointConfiguration(entry).setUseSsl(val) 1707 | 1708 | def email_businessservice_retrycount(entry, val): 1709 | getCommonOutboundProperties(entry).setRetryCount(val) 1710 | 1711 | def email_businessservice_retryinterval(entry, val): 1712 | getCommonOutboundProperties(entry).setRetryInterval(val) 1713 | 1714 | def email_businessservice_connectiontimeout(entry, val): 1715 | getEmailOutboundProperties(entry).setConnectionTimeout(val) 1716 | 1717 | def email_businessservice_fromaddress(entry, val): 1718 | getEmailOutboundProperties(entry).setFromAddress(val) 1719 | 1720 | def email_businessservice_fromname(entry, val): 1721 | getEmailOutboundProperties(entry).setFromName(val) 1722 | 1723 | def email_businessservice_replytoaddress(entry, val): 1724 | getEmailOutboundProperties(entry).setReplyToAddress(val) 1725 | 1726 | def email_businessservice_replyname(entry, val): 1727 | getEmailOutboundProperties(entry).setReplyToName(val) 1728 | 1729 | def email_businessservice_sockettimeout(entry, val): 1730 | getEmailOutboundProperties(entry).setTimeout(val) 1731 | 1732 | 1733 | #=================================================================== 1734 | # Customize: ProxyService: Transport Type: SB 1735 | #=================================================================== 1736 | 1737 | def sb_proxyservice_description(entry, val): 1738 | local_proxyservice_description(entry, val) 1739 | 1740 | def sb_proxyservice_monitoring(entry, val): 1741 | return True 1742 | 1743 | def sb_proxyservice_logging(entry, val): 1744 | return True 1745 | 1746 | def sb_proxyservice_slaalerting(entry, val): 1747 | return True 1748 | 1749 | def sb_proxyservice_pipelinealerting(entry, val): 1750 | return True 1751 | 1752 | def sb_proxyservice_monitoring_isenabled(entry, val): 1753 | local_proxyservice_monitoring_isenabled(entry, val) 1754 | 1755 | def sb_proxyservice_monitoring_aggregationinterval(entry, val): 1756 | local_proxyservice_monitoring_aggregationinterval(entry, val) 1757 | 1758 | def sb_proxyservice_monitoring_pipelinemonitoringlevel(entry, val): 1759 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 1760 | 1761 | def sb_proxyservice_reporting(entry, val): 1762 | local_proxyservice_reporting(entry, val) 1763 | 1764 | def sb_proxyservice_logging_isenabled(entry, val): 1765 | local_proxyservice_logging_isenabled(entry, val) 1766 | 1767 | def sb_proxyservice_logging_loglevel(entry, val): 1768 | local_proxyservice_logging_loglevel(entry, val) 1769 | 1770 | def sb_proxyservice_slaalerting_isenabled(entry, val): 1771 | local_proxyservice_slaalerting_isenabled(entry, val) 1772 | 1773 | def sb_proxyservice_slaalerting_alertlevel(entry, val): 1774 | local_proxyservice_slaalerting_alertlevel(entry, val) 1775 | 1776 | def sb_proxyservice_pipelinealerting_isenabled(entry, val): 1777 | local_proxyservice_pipelinealerting_isenabled(entry, val) 1778 | 1779 | def sb_proxyservice_pipelinealerting_alertlevel(entry, val): 1780 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 1781 | 1782 | def sb_proxyservice_endpointuri(entry, val): 1783 | changeEndpointUri(convertToTuple(val),entry) 1784 | 1785 | def sb_proxyservice_dispatchpolicy(entry, val): 1786 | getSBEndPointConfiguration(entry).setDispatchPolicy(val) 1787 | 1788 | def sb_proxyservice_ssluse(entry, val): 1789 | getSbInboundProperties(entry).setUseSsl(val) 1790 | 1791 | #=================================================================== 1792 | # Customize: BusinessService: Transport Type: SB 1793 | #=================================================================== 1794 | 1795 | def sb_businessservice_monitoring(entry, val): 1796 | return True 1797 | 1798 | def sb_businessservice_logging(entry, val): 1799 | return True 1800 | 1801 | def sb_businessservice_slaalerting(entry, val): 1802 | return True 1803 | 1804 | def sb_businessservice_pipelinealerting(entry, val): 1805 | return True 1806 | 1807 | def sb_businessservice_monitoring_isenabled(entry, val): 1808 | local_proxyservice_monitoring_isenabled(entry, val) 1809 | 1810 | def sb_businessservice_monitoring_aggregationinterval(entry, val): 1811 | local_proxyservice_monitoring_aggregationinterval(entry, val) 1812 | 1813 | def sb_businessservice_monitoring_pipelinemonitoringlevel(entry, val): 1814 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 1815 | 1816 | def sb_businessservice_reporting(entry, val): 1817 | local_proxyservice_reporting(entry, val) 1818 | 1819 | def sb_businessservice_logging_isenabled(entry, val): 1820 | local_proxyservice_logging_isenabled(entry, val) 1821 | 1822 | def sb_businessservice_logging_loglevel(entry, val): 1823 | local_proxyservice_logging_loglevel(entry, val) 1824 | 1825 | def sb_businessservice_slaalerting_isenabled(entry, val): 1826 | local_proxyservice_slaalerting_isenabled(entry, val) 1827 | 1828 | def sb_businessservice_slaalerting_alertlevel(entry, val): 1829 | local_proxyservice_slaalerting_alertlevel(entry, val) 1830 | 1831 | def sb_businessservice_pipelinealerting_isenabled(entry, val): 1832 | local_proxyservice_pipelinealerting_isenabled(entry, val) 1833 | 1834 | def sb_businessservice_pipelinealerting_alertlevel(entry, val): 1835 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 1836 | 1837 | def sb_businessservice_endpointuri(entry, val): 1838 | changeEndpointUri(convertToTuple(val),entry) 1839 | 1840 | def sb_businessservice_timeout(entry, val): 1841 | getSbOutboundProperties(entry).setTimeout(val) 1842 | 1843 | def sb_businessservice_retrycount(entry, val): 1844 | getCommonOutboundProperties(entry).setRetryCount(val) 1845 | 1846 | def sb_businessservice_retryapplicationerrors(entry, val): 1847 | getCommonOutboundProperties(entry).setRetryApplicationErrors(val) 1848 | 1849 | def sb_businessservice_retryinterval(entry, val): 1850 | getCommonOutboundProperties(entry).setRetryInterval(val) 1851 | 1852 | def sb_businessservice_dispatchpolicy(entry, val): 1853 | getSBEndPointConfiguration(entry).setDispatchPolicy(val) 1854 | 1855 | def sb_businessservice_providerid(entry, val): 1856 | endPointConfiguration=entry.getEndpointConfig() 1857 | if val.lower() == 'http' and endPointConfiguration.getProviderId() != 'http': 1858 | # change from sb to http as requested 1859 | endPointConfiguration.setProviderId('http') 1860 | 1861 | endPointConfiguration.unsetProviderSpecific() 1862 | providerSpec = endPointConfiguration.addNewProviderSpecific() 1863 | providerSpec = providerSpec.changeType(HttpEndPointConfiguration.type) 1864 | providerSpec.addNewOutboundProperties() 1865 | 1866 | # set some defaults 1867 | http_businessservice_requestmethod(entry, 'POST') 1868 | http_businessservice_readtimeout(entry, 15) 1869 | http_businessservice_connectiontimeout(entry, 20) 1870 | http_businessservice_followredirects(entry, false) 1871 | http_businessservice_chunkedstreamingmode(entry, true) 1872 | http_businessservice_sessionsctikiness(entry, false) 1873 | else: 1874 | # not supported 1875 | return True 1876 | 1877 | #### ############################################################################################################################################### 1878 | #### ############################################################################################################################################### 1879 | #### 1880 | #### Customization End 1881 | #### 1882 | #### ############################################################################################################################################### 1883 | #### ############################################################################################################################################### 1884 | 1885 | 1886 | #### ############################################################################################################################################### 1887 | 1888 | def loadEntryFactory(jarEntry): 1889 | if jarEntry.getExtension()=='proxyservice' or jarEntry.getExtension()=='businessservice': 1890 | return ServiceDefinition.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1891 | elif jarEntry.getExtension()=='serviceaccount': 1892 | return ServiceAccountDocument.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1893 | elif jarEntry.getExtension()=='Operations'.lower(): 1894 | return OperationalSettings.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1895 | elif jarEntry.getExtension()=='UDDIRegistry'.lower(): 1896 | return UDDIRegistryEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1897 | elif jarEntry.getExtension()=='ForeignJNDIProvider'.lower(): 1898 | return JndiProviderEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1899 | elif jarEntry.getExtension()=='SMTPServer'.lower(): 1900 | return SmtpServerEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1901 | elif jarEntry.getExtension()=='ProxyServer'.lower(): 1902 | return ProxyServerDocument.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1903 | elif jarEntry.getExtension()=='AlertDestination'.lower(): 1904 | return AlertDestination.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1905 | elif jarEntry.getExtension()=='ServiceProvider'.lower(): 1906 | return ServiceProviderEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1907 | elif jarEntry.getExtension()=='MQConnection'.lower(): 1908 | return MqConnectionEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1909 | else: 1910 | return None 1911 | 1912 | #### ############################################################################################################################################### 1913 | 1914 | def lookupCustomizationFunction(functionName, parent, entry): 1915 | for setFunction in reverseDict(parent): 1916 | impleSetFunction= (functionName + '_' + setFunction).lower() 1917 | 1918 | #print 'CustFunct: ' + impleSetFunction 1919 | print LOG_CUST_FUNCTION + setFunction 1920 | 1921 | #if the customization function return True than exists another customization function 1922 | if impleSetFunction in globals(): 1923 | if (globals()[impleSetFunction](entry, parent[setFunction])): 1924 | if isDict(parent[setFunction]): 1925 | lookupCustomizationFunction(impleSetFunction, parent[setFunction],entry) 1926 | else: 1927 | print LOG_NOT_FOUND_FUNCTION + impleSetFunction 1928 | NOT_FOUND_CUSTOMIZATION.append(impleSetFunction) 1929 | 1930 | 1931 | def customizeSbConfigFile(customizationFile,path): 1932 | osbJarEntries=parseOsbJar(readBinaryFile(path)) 1933 | 1934 | print 'Customize the following files:' 1935 | 1936 | #customize services by transport type... 1937 | for customizationType in reverseDict(customizationFile): 1938 | #print '--> '+ customizationType 1939 | customizationEntries=customizationFile[customizationType] 1940 | 1941 | for custEntryFile in reverseDict(customizationEntries): 1942 | jarEntries=findOsbJarEntries(custEntryFile,osbJarEntries) 1943 | 1944 | if not jarEntries: 1945 | print LOG_CUST_FILE + 'Not found Entry: ' + custEntryFile 1946 | else: 1947 | for jarEntry in jarEntries: 1948 | print LOG_CUST_FILE + jarEntry.getName() 1949 | sbentry=loadEntryFactory(jarEntry) 1950 | if sbentry!=None: 1951 | # dynamic function name, eg. sb_businessservice 1952 | execFunctionName = customizationType.lower().strip()+'_'+jarEntry.getExtension().lower().strip() 1953 | #execute customization 1954 | lookupCustomizationFunction(execFunctionName,customizationEntries[custEntryFile],sbentry) 1955 | #update jar entry 1956 | jarEntry.setData(sbentry.toString().encode('utf-8')) 1957 | else: 1958 | print LOG_CUST_FUNCTION + 'Customization is not supported!' 1959 | 1960 | if len(NOT_FOUND_CUSTOMIZATION)!=0: 1961 | print ' ' 1962 | print '------------------------------------' 1963 | print 'Not found customization functions:' 1964 | for notFoundFunct in NOT_FOUND_CUSTOMIZATION: 1965 | print ' '+ notFoundFunct 1966 | print '------------------------------------' 1967 | print ' ' 1968 | #generate new SB Config 1969 | return osbJarEntries 1970 | 1971 | def tokenReplaceSbConfigFile(tokens, osbJarEntries): 1972 | print 'Tokens found and replaced on the following files:' 1973 | for jarEntry in osbJarEntries: 1974 | sbentry = loadEntryFactory(jarEntry) 1975 | hasPrintedHeader = False 1976 | if sbentry != None: 1977 | # do token replacement 1978 | 1979 | sbentryAsString = sbentry.toString() 1980 | for token in SB_CUSTOMIZATOR_TOKENS: 1981 | if (token in sbentryAsString): 1982 | if (not hasPrintedHeader): 1983 | print LOG_CUST_FILE + jarEntry.getName() 1984 | hasPrintedHeader = True 1985 | if ('PASSWORD' in token.upper()): 1986 | #mask passwords 1987 | print LOG_CUST_FUNCTION + token + '->' + '*' * len(SB_CUSTOMIZATOR_TOKENS[token]) + ' (masked)' 1988 | else: 1989 | print LOG_CUST_FUNCTION + token + '->' + SB_CUSTOMIZATOR_TOKENS[token] 1990 | sbentryAsString = sbentryAsString.replace(token, SB_CUSTOMIZATOR_TOKENS[token]) 1991 | 1992 | jarEntry.setData(sbentryAsString.encode('utf-8')) 1993 | return osbJarEntries 1994 | 1995 | def checkForForbiddenTokens(forbiddenTokens, osbJarEntries): 1996 | print 'Checking for forbidden tokens in the following files:' 1997 | for jarEntry in osbJarEntries: 1998 | sbentry = loadEntryFactory(jarEntry) 1999 | hasPrintedHeader = False 2000 | if sbentry != None: 2001 | # do token replacement 2002 | 2003 | sbentryAsString = sbentry.toString() 2004 | foundTokens = [x for x in forbiddenTokens if x in sbentryAsString] 2005 | for forbiddenToken in foundTokens: 2006 | if (not hasPrintedHeader): 2007 | print LOG_CUST_FILE + jarEntry.getName() 2008 | hasPrintedHeader = True 2009 | 2010 | print LOG_CUST_FUNCTION + '"' + forbiddenToken + '" detected' 2011 | 2012 | if (foundTokens): 2013 | print '' 2014 | raise ValueError('Found ' + str(len(foundTokens)) + ' forbidden tokens') 2015 | return 2016 | 2017 | def executeCustomization(): 2018 | customized_files = [] 2019 | if 'SB_CUSTOMIZATOR' in globals(): 2020 | for sbFileName in SB_CUSTOMIZATOR: 2021 | print ' ' 2022 | print '------------------------------------' 2023 | print ' Customize Config: '+str(sbFileName) 2024 | sbFile=SB_CUSTOMIZATOR[sbFileName] 2025 | #customize 2026 | replaceFile = sbFile.get('replaceFile', False) 2027 | print LOG_CUST_FILE+' replaceFile: ' + str(replaceFile) 2028 | path=str(sbFileName) 2029 | if "*" in path: 2030 | possibleMatches = glob.glob(path) 2031 | print LOG_CUST_FILE+' '+ str(possibleMatches) 2032 | if (len(possibleMatches) == 1): 2033 | path = possibleMatches[0] 2034 | print LOG_CUST_FILE+' Expanded wildcard to: ' + path 2035 | else: 2036 | message = str(len(possibleMatches)) + ' matches found for ' + path + ' SB Config file; expecting 1.' 2037 | print LOG_CUST_FILE+' Error: ' + message 2038 | raise ValueError(message) 2039 | 2040 | absPath= os.path.abspath(path) 2041 | if os.path.isfile(absPath) and os.path.exists(absPath): 2042 | osbJarEntries= customizeSbConfigFile(sbFile,path) 2043 | if 'SB_CUSTOMIZATOR_TOKENS' in globals(): 2044 | osbJarEntries=tokenReplaceSbConfigFile(SB_CUSTOMIZATOR_TOKENS, osbJarEntries) 2045 | if 'SB_CUSTOMIZATOR_FORBIDDEN_TOKENS' in globals(): 2046 | checkForForbiddenTokens(SB_CUSTOMIZATOR_FORBIDDEN_TOKENS, osbJarEntries) 2047 | 2048 | #generate new sbconfig file 2049 | data=generateNewSBConfig(osbJarEntries) 2050 | #deploy 2051 | customized_files.append(saveNewSbConfigNoFS(path,data, replaceFile)) 2052 | else: 2053 | print LOG_CUST_FILE+' Error: ' + absPath + ' SB Config file not found' 2054 | else: 2055 | print LOG_CUST_FILE+' Not found customization config: SB_CUSTOMIZATOR' 2056 | return customized_files 2057 | 2058 | try: 2059 | print '################################################################################' 2060 | print '' 2061 | print ' OSB-Config-WLST-Configurator (TomeCode.com)' 2062 | print ' ' 2063 | print ' Version: ${project.version}' 2064 | print ' ' 2065 | 2066 | if len(sys.argv)!=2: 2067 | print ' Wrong number of arguments: OSB Customization file not found!' 2068 | print ' Execute: ./osbCustomizer.(sh/cmd) osbCustomizer.properties' 2069 | print ' ' 2070 | print ' ' 2071 | exit(exitcode=1) 2072 | 2073 | f=sys.argv[1] 2074 | 2075 | print ' Load customization file: ' + f 2076 | f = os.path.abspath(f) 2077 | exec open(str(f),'r') 2078 | 2079 | deployFiles=executeCustomization() 2080 | deployToOsb(deployFiles) 2081 | 2082 | except Exception, err: 2083 | print ' Failed Execute customization file: '+ f 2084 | traceback.print_exc() 2085 | #or 2086 | print sys.exc_info()[0] 2087 | print 'Setting exitcode=1' 2088 | exit(exitcode=1) 2089 | 2090 | 2091 | exit(exitcode=0) 2092 | -------------------------------------------------------------------------------- /src/main/resources/osbCustomizer.sh: -------------------------------------------------------------------------------- 1 | #################################################################### 2 | # 3 | # Author: Tomas (Tome) Frastia 4 | # Web: http://www.TomeCode.com 5 | # Version: ${project.version} 6 | # Description: 7 | # Copyright (c): Tomas (Tome) Frastia | TomeCode.com 8 | # 9 | # Changelog: 10 | # 1.1.19 Exclude embedded jars from tokenisation 11 | # 1.1.18 Token replacement and detection now happens on all files in jar 12 | # 1.1.17 Support for specifying policies 13 | # 1.1.16 Support for changing WS Policy fields 14 | # 1.1.15 Sets wlst exitcode on failure so calling script can detect failed deployment 15 | # 1.1.14 Added ability to configure http business service throttling when no throttling entry exists in business service source 16 | # 1.1.13 Added ability to configure http business service throttling 17 | # 1.1.11 Changed session name 18 | # 1.1.10 Prints version 19 | # 1.1.9 Added support for failure if tokens remain uncustomised 20 | # 1.1.8 Added support for work managers on http bizrefs. 21 | # 1.1.7 Updated for sb inbound services 22 | # 1.1.6 Fixed bug preventing customisation of multiple files at once 23 | # 1.1.5 Updated to properly support proxy service inbound properties 24 | # 1.1.4 Added ability to change biz from sb transport to http transport 25 | # 1.1.3 Added ability to do token replacement 26 | # 1.1.2 Added more customisation fields 27 | # 1.1.1 Added toggle to replace the original sbconfig jar rather than create a new one. Disabled by default. 28 | # 1.1.0 29 | # Customize: MQConnection 30 | # Proxy Service and Business Service with transport: MQ, MQConnection, FTP, FILE, SFTP, EMAIL, SB 31 | # Bug fixes and improvements 32 | # 1.0.0 33 | # New customization core 34 | # Customize: authentication for: SSLClientAuthenticationType, CustomTokenAuthenticationType for HTTP/Proxy 35 | # ProxyServer, AlertDestination, ServiceProvider 36 | # (Static) ServiceAccount 37 | # RetryCount and RetryInterval in HTTP/Proxy 38 | # Enable or disable deployment to OSB 39 | # Bug fixes 40 | # 0.0.2 41 | # Bug fixes 42 | # 0.0.2 43 | # Bug fixes 44 | # 0.0.1 45 | # Customize: Proxy Service and Business Service with transport: JMS and HTTP 46 | #################################################################### 47 | 48 | import sys, traceback 49 | import os 50 | import os.path 51 | import time 52 | import shutil 53 | import glob 54 | import fnmatch 55 | import re 56 | 57 | from xml.dom import minidom 58 | from javax.xml.namespace import QName 59 | 60 | from java.io import ByteArrayInputStream 61 | from java.io import ByteArrayInputStream 62 | from java.io import ByteArrayOutputStream 63 | from java.io import FileOutputStream 64 | from java.util.jar import JarInputStream 65 | from java.util.jar import JarOutputStream 66 | from java.util.jar import JarEntry 67 | 68 | from com.tomecode.utils import Utils 69 | 70 | from com.bea.wli.sb.services import ServiceAccountDocument 71 | from com.bea.wli.sb.services import ServiceDefinition 72 | from com.bea.wli.sb.services import StaticServiceAccount 73 | from com.bea.wli.sb.services import ServiceProviderEntry 74 | from com.bea.wli.sb.services import PolicyBindingModeType 75 | 76 | from com.bea.wli.sb.transports import EndPointConfiguration 77 | from com.bea.wli.sb.transports import URIType 78 | from com.bea.wli.sb.transports import FilePathType 79 | 80 | from com.bea.wli.sb.transports.http import AuthenticationConfigurationType 81 | from com.bea.wli.sb.transports.http import SSLClientAuthenticationType 82 | from com.bea.wli.sb.transports.http import CustomTokenAuthenticationType 83 | from com.bea.wli.sb.transports.http import HttpBasicAuthenticationType 84 | from com.bea.wli.sb.transports.http import HttpEndPointConfiguration 85 | from com.bea.wli.sb.transports.http import HttpInboundPropertiesType 86 | from com.bea.wli.sb.transports.http import HttpOutboundPropertiesType 87 | from com.bea.wli.sb.transports.http import HttpRequestMethodEnum 88 | from com.bea.wli.sb.transports.http import SessionStickinessType 89 | 90 | from com.bea.wli.sb.transports.mq import MQInboundProperties 91 | from com.bea.wli.sb.transports.mq import MQEndPointConfiguration 92 | from com.bea.wli.sb.transports.mq import MQMessageTypeEnum 93 | 94 | from com.bea.wli.sb.transports.ftp import FtpEndPointConfiguration 95 | from com.bea.wli.sb.transports.ftp import FtpInboundPropertiesType 96 | from com.bea.wli.sb.transports.ftp import FilePollInfo 97 | 98 | from com.bea.wli.sb.transports.file import FileEndPointConfiguration 99 | from com.bea.wli.sb.transports.file import FileInBoundProperties 100 | 101 | from com.bea.wli.sb.transports.sftp import SftpEndPointConfiguration 102 | 103 | from com.bea.wli.sb.transports.email import EmailEndPointConfiguration 104 | 105 | from com.bea.wli.sb.transports.sb import SBEndPointConfiguration 106 | 107 | from com.bea.wli.sb.transports.jms import JmsEndPointConfiguration 108 | from com.bea.wli.sb.transports.jms import JmsResponsePatternEnum 109 | from com.bea.wli.sb.transports.jms import JmsMessageTypeEnum 110 | 111 | from com.bea.wli.sb.uddi import UDDIRegistryEntry 112 | 113 | from com.bea.wli.sb.security.accesscontrol.config import PolicyContainerType 114 | from com.bea.wli.sb.security.accesscontrol.config import ProviderPolicyContainerType 115 | 116 | from com.bea.wli.sb.services.security.config import XPathSelectorType 117 | 118 | from com.bea.wli.sb.resources.proxyserver.config import ProxyServerDocument 119 | from com.bea.wli.sb.resources.proxyserver.config import ProxyServerParams 120 | 121 | 122 | from com.bea.wli.sb.services.security.config import XPathSelectorType 123 | 124 | from com.bea.wli.sb.util import Refs 125 | 126 | from com.bea.wli.sb.resources.config import SmtpServerEntry 127 | from com.bea.wli.sb.resources.config import JndiProviderEntry 128 | from com.bea.wli.sb.resources.config import ServiceAccountUserPassword 129 | from com.bea.wli.sb.resources.config import UserPassword 130 | from com.bea.wli.sb.resources.config import MqConnectionEntry 131 | from com.bea.wli.sb.resources.config import MqTcpModeType 132 | 133 | from com.bea.wli.sb.management.importexport import ALSBImportOperation 134 | from com.bea.wli.sb.management.configuration import SessionManagementMBean 135 | from com.bea.wli.sb.management.configuration import ServiceConfigurationMBean 136 | from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean 137 | from com.bea.wli.sb.management.query import ProxyServiceQuery 138 | 139 | from com.bea.wli.domain.config import OperationalSettings 140 | 141 | from com.bea.wli.config.customization import Customization 142 | 143 | from com.bea.wli.monitoring.alert import AlertDestination 144 | 145 | #=================================================================== 146 | LOG_CUST_FILE = ' --> ' 147 | LOG_CUST_FUNCTION = ' --> ' 148 | LOG_NOT_FOUND_FUNCTION = ' ##> Error Not found: ' 149 | #=================================================================== 150 | 151 | NOT_FOUND_CUSTOMIZATION=[] 152 | 153 | #=================================================================== 154 | # Jar Entry 155 | #=================================================================== 156 | class OsbJarEntry: 157 | name='' 158 | directory=False 159 | data=None 160 | extension=None 161 | 162 | def __init__(self,n,d,b): 163 | self.name=n 164 | self.directory=d 165 | self.data=b 166 | #get extensio name 167 | self.extension=os.path.splitext(self.name)[1][1:] 168 | 169 | def getName(self): 170 | return self.name 171 | 172 | def getData(self): 173 | return self.data 174 | 175 | def setData(self, d): 176 | self.data=d 177 | 178 | def getExtension(self): 179 | return self.extension.lower() 180 | 181 | 182 | def findOsbJarEntry(indexName,osbJarEntries): 183 | for entry in osbJarEntries: 184 | if entry.getName()==indexName: 185 | return entry 186 | 187 | return None 188 | 189 | def findOsbJarEntries(indexName,osbJarEntries): 190 | if "*" in indexName: 191 | regex = fnmatch.translate(indexName) 192 | return [entry for entry in osbJarEntries if re.match(regex, entry.getName())] 193 | else: 194 | return [entry for entry in osbJarEntries if entry.getName()==indexName] 195 | 196 | 197 | #=================================================================== 198 | # Parse sbconfig file 199 | #=================================================================== 200 | def parseOsbJar(data): 201 | osbJarEntries=[] 202 | jis = None 203 | jis = JarInputStream(ByteArrayInputStream(data)) 204 | 205 | entry = jis.getNextJarEntry() 206 | while (entry != None): 207 | if (entry.isDirectory()): 208 | osbJarEntries.append(OsbJarEntry(entry.toString(), entry.isDirectory(), None)) 209 | else: 210 | osbJarEntries.append(OsbJarEntry(entry.toString(), entry.isDirectory(), Utils.readJarEntryToBytes(jis,entry))) 211 | entry = jis.getNextJarEntry() 212 | 213 | jis.close() 214 | return osbJarEntries 215 | 216 | def convertToTuple(values): 217 | list=[] 218 | if '' in str(type(values)): 219 | list.append(str(values)) 220 | else: 221 | for val in values: 222 | list.append(val) 223 | return list 224 | 225 | 226 | def isDict(val): 227 | return ('' in str(type(val))) 228 | 229 | def reverseDict(val): 230 | if val==None: 231 | return [] 232 | if not isinstance(val,dict): 233 | return [] 234 | list=val.keys() 235 | list.reverse() 236 | return list 237 | 238 | #=================================================================== 239 | # Generating a new sbconfig file 240 | #=================================================================== 241 | def generateNewSBConfig(osbJarEntries): 242 | baos = ByteArrayOutputStream() 243 | jos = None 244 | try: 245 | jos = JarOutputStream(baos) 246 | for entry in osbJarEntries: 247 | jarEntry = JarEntry(entry.getName()) 248 | jos.putNextEntry(jarEntry) 249 | if entry.getData() != None: 250 | jos.write(entry.getData(), 0, len(entry.getData())) 251 | jos.closeEntry() 252 | except Exception, err: 253 | print traceback.format_exc() 254 | jos.close() 255 | return baos.toByteArray() 256 | 257 | 258 | #=================================================================== 259 | # Read binary file (Sbconfig) 260 | #=================================================================== 261 | def readBinaryFile(fileName): 262 | file = open(fileName, 'rb') 263 | bytes = file.read() 264 | return bytes 265 | 266 | #=================================================================== 267 | # Write binary file (Sbconfig) 268 | #=================================================================== 269 | def writeToFile(fName, data): 270 | fos = FileOutputStream(fName) 271 | fos.write(data) 272 | fos.flush() 273 | fos.close() 274 | 275 | def saveNewSbConfigNoFS(sbFileName,data, replaceFile): 276 | index=sbFileName.rfind('.') 277 | if (replaceFile): 278 | newSbFileName = sbFileName 279 | oldSbFileName= sbFileName[0:index] + '-' + time.strftime('%Y%m%d_%H%M%S')+'.jar.old' 280 | print ' Moving old sbconfig to: ' + oldSbFileName 281 | shutil.copy2(sbFileName, oldSbFileName) 282 | else: 283 | newSbFileName= sbFileName[0:index] + '-' + time.strftime('%Y%m%d_%H%M%S')+'.jar' 284 | print ' New customizated sbconfig is: ' + newSbFileName 285 | 286 | writeToFile(newSbFileName,data) 287 | return newSbFileName 288 | 289 | #-------------------------------------------------------------------------------- 290 | #-------------------------------------------------------------------------------- 291 | #-------------------------------------------------------------------------------- 292 | #-------------------------------------------------------------------------------- 293 | #-------------------------------------------------------------------------------- 294 | #-------------------------------------------------------------------------------- 295 | 296 | 297 | 298 | #=================================================================== 299 | # Connect to the Admin Server 300 | #=================================================================== 301 | def connectToOSB(): 302 | print ' ' 303 | print '------------------------------------' 304 | print ' --- Connecting to OSB server ' 305 | if 'Url' in SB_SERVER: 306 | uri = SB_SERVER['Url'] 307 | else: 308 | uri = 't3://' + SB_SERVER['ListenAddress'] + ':' + str(SB_SERVER['ListenPort']) 309 | try: 310 | connect(SB_SERVER['Username'],SB_SERVER['Password'],uri) 311 | domainRuntime() 312 | return True 313 | except WLSTException: 314 | print ' --- No server is running at '+ uri+ ' !\n Deploy cancelled!' 315 | return False 316 | 317 | 318 | #=================================================================== 319 | # Utility function to load a session MBeans 320 | #=================================================================== 321 | def createOSBSession(): 322 | sessionName = "BulkDeploy_" + str(System.currentTimeMillis()) 323 | sessionMBean = findService(SessionManagementMBean.NAME, SessionManagementMBean.TYPE) 324 | sessionMBean.createSession(sessionName) 325 | print ' ..OSB Session Created: ' + sessionName 326 | return sessionMBean, sessionName 327 | 328 | def createImportProject(ALSBConfigurationMBean): 329 | alsbJarInfo = ALSBConfigurationMBean.getImportJarInfo() 330 | alsbImportPlan = alsbJarInfo.getDefaultImportPlan() 331 | #alsbImportPlan.setPassphrase(None) 332 | alsbImportPlan.setPreserveExistingAccessControlPolicies(False) 333 | alsbImportPlan.setPreserveExistingCredentials(False) 334 | alsbImportPlan.setPreserveExistingOperationalValues(False) 335 | alsbImportPlan.setPreserveExistingEnvValues(False) 336 | alsbImportPlan.setPreserveExistingSecurityAndPolicyConfig(False) 337 | return ALSBConfigurationMBean.importUploaded(alsbImportPlan) 338 | 339 | def uploadSbConfigToOSB(ALSBConfigurationMBean, sbConfigJar): 340 | ALSBConfigurationMBean.uploadJarFile(readBinaryFile(sbConfigJar)) 341 | print ' ..Uploaded: ' + sbConfigJar 342 | importResult= createImportProject(ALSBConfigurationMBean) 343 | 344 | def showVersionSummary(): 345 | print 'Server: ' + version 346 | print 'Java..: ' + sys.platform 347 | print 'Jython: ' + sys.version 348 | 349 | def deployToOsb(files): 350 | 351 | if 'SB_SERVER' in globals(): 352 | print ' Deploying to OSB: '+ ', '.join(files) 353 | 354 | try: 355 | if connectToOSB()== True: 356 | showVersionSummary() 357 | #create new session 358 | sessionMBean, sessionName = createOSBSession() 359 | 360 | ALSBConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean") 361 | 362 | #simple import without customization 363 | for file in files: 364 | uploadSbConfigToOSB(ALSBConfigurationMBean,file) 365 | 366 | print ' ..Commiting session, please wait, this can take a while...' 367 | sessionMBean.activateSession(sessionName, "Import from wlst") 368 | print ' ..Session was successfully committed!' 369 | print ' ' 370 | except java.lang.Exception, e: 371 | print ' Import to OSB: Failed, please see logs...' + '\n ', e 372 | dumpStack() 373 | if sessionMBean != None: 374 | sessionMBean.discardSession(sessionName) 375 | print 'Session discarded.' 376 | print 'Setting exitcode to 5' 377 | exit(exitcode=5) 378 | else: 379 | print 'Deployment to OSB is disabled' 380 | 381 | 382 | #### ############################################################################################################################################### 383 | #### ############################################################################################################################################### 384 | #### 385 | #### Customization functions 386 | #### 387 | #### ############################################################################################################################################### 388 | #### ############################################################################################################################################### 389 | 390 | def getJmsEndPointConfiguration(serviceDefinition): 391 | JmsEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 392 | return JmsEndPointConfiguration 393 | 394 | 395 | def getCommonOutboundProperties(serviceDefinition): 396 | endPointConfiguration=serviceDefinition.getEndpointConfig() 397 | outboundProperties= endPointConfiguration.getOutboundProperties() 398 | if outboundProperties == None: 399 | outboundProperties= endPointConfiguration.addNewOutboundProperties() 400 | return outboundProperties 401 | 402 | def getJmsInboundProperties(serviceDefinition): 403 | jmsEndPointConfiguration=getJmsEndPointConfiguration(serviceDefinition) 404 | jmsInboundProperties= jmsEndPointConfiguration.getInboundProperties() 405 | if jmsInboundProperties == None: 406 | jmsInboundProperties= jmsEndPointConfiguration.addNewInboundProperties() 407 | return jmsInboundProperties 408 | 409 | 410 | def changeEndpointUri(endpoints,serviceDefinition): 411 | endpointConfiguration = serviceDefinition.getEndpointConfig() 412 | if len(endpointConfiguration.getURIArray()) >= 1: 413 | #uris=URIType[0] 414 | endpointConfiguration.setURIArray([]) 415 | 416 | for uri in endpoints: 417 | endpointConfiguration.addNewURI().setValue(uri) 418 | 419 | def getTransactions(serviceDefinition): 420 | transactions=serviceDefinition.getCoreEntry().getTransactions() 421 | if transactions==None: 422 | return serviceDefinition.getCoreEntry().addNewTransactions() 423 | return transactions 424 | 425 | def getThrottling(serviceDefinition): 426 | throttling=serviceDefinition.getCoreEntry().getThrottling() 427 | if throttling==None: 428 | return serviceDefinition.getCoreEntry().addNewThrottling() 429 | return throttling 430 | 431 | def getWsPolicyPolicies(serviceDefinition): 432 | policies = serviceDefinition.getCoreEntry().getWsPolicy().getPolicies() 433 | if policies==None: 434 | return serviceDefinition.getCoreEntry().getWsPolicy().addNewPolicies() 435 | return policies 436 | 437 | def getWsPolicyPoliciesServicePolicy(serviceDefinition): 438 | policies = getWsPolicyPolicies(serviceDefinition) 439 | policy = policies.getServicePolicy() 440 | if policy==None: 441 | return policies.addNewServicePolicy() 442 | return policy 443 | 444 | def getHttpInboundProperties(serviceDefinition): 445 | httpEndPointConfiguration = getHttpEndPointConfiguration(serviceDefinition) 446 | httpInboundProperties= httpEndPointConfiguration.getInboundProperties() 447 | if httpInboundProperties == None: 448 | httpInboundProperties= httpEndPointConfiguration.addNewInboundProperties() 449 | return httpInboundProperties 450 | 451 | def getHttpOutboundProperties(serviceDefinition): 452 | httpEndPointConfiguration = getHttpEndPointConfiguration(serviceDefinition) 453 | outboundProperties= httpEndPointConfiguration.getOutboundProperties() 454 | if outboundProperties == None: 455 | outboundProperties= httpEndPointConfiguration.addNewOutboundProperties() 456 | return outboundProperties 457 | 458 | def getHttpEndPointConfiguration(serviceDefinition): 459 | providerSpecific=serviceDefinition.getEndpointConfig().getProviderSpecific() 460 | providerSpecific = providerSpecific.changeType(HttpEndPointConfiguration.type) 461 | return providerSpecific 462 | 463 | def findKeyPairForServiceProvider(serviceProviderEntry, prupose): 464 | if serviceProviderEntry.getCredentials()!=None: 465 | keyPairArray=serviceProviderEntry.getCredentials().getKeyPairArray() 466 | if keyPairArray!= None: 467 | for keyPair in keyPairArray: 468 | if prupose in keyPair.getPurpose(): 469 | return keyPair 470 | 471 | return None 472 | 473 | 474 | def getMqOutboundProperties(serviceDefinition): 475 | MQEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 476 | outboundProperties= MQEndPointConfiguration.getOutboundProperties() 477 | if outboundProperties == None: 478 | outboundProperties= MQEndPointConfiguration.addNewOutboundProperties() 479 | return outboundProperties 480 | 481 | 482 | def getFtpOutboundProperties(serviceDefinition): 483 | FtpEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 484 | outboundProperties= FtpEndPointConfiguration.getOutboundProperties() 485 | if outboundProperties == None: 486 | outboundProperties= FtpEndPointConfiguration.addNewOutboundProperties() 487 | return outboundProperties 488 | 489 | 490 | def getFtpPrefixSufix(outboundProperties): 491 | if outboundProperties.getDestinationFileName()==None: 492 | outboundProperties.addNewDestinationFileName() 493 | if outboundProperties.getDestinationFileName().getPrefixSuffix()==None: 494 | outboundProperties.getDestinationFileName().addNewPrefixSuffix() 495 | return outboundProperties.getDestinationFileName().getPrefixSuffix() 496 | 497 | def getFileOutboundProperties(serviceDefinition): 498 | FileEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 499 | outboundProperties= FileEndPointConfiguration.getOutboundProperties() 500 | if outboundProperties == None: 501 | outboundProperties= FileEndPointConfiguration.addNewOutboundProperties() 502 | return outboundProperties 503 | 504 | 505 | def getMqInboundProperties(serviceDefinition): 506 | MQEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 507 | inboundProperties=MQEndPointConfiguration.selectChildren(QName("http://www.bea.com/wli/sb/transports/mq", "inbound-properties"))[0] 508 | mqInboundProperties = MQInboundProperties.Factory.parse(inboundProperties.toString()) 509 | return inboundProperties, mqInboundProperties 510 | 511 | def getFtpInboundProperties(serviceDefinition): 512 | FtpEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 513 | inboundProperties=FtpEndPointConfiguration.selectChildren(QName("http://www.bea.com/wli/sb/transports/ftp", "inbound-properties"))[0] 514 | ftpInboundProperties = FtpInboundPropertiesType.Factory.parse(inboundProperties.toString()) 515 | return inboundProperties, ftpInboundProperties 516 | 517 | 518 | def getFileInboundProperties(serviceDefinition): 519 | FileEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 520 | inboundProperties=FileEndPointConfiguration.selectChildren(QName("http://www.bea.com/wli/sb/transports/file", "inbound-properties"))[0] 521 | fileInBoundProperties = FileInBoundProperties.Factory.parse(inboundProperties.toString()) 522 | return inboundProperties, fileInBoundProperties 523 | 524 | def getSftpInboundProperties(serviceDefinition): 525 | SftpEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 526 | inboundProperties= SftpEndPointConfiguration.getInboundProperties() 527 | if inboundProperties == None: 528 | inboundProperties= SftpEndPointConfiguration.addNewInboundProperties() 529 | return inboundProperties 530 | 531 | def getSftpOutboundProperties(serviceDefinition): 532 | SftpEndPointConfiguration = serviceDefinition.getEndpointConfig().getProviderSpecific() 533 | outboundProperties= SftpEndPointConfiguration.getOutboundProperties() 534 | if outboundProperties == None: 535 | outboundProperties= SftpEndPointConfiguration.addNewOutboundProperties() 536 | return outboundProperties 537 | 538 | def getEmailEndPointConfiguration(serviceDefinition): 539 | EmailEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 540 | return EmailEndPointConfiguration 541 | 542 | def getEmailInboundProperties(serviceDefinition): 543 | EmailEndPointConfiguration = getEmailEndPointConfiguration(serviceDefinition) 544 | inboundProperties= EmailEndPointConfiguration.getInboundProperties() 545 | if inboundProperties == None: 546 | inboundProperties= EmailEndPointConfiguration.addNewInboundProperties() 547 | return inboundProperties 548 | 549 | def getEmailOutboundProperties(serviceDefinition): 550 | EmailEndPointConfiguration = getEmailEndPointConfiguration(serviceDefinition) 551 | outboundProperties= EmailEndPointConfiguration.getOutboundProperties() 552 | if outboundProperties == None: 553 | outboundProperties= EmailEndPointConfiguration.addNewOutboundProperties() 554 | return outboundProperties 555 | 556 | def getSBEndPointConfiguration(serviceDefinition): 557 | providerSpecific=serviceDefinition.getEndpointConfig().getProviderSpecific() 558 | providerSpecific = providerSpecific.changeType(SBEndPointConfiguration.type) 559 | return providerSpecific 560 | 561 | def getSbInboundProperties(serviceDefinition): 562 | SBEndPointConfiguration = getSBEndPointConfiguration(serviceDefinition) 563 | inboundProperties= SBEndPointConfiguration.getInboundProperties() 564 | if inboundProperties == None: 565 | inboundProperties= SBEndPointConfiguration.addNewInboundProperties() 566 | return inboundProperties 567 | 568 | def getSbOutboundProperties(serviceDefinition): 569 | SBEndPointConfiguration = getSBEndPointConfiguration(serviceDefinition) 570 | outboundProperties= SBEndPointConfiguration.getOutboundProperties() 571 | if outboundProperties == None: 572 | outboundProperties= SBEndPointConfiguration.addNewOutboundProperties() 573 | return outboundProperties 574 | 575 | #=================================================================== 576 | # Create a policy expression 577 | #=================================================================== 578 | def createPolicyExpression(policyConfig): 579 | expression = '' 580 | provider ='' 581 | 582 | if 'Provider' in reverseDict(policyConfig): 583 | print LOG_CUST_FILE+ 'Policy: Provider' 584 | provider=policyConfig['Provider'] 585 | if 'Users' in policyConfig: 586 | print LOG_CUST_FILE+ 'Policy: Users' 587 | for user in convertToTuple(policyConfig['Users']): 588 | expression += '| Usr('+ str(user) + ')' 589 | 590 | if 'Groups' in policyConfig: 591 | print LOG_CUST_FILE+ 'Policy: Groups' 592 | for group in convertToTuple(policyConfig['Groups']): 593 | expression += '| Grp('+ str(group) + ')' 594 | 595 | if 'Roles' in policyConfig: 596 | print LOG_CUST_FILE+ 'Policy: Roles' 597 | for role in convertToTuple(policyConfig['Roles']): 598 | expression += '| Rol('+ str(role) + ')' 599 | 600 | 601 | expression=expression.strip() 602 | if expression.startswith('|'): 603 | expression=expression[2:len(expression)] 604 | return expression,provider 605 | 606 | #=================================================================== 607 | # Setup policy expression in service 608 | #=================================================================== 609 | def setupPolicyExpression(serviceDefinition, policyExpression, provider): 610 | 611 | if len(policyExpression.strip())!=0 and len(provider.strip())!=0: 612 | security = getSecurityFromServiceDefinition(serviceDefinition) 613 | 614 | accessControlPolicyBindingType = security.getAccessControlPolicies() 615 | if accessControlPolicyBindingType==None: 616 | accessControlPolicyBindingType = security.addNewAccessControlPolicies() 617 | 618 | transportLevelPolicy = accessControlPolicyBindingType.getTransportLevelPolicy() 619 | if accessControlPolicyBindingType.getTransportLevelPolicy() == None: 620 | transportLevelPolicy = accessControlPolicyBindingType.addNewTransportLevelPolicy() 621 | 622 | 623 | policyContainerType = ProviderPolicyContainerType.Factory.newInstance() 624 | policy = policyContainerType.addNewPolicy() 625 | policy.setProviderId(provider) 626 | policy.setPolicyExpression(policyExpression) 627 | 628 | transportLevelPolicy.set(policyContainerType) 629 | else: 630 | policyContainerType = transportLevelPolicy 631 | policyContainerType.getPolicyArray()[0].setProviderId(provider) 632 | policyContainerType.getPolicyArray()[0].setPolicyExpression(policyExpression) 633 | 634 | def getSecurityFromServiceDefinition(serviceDefinition): 635 | security = serviceDefinition.getCoreEntry().getSecurity() 636 | if security == None: 637 | security = serviceDefinition.getCoreEntry().addNewSecurity() 638 | return security 639 | 640 | def prepareCustomTokenAuthentication(security): 641 | customTokenAuthentication=security.getCustomTokenAuthentication() 642 | if customTokenAuthentication==None: 643 | #customTokenAuthentication.unsetCustomTokenAuthentication() 644 | customTokenAuthentication=security.addNewCustomTokenAuthentication() 645 | return customTokenAuthentication 646 | 647 | #### ############################################################################################################################################### 648 | #### ############################################################################################################################################### 649 | #### 650 | #### Customization Start 651 | #### 652 | #### ############################################################################################################################################### 653 | #### ############################################################################################################################################### 654 | 655 | 656 | #=================================================================== 657 | # Customize: Global Operation Settings 658 | #=================================================================== 659 | 660 | def globaloperationalsettings_operations_monitoring(entry, val): 661 | entry.setMonitoring(val) 662 | 663 | def globaloperationalsettings_operations_slaalerting(entry, val): 664 | entry.setSlaAlerting(val) 665 | 666 | def globaloperationalsettings_operations_pipelinealerting(entry, val): 667 | entry.setPipelineAlerting(val) 668 | 669 | def globaloperationalsettings_operations_resultcaching(entry, val): 670 | entry.setResultCaching(val) 671 | 672 | def globaloperationalsettings_operations_reporting(entry, val): 673 | entry.setReporting(val) 674 | 675 | def globaloperationalsettings_operations_logging(entry, val): 676 | entry.setLogging(val) 677 | 678 | #=================================================================== 679 | # Customize: Service Account: Static 680 | #=================================================================== 681 | 682 | def serviceaccount_serviceaccount_description(entry, val): 683 | serviceAccount = entry.getServiceAccount() 684 | serviceAccount.setDescription(val) 685 | 686 | def serviceaccount_serviceaccount_password(entry, val): 687 | serviceAccountUserPassword = entry.getServiceAccount().getStaticAccount() 688 | serviceAccountUserPassword.setPassword(val) 689 | 690 | def serviceaccount_serviceaccount_username(entry, val): 691 | serviceAccountUserPassword = entry.getServiceAccount().getStaticAccount() 692 | serviceAccountUserPassword.setUsername(val) 693 | 694 | #=================================================================== 695 | # Customize: UDDI 696 | #=================================================================== 697 | 698 | def uddi_uddiregistry_loadtmodels(entry, val): 699 | entry.setLoadtModels(val) 700 | 701 | def uddi_uddiregistry_autoimport(entry, val): 702 | entry.setAutoImport(val) 703 | 704 | def uddi_uddiregistry_password(entry, val): 705 | entry.setPassword(val) 706 | 707 | def uddi_uddiregistry_publishurl(entry, val): 708 | entry.setPublishUrl(val) 709 | 710 | def uddi_uddiregistry_subscriptionurl(entry, val): 711 | entry.setSubscriptionUrl(val) 712 | 713 | def uddi_uddiregistry_username(entry, val): 714 | entry.setUsername(val) 715 | 716 | def uddi_uddiregistry_securityurl(entry, val): 717 | entry.setSecurityUrl(val) 718 | 719 | def uddi_uddiregistry_url(entry, val): 720 | entry.setUrl(val) 721 | 722 | def uddi_uddiregistry_description(entry, val): 723 | entry.setDescription(val) 724 | 725 | #=================================================================== 726 | # Customize: JNDI 727 | #=================================================================== 728 | 729 | def jndi_foreignjndiprovider_cachevalues(entry, val): 730 | entry.setCacheValues(val) 731 | 732 | def jndi_foreignjndiprovider_requesttimeout(entry, val): 733 | entry.setRequestTimeout(val) 734 | 735 | def jndi_foreignjndiprovider_providerurl(entry, val): 736 | entry.setProviderUrl(val) 737 | 738 | def jndi_foreignjndiprovider_username(entry, val): 739 | entry.getUserPassword().setUsername(val) 740 | 741 | def jndi_foreignjndiprovider_password(entry, val): 742 | entry.getUserPassword().setPassword(val) 743 | 744 | def jndi_foreignjndiprovider_description(entry, val): 745 | entry.setDescription(val) 746 | 747 | 748 | #=================================================================== 749 | # Customize: SMTP 750 | #=================================================================== 751 | 752 | def smtp_smtpserver_description(entry, val): 753 | entry.setDescription(val) 754 | 755 | def smtp_smtpserver_isdefault(entry, val): 756 | entry.setIsDefault(val) 757 | 758 | def smtp_smtpserver_portnumber(entry, val): 759 | entry.setPortNumber(val) 760 | 761 | def smtp_smtpserver_serverurl(entry, val): 762 | entry.setServerURL(val) 763 | 764 | def smtp_smtpserver_username(entry, val): 765 | entry.setUsername(val) 766 | 767 | def smtp_smtpserver_password(entry, val): 768 | entry.setPassword(val) 769 | 770 | #=================================================================== 771 | # Customize: Proxy Server 772 | #=================================================================== 773 | 774 | def proxyserver_proxyserver_description(entry, val): 775 | entry.getProxyServer().setDescription(val) 776 | 777 | def proxyserver_proxyserver_username(entry, val): 778 | entry.getProxyServer().setUsername(val) 779 | 780 | def proxyserver_proxyserver_password(entry, val): 781 | entry.getProxyServer().setPassword(val) 782 | 783 | def proxyserver_proxyserver_servertable(entry, val): 784 | entry.getProxyServer().getServerTable().setServerArray(None) 785 | list=[] 786 | for v in val: 787 | param = ProxyServerParams.Factory.newInstance() 788 | param.setHost(v) 789 | params=val[v] 790 | for p in params: 791 | if p =='Port': 792 | param.setPort(params[p]) 793 | print LOG_CUST_FUNCTION + 'Port' 794 | elif p =='SslPort': 795 | param.setSslPort(params[p]) 796 | print LOG_CUST_FUNCTION + 'SslPort' 797 | else: 798 | print 'Property is not supported' 799 | 800 | list.append(param) 801 | entry.getProxyServer().getServerTable().setServerArray(list) 802 | 803 | 804 | #=================================================================== 805 | # Customize: Proxy Service: LOCAL 806 | #=================================================================== 807 | 808 | def local_proxyservice_sametxforresponse(entry, val): 809 | getTransactions(entry).setSameTxForResponse(val) 810 | 811 | def local_proxyservice_description(entry, val): 812 | entry.getCoreEntry().setDescription(val) 813 | 814 | def local_proxyservice_monitoring(entry, val): 815 | return True # parent group 816 | 817 | def local_proxyservice_logging(entry, val): 818 | return True # parent group 819 | 820 | def local_proxyservice_slaalerting(entry, val): 821 | return True # parent group 822 | 823 | def local_proxyservice_pipelinealerting(entry, val): 824 | return True # parent group 825 | 826 | def local_proxyservice_wspolicy(entry, val): 827 | return True # parent group 828 | 829 | def local_proxyservice_wspolicy_bindingmode(entry, val): 830 | entry.getCoreEntry().getWsPolicy().setBindingMode(PolicyBindingModeType.Enum.forString(val)) 831 | 832 | def local_proxyservice_wspolicy_policies(entry, values): 833 | servicePolicy = getWsPolicyPoliciesServicePolicy(entry) 834 | #clean out existing policies 835 | servicePolicy.setOwsmPolicyRefArray([]) 836 | for ref in values: 837 | servicePolicy.addNewOwsmPolicyRef().setID(ref) 838 | 839 | def local_proxyservice_monitoring_isenabled(entry, val): 840 | entry.getCoreEntry().getMonitoring().setIsEnabled(val) 841 | 842 | def local_proxyservice_monitoring_aggregationinterval(entry, val): 843 | entry.getCoreEntry().getMonitoring().setAggregationInterval(val) 844 | 845 | def local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val): 846 | entry.getCoreEntry().getMonitoring().setPipelineMonitoringLevel(val) 847 | 848 | def local_proxyservice_reporting(entry, val): 849 | entry.getCoreEntry().setReporting(val) 850 | 851 | def local_proxyservice_logging_isenabled(entry, val): 852 | entry.getCoreEntry().getLogging().setIsEnabled(val) 853 | 854 | def local_proxyservice_logging_loglevel(entry, val): 855 | entry.getCoreEntry().getLogging().setLogLevel(val) 856 | 857 | def local_proxyservice_slaalerting_isenabled(entry, val): 858 | entry.getCoreEntry().getSlaAlerting().setIsEnabled(val) 859 | 860 | def local_proxyservice_slaalerting_alertlevel(entry, val): 861 | entry.getCoreEntry().getSlaAlerting().setAlertLevel(val) 862 | 863 | def local_proxyservice_pipelinealerting_isenabled(entry, val): 864 | entry.getCoreEntry().getPipelineAlerting().setIsEnabled(val) 865 | 866 | def local_proxyservice_pipelinealerting_alertlevel(entry, val): 867 | entry.getCoreEntry().getPipelineAlerting().setAlertLevel(val) 868 | 869 | def local_proxyservice_isrequired(entry, val): 870 | getTransactions(entry).setIsRequired(val) 871 | 872 | #=================================================================== 873 | # Customize: Proxy Service: Transport Type: HTTP 874 | #=================================================================== 875 | 876 | def http_proxyservice_description(entry, val): 877 | entry.getCoreEntry().setDescription(val) 878 | 879 | def http_proxyservice_monitoring(entry, val): 880 | return True 881 | 882 | def http_proxyservice_logging(entry, val): 883 | return True 884 | 885 | def http_proxyservice_slaalerting(entry, val): 886 | return True 887 | 888 | def http_proxyservice_pipelinealerting(entry, val): 889 | return True 890 | 891 | def http_proxyservice_wspolicy(entry, val): 892 | return True 893 | 894 | def http_proxyservice_wspolicy_bindingmode(entry, val): 895 | local_proxyservice_wspolicy_bindingmode(entry, val) 896 | 897 | def http_proxyservice_wspolicy_policies(entry, values): 898 | local_proxyservice_wspolicy_policies(entry, values) 899 | 900 | def http_proxyservice_monitoring_isenabled(entry, val): 901 | local_proxyservice_monitoring_isenabled(entry, val) 902 | 903 | def http_proxyservice_monitoring_aggregationinterval(entry, val): 904 | local_proxyservice_monitoring_aggregationinterval(entry, val) 905 | 906 | def http_proxyservice_monitoring_pipelinemonitoringlevel(entry, val): 907 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 908 | 909 | def http_proxyservice_reporting(entry, val): 910 | local_proxyservice_reporting(entry, val) 911 | 912 | def http_proxyservice_logging_isenabled(entry, val): 913 | local_proxyservice_logging_isenabled(entry, val) 914 | 915 | def http_proxyservice_logging_loglevel(entry, val): 916 | local_proxyservice_logging_loglevel(entry, val) 917 | 918 | def http_proxyservice_slaalerting_isenabled(entry, val): 919 | local_proxyservice_slaalerting_isenabled(entry, val) 920 | 921 | def http_proxyservice_slaalerting_alertlevel(entry, val): 922 | local_proxyservice_slaalerting_alertlevel(entry, val) 923 | 924 | def http_proxyservice_pipelinealerting_isenabled(entry, val): 925 | local_proxyservice_pipelinealerting_isenabled(entry, val) 926 | 927 | def http_proxyservice_pipelinealerting_alertlevel(entry, val): 928 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 929 | 930 | def http_proxyservice_retrycount(entry, val): 931 | getCommonOutboundProperties(entry).setRetryCount(val) 932 | 933 | def http_proxyservice_retryinterval(entry, val): 934 | getCommonOutboundProperties(entry).setRetryInterval(val) 935 | 936 | def http_proxyservice_usehttps(entry, val): 937 | getHttpInboundProperties(entry).setUseHttps(val) 938 | 939 | def http_proxyservice_endpointuri(entry, val): 940 | changeEndpointUri(convertToTuple(val),entry) 941 | 942 | def http_proxyservice_requestencoding(entry, val): 943 | getHttpEndPointConfiguration(entry).setRequestEncoding(val) 944 | 945 | def http_proxyservice_responseencoding(entry, val): 946 | getHttpEndPointConfiguration(entry).setResponseEncoding(val) 947 | 948 | def http_proxyservice_dispatchpolicy(entry, val): 949 | getHttpEndPointConfiguration(entry).setDispatchPolicy(val) 950 | 951 | def http_proxyservice_isrequired(entry, val): 952 | getTransactions(entry).setIsRequired(val) 953 | 954 | def http_proxyservice_sametxforresponse(entry, val): 955 | getTransactions(entry).setSameTxForResponse(val) 956 | 957 | def http_proxyservice_policy(entry, val): 958 | policyExpression, provider=createPolicyExpression(val) 959 | setupPolicyExpression(entry, policyExpression, provider) 960 | 961 | def http_proxyservice_authentication(entry, val): 962 | return True 963 | 964 | def http_proxyservice_authentication_basicauthentication(entry, val): 965 | getHttpInboundProperties(entry).setClientAuthentication(HttpBasicAuthenticationType.Factory.newInstance()) 966 | 967 | def http_proxyservice_authentication_customtokenauthentication(entry, val): 968 | httpInboundProperties= getHttpInboundProperties(entry) 969 | customTokenAuthenticationType = CustomTokenAuthenticationType.Factory.newInstance() 970 | 971 | for v in val: 972 | if 'TokenType' in v: 973 | customTokenAuthenticationType.setTokenType(val[v]) 974 | elif 'HeaderName' in v: 975 | customTokenAuthenticationType.setHeaderName(val[v]) 976 | httpInboundProperties.setClientAuthentication(customTokenAuthenticationType) 977 | 978 | def http_proxyservice_authentication_sslclientauthentication(entry, val): 979 | getHttpInboundProperties(entry).setClientAuthentication(SSLClientAuthenticationType.Factory.newInstance()) 980 | 981 | def http_proxyservice_authentication_none(entry, val): 982 | getHttpInboundProperties(entry).setClientAuthentication(None) 983 | 984 | def http_proxyservice_security(entry, val): 985 | return True 986 | 987 | def http_proxyservice_security_customauthentication(entry, val): 988 | return True 989 | 990 | def http_proxyservice_security_customauthentication_contextproperties(entry, val): 991 | security=getSecurityFromServiceDefinition(entry) 992 | customTokenAuthentication=prepareCustomTokenAuthentication(security) 993 | 994 | userDefinedContext=customTokenAuthentication.getUserDefinedContext() 995 | if userDefinedContext!=None: 996 | customTokenAuthentication.unsetUserDefinedContext() 997 | userDefinedContext=customTokenAuthentication.addNewUserDefinedContext() 998 | 999 | for v in val: 1000 | property=userDefinedContext.addNewProperty() 1001 | property.setName(v) 1002 | valueSelector=property.addNewValueSelector() 1003 | valueSelector.setVariable('header') 1004 | valueSelector.setXpath(val[v]) 1005 | print ' --> set ContextProperty: ' + v 1006 | 1007 | def http_proxyservice_security_customauthentication_authenticationtype(entry, val): 1008 | return True 1009 | 1010 | def http_proxyservice_security_customauthentication_authenticationtype_none(entry, val): 1011 | return 'TODO: not implemented' 1012 | 1013 | def http_paroxyservice_security_customauthentication_authenticationtype_customusernameandpassword(entry, val): 1014 | security=getSecurityFromServiceDefinition(entry) 1015 | customTokenAuthentication=prepareCustomTokenAuthentication(security) 1016 | 1017 | usernamePassword=customTokenAuthentication.getUsernamePassword() 1018 | if usernamePassword==None: 1019 | usernamePassword=customTokenAuthentication.addNewUsernamePassword() 1020 | 1021 | passwordSelector=usernamePassword.getPasswordSelector() 1022 | if passwordSelector==None: 1023 | passwordSelector=usernamePassword.addNewPasswordSelector() 1024 | 1025 | usernameSelector=usernamePassword.getUsernameSelector() 1026 | if usernameSelector==None: 1027 | usernameSelector=usernamePassword.addNewUsernameSelector() 1028 | 1029 | usernameSelector.setVariable('header') 1030 | usernameSelector.setXpath(val['UsernameXpath']) 1031 | 1032 | passwordSelector.setVariable('header') 1033 | passwordSelector.setXpath(val['PasswordXpath']) 1034 | 1035 | def http_proxyservice_security_customauthentication_authenticationtype_customtoken(entry, val): 1036 | security=getSecurityFromServiceDefinition(entry) 1037 | customTokenAuthentication=prepareCustomTokenAuthentication(security) 1038 | 1039 | customToken=customTokenAuthentication.getCustomToken() 1040 | if customToken==None: 1041 | customToken=customTokenAuthentication.addNewCustomToken() 1042 | 1043 | tokenSelector=customToken.getTokenSelector() 1044 | if tokenSelector==None: 1045 | customToken.setTokenSelector(XPathSelectorType.Factory.newInstance()) 1046 | tokenSelector=customToken.getTokenSelector() 1047 | 1048 | tokenSelector.setVariable('header') 1049 | tokenSelector.setXpath(val['Xpath']) 1050 | 1051 | def http_proxyservice_security_customauthentication_authenticationtype_customusernameandpassword(entry, val): 1052 | security=getSecurityFromServiceDefinition(entry) 1053 | customTokenAuthentication=prepareCustomTokenAuthentication(security) 1054 | #customTokenAuthentication.unsetCustomToken() 1055 | 1056 | usernamePassword=customTokenAuthentication.getUsernamePassword() 1057 | if usernamePassword==None: 1058 | usernamePassword=customTokenAuthentication.addNewUsernamePassword() 1059 | 1060 | passwordSelector=usernamePassword.getPasswordSelector() 1061 | if passwordSelector==None: 1062 | passwordSelector=usernamePassword.addNewPasswordSelector() 1063 | 1064 | usernameSelector=usernamePassword.getUsernameSelector() 1065 | if usernameSelector==None: 1066 | usernameSelector=usernamePassword.addNewUsernameSelector() 1067 | 1068 | usernameSelector.setVariable('header') 1069 | usernameSelector.setXpath(val['UsernameXpath']) 1070 | 1071 | passwordSelector.setVariable('header') 1072 | passwordSelector.setXpath(val['PasswordXpath']) 1073 | 1074 | 1075 | #=================================================================== 1076 | # Customize: Proxy Service: Transport Type: JMS 1077 | #=================================================================== 1078 | 1079 | def jms_proxyservice_retrycount(entry, val): 1080 | getJmsInboundProperties(entry).setRetryCount(val) 1081 | 1082 | def jms_proxyservice_endpointuri(entry, val): 1083 | changeEndpointUri(convertToTuple(val),entry) 1084 | 1085 | def jms_proxyservice_dispatchpolicy(entry, val): 1086 | getJmsEndPointConfiguration(entry).setDispatchPolicy(val) 1087 | 1088 | def jms_proxyservice_requestencoding(entry, val): 1089 | getJmsEndPointConfiguration(entry).setRequestEncoding(val) 1090 | 1091 | def jms_proxyservice_jnditimeout(entry, val): 1092 | getJmsEndPointConfiguration(entry).setJndiTimeout(val) 1093 | 1094 | def jms_proxyservice_usessl(entry, val): 1095 | getJmsEndPointConfiguration(entry).setIsSecure(val) 1096 | 1097 | def jms_proxyservice_isxarequired(entry, val): 1098 | getJmsInboundProperties(entry).setXARequired(val) 1099 | 1100 | def jms_proxyservice_errordestination(entry, val): 1101 | getJmsInboundProperties(entry).setErrorDestination(val) 1102 | 1103 | def jms_proxyservice_messageselector(entry, val): 1104 | getJmsInboundProperties(entry).setMessageSelector(val) 1105 | 1106 | def jms_proxyservice_retryinterval(entry, val): 1107 | getJmsInboundProperties(entry).setRetryInterval(val) 1108 | 1109 | def jms_proxyservice_isresponserequired(entry, val): 1110 | getJmsInboundProperties(entry).setResponseRequired(val) 1111 | 1112 | def jms_proxyservice_isrequired(entry, val): 1113 | getTransactions(entry).setIsRequired(val) 1114 | 1115 | def jms_proxyservice_sametxforresponse(entry, val): 1116 | getTransactions(entry).setSameTxForResponse(val) 1117 | 1118 | def jms_proxyservice_destinationtypequeue(entry, val): 1119 | lookupCustomizationFunction(sys._getframe().f_code.co_name, val, entry) 1120 | 1121 | def jms_proxyservice_destinationtypequeue_responsepattern(entry, val): 1122 | if val == 'JMS_CORRELATION_ID': 1123 | getJmsInboundProperties(entry).setResponsePattern(JmsResponsePatternEnum.JMS_CORRELATION_ID) 1124 | else: 1125 | getJmsInboundProperties(entry).setResponsePattern(JmsResponsePatternEnum.JMS_MESSAGE_ID) 1126 | 1127 | def jms_proxyservice_destinationtypequeue_responseuri(entry, val): 1128 | getJmsInboundProperties(entry).setResponseURI(val) 1129 | 1130 | def jms_proxyservice_destinationtypequeue_responseencoding(entry, val): 1131 | getJmsEndPointConfiguration(entry).setResponseEncoding(val) 1132 | 1133 | def jms_proxyservice_destinationtypequeue_responsemessagetype(entry, val): 1134 | if val == 'BYTES': 1135 | getJmsInboundProperties(entry).setResponseMessageType(JmsMessageTypeEnum.BYTES) 1136 | else: 1137 | getJmsInboundProperties(entry).setResponseMessageType(JmsMessageTypeEnum.TEXT) 1138 | 1139 | def jms_proxyservice_description(entry, val): 1140 | entry.getCoreEntry().setDescription(val) 1141 | 1142 | def jms_proxyservice_monitoring(entry, val): 1143 | return True 1144 | 1145 | def jms_proxyservice_logging(entry, val): 1146 | return True 1147 | 1148 | def jms_proxyservice_slaalerting(entry, val): 1149 | return True 1150 | 1151 | def jms_proxyservice_pipelinealerting(entry, val): 1152 | return True 1153 | 1154 | def jms_proxyservice_wspolicy(entry, val): 1155 | return True 1156 | 1157 | def jms_proxyservice_wspolicy_bindingmode(entry, val): 1158 | local_proxyservice_wspolicy_bindingmode(entry, val) 1159 | 1160 | def jms_proxyservice_wspolicy_policies(entry, values): 1161 | local_proxyservice_wspolicy_policies(entry, values) 1162 | 1163 | def jms_proxyservice_monitoring_isenabled(entry, val): 1164 | local_proxyservice_monitoring_isenabled(entry, val) 1165 | 1166 | def jms_proxyservice_monitoring_aggregationinterval(entry, val): 1167 | local_proxyservice_monitoring_aggregationinterval(entry, val) 1168 | 1169 | def jms_proxyservice_monitoring_pipelinemonitoringlevel(entry, val): 1170 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 1171 | 1172 | def jms_proxyservice_reporting(entry, val): 1173 | local_proxyservice_reporting(entry, val) 1174 | 1175 | def jms_proxyservice_logging_isenabled(entry, val): 1176 | local_proxyservice_logging_isenabled(entry, val) 1177 | 1178 | def jms_proxyservice_logging_loglevel(entry, val): 1179 | local_proxyservice_logging_loglevel(entry, val) 1180 | 1181 | def jms_proxyservice_slaalerting_isenabled(entry, val): 1182 | local_proxyservice_slaalerting_isenabled(entry, val) 1183 | 1184 | def jms_proxyservice_slaalerting_alertlevel(entry, val): 1185 | local_proxyservice_slaalerting_alertlevel(entry, val) 1186 | 1187 | def jms_proxyservice_pipelinealerting_isenabled(entry, val): 1188 | local_proxyservice_pipelinealerting_isenabled(entry, val) 1189 | 1190 | def jms_proxyservice_pipelinealerting_alertlevel(entry, val): 1191 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 1192 | 1193 | def jms_proxyservice_policy(entry, val): 1194 | policyExpression, provider=createPolicyExpression(val) 1195 | setupPolicyExpression(entry, policyExpression, provider) 1196 | 1197 | #=================================================================== 1198 | # Customize: BusinessService: Transport Type: HTTP 1199 | #=================================================================== 1200 | 1201 | def http_businessservice_description(entry, val): 1202 | entry.getCoreEntry().setDescription(val) 1203 | 1204 | def http_businessservice_monitoring(entry, val): 1205 | return True 1206 | 1207 | def http_businessservice_logging(entry, val): 1208 | return True 1209 | 1210 | def http_businessservice_slaalerting(entry, val): 1211 | return True 1212 | 1213 | def http_businessservice_pipelinealerting(entry, val): 1214 | return True 1215 | 1216 | def http_businessservice_wspolicy(entry, val): 1217 | return True 1218 | 1219 | def http_businessservice_wspolicy_bindingmode(entry, val): 1220 | local_proxyservice_wspolicy_bindingmode(entry, val) 1221 | 1222 | def http_businessservice_wspolicy_policies(entry, values): 1223 | local_proxyservice_wspolicy_policies(entry, values) 1224 | 1225 | def http_businessservice_throttling(entry, val): 1226 | return True 1227 | 1228 | def http_businessservice_throttling_enabled(entry, val): 1229 | getThrottling(entry).setEnabled(val) 1230 | 1231 | def http_businessservice_throttling_capacity(entry, val): 1232 | getThrottling(entry).setCapacity(val) 1233 | 1234 | def http_businessservice_throttling_maxqueuelength(entry, val): 1235 | getThrottling(entry).setMaxQueueLength(val) 1236 | 1237 | def http_businessservice_throttling_timetolive(entry, val): 1238 | getThrottling(entry).setTimeToLive(val) 1239 | 1240 | def http_businessservice_monitoring_isenabled(entry, val): 1241 | local_proxyservice_monitoring_isenabled(entry, val) 1242 | 1243 | def http_businessservice_monitoring_aggregationinterval(entry, val): 1244 | local_proxyservice_monitoring_aggregationinterval(entry, val) 1245 | 1246 | def http_businessservice_monitoring_pipelinemonitoringlevel(entry, val): 1247 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 1248 | 1249 | def http_businessservice_reporting(entry, val): 1250 | local_proxyservice_reporting(entry, val) 1251 | 1252 | def http_businessservice_logging_isenabled(entry, val): 1253 | local_proxyservice_logging_isenabled(entry, val) 1254 | 1255 | def http_businessservice_logging_loglevel(entry, val): 1256 | local_proxyservice_logging_loglevel(entry, val) 1257 | 1258 | def http_businessservice_slaalerting_isenabled(entry, val): 1259 | local_proxyservice_slaalerting_isenabled(entry, val) 1260 | 1261 | def http_businessservice_slaalerting_alertlevel(entry, val): 1262 | local_proxyservice_slaalerting_alertlevel(entry, val) 1263 | 1264 | def http_businessservice_pipelinealerting_isenabled(entry, val): 1265 | local_proxyservice_pipelinealerting_isenabled(entry, val) 1266 | 1267 | def http_businessservice_pipelinealerting_alertlevel(entry, val): 1268 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 1269 | 1270 | 1271 | def http_businessservice_endpointuri(entry, val): 1272 | changeEndpointUri(convertToTuple(val),entry) 1273 | 1274 | def http_businessservice_readtimeout(entry, val): 1275 | getHttpOutboundProperties(entry).setTimeout(val) 1276 | 1277 | def http_businessservice_requestencoding(entry, val): 1278 | getHttpEndPointConfiguration(entry).setRequestEncoding(val) 1279 | 1280 | def http_businessservice_responseencoding(entry, val): 1281 | getHttpEndPointConfiguration(entry).setResponseEncoding(val) 1282 | 1283 | def http_businessservice_dispatchpolicy(entry, val): 1284 | getHttpEndPointConfiguration(entry).setDispatchPolicy(val) 1285 | 1286 | def http_businessservice_connectiontimeout(entry, val): 1287 | getHttpOutboundProperties(entry).setConnectionTimeout(val) 1288 | 1289 | def http_businessservice_requestmethod(entry, val): 1290 | getHttpOutboundProperties(entry).setRequestMethod(HttpRequestMethodEnum.Enum.forString(val)) 1291 | 1292 | def http_businessservice_followredirects(entry, val): 1293 | getHttpOutboundProperties(entry).setFollowRedirects(val) 1294 | 1295 | def http_businessservice_chunkedstreamingmode(entry, val): 1296 | getHttpOutboundProperties(entry).setChunkedStreamingMode(val) 1297 | 1298 | def http_businessservice_sessionsctikiness(entry, val): 1299 | if getHttpOutboundProperties(entry).getSessionSctikiness() == None: 1300 | getHttpOutboundProperties(entry).addNewSessionSctikiness() 1301 | getHttpOutboundProperties(entry).getSessionSctikiness().changeType(SessionStickinessType.type) 1302 | 1303 | getHttpOutboundProperties(entry).getSessionSctikiness().setEnabled(val) 1304 | # assumed to always be JSESSIONID 1305 | getHttpOutboundProperties(entry).getSessionSctikiness().setSessionIdName('JSESSIONID') 1306 | 1307 | def http_businessservice_providerid(entry, val): 1308 | endPointConfiguration=entry.getEndpointConfig() 1309 | if val.lower() == 'sb' and endPointConfiguration.getProviderId() != 'sb': 1310 | # change from http to sb as requested 1311 | endPointConfiguration.setProviderId('sb') 1312 | endPointConfiguration.unsetProviderSpecific() 1313 | providerSpec = endPointConfiguration.addNewProviderSpecific() 1314 | providerSpec = providerSpec.changeType(SBEndPointConfiguration.type) 1315 | providerSpec.addNewOutboundProperties() 1316 | 1317 | # set some defaults 1318 | sb_businessservice_timeout(entry, 15) 1319 | sb_businessservice_retryinterval(entry, 30) 1320 | else: 1321 | # not supported 1322 | return True 1323 | 1324 | 1325 | #=================================================================== 1326 | # Customize: Alert Destination 1327 | #=================================================================== 1328 | 1329 | def alertdestination_alertdestination_description(entry, val): 1330 | entry.setDescription(val) 1331 | 1332 | def alertdestination_alertdestination_alertlogging(entry, val): 1333 | entry.setAlertToConsole(val) 1334 | 1335 | def alertdestination_alertdestination_reporting(entry, val): 1336 | entry.setAlertToReportingDataSet(val) 1337 | 1338 | def alertdestination_alertdestination_snmptrap(entry, val): 1339 | entry.setAlertToSNMP(val) 1340 | 1341 | #=================================================================== 1342 | # Cutomize: Service Provider 1343 | #=================================================================== 1344 | 1345 | def serviceprovider_serviceprovider_description(entry, val): 1346 | entry.setDescription(val) 1347 | 1348 | def serviceprovider_serviceprovider_ssl(entry, val): 1349 | return True 1350 | 1351 | def serviceprovider_serviceprovider_encryption(entry, val): 1352 | return True 1353 | 1354 | def serviceprovider_serviceprovider_digitalsignature(entry, val): 1355 | return True 1356 | 1357 | def serviceprovider_serviceprovider_ssl_alias(entry, val): 1358 | serviceprovider_serviceprovider_by_prupose(entry, val, 'SSL', 'Alias') 1359 | 1360 | def serviceprovider_serviceprovider_ssl_password(entry, val): 1361 | serviceprovider_serviceprovider_by_prupose(entry, val, 'SSL', 'Password') 1362 | 1363 | def serviceprovider_serviceprovider_encryption_alias(entry, val): 1364 | serviceprovider_serviceprovider_by_prupose(entry, val, 'Encryption', 'Alias') 1365 | 1366 | def serviceprovider_serviceprovider_encryption_password(entry, val): 1367 | serviceprovider_serviceprovider_by_prupose(entry, val, 'Encryption', 'Password') 1368 | 1369 | def serviceprovider_serviceprovider_digitalsignature_alias(entry, val): 1370 | serviceprovider_serviceprovider_by_prupose(entry, val, 'DigitalSignature', 'Password') 1371 | 1372 | def serviceprovider_serviceprovider_digitalsignature_password(entry, val): 1373 | serviceprovider_serviceprovider_by_prupose(entry, val, 'DigitalSignature', 'Password') 1374 | 1375 | def serviceprovider_serviceprovider_by_prupose(entry, val, prupose, attr): 1376 | keyPair=findKeyPairForServiceProvider(entry,prupose) 1377 | if keyPair !=None: 1378 | if 'Password' in attr: 1379 | keyPair.setPassword(val) 1380 | elif 'Alias' in attr: 1381 | keyPair.setAlias(val) 1382 | else: 1383 | print LOG_CUST_FILE+ 'Warning: '+val+' property is not supported' 1384 | 1385 | #=================================================================== 1386 | # Customize: MQConnection 1387 | #=================================================================== 1388 | 1389 | def mqconnection_mqconnection_xaenabled(entry, val): 1390 | entry.setMqXaEnabled(val) 1391 | 1392 | def mqconnection_mqconnection_mqconnectionmaxwait(entry, val): 1393 | entry.setMqConnMaxWait(val) 1394 | 1395 | def mqconnection_mqconnection_mqconnectionpoolsize(entry, val): 1396 | entry.setMqConnPoolSize(val) 1397 | 1398 | def mqconnection_mqconnection_mqconnectiontimeout(entry, val): 1399 | entry.setMqConnTimeout(val) 1400 | 1401 | def mqconnection_mqconnection_mqversion(entry, val): 1402 | entry.setMqVersion(val) 1403 | 1404 | #=================================================================== 1405 | # Customize: MQConnection - Connection Type:BindingsMode 1406 | #=================================================================== 1407 | 1408 | def mqconnection_mqconnection_bindingmode(entry, val): 1409 | return True 1410 | 1411 | def mqconnection_mqconnection_bindingmode_mqqueuemanagername(entry, val): 1412 | entry.getBindingsMode().setQueueManagerName(val) 1413 | 1414 | def mqconnection_mqconnection_tcpmode(entry, val): 1415 | return True 1416 | 1417 | #=================================================================== 1418 | # Customize: MQConnection - Connection Type:TcpMode 1419 | #=================================================================== 1420 | 1421 | def mqconnection_mqconnection_tcpmode_mqqueuemanagername(entry, val): 1422 | entry.getTcpMode().setQueueManagerName(val) 1423 | 1424 | def mqconnection_mqconnection_tcpmode_mqqueuemanagerchannelname(entry, val): 1425 | entry.getTcpMode().setQueueManagerChannelName(val) 1426 | 1427 | def mqconnection_mqconnection_tcpmode_mqportnumber(entry, val): 1428 | entry.getTcpMode().setPort(val) 1429 | 1430 | def mqconnection_mqconnection_tcpmode_mqhostname(entry, val): 1431 | entry.getTcpMode().setHost(val) 1432 | 1433 | def mqconnection_mqconnection_tcpmode_queuemanagerccsid(entry, val): 1434 | entry.getTcpMode().setQueueManagerCcsid(val) 1435 | 1436 | #=================================================================== 1437 | # Customize: BusinessService: Transport Type: MQ 1438 | #=================================================================== 1439 | 1440 | def mq_businessservice_endpointuri(entry, val): 1441 | changeEndpointUri(convertToTuple(val),entry) 1442 | 1443 | def mq_businessservice_retrycount(entry, val): 1444 | getCommonOutboundProperties(entry).setRetryCount(val) 1445 | 1446 | def mq_businessservice_retryinterval(entry, val): 1447 | getCommonOutboundProperties(entry).setRetryInterval(val) 1448 | 1449 | def mq_businessservice_messagetype(entry, val): 1450 | if 'Bytes' ==val: 1451 | getMqOutboundProperties(entry).setMessageType(MQMessageTypeEnum.BYTES) 1452 | elif 'Text' ==val: 1453 | getMqOutboundProperties(entry).setMessageType(MQMessageTypeEnum.TEXT) 1454 | else: 1455 | print LOG_CUST_FILE+ 'Warning: '+val+' property is not supported for message type' 1456 | 1457 | 1458 | def mq_businessservice_responsetimeout(entry, val): 1459 | getMqOutboundProperties(entry).setResponseTimeout(val) 1460 | 1461 | def mq_businessservice_autogeneratecorrelationvalue(entry, val): 1462 | getMqOutboundProperties(entry).setAutoGenCorrelationValue(val) 1463 | 1464 | def mq_businessservice_mqresponseuri(entry,val): 1465 | getMqOutboundProperties(entry).setResponseURI(val) 1466 | 1467 | def mq_businessservice_pollinginterval(entry, val): 1468 | getMqOutboundProperties(entry).setPollingInterval(val) 1469 | 1470 | def mq_businessservice_processrfh2headers(entry, val): 1471 | getMqOutboundProperties(entry).setProcessRfh2(val) 1472 | 1473 | 1474 | #=================================================================== 1475 | # Customize: ProxyService: Transport Type: MQ 1476 | #=================================================================== 1477 | 1478 | def mq_proxyservice_endpointuri(entry, val): 1479 | changeEndpointUri(convertToTuple(val),entry) 1480 | 1481 | def mq_proxyservice_mqresponseuri(entry, val): 1482 | inboundProperties, mqInboundProperties=getMqInboundProperties(entry) 1483 | mqInboundProperties.setResponseURI(val) 1484 | inboundProperties.set(mqInboundProperties) 1485 | 1486 | def mq_proxyservice_responsemessagetype(entry, val): 1487 | inboundProperties, mqInboundProperties=getMqInboundProperties(entry) 1488 | if 'Bytes' ==val: 1489 | mqInboundProperties.setResponseMessageType(MQMessageTypeEnum.BYTES) 1490 | elif 'Text' ==val: 1491 | mqInboundProperties.setResponseMessageType(MQMessageTypeEnum.TEXT) 1492 | print LOG_CUST_FILE+ 'Warning: '+val+' property is not supported for message type' 1493 | inboundProperties.set(mqInboundProperties) 1494 | 1495 | def mq_proxyservice_retrycount(entry, val): 1496 | inboundProperties, mqInboundProperties=getMqInboundProperties(entry) 1497 | mqInboundProperties.setRetryCount(val) 1498 | inboundProperties.set(mqInboundProperties) 1499 | 1500 | def mq_proxyservice_pollinginterval(entry, val): 1501 | inboundProperties, mqInboundProperties=getMqInboundProperties(entry) 1502 | mqInboundProperties.setPollingInterval(val) 1503 | inboundProperties.set(mqInboundProperties) 1504 | 1505 | #=================================================================== 1506 | # Customize: ProxyService: Transport Type: FTP 1507 | #=================================================================== 1508 | 1509 | def ftp_proxyservice_endpointuri(entry, val): 1510 | changeEndpointUri(convertToTuple(val),entry) 1511 | 1512 | def ftp_proxyservice_readlimit(entry, val): 1513 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1514 | ftpInboundProperties.setReadLimit(val) 1515 | inboundProperties.set(ftpInboundProperties) 1516 | 1517 | def ftp_proxyservice_directstreaming(entry, val): 1518 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1519 | ftpInboundProperties.setDirectStreaming(val) 1520 | inboundProperties.set(ftpInboundProperties) 1521 | 1522 | def ftp_proxyservice_timeout(entry,val): 1523 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1524 | ftpInboundProperties.setTimeout(val) 1525 | inboundProperties.set(ftpInboundProperties) 1526 | 1527 | def getFtpInboundProperties(serviceDefinition): 1528 | FtpEndPointConfiguration=serviceDefinition.getEndpointConfig().getProviderSpecific() 1529 | inboundProperties=FtpEndPointConfiguration.selectChildren(QName("http://www.bea.com/wli/sb/transports/ftp", "inbound-properties"))[0] 1530 | ftpInboundProperties = FtpInboundPropertiesType.Factory.parse(inboundProperties.toString()) 1531 | return inboundProperties, ftpInboundProperties 1532 | 1533 | def ftp_proxyservice_recursivescan(entry, val): 1534 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1535 | ftpInboundProperties.setRecursiveScan(val) 1536 | inboundProperties.set(ftpInboundProperties) 1537 | 1538 | def ftp_proxyservice_downloaddirectory(entry, val): 1539 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1540 | filePath=FilePathType.Factory.newInstance() 1541 | filePath.setValue(val) 1542 | ftpInboundProperties.setDownloadDirectory(filePath) 1543 | inboundProperties.set(ftpInboundProperties) 1544 | 1545 | def ftp_proxyservice_pollinginterval(entry, val): 1546 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1547 | pollInfo=FilePollInfo.Factory.newInstance() 1548 | pollInfo.setIntervalMilliseconds(val) 1549 | ftpInboundProperties.setPollInfo(pollInfo) 1550 | inboundProperties.set(ftpInboundProperties) 1551 | 1552 | def ftp_proxyservice_passbyreference(entry, val): 1553 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1554 | ftpInboundProperties.setDirectStreaming(val) 1555 | inboundProperties.set(ftpInboundProperties) 1556 | 1557 | def ftp_proxyservice_filemask(entry, val): 1558 | inboundProperties, ftpInboundProperties=getFtpInboundProperties(entry) 1559 | ftpInboundProperties.setFileMask(val) 1560 | inboundProperties.set(ftpInboundProperties) 1561 | 1562 | #=================================================================== 1563 | # Customize: BusinessService: Transport Type: FTP 1564 | #=================================================================== 1565 | 1566 | def ftp_businessservice_endpointuri(entry, val): 1567 | changeEndpointUri(convertToTuple(val),entry) 1568 | 1569 | def ftp_businessservice_timeout(entry, val): 1570 | getFtpOutboundProperties(entry).setTimeout(val) 1571 | 1572 | def ftp_businessservice_prefix(entry, val): 1573 | getFtpPrefixSufix(getFtpOutboundProperties(entry)).setPrefix(val) 1574 | 1575 | def ftp_businessservice_suffix(entry, val): 1576 | getFtpPrefixSufix(getFtpOutboundProperties(entry)).setSuffix(val) 1577 | 1578 | def ftp_businessservice_retrycount(entry, val): 1579 | getCommonOutboundProperties(entry).setRetryCount(val) 1580 | 1581 | def ftp_businessservice_retryinterval(entry, val): 1582 | getCommonOutboundProperties(entry).setRetryInterval(val) 1583 | 1584 | 1585 | def file_proxyservice_endpointuri(entry, val): 1586 | changeEndpointUri(convertToTuple(val),entry) 1587 | 1588 | def file_proxyservice_sortbyarrival(entry, val): 1589 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1590 | fileInBoundProperties.setSortByArrival(val) 1591 | inboundProperties.set(fileInBoundProperties) 1592 | 1593 | def file_proxyservice_readlimit(entry, val): 1594 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1595 | fileInBoundProperties.setReadLimit(val) 1596 | inboundProperties.set(fileInBoundProperties) 1597 | 1598 | def file_proxyservice_stagedir(entry, val): 1599 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1600 | if fileInBoundProperties.getStageDir()==None: 1601 | fileInBoundProperties.addNewStageDir() 1602 | fileInBoundProperties.getStageDir().setValue(val) 1603 | inboundProperties.set(fileInBoundProperties) 1604 | 1605 | def file_proxyservice_scansubdirectories(entry, val): 1606 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1607 | fileInBoundProperties.setScanSubDirectories(val) 1608 | inboundProperties.set(fileInBoundProperties) 1609 | 1610 | def file_proxyservice_archivedir(entry, val): 1611 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1612 | if fileInBoundProperties.getArchiveDir()==None: 1613 | fileInBoundProperties.addNewArchiveDir() 1614 | fileInBoundProperties.getArchiveDir().setValue(val) 1615 | inboundProperties.set(fileInBoundProperties) 1616 | 1617 | def file_proxyservice_errordir(entry, val): 1618 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1619 | if fileInBoundProperties.getErrorDir()==None: 1620 | fileInBoundProperties.addNewErrorDir() 1621 | fileInBoundProperties.getErrorDir().setValue(val) 1622 | inboundProperties.set(fileInBoundProperties) 1623 | 1624 | def file_proxyservice_pollinginterval(entry, val): 1625 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1626 | fileInBoundProperties.setPollingInterval(val) 1627 | inboundProperties.set(fileInBoundProperties) 1628 | 1629 | def file_proxyservice_filemask(entry, val): 1630 | inboundProperties, fileInBoundProperties=getFileInboundProperties(entry) 1631 | fileInBoundProperties.setFileMask(val) 1632 | inboundProperties.set(fileInBoundProperties) 1633 | 1634 | #=================================================================== 1635 | # Customize: BusinessService: Transport Type: FTP 1636 | #=================================================================== 1637 | 1638 | def file_businessservice_endpointuri(entry, val): 1639 | changeEndpointUri(convertToTuple(val),entry) 1640 | 1641 | def file_businessservice_suffix(entry, val): 1642 | getFileOutboundProperties(entry).setSuffix(val) 1643 | 1644 | def file_businessservice_prefix(entry, val): 1645 | getFileOutboundProperties(entry).setPrefix(val) 1646 | 1647 | def file_businessservice_retrycount(entry, val): 1648 | getCommonOutboundProperties(entry).setRetryCount(val) 1649 | 1650 | def file_businessservice_retryinterval(entry, val): 1651 | getCommonOutboundProperties(entry).setRetryInterval(val) 1652 | 1653 | #=================================================================== 1654 | # Customize: ProxyService: Transport Type: SFTP 1655 | #=================================================================== 1656 | 1657 | def sftp_proxyservice_endpointuri(entry, val): 1658 | changeEndpointUri(convertToTuple(val),entry) 1659 | 1660 | def sftp_proxyservice_retrycount(entry, val): 1661 | getSftpInboundProperties(entry).setRetryCount(val) 1662 | def sftp_proxyservice_sortbyarrival(entry, val): 1663 | getSftpInboundProperties(entry).setSortByArrival(val) 1664 | 1665 | def sftp_proxyservice_readlimit(entry, val): 1666 | getSftpInboundProperties(entry).setReadLimit(val) 1667 | 1668 | def sftp_proxyservice_directstreaming(entry, val): 1669 | getSftpInboundProperties(entry).setDirectStreaming(val) 1670 | 1671 | def sftp_proxyservice_archivedir(entry, val): 1672 | if getSftpInboundProperties(entry).getArchiveDirectory()==None: 1673 | getSftpInboundProperties(entry).addNewArchiveDirectory() 1674 | getSftpInboundProperties(entry).getArchiveDirectory().setValue(val) 1675 | 1676 | def sftp_proxyservice_timeout(entry, val): 1677 | getSftpInboundProperties(entry).setTimeout(val) 1678 | 1679 | def sftp_proxyservice_errordir(entry, val): 1680 | if getSftpInboundProperties(entry).getErrorDirectory()==None: 1681 | getSftpInboundProperties(entry).addNewErrorDirectory() 1682 | getSftpInboundProperties(entry).getErrorDirectory().setValue(val) 1683 | 1684 | def sftp_proxyservice_recursivescan(entry, val): 1685 | getSftpInboundProperties(entry).setRecursiveScan(val) 1686 | 1687 | def sftp_proxyservice_pollinginterval(entry, val): 1688 | if getSftpInboundProperties(entry).getPollInfo()==None: 1689 | getSftpInboundProperties(entry).addNewPollInfo() 1690 | getSftpInboundProperties(entry).getPollInfo().setIntervalMilliseconds(val) 1691 | 1692 | def sftp_proxyservice_filemask(entry , val): 1693 | getSftpInboundProperties(entry).setFileMask(val) 1694 | 1695 | def sftp_proxyservice_downloaddir(entry , val): 1696 | if getSftpInboundProperties(entry).getDownloadDirectory()==None: 1697 | getSftpInboundProperties(entry).addNewDownloadDirectory() 1698 | getSftpInboundProperties(entry).getDownloadDirectory().setValue(val) 1699 | 1700 | #=================================================================== 1701 | # Customize: BusinessService: Transport Type: SFTP 1702 | #=================================================================== 1703 | 1704 | def sftp_businessservice_endpointuri(entry, val): 1705 | changeEndpointUri(convertToTuple(val),entry) 1706 | 1707 | def sftp_businessservice_prefix(entry, val): 1708 | getFtpPrefixSufix(getSftpOutboundProperties(entry)).setPrefix(val) 1709 | 1710 | def sftp_businessservice_suffix(entry, val): 1711 | getFtpPrefixSufix(getSftpOutboundProperties(entry)).setSuffix(val) 1712 | 1713 | def sftp_businessservice_retrycount(entry, val): 1714 | getCommonOutboundProperties(entry).setRetryCount(val) 1715 | 1716 | def sftp_businessservice_retryinterval(entry, val): 1717 | getCommonOutboundProperties(entry).setRetryInterval(val) 1718 | 1719 | #=================================================================== 1720 | # Customize: ProxyService: Transport Type: EMAIL 1721 | #=================================================================== 1722 | 1723 | def email_proxyservice_endpointuri(entry, val): 1724 | changeEndpointUri(convertToTuple(val),entry) 1725 | 1726 | def email_proxyservice_ssluse(entry, val): 1727 | getEmailEndPointConfiguration(entry).setUseSsl(val) 1728 | 1729 | def email_proxyservice_readlimit(entry, val): 1730 | getEmailInboundProperties(entry).setReadLimit(val) 1731 | 1732 | def email_proxyservice_passbyreference(entry, val): 1733 | getEmailInboundProperties(entry).setPassByReference(val) 1734 | 1735 | def email_proxyservice_pollinginterval(entry, val): 1736 | getEmailInboundProperties(entry).setPollingInterval(val) 1737 | 1738 | def email_proxyservice_imapmovefolder(entry, val): 1739 | getEmailInboundProperties(entry).setImapMoveFolder(val) 1740 | 1741 | def email_proxyservice_archivedir(entry, val): 1742 | if getEmailInboundProperties(entry).getArchiveDirectory()==None: 1743 | getEmailInboundProperties(entry).addNewArchiveDirectory() 1744 | getEmailInboundProperties(entry).getArchiveDirectory().setValue(val) 1745 | 1746 | def email_proxyservice_errordir(entry, val): 1747 | if getEmailInboundProperties(entry).getErrorDirectory()==None: 1748 | getEmailInboundProperties(entry).addNewErrorDirectory() 1749 | getEmailInboundProperties(entry).getErrorDirectory().setValue(val) 1750 | 1751 | def email_proxyservice_downloaddir(entry, val): 1752 | if getEmailInboundProperties(entry).getDownloadDirectory()==None: 1753 | getEmailInboundProperties(entry).addNewDownloadDirectory() 1754 | getEmailInboundProperties(entry).getDownloadDirectory().setValue(val) 1755 | 1756 | #=================================================================== 1757 | # Customize: BusinessService: Transport Type: EMAIL 1758 | #=================================================================== 1759 | 1760 | def email_businessservice_endpointuri(entry, val): 1761 | changeEndpointUri(convertToTuple(val),entry) 1762 | 1763 | def email_businessservice_ssluse(entry, val): 1764 | getEmailEndPointConfiguration(entry).setUseSsl(val) 1765 | 1766 | def email_businessservice_retrycount(entry, val): 1767 | getCommonOutboundProperties(entry).setRetryCount(val) 1768 | 1769 | def email_businessservice_retryinterval(entry, val): 1770 | getCommonOutboundProperties(entry).setRetryInterval(val) 1771 | 1772 | def email_businessservice_connectiontimeout(entry, val): 1773 | getEmailOutboundProperties(entry).setConnectionTimeout(val) 1774 | 1775 | def email_businessservice_fromaddress(entry, val): 1776 | getEmailOutboundProperties(entry).setFromAddress(val) 1777 | 1778 | def email_businessservice_fromname(entry, val): 1779 | getEmailOutboundProperties(entry).setFromName(val) 1780 | 1781 | def email_businessservice_replytoaddress(entry, val): 1782 | getEmailOutboundProperties(entry).setReplyToAddress(val) 1783 | 1784 | def email_businessservice_replyname(entry, val): 1785 | getEmailOutboundProperties(entry).setReplyToName(val) 1786 | 1787 | def email_businessservice_sockettimeout(entry, val): 1788 | getEmailOutboundProperties(entry).setTimeout(val) 1789 | 1790 | 1791 | #=================================================================== 1792 | # Customize: ProxyService: Transport Type: SB 1793 | #=================================================================== 1794 | 1795 | def sb_proxyservice_description(entry, val): 1796 | local_proxyservice_description(entry, val) 1797 | 1798 | def sb_proxyservice_monitoring(entry, val): 1799 | return True 1800 | 1801 | def sb_proxyservice_logging(entry, val): 1802 | return True 1803 | 1804 | def sb_proxyservice_slaalerting(entry, val): 1805 | return True 1806 | 1807 | def sb_proxyservice_pipelinealerting(entry, val): 1808 | return True 1809 | 1810 | def sb_proxyservice_wspolicy(entry, val): 1811 | return True 1812 | 1813 | def sb_proxyservice_wspolicy_bindingmode(entry, val): 1814 | local_proxyservice_wspolicy_bindingmode(entry, val) 1815 | 1816 | def sb_proxyservice_wspolicy_policies(entry, values): 1817 | local_proxyservice_wspolicy_policies(entry, values) 1818 | 1819 | def sb_proxyservice_monitoring_isenabled(entry, val): 1820 | local_proxyservice_monitoring_isenabled(entry, val) 1821 | 1822 | def sb_proxyservice_monitoring_aggregationinterval(entry, val): 1823 | local_proxyservice_monitoring_aggregationinterval(entry, val) 1824 | 1825 | def sb_proxyservice_monitoring_pipelinemonitoringlevel(entry, val): 1826 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 1827 | 1828 | def sb_proxyservice_reporting(entry, val): 1829 | local_proxyservice_reporting(entry, val) 1830 | 1831 | def sb_proxyservice_logging_isenabled(entry, val): 1832 | local_proxyservice_logging_isenabled(entry, val) 1833 | 1834 | def sb_proxyservice_logging_loglevel(entry, val): 1835 | local_proxyservice_logging_loglevel(entry, val) 1836 | 1837 | def sb_proxyservice_slaalerting_isenabled(entry, val): 1838 | local_proxyservice_slaalerting_isenabled(entry, val) 1839 | 1840 | def sb_proxyservice_slaalerting_alertlevel(entry, val): 1841 | local_proxyservice_slaalerting_alertlevel(entry, val) 1842 | 1843 | def sb_proxyservice_pipelinealerting_isenabled(entry, val): 1844 | local_proxyservice_pipelinealerting_isenabled(entry, val) 1845 | 1846 | def sb_proxyservice_pipelinealerting_alertlevel(entry, val): 1847 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 1848 | 1849 | def sb_proxyservice_endpointuri(entry, val): 1850 | changeEndpointUri(convertToTuple(val),entry) 1851 | 1852 | def sb_proxyservice_dispatchpolicy(entry, val): 1853 | getSBEndPointConfiguration(entry).setDispatchPolicy(val) 1854 | 1855 | def sb_proxyservice_ssluse(entry, val): 1856 | getSbInboundProperties(entry).setUseSsl(val) 1857 | 1858 | #=================================================================== 1859 | # Customize: BusinessService: Transport Type: SB 1860 | #=================================================================== 1861 | 1862 | def sb_businessservice_monitoring(entry, val): 1863 | return True 1864 | 1865 | def sb_businessservice_logging(entry, val): 1866 | return True 1867 | 1868 | def sb_businessservice_slaalerting(entry, val): 1869 | return True 1870 | 1871 | def sb_businessservice_pipelinealerting(entry, val): 1872 | return True 1873 | 1874 | def sb_businessservice_wspolicy(entry, val): 1875 | return True 1876 | 1877 | def sb_businessservice_wspolicy_bindingmode(entry, val): 1878 | local_proxyservice_wspolicy_bindingmode(entry, val) 1879 | 1880 | def sb_businessservice_wspolicy_policies(entry, values): 1881 | local_proxyservice_wspolicy_policies(entry, values) 1882 | 1883 | def sb_businessservice_monitoring_isenabled(entry, val): 1884 | local_proxyservice_monitoring_isenabled(entry, val) 1885 | 1886 | def sb_businessservice_monitoring_aggregationinterval(entry, val): 1887 | local_proxyservice_monitoring_aggregationinterval(entry, val) 1888 | 1889 | def sb_businessservice_monitoring_pipelinemonitoringlevel(entry, val): 1890 | local_proxyservice_monitoring_pipelinemonitoringlevel(entry, val) 1891 | 1892 | def sb_businessservice_reporting(entry, val): 1893 | local_proxyservice_reporting(entry, val) 1894 | 1895 | def sb_businessservice_logging_isenabled(entry, val): 1896 | local_proxyservice_logging_isenabled(entry, val) 1897 | 1898 | def sb_businessservice_logging_loglevel(entry, val): 1899 | local_proxyservice_logging_loglevel(entry, val) 1900 | 1901 | def sb_businessservice_slaalerting_isenabled(entry, val): 1902 | local_proxyservice_slaalerting_isenabled(entry, val) 1903 | 1904 | def sb_businessservice_slaalerting_alertlevel(entry, val): 1905 | local_proxyservice_slaalerting_alertlevel(entry, val) 1906 | 1907 | def sb_businessservice_pipelinealerting_isenabled(entry, val): 1908 | local_proxyservice_pipelinealerting_isenabled(entry, val) 1909 | 1910 | def sb_businessservice_pipelinealerting_alertlevel(entry, val): 1911 | local_proxyservice_pipelinealerting_alertlevel(entry, val) 1912 | 1913 | def sb_businessservice_endpointuri(entry, val): 1914 | changeEndpointUri(convertToTuple(val),entry) 1915 | 1916 | def sb_businessservice_timeout(entry, val): 1917 | getSbOutboundProperties(entry).setTimeout(val) 1918 | 1919 | def sb_businessservice_retrycount(entry, val): 1920 | getCommonOutboundProperties(entry).setRetryCount(val) 1921 | 1922 | def sb_businessservice_retryapplicationerrors(entry, val): 1923 | getCommonOutboundProperties(entry).setRetryApplicationErrors(val) 1924 | 1925 | def sb_businessservice_retryinterval(entry, val): 1926 | getCommonOutboundProperties(entry).setRetryInterval(val) 1927 | 1928 | def sb_businessservice_dispatchpolicy(entry, val): 1929 | getSBEndPointConfiguration(entry).setDispatchPolicy(val) 1930 | 1931 | def sb_businessservice_providerid(entry, val): 1932 | endPointConfiguration=entry.getEndpointConfig() 1933 | if val.lower() == 'http' and endPointConfiguration.getProviderId() != 'http': 1934 | # change from sb to http as requested 1935 | endPointConfiguration.setProviderId('http') 1936 | 1937 | endPointConfiguration.unsetProviderSpecific() 1938 | providerSpec = endPointConfiguration.addNewProviderSpecific() 1939 | providerSpec = providerSpec.changeType(HttpEndPointConfiguration.type) 1940 | providerSpec.addNewOutboundProperties() 1941 | 1942 | # set some defaults 1943 | http_businessservice_requestmethod(entry, 'POST') 1944 | http_businessservice_readtimeout(entry, 15) 1945 | http_businessservice_connectiontimeout(entry, 20) 1946 | http_businessservice_followredirects(entry, false) 1947 | http_businessservice_chunkedstreamingmode(entry, true) 1948 | http_businessservice_sessionsctikiness(entry, false) 1949 | else: 1950 | # not supported 1951 | return True 1952 | 1953 | #### ############################################################################################################################################### 1954 | #### ############################################################################################################################################### 1955 | #### 1956 | #### Customization End 1957 | #### 1958 | #### ############################################################################################################################################### 1959 | #### ############################################################################################################################################### 1960 | 1961 | 1962 | #### ############################################################################################################################################### 1963 | 1964 | def loadEntryFactory(jarEntry): 1965 | if jarEntry.getExtension()=='proxyservice' or jarEntry.getExtension()=='businessservice': 1966 | return ServiceDefinition.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1967 | elif jarEntry.getExtension()=='serviceaccount': 1968 | return ServiceAccountDocument.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1969 | elif jarEntry.getExtension()=='Operations'.lower(): 1970 | return OperationalSettings.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1971 | elif jarEntry.getExtension()=='UDDIRegistry'.lower(): 1972 | return UDDIRegistryEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1973 | elif jarEntry.getExtension()=='ForeignJNDIProvider'.lower(): 1974 | return JndiProviderEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1975 | elif jarEntry.getExtension()=='SMTPServer'.lower(): 1976 | return SmtpServerEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1977 | elif jarEntry.getExtension()=='ProxyServer'.lower(): 1978 | return ProxyServerDocument.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1979 | elif jarEntry.getExtension()=='AlertDestination'.lower(): 1980 | return AlertDestination.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1981 | elif jarEntry.getExtension()=='ServiceProvider'.lower(): 1982 | return ServiceProviderEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1983 | elif jarEntry.getExtension()=='MQConnection'.lower(): 1984 | return MqConnectionEntry.Factory.parse(ByteArrayInputStream(jarEntry.getData())) 1985 | else: 1986 | return None 1987 | 1988 | #### ############################################################################################################################################### 1989 | 1990 | def lookupCustomizationFunction(functionName, parent, entry): 1991 | for setFunction in reverseDict(parent): 1992 | impleSetFunction= (functionName + '_' + setFunction).lower() 1993 | 1994 | #print 'CustFunct: ' + impleSetFunction 1995 | print LOG_CUST_FUNCTION + setFunction 1996 | 1997 | #if the customization function return True than exists another customization function 1998 | if impleSetFunction in globals(): 1999 | if (globals()[impleSetFunction](entry, parent[setFunction])): 2000 | if isDict(parent[setFunction]): 2001 | lookupCustomizationFunction(impleSetFunction, parent[setFunction],entry) 2002 | else: 2003 | print LOG_NOT_FOUND_FUNCTION + impleSetFunction 2004 | NOT_FOUND_CUSTOMIZATION.append(impleSetFunction) 2005 | 2006 | 2007 | def customizeSbConfigFile(customizationFile,path): 2008 | osbJarEntries=parseOsbJar(readBinaryFile(path)) 2009 | 2010 | print 'Customize the following files:' 2011 | 2012 | #customize services by transport type... 2013 | for customizationType in reverseDict(customizationFile): 2014 | #print '--> '+ customizationType 2015 | customizationEntries=customizationFile[customizationType] 2016 | 2017 | for custEntryFile in reverseDict(customizationEntries): 2018 | jarEntries=findOsbJarEntries(custEntryFile,osbJarEntries) 2019 | 2020 | if not jarEntries: 2021 | print LOG_CUST_FILE + 'Not found Entry: ' + custEntryFile 2022 | else: 2023 | for jarEntry in jarEntries: 2024 | print LOG_CUST_FILE + jarEntry.getName() 2025 | sbentry=loadEntryFactory(jarEntry) 2026 | if sbentry!=None: 2027 | # dynamic function name, eg. sb_businessservice 2028 | execFunctionName = customizationType.lower().strip()+'_'+jarEntry.getExtension().lower().strip() 2029 | #execute customization 2030 | lookupCustomizationFunction(execFunctionName,customizationEntries[custEntryFile],sbentry) 2031 | #update jar entry 2032 | jarEntry.setData(sbentry.toString().encode('utf-8')) 2033 | else: 2034 | print LOG_CUST_FUNCTION + 'Customization is not supported!' 2035 | 2036 | if len(NOT_FOUND_CUSTOMIZATION)!=0: 2037 | print ' ' 2038 | print '------------------------------------' 2039 | print 'Not found customization functions:' 2040 | for notFoundFunct in NOT_FOUND_CUSTOMIZATION: 2041 | print ' '+ notFoundFunct 2042 | print '------------------------------------' 2043 | print ' ' 2044 | #generate new SB Config 2045 | return osbJarEntries 2046 | 2047 | def jarEntryToString(jarEntry): 2048 | baos = ByteArrayOutputStream(); 2049 | if jarEntry.getData() != None: 2050 | baos.write(jarEntry.getData(), 0, len(jarEntry.getData())) 2051 | return baos.toString() 2052 | 2053 | def tokenReplaceSbConfigFile(tokens, osbJarEntries): 2054 | print 'Tokens found and replaced on the following files:' 2055 | for jarEntry in [jarEntry for jarEntry in osbJarEntries if jarEntry.getExtension() != 'archive']: 2056 | hasPrintedHeader = False 2057 | sbentryAsString = jarEntryToString(jarEntry) 2058 | for token in SB_CUSTOMIZATOR_TOKENS: 2059 | if (token in sbentryAsString): 2060 | if (not hasPrintedHeader): 2061 | print LOG_CUST_FILE + jarEntry.getName() 2062 | hasPrintedHeader = True 2063 | if ('PASSWORD' in token.upper()): 2064 | #mask passwords 2065 | print LOG_CUST_FUNCTION + token + '->' + '*' * len(SB_CUSTOMIZATOR_TOKENS[token]) + ' (masked)' 2066 | else: 2067 | print LOG_CUST_FUNCTION + token + '->' + SB_CUSTOMIZATOR_TOKENS[token] 2068 | sbentryAsString = sbentryAsString.replace(token, SB_CUSTOMIZATOR_TOKENS[token]) 2069 | 2070 | jarEntry.setData(sbentryAsString.encode('utf-8')) 2071 | return osbJarEntries 2072 | 2073 | def checkForForbiddenTokens(forbiddenTokens, osbJarEntries): 2074 | print 'Checking for forbidden tokens in the following files:' 2075 | for jarEntry in [jarEntry for jarEntry in osbJarEntries if jarEntry.getExtension() != 'archive']: 2076 | hasPrintedHeader = False 2077 | sbentryAsString = jarEntryToString(jarEntry) 2078 | foundTokens = [x for x in forbiddenTokens if x in sbentryAsString] 2079 | for forbiddenToken in foundTokens: 2080 | if (not hasPrintedHeader): 2081 | print LOG_CUST_FILE + jarEntry.getName() 2082 | hasPrintedHeader = True 2083 | 2084 | print LOG_CUST_FUNCTION + '"' + forbiddenToken + '" detected' 2085 | 2086 | if (foundTokens): 2087 | print '' 2088 | raise ValueError('Found ' + str(len(foundTokens)) + ' forbidden tokens') 2089 | return 2090 | 2091 | def executeCustomization(): 2092 | customized_files = [] 2093 | if 'SB_CUSTOMIZATOR' in globals(): 2094 | for sbFileName in SB_CUSTOMIZATOR: 2095 | print ' ' 2096 | print '------------------------------------' 2097 | print ' Customize Config: '+str(sbFileName) 2098 | sbFile=SB_CUSTOMIZATOR[sbFileName] 2099 | #customize 2100 | replaceFile = sbFile.get('replaceFile', False) 2101 | print LOG_CUST_FILE+' replaceFile: ' + str(replaceFile) 2102 | path=str(sbFileName) 2103 | if "*" in path: 2104 | possibleMatches = glob.glob(path) 2105 | print LOG_CUST_FILE+' '+ str(possibleMatches) 2106 | if (len(possibleMatches) == 1): 2107 | path = possibleMatches[0] 2108 | print LOG_CUST_FILE+' Expanded wildcard to: ' + path 2109 | else: 2110 | message = str(len(possibleMatches)) + ' matches found for ' + path + ' SB Config file; expecting 1.' 2111 | print LOG_CUST_FILE+' Error: ' + message 2112 | raise ValueError(message) 2113 | 2114 | absPath= os.path.abspath(path) 2115 | if os.path.isfile(absPath) and os.path.exists(absPath): 2116 | osbJarEntries= customizeSbConfigFile(sbFile,path) 2117 | if 'SB_CUSTOMIZATOR_TOKENS' in globals(): 2118 | osbJarEntries=tokenReplaceSbConfigFile(SB_CUSTOMIZATOR_TOKENS, osbJarEntries) 2119 | if 'SB_CUSTOMIZATOR_FORBIDDEN_TOKENS' in globals(): 2120 | checkForForbiddenTokens(SB_CUSTOMIZATOR_FORBIDDEN_TOKENS, osbJarEntries) 2121 | 2122 | #generate new sbconfig file 2123 | data=generateNewSBConfig(osbJarEntries) 2124 | #deploy 2125 | customized_files.append(saveNewSbConfigNoFS(path,data, replaceFile)) 2126 | else: 2127 | print LOG_CUST_FILE+' Error: ' + absPath + ' SB Config file not found' 2128 | else: 2129 | print LOG_CUST_FILE+' Not found customization config: SB_CUSTOMIZATOR' 2130 | return customized_files 2131 | 2132 | try: 2133 | print '################################################################################' 2134 | print '' 2135 | print ' OSB-Config-WLST-Configurator (TomeCode.com)' 2136 | print ' ' 2137 | print ' Version: ${project.version}' 2138 | print ' ' 2139 | 2140 | if len(sys.argv)!=2: 2141 | print ' Wrong number of arguments: OSB Customization file not found!' 2142 | print ' Execute: ./osbCustomizer.(sh/cmd) osbCustomizer.properties' 2143 | print ' ' 2144 | print ' ' 2145 | exit(exitcode=1) 2146 | 2147 | f=sys.argv[1] 2148 | 2149 | print ' Load customization file: ' + f 2150 | f = os.path.abspath(f) 2151 | exec open(str(f),'r') 2152 | 2153 | deployFiles=executeCustomization() 2154 | deployToOsb(deployFiles) 2155 | 2156 | except Exception, err: 2157 | print ' Failed Execute customization file: '+ f 2158 | traceback.print_exc() 2159 | #or 2160 | print sys.exc_info()[0] 2161 | print 'Setting exitcode=1' 2162 | exit(exitcode=1) 2163 | 2164 | 2165 | exit(exitcode=0) 2166 | -------------------------------------------------------------------------------- /src/main/resources/sample01/sample01.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample01/sample01.jar -------------------------------------------------------------------------------- /src/main/resources/sample01/sample01.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | #Setting for customizer 10 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 11 | SB_CUSTOMIZATOR={ 12 | #SBConfig file location 13 | "sample01/sample01.jar":{ 14 | #Customization type: Global Operational Settings 15 | "GlobalOperationalSettings":{ 16 | "System/Operator_Settings/GlobalOperationalSettings.Operations":{ 17 | "Logging":True, 18 | "Monitoring":True, 19 | "PipelineAlerting":False, 20 | "Reporting":False, 21 | "ResultCaching":False, 22 | "SlaAlerting":True, 23 | }, 24 | }, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/sample02/sample02.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample02/sample02.jar -------------------------------------------------------------------------------- /src/main/resources/sample02/sample02.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample02/sample02.jar":{ 15 | #Customization type: (STATIC) Service Account 16 | "SERVICEACCOUNT":{ 17 | #Path to the file (ServiceAccount), which will be customized in SBConfig 18 | "project02/sm01.ServiceAccount":{ 19 | "Username":"Tome", 20 | "Password":"TomeCodePassword", 21 | "Description":"Test description 01", 22 | }, 23 | #Path to the file (ServiceAccount), which will be customized in SBConfig 24 | "default/staticAccount.ServiceAccount":{ 25 | "Username":"TestUser02", 26 | "Password":"PasswordUser02", 27 | "Description":"Test description 02", 28 | }, 29 | }, 30 | }, 31 | } -------------------------------------------------------------------------------- /src/main/resources/sample03/sample03.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample03/sample03.jar -------------------------------------------------------------------------------- /src/main/resources/sample03/sample03.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample03/sample03.jar":{ 15 | #Customization type: UDDI 16 | "UDDI":{ 17 | #Path to the file (UDDIRegistry), which will be customized in SBConfig 18 | "System/UDDI/osr01.UDDIRegistry":{ 19 | "Description":"Hello this is a Tomecode.com customization", 20 | "Url":"http://localhost:20001/registry/uddi/inquiry", 21 | "PublishUrl":"http://localhost:20001/registry/uddi/publishing", 22 | "SubscriptionUrl":"http://localhost:20001/registry/uddi/subscription", 23 | "SecurityUrl":"http://localhost:20001/registry/uddi/security", 24 | "Username":"HelloUDDITome991", 25 | "Password":"HelloUDDITomecode", 26 | "AutoImport":False, 27 | "LoadtModels":True, 28 | }, 29 | }, 30 | }, 31 | } -------------------------------------------------------------------------------- /src/main/resources/sample04/sample04.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample04/sample04.jar -------------------------------------------------------------------------------- /src/main/resources/sample04/sample04.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample04/sample04.jar":{ 15 | #Customization type: Proxy Services with transport type: LOCAL 16 | "LOCAL":{ 17 | #Path to the file (Proxy Service), which will be customized in SBConfig 18 | "default/local.ProxyService":{ 19 | "Description":"LOCAL ProxyService was customized by Tome", 20 | "IsRequired":True, 21 | "SameTxForResponse":True, 22 | }, 23 | #Path to the file (Proxy Service), which will be customized in SBConfig 24 | #"default/local2.ProxyService":{ 25 | # "Description":"Hello LOCAL ProxyService here is Tome", 26 | # "IsRequired":True, 27 | # "SameTxForResponse":True, 28 | #},... 29 | }, 30 | }, 31 | } -------------------------------------------------------------------------------- /src/main/resources/sample05/sample05.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample05/sample05.jar -------------------------------------------------------------------------------- /src/main/resources/sample05/sample05.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | #SB_SERVER={ 3 | # "ListenAddress":"localhost", 4 | # "ListenPort":16001, 5 | # "Username":"admin", 6 | # "Password":"admin1234", 7 | #} 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample05/sample05.jar":{ 15 | #Customization type: Proxy Services with transport type: HTTP 16 | "HTTP":{ 17 | #Path to the file (Proxy Service), which will be customized in SBConfig 18 | "default/http.ProxyService":{ 19 | #Description of the 20 | "Description":"Hello HTTP ProxyService Tome", 21 | #Endpoiint 22 | "EndpointUri":"http/endpoint/tome/customizer", 23 | #Enable or disable https 24 | "UseHttps":True, 25 | "Authentication":{ 26 | #Remove authentification 27 | "None":{}, 28 | ##Basic authentification 29 | "BasicAuthentication":{}, 30 | ##SSL Authentification 31 | "SSLClientAuthentication":{}, 32 | ##Setup custom authentification 33 | "CustomTokenAuthentication":{ 34 | ## Custtom authentificator token type 35 | "TokenType":"TomeCustomToken", 36 | ## Custtom authentificator header name 37 | "HeaderName":"TomeHeaderName", 38 | }, 39 | }, 40 | #Customize authentification in security tab 41 | "Security":{ 42 | #Customize authentication by type 43 | "CustomAuthentication":{ 44 | "AuthenticationType":{ 45 | ##remove AuthenticationType 46 | #"None":{}, 47 | ##Custom user name and password authentication 48 | "CustomUserNameAndPassword":{ 49 | ##xpath for username 50 | "UsernameXpath":"//username/tome/text()", 51 | ##xpath for password 52 | "PasswordXpath":"//username/tome/text()", 53 | }, 54 | ##Customize custom token 55 | #"CustomToken":{ 56 | ##customize xpath 57 | # "Xpath":"//tome/Xpath/text()", 58 | #}, 59 | }, 60 | ##customize context properties 61 | "ContextProperties":{ 62 | ##First variable 63 | "TomePremenna":"//tome/text()", 64 | ##Second variable 65 | "MajovaPremenna":"//majo/text()", 66 | }, 67 | }, 68 | }, 69 | "RequestEncoding":"UTF-8", 70 | "ResponseEncoding":"UTF-8", 71 | "DispatchPolicy":"HelloWorkmanager", 72 | #"ChunkedStreamingMode":True, 73 | "IsRequired":True, 74 | "SameTxForResponse":True, 75 | }, 76 | #... 77 | }, 78 | "LOCAL":{ 79 | "default/local.ProxyService":{ 80 | #Setup customization properties 81 | }, 82 | #... 83 | }, 84 | }, 85 | } -------------------------------------------------------------------------------- /src/main/resources/sample06/sample06.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample06/sample06.jar -------------------------------------------------------------------------------- /src/main/resources/sample06/sample06.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample06/sample06.jar":{ 15 | #Customization type: JNDI 16 | "JNDI":{ 17 | #Path to the file (JNDI), which will be customized in SBConfig 18 | "System/JNDI_Providers/jndi.ForeignJNDIProvider":{ 19 | "ProviderURL":"t3://jndi.com/tomecode", 20 | "Username":"JndiUser02", 21 | "Password":"JndiPass02", 22 | "CacheValues":True, 23 | "RequestTimeout":2333, 24 | "Description":"Hello JNDI Tomecode", 25 | }, 26 | }, 27 | }, 28 | } -------------------------------------------------------------------------------- /src/main/resources/sample07/sample07.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample07/sample07.jar -------------------------------------------------------------------------------- /src/main/resources/sample07/sample07.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample07/sample07.jar":{ 15 | #Customization type: SMTP 16 | "SMTP":{ 17 | #Path to the file (SMTPServer), which will be customized in SBConfig 18 | "System/SMTP_Servers/demoSmtp.SMTPServer":{ 19 | "Description":"hello customization - tomecode", 20 | "IsDefault":True, 21 | "PortNumber":3999, 22 | "ServerURL":"smpt.server.tomecode.com", 23 | "Username":"tomecode", 24 | "Password":"helloWordTomecode", 25 | }, 26 | #"System/SMTP_Servers/demoSmtp2.SMTPServer":{ 27 | #... 28 | #... 29 | #} 30 | }, 31 | }, 32 | } -------------------------------------------------------------------------------- /src/main/resources/sample08/sample08.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample08/sample08.jar -------------------------------------------------------------------------------- /src/main/resources/sample08/sample08.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample08/sample08.jar":{ 15 | #Customization type: Proxy Service with transport type: JMS 16 | "JMS":{ 17 | #Path to the file (Proxy Service), which will be customized in SBConfig 18 | "default/jms.ProxyService":{ 19 | "Description":"Hello JMS - tomecode", 20 | "EndpointUri":"jms://localhost:16011/XAConnectionFactory/TomeRequestCode11", 21 | "DispatchPolicy":"SSS", 22 | "RequestEncoding":"UTF-16", 23 | "IsResponseRequired":True, 24 | 25 | #This is a configuration for Destination Type: Queue 26 | "DestinationTypeQueue":{ 27 | "ResponseEncoding":"UTF-16", 28 | "ResponsePattern":"JMS_CORRELATION_ID",# or JMS_MESSAGE_ID 29 | "ResponseMessageType":"BYTES", #or TEXT 30 | "ResponseURI":"jms://localhost:16011/XAConnectionFactory/TomeResponseCode11", 31 | 32 | }, 33 | "MessageSelector":"tomecodeSelector", 34 | "RetryCount":333, 35 | "RetryInterval":22, 36 | "ErrorDestination":"jms://localhost:16011/XAConnectionFactory/TomecodeErrorResponse", 37 | "IsXARequired":True, 38 | "JNDITimeout":333, 39 | }, 40 | }, 41 | }, 42 | } -------------------------------------------------------------------------------- /src/main/resources/sample09/sample09.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample09/sample09.jar -------------------------------------------------------------------------------- /src/main/resources/sample09/sample09.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | #SB_SERVER={ 3 | # "ListenAddress":"localhost", 4 | # "ListenPort":16001, 5 | # "Username":"admin", 6 | # "Password":"admin1234", 7 | #} 8 | 9 | #Setting for customizer 10 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 11 | SB_CUSTOMIZATOR={ 12 | #SBConfig file location 13 | "sample09/sample09.jar":{ 14 | #Customization type 15 | "JMS":{ 16 | #Path to the file (Proxy Service), which will be customized in SBConfig 17 | "default/jms.ProxyService":{ 18 | #Configuration for Transport Level Policy 19 | "Policy":{ 20 | #Setup provider 21 | "Provider":"XACMLAuthorizer", 22 | #list of user 23 | "Users":("tome00", "tome01", "tome02"), 24 | #list of roles 25 | "Roles":("helloRole"), 26 | #list of groups 27 | "Groups":("HelloGroup01","helloGroup03"), 28 | } 29 | }, 30 | }, 31 | 32 | "HTTP":{ 33 | #Path to the file (Proxy Service), which will be customized in SBConfig 34 | "default/http.ProxyService":{ 35 | #Configuration for Transport Level Policy 36 | "Policy":{ 37 | #Setup provider 38 | "Provider":"XACMLAuthorizer", 39 | #List of user e.g.: ("user1","user2",...) 40 | "Users":"tome00", 41 | } 42 | }, 43 | }, 44 | }, 45 | } -------------------------------------------------------------------------------- /src/main/resources/sample10/sample10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample10/sample10.jar -------------------------------------------------------------------------------- /src/main/resources/sample10/sample10.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample10/sample10.jar":{ 15 | #Customization type: Business Service with transport type: HTTP 16 | "HTTP":{ 17 | #Path to the file (BusinessService), which will be customized in SBConfig 18 | "osrTest/out/helloOSR.BusinessService":{ 19 | "Description":"Hello HTTP ProxyService Tome", 20 | "EndpointUri":"http/endpoint/tome/customizer", 21 | "ReadTimeout":20, 22 | "RequestEncoding":"UTF-8", 23 | "ResponseEncoding":"UTF-8", 24 | "ConnectionTimeout":55 25 | }, 26 | }, 27 | #... 28 | }, 29 | } -------------------------------------------------------------------------------- /src/main/resources/sample11/sample11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample11/sample11.jar -------------------------------------------------------------------------------- /src/main/resources/sample11/sample11.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample11/sample11.jar":{ 15 | #Customization type: Proxy Server 16 | "PROXYSERVER":{ 17 | #Path to the file (Proxy Server), which will be customized in SBConfig 18 | "System/Proxy_Servers/Proxy.ProxyServer":{ 19 | "Description":"Hello Proxy Server", 20 | "Username":"helloProxy", 21 | "Password":"mypassword", 22 | "ServerTable":{ 23 | "TomeHost":{ 24 | "Port":333, 25 | "SslPort":911, 26 | } 27 | } 28 | }, 29 | }, 30 | #... 31 | }, 32 | } -------------------------------------------------------------------------------- /src/main/resources/sample12/sample12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample12/sample12.jar -------------------------------------------------------------------------------- /src/main/resources/sample12/sample12.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | #SB_SERVER={ 3 | # "ListenAddress":"localhost", 4 | # "ListenPort":16001, 5 | # "Username":"admin", 6 | # "Password":"admin1234", 7 | #} 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample12/sample12.jar":{ 15 | #Customization type: Service Provider 16 | "SERVICEPROVIDER":{ 17 | #Path to the file (Service Provider), which will be customized in SBConfig 18 | "tome/helloServiceKey.ServiceProvider":{ 19 | "Description":"Hello ServiceProvider- tomecode", 20 | "Encryption":{ 21 | "Alias":"hubeas01a", 22 | "Password":".WeblogicSSL@" 23 | }, 24 | "DigitalSignature":{ 25 | "Alias":"hubeas01a", 26 | "Password":".WeblogicSSL@" 27 | }, 28 | "SSL":{ 29 | "Alias":"hubeas01a", 30 | "Password":".WeblogicSSL@" 31 | } 32 | 33 | }, 34 | }, 35 | }, 36 | } -------------------------------------------------------------------------------- /src/main/resources/sample13/sample13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample13/sample13.jar -------------------------------------------------------------------------------- /src/main/resources/sample13/sample13.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample13/sample13.jar":{ 15 | #Customization type: Alert Destination 16 | "ALERTDESTINATION":{ 17 | #Path to the file (Alert Destination), which will be customized in SBConfig 18 | "tome/sample13/helloAlertDestination.AlertDestination":{ 19 | "Description":"Hello AllertDestination- tomecode", 20 | "AlertLogging":True, 21 | "Reporting":True, 22 | "SNMPTrap":True, 23 | }, 24 | }, 25 | }, 26 | } -------------------------------------------------------------------------------- /src/main/resources/sample14/sample14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample14/sample14.jar -------------------------------------------------------------------------------- /src/main/resources/sample14/sample14.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample14/sample14.jar":{ 15 | #Customization type: MQ Connection 16 | "MQCONNECTION":{ 17 | #Path to the file (MQ Connection), which will be customized in SBConfig 18 | "MQ/helloMq_bidingMode.MQConnection":{ 19 | #connection type: TcpMode 20 | "BindingMode":{ 21 | "MQQueueManagerName":"", 22 | }, 23 | "MQVersion":"v5", #or v6, or v7 24 | "MQConnectionPoolSize":34, 25 | "MQConnectionTimeout":999, 26 | "MQConnectionMaxWait":666, 27 | "XAEnabled":True, 28 | }, 29 | #Path to the file (MQ Connection), which will be customized in SBConfig 30 | "MQ/helloMq_tcpMode.MQConnection":{ 31 | #connection type: TcpMode 32 | "TcpMode":{ 33 | "MQHostName":"locolhost.mainframe.com", 34 | "MQPortNumber":32635, 35 | "MQQueueManagerName":"Q500", 36 | #"QueueManagerCCSID":0, 37 | "MQQueueManagerChannelName":"S01.OSB", 38 | }, 39 | "MQVersion":"v5", #or v6, or v7 40 | "MQConnectionPoolSize":22, 41 | "MQConnectionTimeout":911, 42 | "MQConnectionMaxWait":3000000, 43 | "XAEnabled":True, 44 | }, 45 | }, 46 | }, 47 | } -------------------------------------------------------------------------------- /src/main/resources/sample15/sample15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample15/sample15.jar -------------------------------------------------------------------------------- /src/main/resources/sample15/sample15.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample15/sample15.jar":{ 15 | #Customization type: MQ w 16 | "MQ":{ 17 | #Path to the file (Business Service), which will be customized in SBConfig 18 | "MQ/mqbusinessService.BusinessService":{ 19 | "EndpointURI":"mq://CICS.SA2.OSB.REQ?conn=MQ/helloMq_bidingMode", 20 | "RetryCount":2, 21 | "RetryInterval":666, 22 | "MessageType":"Text", #or Bytes 23 | "AutoGenerateCorrelationValue":True, 24 | "MQResponseURI":"mq://CICS.SA2.RESP?conn=MQ/helloMq_bidingMode", 25 | "ResponseTimeout":33, 26 | "PollingInterval":1300, 27 | "ProcessRFH2Headers":True, 28 | }, 29 | #Path to the file (Proxy Service), which will be customized in SBConfig 30 | "MQ/mqProxy.ProxyService":{ 31 | "EndpointURI":"mq://OSB.REQ?conn=MQ/helloMq_bidingMode", 32 | "RetryCount":2, 33 | "ResponseMessageType":"Text", #or Bytes 34 | "MQResponseURI":"mq://RESP?conn=MQ/helloMq_bidingMode", 35 | "PollingInterval":10, 36 | }, 37 | }, 38 | }, 39 | } -------------------------------------------------------------------------------- /src/main/resources/sample16/sample16.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample16/sample16.jar -------------------------------------------------------------------------------- /src/main/resources/sample16/sample16.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample16/sample16.jar":{ 15 | #Customization FTP 16 | "FTP":{ 17 | #Path to the file (Proxy Service), which will be customized in SBConfig 18 | "FTPsample/ftpProxy.ProxyService":{ 19 | "EndpointURI":"ftp://domain:1739/hello/dir", 20 | "RecursiveScan":True, 21 | "DirectStreaming":True, 22 | "DownloadDirectory":"download/dir/test01", 23 | "Timeout":999, 24 | "FileMask":"hello*.custom", 25 | "PollingInterval":1300, #in miliseconds 26 | "ReadLimit":240, 27 | }, 28 | #Path to the file (Business Service), which will be customized in SBConfig 29 | "FTPsample/ftpService.BusinessService":{ 30 | "EndpointURI":"ftp://ftpserver:4739/hello/dir", 31 | "RetryCount":3, 32 | "RetryInterval":300, 33 | "Timeout":76, 34 | "Prefix":"Tome", 35 | "Suffix":"Code", 36 | }, 37 | }, 38 | }, 39 | } -------------------------------------------------------------------------------- /src/main/resources/sample17/sample17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample17/sample17.jar -------------------------------------------------------------------------------- /src/main/resources/sample17/sample17.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample17/sample17.jar":{ 15 | #Customization FILE 16 | "FILE":{ 17 | #Path to the file (Proxy Service), which will be customized in SBConfig 18 | "FileSample/fileProxy.ProxyService":{ 19 | "EndpointURI":"file:///c:/JDev", 20 | "FileMask":"tome.code", 21 | "PollingInterval":300, 22 | "SortByArrival":True, 23 | "ReadLimit":300, 24 | "ScanSubDirectories":True, 25 | "ArchiveDir":"dir/archive", 26 | "StageDir":"dir/stage", 27 | "ErrorDir":"dir/error", 28 | }, 29 | #Path to the file (Business Service), which will be customized in SBConfig 30 | "FileSample/fileService.BusinessService":{ 31 | "EndpointURI":"file:///c:/JDeveloper", 32 | "RetryCount":3, 33 | "RetryInterval":300, 34 | "Prefix":"Tome", 35 | "Suffix":"Code", 36 | }, 37 | }, 38 | }, 39 | } -------------------------------------------------------------------------------- /src/main/resources/sample18/sample18.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample18/sample18.jar -------------------------------------------------------------------------------- /src/main/resources/sample18/sample18.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample18/sample18.jar":{ 15 | #Customization SFTP 16 | "SFTP":{ 17 | #Path to the file (Proxy Service), which will be customized in SBConfig 18 | "SftpSample/sftpProxy.ProxyService":{ 19 | "EndpointURI":"sftp://tomecode.com:33/tomeDir", 20 | "RecursiveScan":True, 21 | "DirectStreaming":True, 22 | "RetryCount":3, 23 | "FileMask":"Tome.Code", 24 | "PollingInterval":600002, 25 | "ReadLimit":20, 26 | "Timeout":300, 27 | "ArchiveDir":"dir/archive", 28 | "DownloadDir":"dir/stage", 29 | "ErrorDir":"dir/error", 30 | "SortByArrival":True, 31 | }, 32 | #Path to the file (Business Service), which will be customized in SBConfig 33 | "SftpSample/sftpService.BusinessService":{ 34 | "EndpointURI":"sftp://tomecode.com:3334/tomeDir/services", 35 | "RetryCount":3, 36 | "RetryInterval":300, 37 | "Prefix":"Tome", 38 | "Suffix":"Code", 39 | }, 40 | }, 41 | }, 42 | } -------------------------------------------------------------------------------- /src/main/resources/sample19/sample19.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample19/sample19.jar -------------------------------------------------------------------------------- /src/main/resources/sample19/sample19.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample19/sample19.jar":{ 15 | #Customization EMAIL 16 | "EMAIL":{ 17 | #Path to the file (Proxy Service), which will be customized in SBConfig 18 | "EmailSample/EmailProxy.ProxyService":{ 19 | "EndpointURI":"mailfrom:tomeserver.com:1999", 20 | "SSLuse":True, 21 | "PollingInterval":30, 22 | "ReadLimit":33, 23 | "PassByReference":True, 24 | "IMAPMoveFolder":"dir/ImapFolder", 25 | "ArchiveDir":"dir/archive", 26 | "DownloadDir":"dir/stage", 27 | "ErrorDir":"dir/error", 28 | }, 29 | #Path to the file (Business Service), which will be customized in SBConfig 30 | "EmailSample/EmailService.BusinessService":{ 31 | "EndpointURI":"mailto:foo@bar.com", 32 | "ConnectionTimeout":220, 33 | "FromAddress":"from@address.com", 34 | "FromName":"fromName", 35 | "ReplyToAddress":"reploy@address.com", 36 | "ReplyName":"replyName", 37 | "SocketTimeout":33, 38 | "SSLuse":True, 39 | "RetryCount":3, 40 | "RetryInterval":300, 41 | 42 | }, 43 | }, 44 | }, 45 | } -------------------------------------------------------------------------------- /src/main/resources/sample20/sample20.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomecode/OSB-Config-WLST-Configurator/5749d227156c058c80394d7cd94c94f96b239b88/src/main/resources/sample20/sample20.jar -------------------------------------------------------------------------------- /src/main/resources/sample20/sample20.properties: -------------------------------------------------------------------------------- 1 | #OSB Configuration for deployment 2 | SB_SERVER={ 3 | "ListenAddress":"localhost", 4 | "ListenPort":16001, 5 | "Username":"admin", 6 | "Password":"admin1234", 7 | } 8 | 9 | 10 | #Setting for customizer 11 | #The list of settings, which will be customized in SBConfig (jar) before deploying to the OSB 12 | SB_CUSTOMIZATOR={ 13 | #SBConfig file location 14 | "sample20/sample20.jar":{ 15 | #Customization SB 16 | "SB":{ 17 | #Path to the file (Proxy Service), which will be customized in SBConfig 18 | "SBsample/SBproxy.ProxyService":{ 19 | "EndpointURI":"SBproxy_service-uri-tome", 20 | "SSLuse":False, 21 | }, 22 | #Path to the file (Business Service), which will be customized in SBConfig 23 | "SBsample/SBservice.BusinessService":{ 24 | "EndpointURI":"sb://jndi_provider_uri_is_tomecode", 25 | "Timeout":33, 26 | "RetryApplicationErrors":True, 27 | "RetryCount":3, 28 | "RetryInterval":300, 29 | 30 | }, 31 | }, 32 | }, 33 | } --------------------------------------------------------------------------------