FTP Adapter Connection Pool JNDI Creation
My Server Details are,
Cluster Environment: 1 Admin Server and 2 Managed Server (wls_osb1 and wls_osb2)
Domain Name: soa_domain
Save below weblogic.properties
#################################################################################
# admin server url
admin.url=t3://localhost:7001
#################################################################################
#Domain Name:
domainName=soa_domain
osbServer1=wls_osb1
osbServer2=wls_osb2
#Manage Server Name:
targetServer.1=wls_osb1
targetServer.2=wls_osb2
#Cluster Name:
osb_ClusterName=osb_cluster
migrateServerType=MigratableTarget
clusterServerType=Cluster
normalServerType=Server
#################################################################################
# FTP adapter Properties
#################################################################################
#Below FTP Adapter JNDI will be create
#DB Adapter JNDI for OFM: 1. eis/ftp/OMCSSFTP
# 2. eis/ftp/EGDC
# 3. eis/ftp/ISCM
#################################################################################
# Plan and Adapter Path
shared_FTP_PlanPath=/u01/Middleware/Oracle_OSB1/soa/connectors/FTP_plan.xml
FTP_appPath =/u01/Middleware/Oracle_OSB1/soa/connectors/FtpAdapter.rar
#################################################################################
# FTP adapter JNDI entry
#Total how many AQ JNDI needs to be create
total.FTPjndi=3
FTP_eisName.1=eis/ftp/OFMSFTP
FTP_host.1=localhost
FTP_password.1=changeit
FTP_port.1=22
FTP_username.1=j_acda
FTP_useSftp.1=true
FTP_controlDir.1=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.1=jdbc/SOADataSource
FTP_outboundDataSource.1=jdbc/SOADataSource
FTP_outboundDataSourceLocal.1=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.1=oracle
FTP_authenticationType.1=PUBLICKEY
FTP_changeDirectory.1=false
FTP_enforceFileTypeFromSpec.1=false
FTP_ftpAbsolutePathBegin.1=/
FTP_ftpPathSeparator.1=/
FTP_ignorePermissionsOnFile.1=true
FTP_preferredCipherSuite.1=blowfish-cbc
FTP_privateKeyFile.1=/u01/local/rsa/id_rsa
FTP_workingDirectory.1=default
FTP_eisName.2=eis/ftp/OMS
FTP_host.2=185.29.224.14
FTP_password.2=C0ndu1t01
FTP_port.2=22
FTP_username.2=OFM
FTP_useSftp.2=true
FTP_controlDir.2=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.2=jdbc/SOADataSource
FTP_outboundDataSource.2=jdbc/SOADataSource
FTP_outboundDataSourceLocal.2=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.2=oracle
FTP_authenticationType.2=password
FTP_changeDirectory.2=false
FTP_enforceFileTypeFromSpec.2=false
FTP_ftpAbsolutePathBegin.2=/
FTP_ftpPathSeparator.2=/
FTP_ignorePermissionsOnFile.2=false
FTP_preferredCipherSuite.2=aes128-cbc
FTP_privateKeyFile.2=
FTP_workingDirectory.2=default
FTP_eisName.3=eis/ftp/Oracle
FTP_host.3=194.72.50.34
FTP_password.3=chaos15
FTP_port.3=21
FTP_username.3=FUSIONE2E
FTP_useSftp.3=false
FTP_controlDir.3=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.3=jdbc/SOADataSource
FTP_outboundDataSource.3=jdbc/SOADataSource
FTP_outboundDataSourceLocal.3=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.3=oracle
FTP_authenticationType.3=password
FTP_changeDirectory.3=true
FTP_enforceFileTypeFromSpec.3=true
FTP_ftpAbsolutePathBegin.3=
FTP_ftpPathSeparator.3=
FTP_ignorePermissionsOnFile.3=true
FTP_preferredCipherSuite.3=aes128-cbc
FTP_privateKeyFile.3=
FTP_workingDirectory.3=
#################################################################################
Now, you have to save python script as Create_FTPAdapters.py
#################################################################################
#!/usr/bin/python
from java.io import FileInputStream
import time
propInputStream= FileInputStream('weblogic.properties')
configProps = Properties()
configProps.load(propInputStream)
adminURL= configProps.get('admin.url')
# Enter username and password
adminUserName= ''
adminPassword= ''
total_jndi_to_create=configProps.get('total.FTPjndi')
appName='FtpAdapter'
moduleOverrideName=appName+'.rar'
moduleDescriptorName='META-INF/weblogic-ra.xml'
planPath = configProps.get('shared_FTP_PlanPath')
appPath = configProps.get('FTP_appPath')
def makeDeploymentPlanVariable(wlstPlan, name, value, xpath, origin='planbased'):
"""Create a varaible in the Plan.
This method is used to create the variables that are needed in the Plan in order
to add an entry for the outbound connection pool for the new data source.
"""
try:
variableAssignment = wlstPlan.createVariableAssignment(name, moduleOverrideName, moduleDescriptorName)
variableAssignment.setXpath(xpath)
variableAssignment.setOrigin(origin)
wlstPlan.createVariable(name, value)
except:
print('--> was not able to create deployment plan variables successfully')
def main():
#
# generate a unique string to use in the names
#
uniqueString =''
uniqueString = str(int(time.time()))
#
# Create a JDBC Data Source.
#
try:
print('--> about to connect to weblogic')
connect(adminUserName, adminPassword, adminURL)
edit()
#
# update the deployment plan
#
startEdit()
i=1
while (i <= int(total_jndi_to_create)):
cd('/')
print('--> about to update the deployment plan for the FtpAdapter')
eisName = configProps.get('FTP_eisName.'+ str(i))
print('--> about to create a Adapter JNDI ' + eisName)
Host = configProps.get("FTP_host."+ str(i))
print('--> about to assign a FTP host ' + Host)
userName = configProps.get("FTP_username."+ str(i))
print('--> about to assign a FTP userName ' + userName)
Port = configProps.get("FTP_port."+ str(i))
print('--> about to assign FTP port ' + Port)
Password = configProps.get("FTP_password."+ str(i))
print('--> about to assign FTP Password ' + Password)
UseSftp = configProps.get("FTP_useSftp."+ str(i))
print('--> about to assign FTP UseSftp ' + UseSftp)
ControlDir = configProps.get("FTP_controlDir."+ str(i))
print('--> about to assign FTP controlDir ' + ControlDir)
InboundDataSource = configProps.get("FTP_inboundDataSource."+ str(i))
print('--> about to assign FTP inboundDataSource ' + InboundDataSource)
OutboundDataSource = configProps.get("FTP_outboundDataSource."+ str(i))
print('--> about to assign FTP outboundDataSource ' + OutboundDataSource)
OutboundDataSourceLocal = configProps.get("FTP_outboundDataSourceLocal."+ str(i))
print('--> about to assign FTP outboundDataSourceLocal ' + OutboundDataSourceLocal)
OutboundLockTypeForWrite = configProps.get("FTP_outboundLockTypeForWrite."+ str(i))
print('--> about to assign FTP outboundLockTypeForWrite ' + OutboundLockTypeForWrite)
AuthenticationType = configProps.get("FTP_authenticationType."+ str(i))
print('--> about to assign FTP authenticationType ' + AuthenticationType)
ChangeDirectory = configProps.get("FTP_changeDirectory."+ str(i))
print('--> about to assign FTP changeDirectory ' + ChangeDirectory)
EnforceFileTypeFromSpec = configProps.get("FTP_enforceFileTypeFromSpec."+ str(i))
print('--> about to assign FTP enforceFileTypeFromSpec ' + EnforceFileTypeFromSpec)
FtpAbsolutePathBegin = configProps.get("FTP_ftpAbsolutePathBegin."+ str(i))
print('--> about to assign FTP ftpAbsolutePathBegin ' + FtpAbsolutePathBegin)
FtpPathSeparator = configProps.get("FTP_ftpPathSeparator."+ str(i))
print('--> about to assign FTP ftpPathSeparator ' + FtpPathSeparator)
IgnorePermissionsOnFile = configProps.get("FTP_ignorePermissionsOnFile."+ str(i))
print('--> about to assign FTP ignorePermissionsOnFile ' + IgnorePermissionsOnFile)
PreferredCipherSuite = configProps.get("FTP_preferredCipherSuite."+ str(i))
print('--> about to assign FTP preferredCipherSuite ' + PreferredCipherSuite)
PrivateKeyFile = configProps.get("FTP_privateKeyFile."+ str(i))
print('--> about to assign FTP privateKeyFile ' + PrivateKeyFile)
WorkingDirectory = configProps.get("FTP_workingDirectory."+ str(i))
print('--> about to assign FTP workingDirectory ' + WorkingDirectory)
startEdit()
print('--> Using plan ' + planPath)
plan = loadApplication(appPath, planPath)
print('--> adding variables to plan')
print '___ BEGIN change plan'
makeDeploymentPlanVariable(plan, 'ConnectionInstance_'+ eisName +'_JNDIName_'+ uniqueString, eisName, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/jndi-name')
makeDeploymentPlanVariable(plan, 'ConfigProperty_host_'+ Host + '_',Host, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="host"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_password_'+ Password + '_',Password, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="password"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_port_'+ Port + '_',Port, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="port"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_username_'+ userName + '_',userName, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="username"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_useSftp_'+ UseSftp + '_',UseSftp, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="useSftp"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_controlDir_'+ ControlDir + '_',ControlDir, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="controlDir"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_inboundDataSource_'+ InboundDataSource + '_',InboundDataSource, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="inboundDataSource"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundDataSource_'+ OutboundDataSource + '_',OutboundDataSource, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundDataSource"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundDataSourceLocal_'+ OutboundDataSourceLocal + '_',OutboundDataSourceLocal, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundDataSourceLocal"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundLockTypeForWrite_'+ OutboundLockTypeForWrite + '_',OutboundLockTypeForWrite, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundLockTypeForWrite"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_changeDirectory_'+ ChangeDirectory + '_',ChangeDirectory, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="changeDirectory"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_enforceFileTypeFromSpec_'+ EnforceFileTypeFromSpec + '_',EnforceFileTypeFromSpec, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="enforceFileTypeFromSpec"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ftpAbsolutePathBegin_'+ FtpAbsolutePathBegin + '_',FtpAbsolutePathBegin, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ftpAbsolutePathBegin"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ftpPathSeparator_'+ FtpPathSeparator + '_',FtpPathSeparator, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ftpPathSeparator"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ignorePermissionsOnFile_'+ IgnorePermissionsOnFile + '_',IgnorePermissionsOnFile, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ignorePermissionsOnFile"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_preferredCipherSuite_'+ PreferredCipherSuite + '_',PreferredCipherSuite, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="preferredCipherSuite"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_privateKeyFile_'+ PrivateKeyFile + '_',PrivateKeyFile, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="privateKeyFile"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_workingDirectory_'+ WorkingDirectory + '_',WorkingDirectory, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="workingDirectory"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_authenticationType_'+ AuthenticationType + '_',AuthenticationType, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="authenticationType"]/value')
print '___ DONE change plan'
print('--> saving plan')
plan.save();
save();
print('--> activating changes')
activate(block='true');
cd('/AppDeployments/FtpAdapter/Targets');
print('--> redeploying the FtpAdapter')
redeploy(appName, planPath, targets=cmo.getTargets());
print('--> done')
i=i+1
except:
print('--> something went wrong, bailing out')
stopEdit('y')
raise SystemExit
main()
#################################################################################
Procedure to run above python script,
Step1: Copy your weblogic.properties and Create_FTPAdapters.py
in /u01/Middleware/wlserver_10.3/common/bin loaction. Where wlst.sh or wlst.cmd present
Step2: Run ./wlst.sh (if you install middleware in UNIX) or wlst.cmd (if you install middleware in
windows)
Step 3: When Username and Password asked that time you have to pass weblogic console username and password.
Domain Name: soa_domain
Save below weblogic.properties
#################################################################################
# admin server url
admin.url=t3://localhost:7001
#################################################################################
#Domain Name:
domainName=soa_domain
osbServer1=wls_osb1
osbServer2=wls_osb2
#Manage Server Name:
targetServer.1=wls_osb1
targetServer.2=wls_osb2
#Cluster Name:
osb_ClusterName=osb_cluster
migrateServerType=MigratableTarget
clusterServerType=Cluster
normalServerType=Server
#################################################################################
# FTP adapter Properties
#################################################################################
#Below FTP Adapter JNDI will be create
#DB Adapter JNDI for OFM: 1. eis/ftp/OMCSSFTP
# 2. eis/ftp/EGDC
# 3. eis/ftp/ISCM
#################################################################################
# Plan and Adapter Path
shared_FTP_PlanPath=/u01/Middleware/Oracle_OSB1/soa/connectors/FTP_plan.xml
FTP_appPath =/u01/Middleware/Oracle_OSB1/soa/connectors/FtpAdapter.rar
#################################################################################
# FTP adapter JNDI entry
#Total how many AQ JNDI needs to be create
total.FTPjndi=3
FTP_eisName.1=eis/ftp/OFMSFTP
FTP_host.1=localhost
FTP_password.1=changeit
FTP_port.1=22
FTP_username.1=j_acda
FTP_useSftp.1=true
FTP_controlDir.1=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.1=jdbc/SOADataSource
FTP_outboundDataSource.1=jdbc/SOADataSource
FTP_outboundDataSourceLocal.1=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.1=oracle
FTP_authenticationType.1=PUBLICKEY
FTP_changeDirectory.1=false
FTP_enforceFileTypeFromSpec.1=false
FTP_ftpAbsolutePathBegin.1=/
FTP_ftpPathSeparator.1=/
FTP_ignorePermissionsOnFile.1=true
FTP_preferredCipherSuite.1=blowfish-cbc
FTP_privateKeyFile.1=/u01/local/rsa/id_rsa
FTP_workingDirectory.1=default
FTP_eisName.2=eis/ftp/OMS
FTP_host.2=185.29.224.14
FTP_password.2=C0ndu1t01
FTP_port.2=22
FTP_username.2=OFM
FTP_useSftp.2=true
FTP_controlDir.2=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.2=jdbc/SOADataSource
FTP_outboundDataSource.2=jdbc/SOADataSource
FTP_outboundDataSourceLocal.2=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.2=oracle
FTP_authenticationType.2=password
FTP_changeDirectory.2=false
FTP_enforceFileTypeFromSpec.2=false
FTP_ftpAbsolutePathBegin.2=/
FTP_ftpPathSeparator.2=/
FTP_ignorePermissionsOnFile.2=false
FTP_preferredCipherSuite.2=aes128-cbc
FTP_privateKeyFile.2=
FTP_workingDirectory.2=default
FTP_eisName.3=eis/ftp/Oracle
FTP_host.3=194.72.50.34
FTP_password.3=chaos15
FTP_port.3=21
FTP_username.3=FUSIONE2E
FTP_useSftp.3=false
FTP_controlDir.3=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.3=jdbc/SOADataSource
FTP_outboundDataSource.3=jdbc/SOADataSource
FTP_outboundDataSourceLocal.3=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.3=oracle
FTP_authenticationType.3=password
FTP_changeDirectory.3=true
FTP_enforceFileTypeFromSpec.3=true
FTP_ftpAbsolutePathBegin.3=
FTP_ftpPathSeparator.3=
FTP_ignorePermissionsOnFile.3=true
FTP_preferredCipherSuite.3=aes128-cbc
FTP_privateKeyFile.3=
FTP_workingDirectory.3=
#################################################################################
Now, you have to save python script as Create_FTPAdapters.py
#################################################################################
#!/usr/bin/python
from java.io import FileInputStream
import time
propInputStream= FileInputStream('weblogic.properties')
configProps = Properties()
configProps.load(propInputStream)
adminURL= configProps.get('admin.url')
# Enter username and password
adminUserName= ''
adminPassword= ''
total_jndi_to_create=configProps.get('total.FTPjndi')
appName='FtpAdapter'
moduleOverrideName=appName+'.rar'
moduleDescriptorName='META-INF/weblogic-ra.xml'
planPath = configProps.get('shared_FTP_PlanPath')
appPath = configProps.get('FTP_appPath')
def makeDeploymentPlanVariable(wlstPlan, name, value, xpath, origin='planbased'):
"""Create a varaible in the Plan.
This method is used to create the variables that are needed in the Plan in order
to add an entry for the outbound connection pool for the new data source.
"""
try:
variableAssignment = wlstPlan.createVariableAssignment(name, moduleOverrideName, moduleDescriptorName)
variableAssignment.setXpath(xpath)
variableAssignment.setOrigin(origin)
wlstPlan.createVariable(name, value)
except:
print('--> was not able to create deployment plan variables successfully')
def main():
#
# generate a unique string to use in the names
#
uniqueString =''
uniqueString = str(int(time.time()))
#
# Create a JDBC Data Source.
#
try:
print('--> about to connect to weblogic')
connect(adminUserName, adminPassword, adminURL)
edit()
#
# update the deployment plan
#
startEdit()
i=1
while (i <= int(total_jndi_to_create)):
cd('/')
print('--> about to update the deployment plan for the FtpAdapter')
eisName = configProps.get('FTP_eisName.'+ str(i))
print('--> about to create a Adapter JNDI ' + eisName)
Host = configProps.get("FTP_host."+ str(i))
print('--> about to assign a FTP host ' + Host)
userName = configProps.get("FTP_username."+ str(i))
print('--> about to assign a FTP userName ' + userName)
Port = configProps.get("FTP_port."+ str(i))
print('--> about to assign FTP port ' + Port)
Password = configProps.get("FTP_password."+ str(i))
print('--> about to assign FTP Password ' + Password)
UseSftp = configProps.get("FTP_useSftp."+ str(i))
print('--> about to assign FTP UseSftp ' + UseSftp)
ControlDir = configProps.get("FTP_controlDir."+ str(i))
print('--> about to assign FTP controlDir ' + ControlDir)
InboundDataSource = configProps.get("FTP_inboundDataSource."+ str(i))
print('--> about to assign FTP inboundDataSource ' + InboundDataSource)
OutboundDataSource = configProps.get("FTP_outboundDataSource."+ str(i))
print('--> about to assign FTP outboundDataSource ' + OutboundDataSource)
OutboundDataSourceLocal = configProps.get("FTP_outboundDataSourceLocal."+ str(i))
print('--> about to assign FTP outboundDataSourceLocal ' + OutboundDataSourceLocal)
OutboundLockTypeForWrite = configProps.get("FTP_outboundLockTypeForWrite."+ str(i))
print('--> about to assign FTP outboundLockTypeForWrite ' + OutboundLockTypeForWrite)
AuthenticationType = configProps.get("FTP_authenticationType."+ str(i))
print('--> about to assign FTP authenticationType ' + AuthenticationType)
ChangeDirectory = configProps.get("FTP_changeDirectory."+ str(i))
print('--> about to assign FTP changeDirectory ' + ChangeDirectory)
EnforceFileTypeFromSpec = configProps.get("FTP_enforceFileTypeFromSpec."+ str(i))
print('--> about to assign FTP enforceFileTypeFromSpec ' + EnforceFileTypeFromSpec)
FtpAbsolutePathBegin = configProps.get("FTP_ftpAbsolutePathBegin."+ str(i))
print('--> about to assign FTP ftpAbsolutePathBegin ' + FtpAbsolutePathBegin)
FtpPathSeparator = configProps.get("FTP_ftpPathSeparator."+ str(i))
print('--> about to assign FTP ftpPathSeparator ' + FtpPathSeparator)
IgnorePermissionsOnFile = configProps.get("FTP_ignorePermissionsOnFile."+ str(i))
print('--> about to assign FTP ignorePermissionsOnFile ' + IgnorePermissionsOnFile)
PreferredCipherSuite = configProps.get("FTP_preferredCipherSuite."+ str(i))
print('--> about to assign FTP preferredCipherSuite ' + PreferredCipherSuite)
PrivateKeyFile = configProps.get("FTP_privateKeyFile."+ str(i))
print('--> about to assign FTP privateKeyFile ' + PrivateKeyFile)
WorkingDirectory = configProps.get("FTP_workingDirectory."+ str(i))
print('--> about to assign FTP workingDirectory ' + WorkingDirectory)
startEdit()
print('--> Using plan ' + planPath)
plan = loadApplication(appPath, planPath)
print('--> adding variables to plan')
print '___ BEGIN change plan'
makeDeploymentPlanVariable(plan, 'ConnectionInstance_'+ eisName +'_JNDIName_'+ uniqueString, eisName, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/jndi-name')
makeDeploymentPlanVariable(plan, 'ConfigProperty_host_'+ Host + '_',Host, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="host"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_password_'+ Password + '_',Password, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="password"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_port_'+ Port + '_',Port, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="port"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_username_'+ userName + '_',userName, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="username"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_useSftp_'+ UseSftp + '_',UseSftp, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="useSftp"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_controlDir_'+ ControlDir + '_',ControlDir, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="controlDir"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_inboundDataSource_'+ InboundDataSource + '_',InboundDataSource, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="inboundDataSource"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundDataSource_'+ OutboundDataSource + '_',OutboundDataSource, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundDataSource"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundDataSourceLocal_'+ OutboundDataSourceLocal + '_',OutboundDataSourceLocal, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundDataSourceLocal"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundLockTypeForWrite_'+ OutboundLockTypeForWrite + '_',OutboundLockTypeForWrite, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundLockTypeForWrite"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_changeDirectory_'+ ChangeDirectory + '_',ChangeDirectory, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="changeDirectory"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_enforceFileTypeFromSpec_'+ EnforceFileTypeFromSpec + '_',EnforceFileTypeFromSpec, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="enforceFileTypeFromSpec"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ftpAbsolutePathBegin_'+ FtpAbsolutePathBegin + '_',FtpAbsolutePathBegin, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ftpAbsolutePathBegin"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ftpPathSeparator_'+ FtpPathSeparator + '_',FtpPathSeparator, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ftpPathSeparator"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ignorePermissionsOnFile_'+ IgnorePermissionsOnFile + '_',IgnorePermissionsOnFile, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ignorePermissionsOnFile"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_preferredCipherSuite_'+ PreferredCipherSuite + '_',PreferredCipherSuite, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="preferredCipherSuite"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_privateKeyFile_'+ PrivateKeyFile + '_',PrivateKeyFile, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="privateKeyFile"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_workingDirectory_'+ WorkingDirectory + '_',WorkingDirectory, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="workingDirectory"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_authenticationType_'+ AuthenticationType + '_',AuthenticationType, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="authenticationType"]/value')
print '___ DONE change plan'
print('--> saving plan')
plan.save();
save();
print('--> activating changes')
activate(block='true');
cd('/AppDeployments/FtpAdapter/Targets');
print('--> redeploying the FtpAdapter')
redeploy(appName, planPath, targets=cmo.getTargets());
print('--> done')
i=i+1
except:
print('--> something went wrong, bailing out')
stopEdit('y')
raise SystemExit
main()
#################################################################################
Procedure to run above python script,
Step1: Copy your weblogic.properties and Create_FTPAdapters.py
in /u01/Middleware/wlserver_10.3/common/bin loaction. Where wlst.sh or wlst.cmd present
Step2: Run ./wlst.sh (if you install middleware in UNIX) or wlst.cmd (if you install middleware in
windows)
Step 3: When Username and Password asked that time you have to pass weblogic console username and password.
No comments:
Post a Comment