From 9b58911bfa38850e98c74f54b92be754432758c9 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Thu, 9 Nov 2023 09:29:03 +0800 Subject: [PATCH] =?UTF-8?q?scada=E6=9C=8D=E5=8A=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/scada/config/DestinationManager.java | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 op-modules/op-scada/src/main/java/com/op/scada/config/DestinationManager.java diff --git a/op-modules/op-scada/src/main/java/com/op/scada/config/DestinationManager.java b/op-modules/op-scada/src/main/java/com/op/scada/config/DestinationManager.java deleted file mode 100644 index 8f860aa3..00000000 --- a/op-modules/op-scada/src/main/java/com/op/scada/config/DestinationManager.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.op.scada.config; - - -import com.sap.conn.jco.ext.DestinationDataProvider; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.io.File; -import java.io.FileOutputStream; -import java.util.Properties; - - -@Configuration -public class DestinationManager { - @Value("${sap.ashost}") - private String ashost; - - @Value("${sap.sysnr}") - private String sysnr; - - @Value("${sap.client}") - private String client; - - @Value("${sap.user}") - private String user; - - @Value("${sap.passwd}") - private String passwd; - - @Value("${sap.lang}") - private String lang; - - @Value("${sap.pool_capacity}") - private String pool_capacity; - - @Value("${sap.peak_limit}") - private String peak_limit; - - @Value("${sap.saprouter}") - private String saprouter; - - private static final String ABAP_AS_POOLED = "ABAP_AS_WITH_POOL"; - @Bean - public void CreateABAP(){ - - Properties connectProperties = new Properties(); - connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, ashost); - connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, sysnr); - connectProperties.setProperty(DestinationDataProvider.JCO_USER, user); - connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, passwd); - connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, client); - connectProperties.setProperty(DestinationDataProvider.JCO_LANG, lang); - connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT,peak_limit); - connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY,pool_capacity); - connectProperties.setProperty(DestinationDataProvider.JCO_SAPROUTER,saprouter); - createDataFile(ABAP_AS_POOLED,"jcoDestination",connectProperties); - } - private static void createDataFile(String name, String suffix, Properties properties) { - // TODO Auto-generated method stub - File cfg = new File(name + "." + suffix); - if (cfg.exists()) { - cfg.deleteOnExit(); - } - try { - FileOutputStream fos = new FileOutputStream(cfg,false); - properties.store(fos, "for test only!"); - } catch (Exception e) { - // TODO: handle exception -// System.out.println("Create Data file fault,error msg:" + e.toString()); - throw new RuntimeException("无法创建目标文件" + cfg.getName()); - } - } -}