提交 f4a2bce5 编写于 作者: caixiangyi's avatar caixiangyi 提交者: GitHub

Merge pull request #8 from zhouruicn/master

修改目录后调整资源文件.
.DS_Store
jvm/*
webserver/x_desktop_web/.idea/*
\ No newline at end of file
/o2cloud/
\ No newline at end of file
.project
/.settings/
/local/
/logs/
\ No newline at end of file
/logs/
/target/
/x_build_and_scratch/
\ No newline at end of file
eclipse.preferences.version=1
encoding/<project>=UTF-8
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
{
"proxyHost": "",
"proxyPort": 20030,
"port": null,
"forceRedeploy": true,
"sslEnable": false,
"scanInterval":null,
"httpProtocol":""
}
\ No newline at end of file
{
"enable": true,
"name":"dev.ray.local",
"password":"1",
"server":"collect.o2server.io"
}
\ No newline at end of file
{
"enable" : false,
"syncOrganizationDirection":"pull",
"pullSyncOrganizationInterval":null,
"fullPullSyncOrganizationInterval":null,
"corpId": "ding21016b71e78da961",
"corpSecret": "hkqWR0RvwvkSZsyWv05PtU3O9NFUoazYgpBeDjSPXzr8vLhXk6SJ2NWmk9dOWDqA",
"syncOrganizationCallbackAddress" :""
}
{
"batchSize":null,
"includes":[],
"excludes":[]
}
\ No newline at end of file
[
{
"url" : "jdbc:dm://192.168.83.128:5236/DAMENG",
"username" : "SYSDBA",
"password" :"123456789",
"includes": [],
"excludes": [],
"enable" : false
}
]
\ No newline at end of file
[
{
"url" : "jdbc:db2://127.0.0.1:50000/X01",
"username" : "db2admin",
"password" :"1234abcd",
"includes": [],
"excludes": [],
"enable" : true
}
]
\ No newline at end of file
[
{
"url":"jdbc:mysql://127.0.0.1:3306/X?serverTimezone=UTC&useSSL=false",
"username" : "root",
"password" :"1234abcd",
"includes": [],
"excludes": [],
"enable" : true
}
]
\ No newline at end of file
[
{
"url":"jdbc:oracle:thin:@//127.0.0.1:1521/orcl",
"username" : "X",
"password" :"ABcd1234",
"includes": [],
"excludes": [],
"enable" : true
}
]
\ No newline at end of file
[
{
"url" : "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=X;selectMethod=cursor;sendStringParametersAsUnicode=false",
"username" : "sa",
"password" :"zone2018",
"includes": [],
"excludes": [],
"enable" : true
}
]
\ No newline at end of file
{
"x_query_assemble_designer": "debug",
"x_processplatform_service_processing" :"debug",
"x_query_service_processing": "debug",
"x_query_assemble_surface": "debug",
"x_program_center" :"info"
}
\ No newline at end of file
{
"enable": true,
"port":null,
"sslEnable":false,
"logLevel":"warn",
"scanInterval" :3,
"isPrimaryCenter": true,
"application": {
"enable": true,
"port": null,
"sslEnable": false,
"proxyHost": "",
"proxyPort": null,
"forceRedeploy": true,
"scanInterval":5,
"includes":[],
"excludes":["x_report_*","x_strategydeploy_*","x_mind_assemble_*","x_okr_assemble_*","x_hotpic_core_*","x_calendar_*","x_attendance_*"]
},
"web": {
"enable": true,
"port": null,
"sslEnable": false,
"proxyHost": "",
"proxyPort": null,
"forceRedeploy": true
},
"storage": {
"enable": true,
"port": null,
"sslEnable": false,
"name" : ""
},
"data": {
"enable": true,
"tcpPort": null,
"webPort": null,
"includes": [],
"excludes": []
}
}
\ No newline at end of file
{
"oauthLogin": false,
"codeLogin": true,
"bindLogin": true,
"faceLogin": true,
"password": "(person.getMobile())",
"passwordPeriod": 0,
"register": "disable",
"superPermission": true,
"mobileRegex": "(^(\\+)?0{0,2}852\\d{8}$)|(^(\\+)?0{0,2}853\\d{8}$)|(^1(3|4|5|7|8|9)\\d{9}$)",
"loginPage": {
"enable": false,
"portal": "",
"page": ""
}
}
\ No newline at end of file
{
"scheduleScanTrigger": {
"minutes": 0
}
}
{
"enable" : false,
"syncOrganizationDirection":"pull",
"apiAddress":"https://qyapi.weixin.qq.com",
"pullSyncOrganizationInterval":null,
"fullPullSyncOrganizationInterval":null,
"corpId":"wxe4338503a5176e16",
"corpSecret":"eqMP0Wzmkm7aBo70AuzAEjA8ZqLLDTu70PRvrkgqAXk",
"syncOrganizationCallbackAddress" :""
}
{
"key": "",
"password": "o2",
"sslKeyStorePassword": "12345678",
"sslKeyManagerPassword": "12345678",
"initialManager": "xadmin",
"initialManagerDistinguishedName": "xadmin@o2oa@P",
"ssos": [],
"oauths": [],
"oauthClients": []
}
\ No newline at end of file
{
"appId":"dtdream_sheng_shnegjiguanshiwuju_1",
"appSecret":"XhlS2ZRXY8JZ",
"agentId":"184707353",
"syncOrganizationDirection":"pull",
"oapiAddress":"https://59.202.29.46:8004/oapi",
"pullSyncOrganizationInterval":null,
"fullPullSyncOrganizationInterval":null,
"corpId":"ding5d2dd335032d4436",
"corpSecret":"EZswiw9PKkuNmNwhIpThcO2w3mXGyOxNHxWV0EzaJGsRAP8b9SLV6HmEXL3JbfWl",
"syncOrganizationCallbackAddress" :"",
"enable":false
}
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="main" default="default">
<basename property="project" file="${basedir}" />
<tstamp>
<format property="VERSION" pattern="yyyyMMddHHmmss" locale="zh-cn" />
</tstamp>
<target name="default">
<delete dir="target" />
<mkdir dir="target/o2server" />
<mkdir dir="target/o2server/logs" />
<copy todir="target/o2server/commons/">
<fileset dir="./commons/" />
</copy>
<copy todir="target/o2server/config/sample">
<fileset dir="./config/sample">
<exclude name="**/.gitignore" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
<exclude name="**/.settings/" />
</fileset>
</copy>
<copy todir="target/o2server/local/sample">
<fileset dir="./local/sample">
<exclude name="**/.gitignore" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
<exclude name="**/.settings/" />
</fileset>
</copy>
<mkdir dir="target/o2server/servers/centerServer/webapps" />
<mkdir dir="target/o2server/servers/centerServer/work" />
<mkdir dir="target/o2server/servers/applicationServer/webapps" />
<mkdir dir="target/o2server/servers/applicationServer/work" />
<copy todir="target/o2server/servers/webServer/">
<fileset dir="./servers/webServer/">
<exclude name="**/.settings/" />
<exclude name="**/.svn/" />
<exclude name="**/.gitignore" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
<exclude name="**/Thumbs.db" />
<exclude name="**/*.bak" />
<exclude name="**/*.temp" />
<exclude name="**/*.tmp" />
<exclude name="**/~*" />
<exclude name="**/*.log" />
<exclude name="**/*.js" />
<exclude name="**/*.zip" />
<exclude name="**/*.7z" />
</fileset>
</copy>
<copy todir="target/o2server/servers/webServer/">
<fileset dir="./servers/webServer/">
<include name="**/*.min.js" />
</fileset>
</copy>
<copy todir="target/o2server/servers/webServer/x_desktop">
<fileset dir="./servers/webServer/x_desktop">
<include name="**/*.js" />
<exclude name="**/.gitignore" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
<exclude name="**/.settings/" />
</fileset>
</copy>
<copy todir="target/o2server/store/">
<fileset dir="./store/">
<exclude name="**/.settings/" />
<exclude name="**/.gitignore" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
</fileset>
</copy>
<copy todir="target/jvm/">
<fileset dir="./jvm/">
<exclude name="**/.gitignore" />
<exclude name="**/.settings/" />
</fileset>
</copy>
<copy todir="target/o2server">
<fileset dir="./">
<include name="start_windows.bat" />
<include name="start_linux.sh" />
<include name="start_aix.sh" />
<include name="start_macos.sh" />
<include name="stop_windows.bat" />
<include name="stop_linux.sh" />
<include name="stop_aix.sh" />
<include name="stop_macos.sh" />
<include name="console_windows.bat" />
<include name="console_linux.sh" />
<include name="console_aix.sh" />
<include name="console_macos.sh" />
<include name="console.jar" />
<include name="index.html" />
<exclude name="**/.gitignore" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
<exclude name="**/.settings/" />
</fileset>
</copy>
<echo message="${VERSION}" file="target/o2server/version.o2" append="false" />
<zip encoding="utf-8" destfile="target/o2server_${VERSION}.zip" update="false">
<zipfileset dir="target/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server" />
</zip>
</target>
</project>
\ No newline at end of file
......@@ -62,7 +62,6 @@
<module>x_report_assemble_control</module>
<module>x_strategydeploy_assemble_control</module>
<module>x_program_center</module>
<module>x_build_and_scratch</module>
<module>x_console</module>
</modules>
<properties>
......
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="main" default="default">
<basename property="project" file="${basedir}" />
<target name="default">
<for-contrib param="line">
<tokens>
<file file="${basedir}/../jars/manifest.cfg" />
</tokens>
<sequential>
<copy tofile="D:/o2collect/store/jars/@{line}" file="${store.dir}/jars/@{line}" overwrite="true" />
</sequential>
</for-contrib>
<for-contrib param="line">
<tokens>
<file file="${store.dir}/manifest_o2collect.cfg" />
</tokens>
<sequential>
<copy tofile="D:/o2collect/store/@{line}" file="${store.dir}/@{line}" overwrite="true" />
</sequential>
</for-contrib>
<for-contrib param="line">
<tokens>
<file file="${ext.dir}/manifest_o2collect.cfg" />
</tokens>
<sequential>
<copy tofile="D:/o2collect/commons/ext/@{line}" file="${ext.dir}/@{line}" overwrite="true" />
</sequential>
</for-contrib>
<copy file="${store.dir}/jars/manifest_o2collect.cfg" tofile="D:/o2collect/store/jars/manifest.cfg" />
<copy file="${store.dir}/manifest_o2collect.cfg" tofile="D:/o2collect/store/manifest.cfg" />
<copy file="${ext.dir}/manifest_o2collect.cfg" tofile="D:/o2collect/commons/ext/manifest.cfg" />
<copy file="${store.dir}/jars/o2_collect_console.jar" tofile="D:/o2collect/console.jar" />
</target>
</project>
\ No newline at end of file
package com.x.a.redeploy;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Date;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import com.x.base.core.project.AssembleA;
import com.x.base.core.project.CoreA;
import com.x.base.core.project.ServiceA;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.tools.Crypto;
import com.x.base.core.project.tools.DateTools;
public class Redeploy {
public static final String DEFAULT_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCWcVZIS57VeOUzi8c01WKvwJK9uRe6hrGTUYmF6J/pI6/UvCbdBWCoErbzsBZOElOH8Sqal3vsNMVLjPYClfoDyYDaUlakP3ldfnXJzAFJVVubF53KadG+fwnh9ZMvxdh7VXVqRL3IQBDwGgzX4rmSK+qkUJjc3OkrNJPB7LLD8QIDAQAB";
public static final String DEFAULT_PRIVATE_KEY = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAJZxVkhLntV45TOLxzTVYq/Akr25F7qGsZNRiYXon+kjr9S8Jt0FYKgStvOwFk4SU4fxKpqXe+w0xUuM9gKV+gPJgNpSVqQ/eV1+dcnMAUlVW5sXncpp0b5/CeH1ky/F2HtVdWpEvchAEPAaDNfiuZIr6qRQmNzc6Ss0k8HsssPxAgMBAAECgYAWtRy05NUgm5Lc6Og0jVDL/mEnydxPBy2ectwzHh2k7wIHNi8XhUxFki2TMqzrM9Dv3/LySpMl4AE3mhs34LNPy6F+MwyF5X7j+2Y6MflJyeb9HNyT++viysQneoOEiOk3ghxF2/GPjpiEF79wSp+1YKTxRAyq7ypV3t35fGOOEQJBANLDPWl8b5c3lrcz/dTamMjHbVamEyX43yzQOphzkhYsz4pruATzTxU+z8/zPdEqHcWWV39CP3xu3EYNcAhxJW8CQQC2u7PF5Xb1xYRCsmIPssFxil64vvdUadSxl7GLAgjQ9ULyYWB24KObCEzLnPcT8Pf2Q0YQOixxa/78FuzmgbyfAkA7ZFFV/H7lugB6t+f7p24OhkRFep9CwBMD6dnZRBgSr6X8d8ZvfrD2Z7DgBMeSva+OEoOtlNmXExZ3lynO9zN5AkAVczEmIMp3DSl6XtAuAZC9kD2QODJ2QToLYsAfjiyUwsWKCC43piTuVOoW2KUUPSwOR1VZIEsJQWEcHGDQqhgHAkAeZ7a6dVRZFdBwKA0ADjYCufAW2cIYiVDQBJpgB+kiLQflusNOCBK0FT3lg8BdUSy2D253Ih6l3lbaM/4M7DFQ";
public static String redeploy(String server, Integer port, Class<?> cls, String publicKey) {
String result = "";
try {
File file = null;
if (AssembleA.class.isAssignableFrom(cls)) {
file = new File("D:/O2/code/store", cls.getSimpleName() + ".war");
} else if (CoreA.class.isAssignableFrom(cls)) {
file = new File("D:/O2/code/store/jars", cls.getSimpleName() + ".jar");
} else if (ServiceA.class.isAssignableFrom(cls)) {
file = new File("D:/O2/code/store", cls.getSimpleName() + ".war");
} else {
throw new Exception("not defined class.");
}
byte[] bytes = FileUtils.readFileToByteArray(file);
CommandObject cmd = new CommandObject();
cmd.setCommand("redeploy:" + cls.getSimpleName());
cmd.setBody(Base64.encodeBase64String(bytes));
if (StringUtils.isNotEmpty(publicKey)) {
cmd.setCredential(Crypto.rsaEncrypt("o2@" + DateTools.format(new Date()), publicKey));
}
String json = XGsonBuilder.toJson(cmd);
try (Socket client = new Socket(server, port)) {
try (OutputStream outputStream = client.getOutputStream();
InputStream inputStream = client.getInputStream()) {
IOUtils.write(json, outputStream);
client.shutdownOutput();
result = IOUtils.toString(inputStream);
client.shutdownInput();
}
}
} catch (Exception e) {
result = e.getMessage();
e.printStackTrace();
}
return result;
}
public static class CommandObject {
private String command;
private String body;
private String credential;
public String getCommand() {
return command;
}
public void setCommand(String command) {
this.command = command;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getCredential() {
return credential;
}
public void setCredential(String credential) {
this.credential = credential;
}
}
@Test
public void testRsaEncrypt() throws Exception {
File file = new File("D:/O2/code/store/x_query_assemble_surface.war");
byte[] bytes = FileUtils.readFileToByteArray(file);
CommandObject cmd = new CommandObject();
cmd.setCommand("redeploy:x_query_assemble_surface");
cmd.setBody(Base64.encodeBase64URLSafeString(bytes));
String json = XGsonBuilder.toJson(cmd);
System.out.println(json);
String en = Crypto.rsaEncrypt(json, DEFAULT_PUBLIC_KEY);
System.out.println(en);
String de = Crypto.rsaDecrypt(en, DEFAULT_PRIVATE_KEY);
System.out.println(de);
}
}
package com.x.a.redeploy;
import org.junit.Test;
import com.x.base.core.project.x_calendar_assemble_control;
import com.x.base.core.project.x_calendar_core_entity;
import com.x.base.core.project.x_cms_assemble_control;
import com.x.base.core.project.x_cms_core_entity;
import com.x.base.core.project.x_organization_assemble_authentication;
import com.x.base.core.project.x_organization_assemble_control;
import com.x.base.core.project.x_processplatform_assemble_surface;
import com.x.base.core.project.x_processplatform_core_entity;
import com.x.base.core.project.x_processplatform_service_processing;
import com.x.base.core.project.x_query_assemble_designer;
import com.x.base.core.project.x_query_assemble_surface;
import com.x.base.core.project.x_query_core_entity;
import com.x.base.core.project.x_report_assemble_control;
import com.x.base.core.project.x_report_core_entity;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
public class Redeploy_127_0_0_1 {
private static Logger logger = LoggerFactory.getLogger(Redeploy_127_0_0_1.class);
public static final String HOST = "localhost";
public static Integer PORT = 20010;
@Test
public void x_cms_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_cms_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_cms_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_cms_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_designer() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_core_entity() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_surface() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_service_processing() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_service_processing.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_authentication() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_authentication.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
}
package com.x.a.redeploy;
import org.junit.Test;
import com.x.base.core.project.x_attendance_assemble_control;
import com.x.base.core.project.x_base_core_project;
import com.x.base.core.project.x_bbs_assemble_control;
import com.x.base.core.project.x_bbs_core_entity;
import com.x.base.core.project.x_calendar_assemble_control;
import com.x.base.core.project.x_calendar_core_entity;
import com.x.base.core.project.x_cms_assemble_control;
import com.x.base.core.project.x_cms_core_entity;
import com.x.base.core.project.x_file_assemble_control;
import com.x.base.core.project.x_hotpic_assemble_control;
import com.x.base.core.project.x_meeting_assemble_control;
import com.x.base.core.project.x_message_assemble_communicate;
import com.x.base.core.project.x_mind_assemble_control;
import com.x.base.core.project.x_okr_assemble_control;
import com.x.base.core.project.x_okr_core_entity;
import com.x.base.core.project.x_organization_assemble_authentication;
import com.x.base.core.project.x_organization_assemble_control;
import com.x.base.core.project.x_organization_assemble_custom;
import com.x.base.core.project.x_portal_assemble_designer;
import com.x.base.core.project.x_portal_assemble_surface;
import com.x.base.core.project.x_processplatform_assemble_designer;
import com.x.base.core.project.x_processplatform_assemble_surface;
import com.x.base.core.project.x_processplatform_core_entity;
import com.x.base.core.project.x_processplatform_service_processing;
import com.x.base.core.project.x_query_assemble_designer;
import com.x.base.core.project.x_query_assemble_surface;
import com.x.base.core.project.x_query_core_entity;
import com.x.base.core.project.x_report_assemble_control;
import com.x.base.core.project.x_report_core_entity;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
public class Redeploy_192_168_10_206 {
private static Logger logger = LoggerFactory.getLogger(Redeploy_192_168_10_206.class);
public static final String HOST = "192.168.10.206";
public static Integer PORT = 20010;
@Test
public void x_hotpic_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_hotpic_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_bbs_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_core_entity() {
logger.print("result:{}.", Redeploy.redeploy(HOST, PORT, x_bbs_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_cms_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_cms_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
// @Test
// public void x_cms_assemble_search() {
// logger.print("result:{}.",
// Redeploy.redeploy(HOST, PORT, x_cms_assemble_search.class, Redeploy.DEFAULT_PUBLIC_KEY));
// }
@Test
public void x_cms_core_entity() {
logger.print("result:{}.", Redeploy.redeploy(HOST, PORT, x_cms_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_attendance_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_attendance_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_report_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_base_core_project() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_base_core_project.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_core_entity() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_report_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_message_assemble_communicate() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_message_assemble_communicate.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_mind_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_mind_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_calendar_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_core_entity() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_calendar_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_okr_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_core_entity() {
logger.print("result:{}.", Redeploy.redeploy(HOST, PORT, x_okr_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_core_entity() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_designer() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_core_entity() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_service_processing() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_service_processing.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_meeting_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_meeting_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_authentication() {
logger.print("result:{}.", Redeploy.redeploy(HOST, PORT, x_organization_assemble_authentication.class,
Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_custom() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_custom.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_portal_assemble_designer() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_portal_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_portal_assemble_surface() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_portal_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_file_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_file_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_designer() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
}
package com.x.a.redeploy;
import org.junit.Test;
import com.x.base.core.project.x_attendance_assemble_control;
import com.x.base.core.project.x_base_core_project;
import com.x.base.core.project.x_bbs_assemble_control;
import com.x.base.core.project.x_bbs_core_entity;
import com.x.base.core.project.x_calendar_assemble_control;
import com.x.base.core.project.x_calendar_core_entity;
import com.x.base.core.project.x_cms_assemble_control;
import com.x.base.core.project.x_cms_core_entity;
import com.x.base.core.project.x_file_assemble_control;
import com.x.base.core.project.x_hotpic_assemble_control;
import com.x.base.core.project.x_meeting_assemble_control;
import com.x.base.core.project.x_message_assemble_communicate;
import com.x.base.core.project.x_mind_assemble_control;
import com.x.base.core.project.x_okr_assemble_control;
import com.x.base.core.project.x_okr_core_entity;
import com.x.base.core.project.x_organization_assemble_authentication;
import com.x.base.core.project.x_organization_assemble_control;
import com.x.base.core.project.x_organization_assemble_custom;
import com.x.base.core.project.x_portal_assemble_designer;
import com.x.base.core.project.x_portal_assemble_surface;
import com.x.base.core.project.x_processplatform_assemble_designer;
import com.x.base.core.project.x_processplatform_assemble_surface;
import com.x.base.core.project.x_processplatform_core_entity;
import com.x.base.core.project.x_processplatform_service_processing;
import com.x.base.core.project.x_query_assemble_designer;
import com.x.base.core.project.x_query_assemble_surface;
import com.x.base.core.project.x_query_core_entity;
import com.x.base.core.project.x_report_assemble_control;
import com.x.base.core.project.x_report_core_entity;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
public class Redeploy_60_190_253_249 {
private static Logger logger = LoggerFactory.getLogger(Redeploy_60_190_253_249.class);
public static final String HOST = "60.190.253.249";
public static Integer PORT = 20010;
@Test
public void x_hotpic_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_hotpic_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_bbs_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_core_entity() {
logger.print("result:{}.", Redeploy.redeploy(HOST, PORT, x_bbs_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_cms_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_cms_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
// @Test
// public void x_cms_assemble_search() {
// logger.print("result:{}.",
// Redeploy.redeploy(HOST, PORT, x_cms_assemble_search.class, Redeploy.DEFAULT_PUBLIC_KEY));
// }
@Test
public void x_cms_core_entity() {
logger.print("result:{}.", Redeploy.redeploy(HOST, PORT, x_cms_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_attendance_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_attendance_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_report_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_base_core_project() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_base_core_project.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_core_entity() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_report_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_message_assemble_communicate() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_message_assemble_communicate.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_mind_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_mind_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_calendar_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_core_entity() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_calendar_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_okr_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_core_entity() {
logger.print("result:{}.", Redeploy.redeploy(HOST, PORT, x_okr_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_core_entity() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_designer() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_core_entity() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_service_processing() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_service_processing.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_meeting_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_meeting_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_authentication() {
logger.print("result:{}.", Redeploy.redeploy(HOST, PORT, x_organization_assemble_authentication.class,
Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_custom() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_custom.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_portal_assemble_designer() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_portal_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_portal_assemble_surface() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_portal_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_file_assemble_control() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_file_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_designer() {
logger.print("result:{}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
}
package com.x.a.redeploy;
import org.junit.Test;
import com.x.base.core.project.x_calendar_assemble_control;
import com.x.base.core.project.x_calendar_core_entity;
import com.x.base.core.project.x_cms_assemble_control;
import com.x.base.core.project.x_cms_core_entity;
import com.x.base.core.project.x_processplatform_assemble_surface;
import com.x.base.core.project.x_query_assemble_surface;
import com.x.base.core.project.x_query_core_entity;
import com.x.base.core.project.x_report_assemble_control;
import com.x.base.core.project.x_report_core_entity;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
public class Redeploy_ahpp_zoneland_net {
private static Logger logger = LoggerFactory.getLogger(Redeploy_ahpp_zoneland_net.class);
public static final String HOST = "ahpp.zoneland.net";
public static Integer PORT = 20010;
@Test
public void x_cms_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_cms_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_cms_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_cms_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_core_entity() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
}
package com.x.a.redeploy;
import org.junit.Test;
import com.x.base.core.project.x_attendance_assemble_control;
import com.x.base.core.project.x_base_core_project;
import com.x.base.core.project.x_bbs_assemble_control;
import com.x.base.core.project.x_bbs_core_entity;
import com.x.base.core.project.x_calendar_assemble_control;
import com.x.base.core.project.x_calendar_core_entity;
import com.x.base.core.project.x_cms_assemble_control;
import com.x.base.core.project.x_cms_core_entity;
import com.x.base.core.project.x_hotpic_assemble_control;
import com.x.base.core.project.x_meeting_assemble_control;
import com.x.base.core.project.x_message_assemble_communicate;
import com.x.base.core.project.x_mind_assemble_control;
import com.x.base.core.project.x_okr_assemble_control;
import com.x.base.core.project.x_okr_core_entity;
import com.x.base.core.project.x_organization_assemble_authentication;
import com.x.base.core.project.x_organization_assemble_control;
import com.x.base.core.project.x_organization_assemble_custom;
import com.x.base.core.project.x_processplatform_assemble_designer;
import com.x.base.core.project.x_processplatform_assemble_surface;
import com.x.base.core.project.x_processplatform_core_entity;
import com.x.base.core.project.x_processplatform_service_processing;
import com.x.base.core.project.x_query_assemble_designer;
import com.x.base.core.project.x_query_assemble_surface;
import com.x.base.core.project.x_query_core_entity;
import com.x.base.core.project.x_report_assemble_control;
import com.x.base.core.project.x_report_core_entity;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
public class Redeploy_demo_o2oa_io {
private static Logger logger = LoggerFactory.getLogger(Redeploy_demo_o2oa_io.class);
public static final String HOST = "demo.o2oa.io";
public static Integer PORT = 20010;
@Test
public void x_hotpic_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_hotpic_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_bbs_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_bbs_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_cms_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_cms_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
// @Test
// public void x_cms_assemble_search() {
// logger.print("result:{}",
// Redeploy.redeploy(HOST, PORT, x_cms_assemble_search.class, Redeploy.DEFAULT_PUBLIC_KEY));
// }
@Test
public void x_cms_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_cms_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_attendance_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_attendance_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_base_core_project() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_base_core_project.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_message_assemble_communicate() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_message_assemble_communicate.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_mind_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_mind_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_okr_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_okr_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_core_entity() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_designer() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_designer() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_query_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_service_processing() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_service_processing.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_meeting_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_meeting_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_authentication() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_organization_assemble_authentication.class,
Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_custom() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_custom.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
}
package com.x.a.redeploy;
import org.junit.Test;
import com.x.base.core.project.x_attendance_assemble_control;
import com.x.base.core.project.x_base_core_project;
import com.x.base.core.project.x_bbs_assemble_control;
import com.x.base.core.project.x_bbs_core_entity;
import com.x.base.core.project.x_calendar_assemble_control;
import com.x.base.core.project.x_calendar_core_entity;
import com.x.base.core.project.x_cms_assemble_control;
import com.x.base.core.project.x_cms_core_entity;
import com.x.base.core.project.x_component_assemble_control;
import com.x.base.core.project.x_hotpic_assemble_control;
import com.x.base.core.project.x_meeting_assemble_control;
import com.x.base.core.project.x_message_assemble_communicate;
import com.x.base.core.project.x_mind_assemble_control;
import com.x.base.core.project.x_mind_core_entity;
import com.x.base.core.project.x_okr_assemble_control;
import com.x.base.core.project.x_okr_core_entity;
import com.x.base.core.project.x_organization_assemble_authentication;
import com.x.base.core.project.x_organization_assemble_control;
import com.x.base.core.project.x_organization_assemble_custom;
import com.x.base.core.project.x_portal_assemble_surface;
import com.x.base.core.project.x_processplatform_assemble_designer;
import com.x.base.core.project.x_processplatform_assemble_surface;
import com.x.base.core.project.x_processplatform_service_processing;
import com.x.base.core.project.x_query_assemble_designer;
import com.x.base.core.project.x_query_assemble_surface;
import com.x.base.core.project.x_query_service_processing;
import com.x.base.core.project.x_report_assemble_control;
import com.x.base.core.project.x_report_core_entity;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
public class Redeploy_dev_o2server_io {
private static Logger logger = LoggerFactory.getLogger(Redeploy_dev_o2server_io.class);
public static final String HOST = "dev.o2server.io";
public static Integer PORT = 20010;
@Test
public void x_hotpic_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_hotpic_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_cms_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_cms_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_cms_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_cms_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_component_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_component_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_attendance_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_attendance_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_base_core_project() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_base_core_project.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_message_assemble_communicate() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_message_assemble_communicate.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_mind_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_mind_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_bbs_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_bbs_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_okr_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_okr_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_mind_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_mind_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_designer() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_query_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_service_processing() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_service_processing.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_designer() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_service_processing() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_service_processing.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_meeting_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_meeting_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_authentication() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_organization_assemble_authentication.class,
Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_custom() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_custom.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_portal_assemble_surface() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_portal_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
}
package com.x.a.redeploy;
import org.junit.Test;
import com.x.base.core.project.x_attendance_assemble_control;
import com.x.base.core.project.x_base_core_project;
import com.x.base.core.project.x_bbs_assemble_control;
import com.x.base.core.project.x_bbs_core_entity;
import com.x.base.core.project.x_calendar_assemble_control;
import com.x.base.core.project.x_calendar_core_entity;
import com.x.base.core.project.x_cms_assemble_control;
import com.x.base.core.project.x_cms_core_entity;
import com.x.base.core.project.x_hotpic_assemble_control;
import com.x.base.core.project.x_meeting_assemble_control;
import com.x.base.core.project.x_message_assemble_communicate;
import com.x.base.core.project.x_mind_assemble_control;
import com.x.base.core.project.x_okr_assemble_control;
import com.x.base.core.project.x_okr_core_entity;
import com.x.base.core.project.x_organization_assemble_authentication;
import com.x.base.core.project.x_organization_assemble_control;
import com.x.base.core.project.x_organization_assemble_custom;
import com.x.base.core.project.x_processplatform_assemble_designer;
import com.x.base.core.project.x_processplatform_assemble_surface;
import com.x.base.core.project.x_processplatform_core_entity;
import com.x.base.core.project.x_processplatform_service_processing;
import com.x.base.core.project.x_query_assemble_designer;
import com.x.base.core.project.x_query_assemble_surface;
import com.x.base.core.project.x_query_core_entity;
import com.x.base.core.project.x_report_assemble_control;
import com.x.base.core.project.x_report_core_entity;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
public class Redeploy_www_o2oa_io {
private static Logger logger = LoggerFactory.getLogger(Redeploy_www_o2oa_io.class);
public static final String HOST = "www.o2oa.io";
public static Integer PORT = 20010;
@Test
public void x_hotpic_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_hotpic_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_bbs_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_bbs_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_bbs_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_cms_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_cms_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
// @Test
// public void x_cms_assemble_search() {
// logger.print("result:{}",
// Redeploy.redeploy(HOST, PORT, x_cms_assemble_search.class, Redeploy.DEFAULT_PUBLIC_KEY));
// }
@Test
public void x_cms_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_cms_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_attendance_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_attendance_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_base_core_project() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_base_core_project.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_message_assemble_communicate() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_message_assemble_communicate.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_mind_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_mind_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_okr_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_okr_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_okr_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_core_entity() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_designer() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_designer() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_query_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_service_processing() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_service_processing.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_meeting_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_meeting_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_authentication() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_organization_assemble_authentication.class,
Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_organization_assemble_custom() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_organization_assemble_custom.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
}
package com.x.a.redeploy;
import org.junit.Test;
import com.x.base.core.project.x_base_core_project;
import com.x.base.core.project.x_calendar_assemble_control;
import com.x.base.core.project.x_calendar_core_entity;
import com.x.base.core.project.x_cms_assemble_control;
import com.x.base.core.project.x_cms_core_entity;
import com.x.base.core.project.x_file_assemble_control;
import com.x.base.core.project.x_hotpic_assemble_control;
import com.x.base.core.project.x_processplatform_assemble_designer;
import com.x.base.core.project.x_processplatform_assemble_surface;
import com.x.base.core.project.x_processplatform_core_entity;
import com.x.base.core.project.x_query_assemble_surface;
import com.x.base.core.project.x_query_core_entity;
import com.x.base.core.project.x_report_assemble_control;
import com.x.base.core.project.x_report_core_entity;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
public class Redeploy_www_zoneland_net {
private static Logger logger = LoggerFactory.getLogger(Redeploy_www_zoneland_net.class);
public static final String HOST = "www.zoneland.net";
public static Integer PORT = 20110;
@Test
public void x_cms_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_cms_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
// @Test
// public void x_cms_assemble_search() {
// logger.print("result:{}",
// Redeploy.redeploy(HOST, PORT, x_cms_assemble_search.class, Redeploy.DEFAULT_PUBLIC_KEY));
// }
@Test
public void x_cms_core_entity() {
logger.print("result:{}", Redeploy.redeploy(HOST, PORT, x_cms_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_base_core_project() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_base_core_project.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_report_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_report_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_calendar_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_calendar_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_query_core_entity() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_query_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_surface() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_surface.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_assemble_designer() {
logger.print("result: {}.",
Redeploy.redeploy(HOST, PORT, x_processplatform_assemble_designer.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_processplatform_core_entity() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_processplatform_core_entity.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_file_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_file_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
@Test
public void x_hotpic_assemble_control() {
logger.print("result:{}",
Redeploy.redeploy(HOST, PORT, x_hotpic_assemble_control.class, Redeploy.DEFAULT_PUBLIC_KEY));
}
}
package o2.a.build.ant;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import com.x.base.core.project.AssembleA;
import com.x.base.core.project.CoreA;
import com.x.base.core.project.Packages;
import com.x.base.core.project.ServiceA;
import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner;
import io.github.lukehutch.fastclasspathscanner.scanner.ScanResult;
public class CopyDeployAntScript {
@Test
public void copyAssembleScript() throws Exception {
File root = new File(new File("").getAbsolutePath());
File template = new File(root, "assemble_template_build.xml");
for (String str : this.listAssemble()) {
File dir = new File(root.getParent(), str);
String name = StringUtils.replace(str, ".", "_") + "_build.xml";
File dest = new File(dir, name);
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
}
@Test
public void copyServiceScript() throws Exception {
File root = new File(new File("").getAbsolutePath());
File template = new File(root, "service_template_build.xml");
for (String str : this.listService()) {
File dir = new File(root.getParent(), str);
String name = StringUtils.replace(str, ".", "_") + "_build.xml";
File dest = new File(dir, name);
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
}
@Test
public void copyCoreScript() throws Exception {
File root = new File(new File("").getAbsolutePath());
File template = new File(root, "core_template_build.xml");
for (String str : this.listCore()) {
File dir = new File(root.getParent(), str);
String name = StringUtils.replace(str, ".", "_") + "_build.xml";
File dest = new File(dir, name);
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
}
private List<String> listAssemble() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> list = new ArrayList<>();
for (String str : scanResult.getNamesOfSubclassesOf(AssembleA.class)) {
Class<?> clz = Class.forName(str);
list.add(clz.getSimpleName());
}
Collections.sort(list, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return list;
}
private List<String> listService() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> list = new ArrayList<>();
for (String str : scanResult.getNamesOfSubclassesOf(ServiceA.class)) {
Class<?> clz = Class.forName(str);
list.add(clz.getSimpleName());
}
Collections.sort(list, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return list;
}
private List<String> listCore() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> list = new ArrayList<>();
for (String str : scanResult.getNamesOfSubclassesOf(CoreA.class)) {
Class<?> clz = Class.forName(str);
list.add(clz.getSimpleName());
}
Collections.sort(list, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return list;
}
}
package o2.a.build.entity;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.openjpa.persistence.jdbc.ContainerTable;
import org.apache.openjpa.persistence.jdbc.Index;
import org.junit.Test;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.ContainerEntity;
import com.x.base.core.project.Packages;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.gson.XGsonBuilder;
import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner;
import io.github.lukehutch.fastclasspathscanner.scanner.ScanResult;
public class CheckEntity {
/*
* 检查数据库字段名是否是ColumnNamePrefix + fieldName
*/
@Test
public void checkColumnName() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> names = scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class);
List<Class<?>> list = new ArrayList<>();
for (String str : names) {
list.add(Class.forName(str));
}
for (Class<?> cls : list) {
List<Field> fields = FieldUtils.getAllFieldsList(cls);
for (Field field : fields) {
Column col = field.getAnnotation(Column.class);
if (null != col) {
if (StringUtils.equals(JpaObject.ColumnNamePrefix + field.getName(), col.name())) {
// System.out.println(cls + ":" + field.getName() + ":" + col.name() + ":" +
// col.length());
} else {
System.err.println(cls + ":" + field.getName() + ":" + col.name() + ":" + col.length());
}
}
}
}
}
/*
* 检查是否有将Lob类型字段增加索引
*/
@Test
public void checkLobIndex() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> names = scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class);
List<Class<?>> list = new ArrayList<>();
for (String str : names) {
list.add(Class.forName(str));
}
for (Class<?> cls : list) {
List<Field> fields = FieldUtils.getAllFieldsList(cls);
for (Field field : fields) {
Lob lob = field.getAnnotation(Lob.class);
Index index = field.getAnnotation(Index.class);
if ((null != lob) && (null != index)) {
System.err.println(cls + ":" + field.getName());
} else {
// System.out.println(cls + ":" + field.getName() ;
}
}
}
}
/*
* 检查是否有将Lob类型字段增加索引
*
* @FieldDescribe("群组的个人成员.存放个人 ID.")
*
* @PersistentCollection(fetch = FetchType.EAGER)
*
* @OrderColumn(name = PersistenceProperties.orderColumn)
*
* @ContainerTable(name = TABLE + ContainerTableNameMiddle +
* personList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle +
* personList_FIELDNAME + JoinIndexNameSuffix))
*
* @ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix +
* personList_FIELDNAME)
*
* @ElementIndex(name = TABLE + IndexNameMiddle + personList_FIELDNAME +
* ElementIndexNameSuffix)
*
* @CheckPersist(allowEmpty = true, citationExists = @CitationExist(type =
* Person.class)) private List<String> personList;
*/
@Test
public void checkListFieldContainerTableName() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> names = scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class);
List<Class<?>> list = new ArrayList<>();
for (String str : names) {
list.add(Class.forName(str));
}
for (Class<?> cls : list) {
List<Field> fields = FieldUtils.getAllFieldsList(cls);
for (Field field : fields) {
if (List.class.isAssignableFrom(field.getType())) {
ContainerTable containerTable = field.getAnnotation(ContainerTable.class);
if (null != containerTable) {
String name = FieldUtils.readStaticField(cls, "TABLE", true).toString()
+ JpaObject.ContainerTableNameMiddle + field.getName();
if (!StringUtils.equals(name, containerTable.name())) {
System.err.println(cls.getName() + ":" + field.getName());
}
}
}
}
}
}
/*
* 检查是否将@FieldDescribe注解到static字段上,如果是意味着上下行搞错了
*/
@Test
public void checkFieldDescribeOnStatic() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> names = scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class);
List<Class<?>> list = new ArrayList<>();
for (String str : names) {
list.add(Class.forName(str));
}
for (Class<?> cls : list) {
List<Field> fields = FieldUtils.getFieldsListWithAnnotation(cls, FieldDescribe.class);
for (Field field : fields) {
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
System.out.println(cls + ":" + field.getName());
}
}
}
}
/*
* 检查约束名中的table名称和entity类中的TABLE名称是否一致
*/
@Test
public void checkTableNameUniqueConstraintName() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> names = scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class);
List<Class<?>> list = new ArrayList<>();
for (String str : names) {
list.add(Class.forName(str));
}
for (Class<?> cls : list) {
Table table = cls.getAnnotation(Table.class);
String name = Objects.toString(FieldUtils.readStaticField(cls, "TABLE", true));
if (!StringUtils.equals(table.name(), name)) {
System.out.println("table name not match:" + cls);
}
for (UniqueConstraint u : table.uniqueConstraints()) {
if (!StringUtils.startsWith(u.name(), table.name())) {
System.out.println("uniqueConstraint name not match:" + cls);
}
}
}
}
/*
* 检查类中是否有在createTime,updateTime和sequence上的索引,这几个索引已经用约束在类上了
*/
@Test
public void checkIdCreateTimeUpdateTimeSequenceIndex() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> names = scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class);
List<Class<?>> list = new ArrayList<>();
for (String str : names) {
list.add(Class.forName(str));
}
for (Class<?> cls : list) {
Field idField = FieldUtils.getField(cls, JpaObject.id_FIELDNAME, true);
Field createTimeField = FieldUtils.getField(cls, JpaObject.createTime_FIELDNAME, true);
Field updateTimeField = FieldUtils.getField(cls, JpaObject.updateTime_FIELDNAME, true);
Field sequenceField = FieldUtils.getField(cls, JpaObject.sequence_FIELDNAME, true);
if ((null != idField.getAnnotation(Index.class)) || (null != createTimeField.getAnnotation(Index.class))
|| (null != updateTimeField.getAnnotation(Index.class))
|| (null != sequenceField.getAnnotation(Index.class))) {
System.out.println(cls.getName() + " has IdCreateTimeUpdateTimeSequenceIndex");
}
}
}
/*
* 检查entity是否有重复的字段
*/
@Test
public void checkMutiField() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> names = scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class);
List<Class<?>> list = new ArrayList<>();
for (String str : names) {
list.add(Class.forName(str));
}
for (Class<?> cls : list) {
Object o = cls.newInstance();
XGsonBuilder.toJson(o);
}
}
/*
* 检查entity是否有重复的字段
*/
@Test
public void checkEnum() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> names = scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class);
List<Class<?>> list = new ArrayList<>();
for (String str : names) {
list.add(Class.forName(str));
}
for (Class<?> cls : list) {
List<Field> fields = FieldUtils.getFieldsListWithAnnotation(cls, FieldDescribe.class);
for (Field field : fields) {
if (field.getType().isEnum()) {
Enumerated enumerated = field.getAnnotation(Enumerated.class);
Column column = field.getAnnotation(Column.class);
if (null == enumerated || (!Objects.equals(EnumType.STRING, enumerated.value())) || (null == column)
|| column.length() > 200) {
System.out.println(cls + ":" + field.getName());
}
}
}
}
}
}
package o2.a.build.jest;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import com.x.base.core.project.AssembleA;
import com.x.base.core.project.Packages;
import com.x.base.core.project.ServiceA;
import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner;
import io.github.lukehutch.fastclasspathscanner.scanner.ScanResult;
public class CopyJest {
@Test
public void copyDescribeJs() throws Exception {
File root = new File(new File("").getAbsolutePath());
File template = new File(root, "jest/describe.js");
for (String str : this.listAssemble()) {
File dir = new File(root.getParent(), str);
File dest = new File(dir, "jest/describe.js");
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
for (String str : this.listService()) {
File dir = new File(root.getParent(), str);
File dest = new File(dir, "jest/describe.js");
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
}
@Test
public void copyJqueryJs() throws Exception {
File root = new File(new File("").getAbsolutePath());
File template = new File(root, "jest/jquery.min.js");
for (String str : this.listAssemble()) {
File dir = new File(root.getParent(), str);
File dest = new File(dir, "jest/jquery.min.js");
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
for (String str : this.listService()) {
File dir = new File(root.getParent(), str);
File dest = new File(dir, "jest/jquery.min.js");
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
}
@Test
public void copylipboardJs() throws Exception {
File root = new File(new File("").getAbsolutePath());
File template = new File(root, "jest/clipboard.min.js");
for (String str : this.listAssemble()) {
File dir = new File(root.getParent(), str);
File dest = new File(dir, "jest/clipboard.min.js");
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
for (String str : this.listService()) {
File dir = new File(root.getParent(), str);
File dest = new File(dir, "jest/jquery.min.js");
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
}
@Test
public void copyIndexHtml() throws Exception {
File root = new File(new File("").getAbsolutePath());
File template = new File(root, "jest/index.html");
for (String str : this.listAssemble()) {
File dir = new File(root.getParent(), str);
File dest = new File(dir, "jest/index.html");
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
for (String str : this.listService()) {
File dir = new File(root.getParent(), str);
File dest = new File(dir, "jest/index.html");
System.out.println("copy to:" + dest.getAbsolutePath());
FileUtils.copyFile(template, dest);
}
}
private List<String> listAssemble() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> list = new ArrayList<>();
for (String str : scanResult.getNamesOfSubclassesOf(AssembleA.class)) {
Class<?> clz = Class.forName(str);
list.add(clz.getSimpleName());
}
Collections.sort(list, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return list;
}
private List<String> listService() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> list = new ArrayList<>();
for (String str : scanResult.getNamesOfSubclassesOf(ServiceA.class)) {
Class<?> clz = Class.forName(str);
list.add(clz.getSimpleName());
}
Collections.sort(list, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return list;
}
}
package o2.a.build.lib;
import java.io.File;
import java.io.FileFilter;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.AndFileFilter;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.NotFileFilter;
import org.apache.commons.io.filefilter.WildcardFileFilter;
import org.junit.Test;
public class Client_sharedLib {
@Test
public void copyJar() throws Exception {
String root = FilenameUtils.getFullPathNoEndSeparator(new File("").getAbsolutePath());
File lib = new File(root, "lib");
File sharedLib = new File(root, "shared/lib");
FileUtils.cleanDirectory(sharedLib);
FileUtils.copyDirectory(new File(lib, "apache/ant"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/beanutils"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/codec"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/collections4"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/dbcp2"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/pool2"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/fileupload"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/io"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/lang3"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/logging"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/commons/net"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "apache/poi"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "sourceforge/dom4j"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "google/gson"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "github/fast-classpath-scanner"), sharedLib,
this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "ehcache"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "slf4j"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "javax"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "mysql"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "postgresql"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "ibm/informix"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "ibm/db2"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "oracle"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "cargo"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "jersey"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "imgscalr"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "jpinyin"), sharedLib, this.notJavadocTestJarFilter());
FileUtils.copyDirectory(new File(lib, "sourceforge/dom4j"), sharedLib, this.notJavadocTestJarFilter());
}
private FileFilter notJavadocTestJarFilter() {
IOFileFilter filter = new AndFileFilter(new NotFileFilter(new WildcardFileFilter("*javadoc.jar")),
new NotFileFilter(new WildcardFileFilter("*tests.jar")));
filter = new AndFileFilter(filter, new NotFileFilter(new WildcardFileFilter("*sources.jar")));
return new AndFileFilter(filter, new WildcardFileFilter("*.jar"));
}
}
/**
* zoneland.net Inc.
* Copyright (c) 2002-2013 All Rights Reserved.
*/
package o2.a.build.lib;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.List;
import java.util.Properties;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
/**
*
* @author ypz
* @version $Id: FtpFileHelper.java, v 0.1 2013-6-6 下午4:57:38 ypz Exp $
*/
public class SFtpFileHelper {
private static final Logger logger = LoggerFactory.getLogger(SFtpFileHelper.class);
private ChannelSftp sftp;
private Session sshSession;
private String ftpIp;
private String username;
private String password;
private int port;
private static final int DEFAULT_PORT = 22;
public SFtpFileHelper(String ftpIp,String username,String password,int port){
this.ftpIp = ftpIp;
this.username = username;
this.password = password;
this.port = port;
}
public SFtpFileHelper(String ftpIp,String username,String password){
this(ftpIp,username,password,DEFAULT_PORT);
}
public boolean uploadFile(File file,String fileName,String directory){
if(file != null && StringUtils.isNotBlank(fileName) && StringUtils.isNotBlank(directory)){
try {
connectFtp();
if(!changeDir(directory)){// 如果该目录文件夹不存在,则创建一个文件夹
sftp.mkdir(directory);
}
this.sftp.put(new FileInputStream(file), file.getName());
return true;
}catch (Exception e) {
logger.error("上传文件异常", e);
}finally{
try {
disConnect();
} catch (Exception e) {
logger.error("释放FTP连接异常", e);
}
}
}
return false;
}
public boolean updloadFile(byte[] byteArray,String fileName,String directory){
if(byteArray != null && byteArray.length > 0 && StringUtils.isNotBlank(fileName) && StringUtils.isNotBlank(directory)){
try {
connectFtp();
if(!changeDir(directory)){
// 如果该目录文件夹不存在,则创建一个文件夹,如果有多级则一层一层创建目录
String[] directorys=directory.split("/");
String workHome="";
for(String dir:directorys){
workHome=workHome+"/"+dir;//windows
if(!changeDir(workHome)){
sftp.mkdir(workHome);
}
}
}
InputStream in = new ByteArrayInputStream(byteArray);
this.sftp.put(in, fileName);
return true;
}catch (Exception e) {
logger.error("上传文件异常", e);
}finally{
try {
disConnect();
} catch (Exception e) {
logger.error("释放FTP连接异常", e);
}
}
}
return false;
}
public byte[] downloadAsByteArray(String fileName,String directory){
if(StringUtils.isNotBlank(fileName)){
try {
connectFtp();
//进入保存目录
changeDir(directory);
InputStream in = this.sftp.get(fileName);
byte[] bytes = new byte[1024];
ByteArrayOutputStream bout = new ByteArrayOutputStream();
int c;
while ( (c=in.read(bytes))!=-1) {
bout.write(bytes, 0 ,c);
}
byte[] b= bout.toByteArray();
in.close();
bout.close();
return b;
}catch (Exception e) {
logger.warn("下载文件异常"+e.getMessage());
}finally{
try {
disConnect();
} catch (Exception e) {
logger.error("释放FTP连接异常", e);
}
}
}
return null;
}
public boolean deleteFtpFiles(List<String> fileNames,String directory) throws Exception{
boolean deleteStatus = false;
try{
connectFtp();
//进入保存目录
changeDir(directory);
if(fileNames != null && fileNames.size()>0) {
for(String fileName : fileNames) {
if(StringUtils.isNotBlank(fileName)) {
sftp.rm(fileName);
}
}
}
}finally{
disConnect();
}
deleteStatus = true;
return deleteStatus;
}
private void connectFtp() throws Exception{
if(sftp != null && sftp.isConnected()){
return;
}
JSch jsch = new JSch();
this.sshSession = jsch.getSession(this.username, this.ftpIp, this.port);
logger.debug("sftp Session created.");
this.sshSession.setPassword(password);
Properties sshConfig = new Properties();
sshConfig.put("StrictHostKeyChecking", "no");
this.sshSession.setConfig(sshConfig);
this.sshSession.connect(20000);
logger.debug("sftp Session connected.");
Channel channel = this.sshSession.openChannel("sftp");
channel.connect();
this.sftp = (ChannelSftp)channel;
logger.debug("sftp Connected to " + this.ftpIp + ".");
}
private void disConnect() throws Exception{
if(sftp != null && sftp.isConnected()){
sftp.disconnect();
}
if(sshSession != null && sshSession.isConnected()){
sshSession.disconnect();
}
}
private boolean changeDir(String directory){
boolean flag = false;;
try {
if(sftp != null && sftp.isConnected()){
if(StringUtils.isNotBlank(directory)){
sftp.cd(directory);
flag = true;
}
}
} catch (Exception e) {
logger.warn(directory+"目录不存在");
}
return flag;
}
}
package o2.a.build.mapping;
public class Client_hbtelecom {
// @Test
// public void create_datas() throws Exception {
// Reflections reflections = new Reflections("com.x");
// Set<Class<?>> ces = reflections.getTypesAnnotatedWith(ContainerEntity.class);
// List<Class<?>> sortedList = new ArrayList<Class<?>>(ces);
// Collections.sort(sortedList, new Comparator<Class<?>>() {
// public int compare(Class<?> c1, Class<?> c2) {
// return c1.getCanonicalName().compareTo(c2.getCanonicalName());
// }
// });
// Datas datas = new Datas();
// for (Class<?> clz : sortedList) {
// CopyOnWriteArrayList<Data> list = new CopyOnWriteArrayList<>();
// Data data0 = new Data();
// data0.setDataServer("xd01");
// data0.setOrder(0);
// data0.setDataCacheLevel(LogLevel.WARN);
// data0.setEnhanceLevel(LogLevel.WARN);
// data0.setJdbcLevel(LogLevel.WARN);
// data0.setMetaDataLevel(LogLevel.WARN);
// data0.setQueryLevel(LogLevel.WARN);
// data0.setRuntimeLevel(LogLevel.WARN);
// data0.setSqlLevel(LogLevel.WARN);
// data0.setToolLevel(LogLevel.WARN);
// Data data1 = new Data();
// data1.setDataServer("xd02");
// data1.setOrder(1);
// data1.setDataCacheLevel(LogLevel.WARN);
// data1.setEnhanceLevel(LogLevel.WARN);
// data1.setJdbcLevel(LogLevel.WARN);
// data1.setMetaDataLevel(LogLevel.WARN);
// data1.setQueryLevel(LogLevel.WARN);
// data1.setRuntimeLevel(LogLevel.WARN);
// data1.setSqlLevel(LogLevel.WARN);
// data1.setToolLevel(LogLevel.WARN);
// Data data2 = new Data();
// data2.setDataServer("xd03");
// data2.setOrder(2);
// data2.setDataCacheLevel(LogLevel.WARN);
// data2.setEnhanceLevel(LogLevel.WARN);
// data2.setJdbcLevel(LogLevel.WARN);
// data2.setMetaDataLevel(LogLevel.WARN);
// data2.setQueryLevel(LogLevel.WARN);
// data2.setRuntimeLevel(LogLevel.WARN);
// data2.setSqlLevel(LogLevel.WARN);
// data2.setToolLevel(LogLevel.WARN);
// Data data3 = new Data();
// data3.setDataServer("xd04");
// data3.setOrder(3);
// data3.setDataCacheLevel(LogLevel.WARN);
// data3.setEnhanceLevel(LogLevel.WARN);
// data3.setJdbcLevel(LogLevel.WARN);
// data3.setMetaDataLevel(LogLevel.WARN);
// data3.setQueryLevel(LogLevel.WARN);
// data3.setRuntimeLevel(LogLevel.WARN);
// data3.setSqlLevel(LogLevel.WARN);
// data3.setToolLevel(LogLevel.WARN);
// list.add(data0);
// list.add(data1);
// list.add(data2);
// list.add(data3);
// datas.put(clz.getCanonicalName(), list);
// }
// File connectionFile = new File("D:/x/configuration/hbtelecom/datas.json");
// FileUtils.writeStringToFile(connectionFile, XGsonBuilder.toJson(datas));
// }
}
package o2.a.build.mapping;
import java.io.File;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.junit.Test;
import com.x.base.core.container.LogLevel;
import com.x.base.core.entity.annotation.ContainerEntity;
import com.x.base.core.project.Packages;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.tools.ClassTools;
import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner;
import io.github.lukehutch.fastclasspathscanner.scanner.ScanResult;
public class Client_single {
@Test
public void demo_xplatform_tech() throws Exception {
this.create_datas("demo.xplatform.tech");
}
@Test
public void xc01_mss_sx_com() throws Exception {
this.create_datas("xc01.mss.sx.com");
}
@Test
public void dev_xplatform_tech() throws Exception {
this.create_datas("dev.xplatform.tech");
}
@Test
public void xa01_ray_local() throws Exception {
this.create_datas("xa01.ray.local");
}
@Test
public void xc01_vsettan_com_cn() throws Exception {
this.create_datas("xc01.vsettan.com.cn");
}
private void create_datas(String dir) throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<Class<?>> list = ClassTools.forName(true, scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class));
Datas datas = new Datas();
for (Class<?> clz : list) {
CopyOnWriteArrayList<Data> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
Data data = new Data();
data.setDataServer("xd01");
data.setOrder(1);
data.setDataCacheLevel(LogLevel.WARN);
data.setEnhanceLevel(LogLevel.WARN);
data.setJdbcLevel(LogLevel.WARN);
data.setMetaDataLevel(LogLevel.WARN);
data.setQueryLevel(LogLevel.WARN);
data.setRuntimeLevel(LogLevel.WARN);
data.setSqlLevel(LogLevel.WARN);
data.setToolLevel(LogLevel.WARN);
copyOnWriteArrayList.add(data);
datas.put(clz.getName(), copyOnWriteArrayList);
}
File file = new File("");
File path = new File(FilenameUtils.getFullPathNoEndSeparator(file.getAbsolutePath()),
"configuration/" + dir + "/datas.json");
FileUtils.writeStringToFile(path, XGsonBuilder.toJson(datas));
}
}
package o2.a.build.mapping;
import com.x.base.core.container.LogLevel;
import com.x.base.core.project.gson.GsonPropertyObject;
public class Data extends GsonPropertyObject {
private String dataServer;
private Integer order;
private LogLevel toolLevel = LogLevel.WARN;
private LogLevel runtimeLevel = LogLevel.WARN;
private LogLevel dataCacheLevel = LogLevel.WARN;
private LogLevel metaDataLevel = LogLevel.WARN;
private LogLevel enhanceLevel = LogLevel.WARN;
private LogLevel queryLevel = LogLevel.WARN;
private LogLevel sqlLevel = LogLevel.WARN;
private LogLevel jdbcLevel = LogLevel.WARN;
public String getDataServer() {
return dataServer;
}
public void setDataServer(String dataServer) {
this.dataServer = dataServer;
}
public Integer getOrder() {
return order;
}
public void setOrder(Integer order) {
this.order = order;
}
public LogLevel getToolLevel() {
return toolLevel;
}
public void setToolLevel(LogLevel toolLevel) {
this.toolLevel = toolLevel;
}
public LogLevel getRuntimeLevel() {
return runtimeLevel;
}
public void setRuntimeLevel(LogLevel runtimeLevel) {
this.runtimeLevel = runtimeLevel;
}
public LogLevel getDataCacheLevel() {
return dataCacheLevel;
}
public void setDataCacheLevel(LogLevel dataCacheLevel) {
this.dataCacheLevel = dataCacheLevel;
}
public LogLevel getMetaDataLevel() {
return metaDataLevel;
}
public void setMetaDataLevel(LogLevel metaDataLevel) {
this.metaDataLevel = metaDataLevel;
}
public LogLevel getEnhanceLevel() {
return enhanceLevel;
}
public void setEnhanceLevel(LogLevel enhanceLevel) {
this.enhanceLevel = enhanceLevel;
}
public LogLevel getQueryLevel() {
return queryLevel;
}
public void setQueryLevel(LogLevel queryLevel) {
this.queryLevel = queryLevel;
}
public LogLevel getSqlLevel() {
return sqlLevel;
}
public void setSqlLevel(LogLevel sqlLevel) {
this.sqlLevel = sqlLevel;
}
public LogLevel getJdbcLevel() {
return jdbcLevel;
}
public void setJdbcLevel(LogLevel jdbcLevel) {
this.jdbcLevel = jdbcLevel;
}
}
\ No newline at end of file
package o2.a.build.mapping;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
import com.x.base.core.entity.annotation.ContainerEntity;
import com.x.base.core.project.Packages;
import com.x.base.core.project.gson.XGsonBuilder;
import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner;
import io.github.lukehutch.fastclasspathscanner.scanner.ScanResult;
public class Datas extends ConcurrentHashMap<String, CopyOnWriteArrayList<Data>> {
private static final long serialVersionUID = -5705119379284982454L;
private static final String FILEPATH = "resources/datas.json";
public void sort() throws Exception {
for (CopyOnWriteArrayList<Data> list : this.values()) {
list.sort(new Comparator<Data>() {
public int compare(Data o1, Data o2) {
return ObjectUtils.compare(o1.getOrder(), o2.getOrder(), true);
}
});
Integer order = 0;
for (Data o : list) {
o.setOrder(order++);
}
}
List<String> entities = this.scanContainerEntityClass();
for (String str : entities) {
CopyOnWriteArrayList<Data> list = this.get(str);
if (null == list) {
this.put(str, new CopyOnWriteArrayList<Data>());
}
}
for (String str : this.keySet()) {
if (!entities.contains(str)) {
this.remove(str);
}
}
}
// public static Datas load() throws Exception {
// File file = new File(ThisApplication.root, FILEPATH);
// return load(file.getAbsolutePath());
// }
public static Datas load(String path) throws Exception {
File file = new File(path);
Datas o = null;
synchronized (Datas.class) {
if (file.exists()) {
o = XGsonBuilder.instance().fromJson(FileUtils.readFileToString(file, "utf-8"), Datas.class);
} else {
o = new Datas();
}
/* 扫描类并生成空值 */
o.sort();
}
return o;
}
//
// public static void store(Datas datas) throws Exception {
// File file = new File(ThisApplication.root, FILEPATH);
// store(datas, file.getAbsolutePath());
// }
public static void store(Datas datas, String path) throws Exception {
synchronized (Datas.class) {
File file = new File(path);
FileUtils.write(file, XGsonBuilder.toJson(datas), "utf-8");
}
}
private List<String> scanContainerEntityClass() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> sortedList = new ArrayList<>(scanResult.getNamesOfClassesWithAnnotation(ContainerEntity.class));
Collections.sort(sortedList, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return sortedList;
}
}
\ No newline at end of file
package o2.a.build.openvpn;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
public class Test {
public static void main(String[] args) throws Exception {
String name = args[0];
if (enable()) {
Process pro = Runtime.getRuntime().exec("ipconfig /all");
BufferedReader br = new BufferedReader(new InputStreamReader(pro.getInputStream(), "gbk"));
List<String> lines = new ArrayList<>();
String temp;
while ((temp = br.readLine()) != null) {
lines.add(temp);
}
String gateway = "";
Pattern pattern = Pattern.compile("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}");
for (String string : lines) {
if (string.indexOf("默认网关") != -1) {
Matcher mc = pattern.matcher(string);
if (mc.find()) {
gateway = mc.group();
break;
}
}
}
if (StringUtils.isNotEmpty(gateway)) {
write_script(name, gateway);
} else {
clean_script(name);
}
} else {
clean_script(name);
}
}
private static void write_script(String name, String gateway) throws Exception {
LinkedHashMap<String, String> map = cn_list();
List<String> up = new ArrayList<>();
List<String> down = new ArrayList<>();
for (Entry<String, String> en : map.entrySet()) {
up.add("route add " + en.getKey() + " mask " + en.getValue() + " " + gateway);
down.add("route delete " + en.getKey());
}
File upFile = new File(name + "_up.bat");
FileUtils.writeLines(upFile, up, false);
File downFile = new File(name + "_down.bat");
FileUtils.writeLines(downFile, down, false);
}
private static void clean_script(String name) throws Exception {
File upFile = new File(name + "_up.bat");
if (upFile.exists()){
FileUtils.deleteQuietly(upFile);
}
File downFile = new File(name + "_down.bat");
if (downFile.exists()){
FileUtils.deleteQuietly(downFile);
}
}
private static LinkedHashMap<String, String> cn_list() throws Exception {
LinkedHashMap<String, String> map = new LinkedHashMap<>();
Map<String, String> maskMapping = new HashMap<>();
maskMapping.put("4194304", "255.192.0.0");
maskMapping.put("2097152", "255.224.0.0");
maskMapping.put("1048576", "255.240.0.0");
maskMapping.put("524288", "255.248.0.0");
maskMapping.put("262144", "255.252.0.0");
maskMapping.put("131072", "255.254.0.0");
maskMapping.put("65536", "255.255.0.0");
maskMapping.put("32768", "255.255.128.0");
maskMapping.put("16384", "255.255.192.0");
maskMapping.put("8192", "255.255.224.0");
maskMapping.put("4096", "255.255.240.0");
maskMapping.put("2048", "255.255.248.0");
maskMapping.put("1024", "255.255.252.0");
maskMapping.put("512", "255.255.254.0");
maskMapping.put("256", "255.255.255.0");
maskMapping.put("128", "255.255.255.128");
maskMapping.put("64", "255.255.255.192");
maskMapping.put("32", "255.255.255.224");
maskMapping.put("16", "255.255.255.240");
maskMapping.put("8", "255.255.255.248");
maskMapping.put("4", "255.255.255.252");
File file = new File("delegated-apnic-latest.txt");
String txt = FileUtils.readFileToString(file);
String[] lines = StringUtils.split(txt);
for (String str : lines) {
if (StringUtils.contains(str, "apnic|CN|ipv4|")) {
String[] ps = StringUtils.split(str, "|");
String host = ps[3];
String mask = maskMapping.get(ps[4]);
if (StringUtils.isEmpty(mask)) {
throw new Exception("error:" + ps[4]);
}
map.put(host, mask);
}
}
return map;
}
private static Boolean enable() throws Exception {
File file = new File("route.cfg");
String str = FileUtils.readFileToString(file, "utf-8");
return BooleanUtils.isTrue(BooleanUtils.toBoolean(StringUtils.trim(str)));
}
}
\ No newline at end of file
package o2.a.build.openvpn;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
public class TestClient {
@Test
public void test() throws Exception {
Map<String, String> map = new HashMap<>();
// map.put("4194302","255.192.0.0");
// map.put("2097150","255.224.0.0");
// map.put("1048574","255.240.0.0");
// map.put("524286","255.248.0.0");
// map.put("262142","255.252.0.0");
// map.put("131070","255.254.0.0 ");
// map.put("65536","255.255.0.0");
// map.put("32766","255.255.128.0");
// map.put("16382","255.255.192.0");
// map.put("8190","255.255.224.0");
// map.put("4094","255.255.240.0");
// map.put("2046","255.255.248.0");
// map.put("1022","255.255.252.0");
// map.put("510","255.255.254.0");
// map.put("254","255.255.255.0");
// map.put("126","255.255.255.128");
// map.put("62","255.255.255.192");
// map.put("30","255.255.255.224");
// map.put("14","255.255.255.240");
// map.put("6","255.255.255.248");
// map.put("2","255.255.255.252");
map.put("4194304", "255.192.0.0");
map.put("2097152", "255.224.0.0");
map.put("1048576", "255.240.0.0");
map.put("524288", "255.248.0.0");
map.put("262144", "255.252.0.0");
map.put("131072", "255.254.0.0");
map.put("65536", "255.255.0.0");
map.put("32768", "255.255.128.0");
map.put("16384", "255.255.192.0");
map.put("8192", "255.255.224.0");
map.put("4096", "255.255.240.0");
map.put("2048", "255.255.248.0");
map.put("1024", "255.255.252.0");
map.put("512", "255.255.254.0");
map.put("256", "255.255.255.0");
map.put("128", "255.255.255.128");
map.put("64", "255.255.255.192");
map.put("32", "255.255.255.224");
map.put("16", "255.255.255.240");
map.put("8", "255.255.255.248");
map.put("4", "255.255.255.252");
// URL url = new
// URL("http://ftp.apnic.net/stats/apnic/delegated-apnic-latest");
File file = new File("src/main/resources/delegated-apnic-latest.txt");
System.out.println(file.getAbsolutePath());
String txt = FileUtils.readFileToString(file);
// System.out.println(txt);
String[] lines = StringUtils.split(txt);
for (String str : lines) {
if (StringUtils.contains(str, "apnic|CN|ipv4|")) {
String[] ps = StringUtils.split(str, "|");
String host = ps[3];
String mask = map.get(ps[4]);
if (StringUtils.isEmpty(mask)) {
throw new Exception("error:" + ps[4]);
}
// System.out.println("push \"route " + host + " " + mask + "
// net_gateway\"");
System.out.println("route " + host + " " + mask + " net_gateway");
}
}
}
@Test
public void getName() {
try {
File file = new File("aaaaaa");
System.out.println(file.getName());
System.out.println(file.getParent());
} catch (Exception e) {
e.printStackTrace();
}
}
}
package o2.a.build.publish;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import com.obs.services.ObsClient;
import com.obs.services.ObsConfiguration;
import com.obs.services.exception.ObsException;
import com.obs.services.model.CompleteMultipartUploadRequest;
import com.obs.services.model.InitiateMultipartUploadRequest;
import com.obs.services.model.InitiateMultipartUploadResult;
import com.obs.services.model.PartEtag;
import com.obs.services.model.UploadPartResult;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.tools.DateTools;
import o2.a.build.lib.SFtpFileHelper;
/**
* This sample demonstrates how to upload multiparts to OBS using the OBS SDK
* for Java.
*/
public class ObsMultipartUploadSample {
private static final String endPoint = "obs.cn-east-2.myhwclouds.com";
private static final String ak = "67CEL8RL5I3QP20IYBIE";
private static final String sk = "eyWMRgA2rxhZS4uPcZ4sFGX2T0wAercYgXRKcXEX";
private static ObsClient obsClient;
private static String bucketName = "obs-o2public";
private static String ftpIp = "122.112.215.151";
private static String ftpUser = "root";
private static String ftpPass = "Zone2018";
private static int ftpPort = 22;
private static String filePath = "/data/www.zoneland.net/o2server/servers/webServer";
public static void main(String... args) throws Exception {
if (args != null && args.length == 2) {
String day = args[0];
String dir = args[1];
String file1 = "o2server_" + day + "_x86.zip";
File file_x86 = new File(dir, file1);
String url1 = ObsMultipartUploadSample.updateToObs(file1, dir);
String file2 = "o2server_" + day + "_macos.zip";
File file_macos = new File(dir, file2);
String url2 = ObsMultipartUploadSample.updateToObs(file2, dir);
String file3 = "o2server_" + day + "_aix.zip";
File file_aix = new File(dir, file3);
String url3 = ObsMultipartUploadSample.updateToObs(file3, dir);
Date now = new Date();
LinkedHashMap<String, Object> map_windows_linux = new LinkedHashMap<>();
LinkedHashMap<String, Object> map_macos = new LinkedHashMap<>();
LinkedHashMap<String, Object> map_aix = new LinkedHashMap<>();
map_windows_linux.put("system", "x86");
map_windows_linux.put("name", "o2server_" + day + "_windows/linux");
map_windows_linux.put("fileName", FilenameUtils.getName(file_x86.getName()));
map_windows_linux.put("fileSize", file_x86.length() / 1024 / 1024 + "MB");
map_windows_linux.put("fileUrl", url1);
map_windows_linux.put("updateTime", DateTools.format(now));
map_macos.put("system", "macos");
map_macos.put("name", FilenameUtils.getBaseName(file_macos.getName()));
map_macos.put("fileName", FilenameUtils.getName(file_macos.getName()));
map_macos.put("fileSize", file_macos.length() / 1024 / 1024 + "MB");
map_macos.put("fileUrl", url2);
map_macos.put("updateTime", DateTools.format(now));
map_aix.put("system", "aix");
map_aix.put("name", FilenameUtils.getBaseName(file_aix.getName()));
map_aix.put("fileName", FilenameUtils.getName(file_aix.getName()));
map_aix.put("fileSize", file_aix.length() / 1024 / 1024 + "MB");
map_aix.put("fileUrl", url3);
map_aix.put("updateTime", DateTools.format(now));
List<LinkedHashMap<String, Object>> list = new ArrayList<>();
list.add(map_windows_linux);
list.add(map_macos);
list.add(map_aix);
try {
File file = new File(dir, "server_download.json");
FileUtils.writeStringToFile(file, XGsonBuilder.toJson(list));
SFtpFileHelper ftpHelper = new SFtpFileHelper(ftpIp, ftpUser, ftpPass, ftpPort);
boolean flag = ftpHelper.updloadFile(getByteFromFile(file), "server_download.json", filePath);
if (flag) {
System.out.println("server_download.json sftp上传到" + ftpIp + "#" + filePath + "成功!");
} else {
System.out.println("sftp上传失败");
}
} catch (Exception e) {
System.out.println("sftp上传失败!" + e.getMessage());
}
} else {
// test("C:/tools","apache-tomcat-7.0.23.rar");
System.out.println("上传失败,参数错误=======");
}
}
/**
* 上传文件到华为OBS
*
* @param objectKeyName
* @param directory
* @return
*/
public static String updateToObs(String objectKeyName, String directory) {
ObsConfiguration config = new ObsConfiguration();
config.setSocketTimeout(30000);
config.setConnectionTimeout(10000);
config.setEndPoint(endPoint);
config.setHttpsOnly(true);
try {
/*
* Constructs a obs client instance with your account for accessing OBS
*/
obsClient = new ObsClient(ak, sk, config);
/*
* Create bucket
*/
// obsClient.createBucket(bucketName);
/*
* Step 1: initiate multipart upload
*/
File file = new File(directory, objectKeyName);
System.out.println("上传附件到obs:" + objectKeyName);
InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest();
request.setBucketName(bucketName);
request.setObjectKey(objectKeyName);
InitiateMultipartUploadResult result = obsClient.initiateMultipartUpload(request);
/*
* Step 2: upload a part
*/
// System.out.println("Step 2: upload part \n");
UploadPartResult uploadPartResult = obsClient.uploadPart(bucketName, objectKeyName, result.getUploadId(), 1,
new FileInputStream(file));
/*
* Step 3: complete multipart upload
*/
// System.out.println("Step 3: complete multipart upload \n");
CompleteMultipartUploadRequest completeMultipartUploadRequest = new CompleteMultipartUploadRequest();
completeMultipartUploadRequest.setBucketName(bucketName);
completeMultipartUploadRequest.setObjectKey(objectKeyName);
completeMultipartUploadRequest.setUploadId(result.getUploadId());
PartEtag partEtag = new PartEtag();
partEtag.setPartNumber(uploadPartResult.getPartNumber());
partEtag.seteTag(uploadPartResult.getEtag());
completeMultipartUploadRequest.getPartEtag().add(partEtag);
obsClient.completeMultipartUpload(completeMultipartUploadRequest);
System.out.println(objectKeyName + "附件上传成功!");
System.out.println("obs地址:https://obs-o2public.obs.cn-east-2.myhwclouds.com/" + objectKeyName);
return "https://obs-o2public.obs.cn-east-2.myhwclouds.com/" + objectKeyName;
} catch (ObsException e) {
System.out.println(objectKeyName + " Response Code: " + e.getResponseCode());
System.out.println(objectKeyName + " Error Message: " + e.getErrorMessage());
System.out.println(objectKeyName + " Error Code: " + e.getErrorCode());
System.out.println(objectKeyName + " Request ID: " + e.getErrorRequestId());
System.out.println(objectKeyName + " Host ID: " + e.getErrorHostId());
} catch (Exception e) {
System.out.println(objectKeyName + " error: " + e.getMessage());
} finally {
if (obsClient != null) {
try {
obsClient.close();
} catch (IOException e) {
}
}
}
return "";
}
/**
* 读取二进制数据从文件
*
* @param filePath
* @return
* @throws Exception
*/
public static byte[] getByteFromFile(File file) throws Exception {
byte b[] = new byte[(int) file.length()];
InputStream is = new FileInputStream(file);
BufferedInputStream bi = new BufferedInputStream(is);
bi.read(b);
bi.close();
is.close();
return b;
}
public static void test(String dir, String file1) {
File file_x86 = new File(dir, file1);
if (file_x86.isFile()) {
String url1 = ObsMultipartUploadSample.updateToObs(file1, dir);
Date now = new Date();
LinkedHashMap<String, Object> map_windows_linux = new LinkedHashMap<>();
map_windows_linux.put("system", "x86");
map_windows_linux.put("name", "o2server_" + "5555" + "_windows/linux");
map_windows_linux.put("fileName", FilenameUtils.getName(file_x86.getName()));
map_windows_linux.put("fileSize", file_x86.length() / 1024 / 1024 + "MB");
map_windows_linux.put("fileUrl", url1);
map_windows_linux.put("updateTime", DateTools.format(now));
List<LinkedHashMap<String, Object>> list = new ArrayList<>();
list.add(map_windows_linux);
try {
File file = new File(dir, "server_download.json");
FileUtils.writeStringToFile(file, XGsonBuilder.toJson(list));
SFtpFileHelper ftpHelper = new SFtpFileHelper(ftpIp, ftpUser, ftpPass, ftpPort);
boolean flag = ftpHelper.updloadFile(getByteFromFile(file), "server_download.json", filePath);
if (flag) {
System.out.println("server_download.json sftp上传到" + ftpIp + "#" + filePath + "成功!");
} else {
System.out.println("sftp上传失败");
}
} catch (Exception e) {
System.out.println("sftp上传失败!" + e.getMessage());
}
}
}
}
package o2.a.build.publish;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.util.Date;
import java.util.LinkedHashMap;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.junit.Test;
import com.obs.services.ObsClient;
import com.obs.services.ObsConfiguration;
import com.obs.services.exception.ObsException;
import com.obs.services.model.CompleteMultipartUploadRequest;
import com.obs.services.model.InitiateMultipartUploadRequest;
import com.obs.services.model.InitiateMultipartUploadResult;
import com.obs.services.model.PartEtag;
import com.obs.services.model.UploadPartResult;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.tools.DateTools;
public class Publish {
private static final String endPoint = "obs.cn-east-2.myhwclouds.com";
private static final String ak = "67CEL8RL5I3QP20IYBIE";
private static final String sk = "eyWMRgA2rxhZS4uPcZ4sFGX2T0wAercYgXRKcXEX";
private static ObsClient obsClient;
private static String bucketName = "obs-o2public";
public static void main(String... args) throws Exception {
String version = args[0];
String dir = args[1];
Date now = new Date();
File file_update = new File(dir, version + ".zip");
String update_url = updateToObs(file_update.getName(), file_update.getParent());
File update_dir = new File("D:/o2collect/servers/webServer/o2server/update");
FileUtils.copyFile(file_update, new File(update_dir, file_update.getName()));
FileUtils.write(new File(update_dir, FilenameUtils.getBaseName(file_update.getName()) + ".txt"),
"o2server update pack version:" + version, false);
FileUtils.write(new File(update_dir, FilenameUtils.getBaseName(file_update.getName()) + ".url"), update_url,
false);
File file_windows = new File(dir, "o2server_" + version + "_windows.zip");
File file_linux = new File(dir, "o2server_" + version + "_linux.zip");
File file_macos = new File(dir, "o2server_" + version + "_macos.zip");
File file_aix = new File(dir, "o2server_" + version + "_aix.zip");
LinkedHashMap<String, Object> map_windows = new LinkedHashMap<>();
LinkedHashMap<String, Object> map_linux = new LinkedHashMap<>();
LinkedHashMap<String, Object> map_macos = new LinkedHashMap<>();
LinkedHashMap<String, Object> map_aix = new LinkedHashMap<>();
map_windows.put("system", "windows");
map_windows.put("name", "o2server_" + version + "_windows");
map_windows.put("fileName", FilenameUtils.getName(file_windows.getName()));
map_windows.put("fileSize", file_windows.length() / 1024 / 1024 + "MB");
map_windows.put("updateTime", DateTools.format(now));
map_windows.put("url", updateToObs(file_windows.getName(), file_windows.getParent()));
map_windows.put("sha256", sha256(file_windows));
map_linux.put("system", "linux");
map_linux.put("name", "o2server_" + version + "_linux");
map_linux.put("fileName", FilenameUtils.getName(file_linux.getName()));
map_linux.put("fileSize", file_linux.length() / 1024 / 1024 + "MB");
map_linux.put("updateTime", DateTools.format(now));
map_linux.put("url", updateToObs(file_linux.getName(), file_linux.getParent()));
map_linux.put("sha256", sha256(file_linux));
map_macos.put("system", "macos");
map_macos.put("name", FilenameUtils.getBaseName(file_macos.getName()));
map_macos.put("fileName", FilenameUtils.getName(file_macos.getName()));
map_macos.put("fileSize", file_macos.length() / 1024 / 1024 + "MB");
map_macos.put("updateTime", DateTools.format(now));
map_macos.put("url", updateToObs(file_macos.getName(), file_macos.getParent()));
map_macos.put("sha256", sha256(file_macos));
map_aix.put("system", "aix");
map_aix.put("name", FilenameUtils.getBaseName(file_aix.getName()));
map_aix.put("fileName", FilenameUtils.getName(file_aix.getName()));
map_aix.put("fileSize", file_aix.length() / 1024 / 1024 + "MB");
map_aix.put("updateTime", DateTools.format(now));
map_aix.put("url", updateToObs(file_aix.getName(), file_aix.getParent()));
map_aix.put("sha256", sha256(file_aix));
LinkedHashMap<String, Object> map = new LinkedHashMap<>();
map.put("windows", map_windows);
map.put("linux", map_linux);
map.put("macos", map_macos);
map.put("aix", map_aix);
File file_download = new File("Z:/www.o2oa.net/o2server/servers/webServer/webSite", "download.json");
FileUtils.writeStringToFile(file_download, XGsonBuilder.toJson(map));
}
public static String updateToObs(String objectKeyName, String directory) {
ObsConfiguration config = new ObsConfiguration();
config.setSocketTimeout(30000);
config.setConnectionTimeout(10000);
config.setEndPoint(endPoint);
config.setHttpsOnly(true);
try {
/*
* Constructs a obs client instance with your account for accessing OBS
*/
obsClient = new ObsClient(ak, sk, config);
/*
* Create bucket
*/
// obsClient.createBucket(bucketName);
/*
* Step 1: initiate multipart upload
*/
File file = new File(directory, objectKeyName);
System.out.println("上传附件到obs:" + objectKeyName);
InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest();
request.setBucketName(bucketName);
request.setObjectKey(objectKeyName);
InitiateMultipartUploadResult result = obsClient.initiateMultipartUpload(request);
/*
* Step 2: upload a part
*/
// System.out.println("Step 2: upload part \n");
UploadPartResult uploadPartResult = obsClient.uploadPart(bucketName, objectKeyName, result.getUploadId(), 1,
new FileInputStream(file));
/*
* Step 3: complete multipart upload
*/
// System.out.println("Step 3: complete multipart upload \n");
CompleteMultipartUploadRequest completeMultipartUploadRequest = new CompleteMultipartUploadRequest();
completeMultipartUploadRequest.setBucketName(bucketName);
completeMultipartUploadRequest.setObjectKey(objectKeyName);
completeMultipartUploadRequest.setUploadId(result.getUploadId());
PartEtag partEtag = new PartEtag();
partEtag.setPartNumber(uploadPartResult.getPartNumber());
partEtag.seteTag(uploadPartResult.getEtag());
completeMultipartUploadRequest.getPartEtag().add(partEtag);
obsClient.completeMultipartUpload(completeMultipartUploadRequest);
System.out.println(objectKeyName + "附件上传成功!");
System.out.println("obs地址:https://obs-o2public.obs.cn-east-2.myhwclouds.com/" + objectKeyName);
return "https://obs-o2public.obs.cn-east-2.myhwclouds.com/" + objectKeyName;
} catch (ObsException e) {
System.out.println(objectKeyName + " Response Code: " + e.getResponseCode());
System.out.println(objectKeyName + " Error Message: " + e.getErrorMessage());
System.out.println(objectKeyName + " Error Code: " + e.getErrorCode());
System.out.println(objectKeyName + " Request ID: " + e.getErrorRequestId());
System.out.println(objectKeyName + " Host ID: " + e.getErrorHostId());
} catch (Exception e) {
System.out.println(objectKeyName + " error: " + e.getMessage());
} finally {
if (obsClient != null) {
try {
obsClient.close();
} catch (IOException e) {
}
}
}
return "";
}
private static String sha256(File file) throws Exception {
MessageDigest messageDigest;
messageDigest = MessageDigest.getInstance("SHA-256");
byte[] hash = messageDigest.digest(FileUtils.readFileToByteArray(file));
return Hex.encodeHexString(hash);
}
@Test
public void test1() throws Exception {
System.out.println(sha256(new File("d:/o2server_20180615160351_x86.zip")));
}
}
package o2.a.build.test;
import java.io.IOException;
import java.sql.SQLException;
import org.apache.openjpa.jdbc.meta.MappingTool;
import org.junit.Test;
public class TestClient {
@Test
public void test() throws IOException, SQLException {
String[] args = new String[] { "-schemaAction", "build", "-sql", "e:/create.sql" };
MappingTool.main(args);
}
}
package o2server.build.pom;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import com.x.base.core.project.AssembleA;
import com.x.base.core.project.CoreA;
import com.x.base.core.project.Packages;
import com.x.base.core.project.ServiceA;
import com.x.base.core.project.jaxrs.logger.LoggerAction;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
import com.x.base.core.project.tools.FileTools;
import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner;
import io.github.lukehutch.fastclasspathscanner.scanner.ScanResult;
public class ReplicateMavenConfig {
private static Logger logger = LoggerFactory.getLogger(ReplicateMavenConfig.class);
public static void main(String[] args) throws Exception {
core();
assemble();
service();
}
private static void core() throws Exception {
MavenXpp3Reader reader = new MavenXpp3Reader();
MavenXpp3Writer writer = new MavenXpp3Writer();
File file = new File("src/main/resources/pom_template_core.xml");
Model model = reader.read(new FileReader(file));
File parent = FileTools.parent(new File(""));
for (String str : listCore()) {
model.setArtifactId(str);
File f = new File(parent, str + "/pom.xml");
logger.print("create pom: {}.", f.getAbsolutePath());
FileUtils.touch(f);
try (FileOutputStream out = new FileOutputStream(f)) {
writer.write(out, model);
}
}
}
private static void assemble() throws Exception {
MavenXpp3Reader reader = new MavenXpp3Reader();
MavenXpp3Writer writer = new MavenXpp3Writer();
File file = new File("src/main/resources/pom_template_assemble.xml");
Model model = reader.read(new FileReader(file));
File parent = FileTools.parent(new File(""));
for (String str : listAssemble()) {
model.setArtifactId(str);
File f = new File(parent, str + "/pom.xml");
logger.print("create pom: {}.", f.getAbsolutePath());
FileUtils.touch(f);
try (FileOutputStream out = new FileOutputStream(f)) {
writer.write(out, model);
}
}
}
private static void service() throws Exception {
MavenXpp3Reader reader = new MavenXpp3Reader();
MavenXpp3Writer writer = new MavenXpp3Writer();
File file = new File("src/main/resources/pom_template_service.xml");
Model model = reader.read(new FileReader(file));
File parent = FileTools.parent(new File(""));
for (String str : listService()) {
model.setArtifactId(str);
File f = new File(parent, str + "/pom.xml");
logger.print("create pom: {}.", f.getAbsolutePath());
FileUtils.touch(f);
try (FileOutputStream out = new FileOutputStream(f)) {
writer.write(out, model);
}
}
}
private static List<String> listAssemble() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> list = new ArrayList<>();
for (String str : scanResult.getNamesOfSubclassesOf(AssembleA.class)) {
Class<?> clz = Class.forName(str);
list.add(clz.getSimpleName());
}
Collections.sort(list, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return list;
}
private static List<String> listService() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> list = new ArrayList<>();
for (String str : scanResult.getNamesOfSubclassesOf(ServiceA.class)) {
Class<?> clz = Class.forName(str);
list.add(clz.getSimpleName());
}
Collections.sort(list, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return list;
}
private static List<String> listCore() throws Exception {
ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
List<String> list = new ArrayList<>();
for (String str : scanResult.getNamesOfSubclassesOf(CoreA.class)) {
Class<?> clz = Class.forName(str);
list.add(clz.getSimpleName());
}
Collections.sort(list, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
return list;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册