Skip to content

Commit

Permalink
扩展代码移动到cachecloud-common
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosfu committed Mar 1, 2016
1 parent d3b8814 commit e729544
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 101 deletions.
21 changes: 21 additions & 0 deletions cachecloud-open-common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.sohu.tv</groupId>
<artifactId>cachecloud-open-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>cachecloud-open-common</artifactId>
<name>cachecloud-open-common</name>

<dependencies>
<dependency>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sohu.cache.util.ConstUtils;

/**
* http原生工具类
*
Expand All @@ -26,14 +24,18 @@
*/
public final class HttpRequestUtil {

// http 超时设置
private static final int HTTP_CONNECTION_TIMEOUT = 3000;
private static final int HTTP_SOCKET_TIMEOUT = 3000;

private static Logger logger = LoggerFactory.getLogger(HttpRequestUtil.class);

public static String doPost(String reqUrl, Map<String, String> parameters) {
return doPost(reqUrl, parameters, "UTF-8", ConstUtils.HTTP_CONNECTION_TIMEOUT, ConstUtils.HTTP_SOCKET_TIMEOUT);
return doPost(reqUrl, parameters, "UTF-8", HTTP_CONNECTION_TIMEOUT, HTTP_SOCKET_TIMEOUT);
}

public static String doPost(String reqUrl, Map<String, String> parameters, String encoding) {
return doPost(reqUrl, parameters, encoding, ConstUtils.HTTP_CONNECTION_TIMEOUT, ConstUtils.HTTP_SOCKET_TIMEOUT);
return doPost(reqUrl, parameters, encoding, HTTP_CONNECTION_TIMEOUT, HTTP_SOCKET_TIMEOUT);
}

public static String doPost(String reqUrl, Map<String, String> parameters, String encoding, int connectTimeout,
Expand Down Expand Up @@ -136,7 +138,7 @@ public static String doGet(String link, String encoding, int connectTimeout, int
* @return
*/
public static String doGet(String link) {
return doGet(link, "UTF-8", ConstUtils.HTTP_CONNECTION_TIMEOUT, ConstUtils.HTTP_SOCKET_TIMEOUT);
return doGet(link, "UTF-8", HTTP_CONNECTION_TIMEOUT, HTTP_SOCKET_TIMEOUT);
}

/**
Expand Down
7 changes: 7 additions & 0 deletions cachecloud-open-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<tomcat.version>8.0.28</tomcat.version>
<cachecloud-open-client-basic>1.0-SNAPSHOT</cachecloud-open-client-basic>
<cachecloud-jedis>1.0-SNAPSHOT</cachecloud-jedis>
<cachecloud-open-common.version>1.0-SNAPSHOT</cachecloud-open-common.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -195,6 +196,12 @@
<artifactId>cachecloud-jedis</artifactId>
<version>${cachecloud-jedis}</version>
</dependency>

<dependency>
<groupId>com.sohu.tv</groupId>
<artifactId>cachecloud-open-common</artifactId>
<version>${cachecloud-open-common.version}</version>
</dependency>

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,4 @@ public void setInstanceStatsDao(InstanceStatsDao instanceStatsDao) {
public void setRedisCenter(RedisCenter redisCenter) {
this.redisCenter = redisCenter;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ public class ConstUtils {
public static final String REDIS_SLOWLOG_JOB_GROUP = "redisSlowLog";
public static final String REDIS_SLOWLOG_TRIGGER_GROUP = "redisSlowLog-";

// http 超时设置
public static final int HTTP_CONNECTION_TIMEOUT = 3000;
public static final int HTTP_SOCKET_TIMEOUT = 3000;

// 创建trigger时,dataMap的数据key
public static final String HOST_KEY = "host_key";
public static final String PORT_KEY = "port_key";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
</bean>

<!-- 分布式QuartzScheduler -->
<bean id="clusterScheduler" name="clusterScheduler" lazy-init="false"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<bean id="clusterScheduler" name="clusterScheduler" lazy-init="false" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="dataSource" ref="cacheCloudDB"></property>
<property name="taskExecutor" ref="quartzThreadPool"/>
<!--
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<modules>
<module>cachecloud-open-web</module>
<module>cachecloud-open-client</module>
</modules>
<module>cachecloud-open-common</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit e729544

Please sign in to comment.