Commit 1dfac44d authored by caohuan's avatar caohuan

原始框架

parents
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="CTIDHTTPService" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="CTIDHTTPService" target="1.5" />
</bytecodeTargetLevel>
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: commons-beanutils:commons-beanutils:1.8.0">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: commons-codec:commons-codec:1.9">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: commons-collections:commons-collections:3.2.1">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: commons-lang:commons-lang:2.5">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/commons-lang/commons-lang/2.5/commons-lang-2.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/commons-lang/commons-lang/2.5/commons-lang-2.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: commons-logging:commons-logging:1.2">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: javax.annotation:javax.annotation-api:1.2">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: javax.servlet:javax.servlet-api:3.1.0">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: javax.validation:validation-api:1.1.0.Final">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: javax.ws.rs:javax.ws.rs-api:2.0">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/javax/ws/rs/javax.ws.rs-api/2.0/javax.ws.rs-api-2.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/javax/ws/rs/javax.ws.rs-api/2.0/javax.ws.rs-api-2.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/javax/ws/rs/javax.ws.rs-api/2.0/javax.ws.rs-api-2.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: net.sf.ezmorph:ezmorph:1.0.6">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: net.sf.json-lib:json-lib:jdk15:2.4">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4-jdk15.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-pool2:2.4.2">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.apache.httpcomponents:httpclient:4.5.3">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.apache.httpcomponents:httpcore:4.4.6">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.eclipse.jetty:jetty-continuation:9.1.1.v20140108">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-continuation/9.1.1.v20140108/jetty-continuation-9.1.1.v20140108.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-continuation/9.1.1.v20140108/jetty-continuation-9.1.1.v20140108-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-continuation/9.1.1.v20140108/jetty-continuation-9.1.1.v20140108-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.eclipse.jetty:jetty-http:9.3.18.v20170406">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-http/9.3.18.v20170406/jetty-http-9.3.18.v20170406.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-http/9.3.18.v20170406/jetty-http-9.3.18.v20170406-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-http/9.3.18.v20170406/jetty-http-9.3.18.v20170406-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.eclipse.jetty:jetty-io:9.3.18.v20170406">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-io/9.3.18.v20170406/jetty-io-9.3.18.v20170406.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-io/9.3.18.v20170406/jetty-io-9.3.18.v20170406-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-io/9.3.18.v20170406/jetty-io-9.3.18.v20170406-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.eclipse.jetty:jetty-security:9.3.18.v20170406">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-security/9.3.18.v20170406/jetty-security-9.3.18.v20170406.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-security/9.3.18.v20170406/jetty-security-9.3.18.v20170406-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-security/9.3.18.v20170406/jetty-security-9.3.18.v20170406-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.eclipse.jetty:jetty-server:9.3.18.v20170406">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-server/9.3.18.v20170406/jetty-server-9.3.18.v20170406.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-server/9.3.18.v20170406/jetty-server-9.3.18.v20170406-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-server/9.3.18.v20170406/jetty-server-9.3.18.v20170406-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.eclipse.jetty:jetty-servlet:9.3.18.v20170406">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-servlet/9.3.18.v20170406/jetty-servlet-9.3.18.v20170406.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-servlet/9.3.18.v20170406/jetty-servlet-9.3.18.v20170406-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-servlet/9.3.18.v20170406/jetty-servlet-9.3.18.v20170406-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.eclipse.jetty:jetty-util:9.3.18.v20170406">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-util/9.3.18.v20170406/jetty-util-9.3.18.v20170406.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-util/9.3.18.v20170406/jetty-util-9.3.18.v20170406-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/eclipse/jetty/jetty-util/9.3.18.v20170406/jetty-util-9.3.18.v20170406-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.hk2.external:aopalliance-repackaged:2.3.0-b05">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/external/aopalliance-repackaged/2.3.0-b05/aopalliance-repackaged-2.3.0-b05.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/external/aopalliance-repackaged/2.3.0-b05/aopalliance-repackaged-2.3.0-b05-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/external/aopalliance-repackaged/2.3.0-b05/aopalliance-repackaged-2.3.0-b05-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.hk2.external:javax.inject:2.3.0-b05">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/external/javax.inject/2.3.0-b05/javax.inject-2.3.0-b05.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/external/javax.inject/2.3.0-b05/javax.inject-2.3.0-b05-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/external/javax.inject/2.3.0-b05/javax.inject-2.3.0-b05-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.hk2:hk2-api:2.3.0-b05">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-api/2.3.0-b05/hk2-api-2.3.0-b05.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-api/2.3.0-b05/hk2-api-2.3.0-b05-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-api/2.3.0-b05/hk2-api-2.3.0-b05-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.hk2:hk2-locator:2.3.0-b05">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-locator/2.3.0-b05/hk2-locator-2.3.0-b05.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-locator/2.3.0-b05/hk2-locator-2.3.0-b05-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-locator/2.3.0-b05/hk2-locator-2.3.0-b05-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.hk2:hk2-utils:2.3.0-b05">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-utils/2.3.0-b05/hk2-utils-2.3.0-b05.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-utils/2.3.0-b05/hk2-utils-2.3.0-b05-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/hk2-utils/2.3.0-b05/hk2-utils-2.3.0-b05-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.hk2:osgi-resource-locator:1.0.1">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.jersey.bundles.repackaged:jersey-guava:2.10">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.10/jersey-guava-2.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.10/jersey-guava-2.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.10/jersey-guava-2.10-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.jersey.containers:jersey-container-jetty-http:2.10">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/containers/jersey-container-jetty-http/2.10/jersey-container-jetty-http-2.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/containers/jersey-container-jetty-http/2.10/jersey-container-jetty-http-2.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/containers/jersey-container-jetty-http/2.10/jersey-container-jetty-http-2.10-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.jersey.containers:jersey-container-servlet-core:2.10">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/containers/jersey-container-servlet-core/2.10/jersey-container-servlet-core-2.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/containers/jersey-container-servlet-core/2.10/jersey-container-servlet-core-2.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/containers/jersey-container-servlet-core/2.10/jersey-container-servlet-core-2.10-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.jersey.core:jersey-client:2.10">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-client/2.10/jersey-client-2.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-client/2.10/jersey-client-2.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-client/2.10/jersey-client-2.10-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.jersey.core:jersey-common:2.10">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-common/2.10/jersey-common-2.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-common/2.10/jersey-common-2.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-common/2.10/jersey-common-2.10-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.jersey.core:jersey-server:2.10">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-server/2.10/jersey-server-2.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-server/2.10/jersey-server-2.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/glassfish/jersey/core/jersey-server/2.10/jersey-server-2.10-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.javassist:javassist:3.18.1-GA">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: redis.clients:jedis:2.9.0">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/redis/clients/jedis/2.9.0/jedis-2.9.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/redis/clients/jedis/2.9.0/jedis-2.9.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/redis/clients/jedis/2.9.0/jedis-2.9.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClientPropertiesManager">
<properties class="javax.swing.AbstractButton">
<property name="hideActionText" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JComponent">
<property name="html.disable" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JEditorPane">
<property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" />
<property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" />
<property name="charset" class="java.lang.String" />
</properties>
<properties class="javax.swing.JList">
<property name="List.isFileList" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JPasswordField">
<property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JSlider">
<property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" />
<property name="JSlider.isFilled" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTable">
<property name="Table.isFileList" class="java.lang.Boolean" />
<property name="JTable.autoStartsEdit" class="java.lang.Boolean" />
<property name="terminateEditOnFocusLost" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JToolBar">
<property name="JToolBar.isRollover" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTree">
<property name="JTree.lineStyle" class="java.lang.String" />
</properties>
<properties class="javax.swing.text.JTextComponent">
<property name="caretAspectRatio" class="java.lang.Double" />
<property name="caretWidth" class="java.lang.Integer" />
</properties>
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/CTIDHTTPService.iml" filepath="$PROJECT_DIR$/CTIDHTTPService.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-logging-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jit-pkitool-2.3.0.25-beta2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jit-pkivstk-jdk15-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jitpkisctk1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-server:9.3.18.v20170406" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-http:9.3.18.v20170406" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-util:9.3.18.v20170406" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-io:9.3.18.v20170406" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-servlet:9.3.18.v20170406" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-security:9.3.18.v20170406" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.core:jersey-server:2.10" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.core:jersey-common:2.10" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.bundles.repackaged:jersey-guava:2.10" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2:osgi-resource-locator:1.0.1" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.core:jersey-client:2.10" level="project" />
<orderEntry type="library" name="Maven: javax.ws.rs:javax.ws.rs-api:2.0" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.2" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-api:2.3.0-b05" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-utils:2.3.0-b05" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2.external:aopalliance-repackaged:2.3.0-b05" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2.external:javax.inject:2.3.0-b05" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-locator:2.3.0-b05" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.containers:jersey-container-servlet-core:2.10" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.containers:jersey-container-jetty-http:2.10" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-continuation:9.1.1.v20140108" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.2" level="project" />
<orderEntry type="library" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.0" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.5" level="project" />
<orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
</component>
</module>
\ No newline at end of file
ServerURL=http\://172.16.17.1\:8000/signserver/service/xml
#ServerURL=http\://192.168.1.13\:8000/signserver/service/xml
#ServerURL=http://192.168.253.126:8000/signserver/service/xml
#ServerURL=http://172.16.40.123:8000/signserver/service/xml
DigestAlg=sm3
#Encrypt Algorithm: des3/scb2
EncAlg=sm4
CertBaseInfo = version;issuerdn;subjectdn;serialnumber;notbefore;notafter
TSACertBaseInfo = issuerdn;subjectdn;serialnumber;signedTime;signedTSA;signedTimeByMS
CertExtendInfo =
AppID=
CertAlias =
BaseInfo =digestalg;digestdata;plaindata;dscert
SendMsgFormat=0
HashActionPosition=0
PrintLog=false
#console/file/log4j ####log4j not implement
logTarget=console
logFilePath=/temp/jit.dss.vstk.log
#rfc3161/rfc2630
TSAType=rfc3161
#dsCert/issuerDNAndSN/CertId
p1VerifyCertId=CertId
Compatible=true
dss.client.class=cn.com.jit.assp.client.DSSClientHttpUrlConnectionImpl
#dss.client.class=cn.com.jit.assp.client.DSSClientHttpClientImpl
#default/encAfterDec/secretEnvelop(use this mode after using VCTK do envelop) secretEnvelop:develop->RSAdecrypt->RSAencrypt->envelop
envelopType=default
#default unit KB and default size is 0,0 is not block;
packageSize=0
#default:10000 unit: ms
timeout=50000
connectTimeOut=50000
# default : system unicode
FileSystemCharSet=UTF-8
vstkVersion=20
EncryptMode=ecb
#package size every time, unit is byte
send_size=1048576
#bigger than this will take big transfer modle, unit is byte
bigdata_limit=20971520
first_read_timeout=10000
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>YXHttpRestServer</groupId>
<artifactId>yxinfo.dev.identify</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<jettyVersion>9.3.18.v20170406</jettyVersion>
<jerseyVersion>2.10</jerseyVersion>
<httpClientVersion>4.5.3</httpClientVersion>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jettyVersion}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jettyVersion}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>${jerseyVersion}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>${jerseyVersion}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-jetty-http</artifactId>
<version>${jerseyVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpClientVersion}</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Manifest-Version: 1.0
Main-Class: com.fri.http.rest.server.YXHttpRestServer
package com.fri.http.rest.config;
/**
* Created by zhangdahui on 4/27/17.
*/
public class YXDefaultServerConfig {
//AApplication Name
//应用程序名称
public static String APPLICATION_NAME = "Aquila - Application Performance Monitoring";
//Http Server Spec
//Http IP 与 port
public static String SERVER_HOST = "0.0.0.0";
public static int SERVER_PORT = 8283;
public static int SERVER_MONITOR_PORT = 9999;
//Servlet 路径
public static String SERVER_REST_ROOT_PATH = "/rest";
public static String SERVER_MONITOR_PATH = "/status";
public static String SERVER_CTID_IDENTITY_PATH = "/ctid";
//超时时间
public static int SERVER_IDLE_TIMEOUT = 60000;
public static int SERVER_STOP_TIMEOUT = 30000;
//服务器线程数、服务器队列长度
public static int SERVER_THREAD_POOL_COUNT =256;
public static int SERVER_ACCEPT_QUEUE_SIZE = 100;
//logging Spec
//日志记录
public static String LOGGING_OUTPUT_FOLDER = "/Users/killsmile/IDEA_JAVA/CTIDHTTPRestService/logs"; // 默认日志路径
public static int LOGGING_ENTRY_BUFFER = 100; // 日志内存缓冲区
public static String LOGGING_NAME_HTTP_SERVER = "HttpServerLog"; //日志名称
public static String LOGGING_NAME_REQUEST_SERVER = "RequestLog"; //日志名称
public static String LOGGING_NAME_RESPONSE_SERVER = "ResponseLog"; //日志名称
public static int LOGGING_FILE_SINGLE_SIZE = 10485760; //日志文件空间
public static int LOGGING_FILE_COUNT = 100; // 日志文件格式
//Kairosdb address
private static String KAIROSDB_HOST = "192.168.100.9";
private static String KAIROSDB_PORT = "8080";
public static String KAIROSDB_REST_ADDRESS = "http://" + KAIROSDB_HOST + ":" + KAIROSDB_PORT + "/api/v1/datapoints";
}
package com.fri.http.rest.connections;
/**
* Created by zhangdahui on 2017/5/1.
*/
public class ConnThreadPool {
}
package com.fri.http.rest.connections;
/**
* Created by zhangdahui on 2017/5/1.
*/
public interface DataEncryptionAgent {
}
package com.fri.http.rest.connections;
/**
* Created by zhangdahui on 2017/5/1.
*/
public class DataSignAgent {
}
package com.fri.http.rest.connections;
import com.fri.http.rest.response.YXJSONResponse;
import org.apache.http.*;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.conn.ConnectionKeepAliveStrategy;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicHeaderElementIterator;
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
/**
* Created by zhangdahui on 2017/5/18.
*/
public class HttpClientPool {
private static PoolingHttpClientConnectionManager cm;
public static void initConnectionPool() {
cm = new PoolingHttpClientConnectionManager();
// Increase max total connection to 200
cm.setMaxTotal(200);
// Increase default max connection per route to 20
cm.setDefaultMaxPerRoute(20);
// Increase max connections for localhost:80 to 50
HttpHost hostBaidu = new HttpHost("www.baidu.com", 80);
cm.setMaxPerRoute(new HttpRoute(hostBaidu), 50);
HttpHost hostKairosDB = new HttpHost("www.centos.org", 80);
cm.setMaxPerRoute(new HttpRoute(hostKairosDB), 50);
}
ConnectionKeepAliveStrategy myStrategy = new ConnectionKeepAliveStrategy() {
public long getKeepAliveDuration(HttpResponse response, HttpContext context) {
// Honor 'keep-alive' header
HeaderElementIterator it = new BasicHeaderElementIterator(response.headerIterator(HTTP.CONN_KEEP_ALIVE));
while (it.hasNext()) {
HeaderElement he = it.nextElement();
String param = he.getName();
String value = he.getValue();
if (value != null && param.equalsIgnoreCase("timeout")) {
try {
return Long.parseLong(value) * 1000;
} catch (NumberFormatException ignore) {}
}
}
HttpHost target = (HttpHost) context.getAttribute(HttpClientContext.HTTP_TARGET_HOST);
if ("www.naughty-server.com".equalsIgnoreCase(target.getHostName())) {
// Keep alive for 5 seconds only
return 5 * 1000;
} else {
// otherwise keep alive for 30 seconds
return 30 * 1000;
}
}
};
public static CloseableHttpClient getClient() {
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(cm).build();
return httpClient;
}
public static YXJSONResponse getRequest(String url) {
YXJSONResponse yxResp = new YXJSONResponse();
CloseableHttpClient hc = HttpClientPool.getClient();
HttpGet httpget = new HttpGet(url);
CloseableHttpResponse response = null;
String respStr = "got error data from [" + url + "]";
try {
response = hc.execute(httpget);
HttpEntity et = response.getEntity();
respStr = EntityUtils.toString(et);
yxResp.ReturnCode = String.valueOf(response.getStatusLine().getStatusCode());
yxResp.outPutSuccess(respStr);
} catch (IOException e) {
e.printStackTrace();
yxResp.outPutError("IOERR", e.getMessage());
} finally {
return yxResp;
}
}
public static YXJSONResponse postRequest(String url, String body) {
YXJSONResponse yxResp = new YXJSONResponse();
CloseableHttpClient hc = HttpClientPool.getClient();
HttpPost httpPost = new HttpPost(url);
CloseableHttpResponse response = null;
StringEntity se = new StringEntity(body, "UTF-8");
se.setContentType("text/json");
se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
httpPost.setEntity(se);
String respStr = "got error data from [" + url + "]";
try {
response = hc.execute(httpPost);
System.out.println(response.getStatusLine().getStatusCode());
HttpEntity et = response.getEntity();
if(response.getEntity() != null){
respStr = EntityUtils.toString(et);
yxResp.outPutSuccess(respStr);
}
} catch (IOException e) {
e.printStackTrace();
yxResp.outPutError("IOERR", e.getMessage());
} finally {
return yxResp;
}
}
}
package com.fri.http.rest.connections;
/**
* Created by zhangdahui on 2017/5/1.
*/
public class RedisAgent {
}
package com.fri.http.rest.logging;
import com.fri.http.rest.config.YXDefaultServerConfig;
import com.fri.http.rest.utils.TimeUtils;
import java.io.IOException;
import java.util.HashMap;
import java.util.logging.FileHandler;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import java.util.logging.MemoryHandler;
class YXLogFormatter extends Formatter {
@Override
public String format(LogRecord record) {
String recordStr;
recordStr = record.getLevel() + ":" +
"[" + record.getSourceClassName() + "." + record.getSourceMethodName() + "]" +
"[" + record.getMillis() + "]" +
"[th-" + record.getThreadID() + "]" + ":" + record.getMessage()+"\n";
return recordStr;
}
}
/**
* Created by zhangdahui on 2017/5/1.
*/
public class YXLogging {
private static final HashMap<String, Logger> _logMap = new HashMap<String, Logger>();
public static Logger CreateLogger(String name, Level level) throws IOException {
if (_logMap.keySet().contains(name)) {
return _logMap.get(name);
}else{
Logger log = Logger.getLogger(name);
String dateTime = TimeUtils.currentDateAsString();
String logFilePath = YXDefaultServerConfig.LOGGING_OUTPUT_FOLDER + '/' + name + '-' + dateTime + ".log";
FileHandler fileHandler = new FileHandler(
logFilePath, // log file full path
YXDefaultServerConfig.LOGGING_FILE_SINGLE_SIZE, // log single file size
YXDefaultServerConfig.LOGGING_FILE_COUNT); // logging file count
fileHandler.setFormatter(new YXLogFormatter());
MemoryHandler m = new MemoryHandler(fileHandler, YXDefaultServerConfig.LOGGING_ENTRY_BUFFER, level);
log.addHandler(m);
_logMap.put(name, log);
return log;
}
}
public static Logger getLogger(String name){
return _logMap.get(name);
}
}
package com.fri.http.rest.resources;
import com.fri.http.rest.config.YXDefaultServerConfig;
import com.fri.http.rest.connections.HttpClientPool;
import com.fri.http.rest.logging.YXLogging;
import com.fri.http.rest.server.YXHttpRestServer;
import com.fri.http.rest.response.YXJSONResponse;
import org.eclipse.jetty.server.ServerConnector;
import org.omg.CORBA.Any;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.HashMap;
import java.util.Random;
import java.util.logging.Logger;
/**
* Created by lixiaoyang on 4/27/17.
* 版本
* v1/postRandom
* v1/postIdentity
*/
@Path("v1")
public class CTIDRestResources {
private String version = "ver1";
private Logger logger = YXLogging.getLogger(YXDefaultServerConfig.LOGGING_NAME_REQUEST_SERVER);
private Logger logger2 = YXLogging.getLogger(YXDefaultServerConfig.LOGGING_NAME_RESPONSE_SERVER);
@GET
@Path("status")
@Produces(MediaType.APPLICATION_JSON)
/**
* 接收带有查询参数的GET的请求
*/
public String hello(@Context HttpServletRequest req, @Context HttpServletResponse resp, @QueryParam("agent") String agent) throws Exception {
resp.setCharacterEncoding("UTF-8");
YXJSONResponse yxResp = new YXJSONResponse();
HashMap dataMap = new HashMap<String, Any>();
dataMap.put("ApiVersion", version);
dataMap.put("ThreadInProcess", YXHttpRestServer.jettyServer.getThreadPool().getThreads());
dataMap.put("CurrentQueueSize", ((ServerConnector)YXHttpRestServer.jettyServer.getConnectors()[0]).getAcceptQueueSize());
dataMap.put("AgentCode", agent);
dataMap.put("BusinessSerialNo", "SAXD1351231512312");
dataMap.put("RandomNo", String.valueOf(new Random().nextInt(999999999)+5));
String jsonStr = yxResp.outPutSuccess(dataMap).toJSONString();
logger.info(req.getRemoteHost() + " => " + jsonStr);
return jsonStr;
}
@POST
@Path("postRandom")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
/**
* 接收带有 JSON Body 的POST请求,非Form模式
*/
public String postRandomBody(String jsonStr) throws Exception {
logger.info(jsonStr);
// YXJSONResponse sta = new YXJSONResponse();
// JSONObject randomResponseObj = new CTIDServer().passRandomData(jsonStr);
// logger2.info(randomResponseObj.toString());
// return sta.outPutSuccess(randomResponseObj).toJSONString();
//接收客户端发送的json 转换并处理返回响应结果
return "身份认证申请的响应json字符串";
}
@POST
@Path("postIdentity")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
//接收带有 JSON Body 的POST请求,非Form模式
public String postIdentityBody(String jsonStr) throws Exception {
logger.info(jsonStr);
// YXJSONResponse sta = new YXJSONResponse();
// String responseStr = new CTIDServer().passIdentityData(jsonStr);
// JSONObject json = JSONObject.fromObject(responseStr);
// logger2.info(json.toString());
// return sta.outPutSuccess(json).toJSONString();
return "身份认证结果的响应json字符串";
}
@GET
@Path("getTest")
@Produces(MediaType.APPLICATION_JSON)
//GET请求,同时向其他服务器发送请求
public String getTest(@Context HttpServletRequest req, @Context HttpServletResponse resp) throws Exception {
YXJSONResponse sta = HttpClientPool.getRequest("http://www.baidu.com");
return sta.toJSONString();
}
@GET
@Path("postTest")
@Produces(MediaType.APPLICATION_JSON)
//GET请求,同时向远程发送POST请求
public String postTest(@Context HttpServletRequest req, @Context HttpServletResponse resp) throws Exception {
String body = "[{\n" +
" \"name\": \"archive_file_search_1\",\n" +
" \"timestamp\": 1359786400000,\n" +
" \"value\": 321,\n" +
" \"tags\": {\"host\": \"server3\"}\n" +
"}]";
YXJSONResponse sta = HttpClientPool.postRequest(YXDefaultServerConfig.KAIROSDB_REST_ADDRESS, body);
return sta.toJSONString();
}
}
\ No newline at end of file
package com.fri.http.rest.resources;
import com.fri.http.rest.config.YXDefaultServerConfig;
import com.fri.http.rest.connections.HttpClientPool;
import com.fri.http.rest.logging.YXLogging;
import com.fri.http.rest.response.YXJSONResponse;
import com.fri.http.rest.server.YXHttpRestServer;
import net.sf.json.JSONObject;
import org.eclipse.jetty.server.ServerConnector;
import org.omg.CORBA.Any;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.HashMap;
import java.util.Random;
import java.util.logging.Logger;
/**
* Created by zhangdahui on 4/27/17.
*/
@Path("v1")
public class YXRestResources {
private String version = "ver1";
private Logger logger = YXLogging.getLogger(YXDefaultServerConfig.LOGGING_NAME_REQUEST_SERVER);
@GET
@Path("status")
@Produces(MediaType.APPLICATION_JSON)
//接收带有查询参数的GET的请求
public String hello(@Context HttpServletRequest req, @Context HttpServletResponse resp, @QueryParam("agent") String agent) throws Exception {
resp.setCharacterEncoding("UTF-8");
YXJSONResponse yxResp = new YXJSONResponse();
HashMap dataMap = new HashMap<String, Any>();
dataMap.put("ApiVersion", version);
dataMap.put("ThreadInProcess", YXHttpRestServer.jettyServer.getThreadPool().getThreads());
dataMap.put("CurrentQueueSize", ((ServerConnector)YXHttpRestServer.jettyServer.getConnectors()[0]).getAcceptQueueSize());
dataMap.put("AgentCode", agent);
dataMap.put("BusinessSerialNo", "SAXD1351231512312");
dataMap.put("RandomNo", String.valueOf(new Random().nextInt(999999999)+5));
String jsonStr = yxResp.outPutSuccess(dataMap).toJSONString();
logger.info(req.getRemoteHost() + " => " + jsonStr);
return jsonStr;
}
@POST
@Path("postBody")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
//接收带有 JSON Body 的POST请求,非Form模式
public String postWithBody(String jsonStr) throws Exception {
YXJSONResponse sta = new YXJSONResponse();
JSONObject json = JSONObject.fromObject(jsonStr);
return sta.outPutSuccess(json).toJSONString();
}
@GET
@Path("getTest")
@Produces(MediaType.APPLICATION_JSON)
//GET请求,同时向其他服务器发送请求
public String getTest(@Context HttpServletRequest req, @Context HttpServletResponse resp) throws Exception {
YXJSONResponse sta = HttpClientPool.getRequest("http://www.baidu.com");
return sta.toJSONString();
}
@GET
@Path("postTest")
@Produces(MediaType.APPLICATION_JSON)
//GET请求,同时向远程发送POST请求
public String postTest(@Context HttpServletRequest req, @Context HttpServletResponse resp) throws Exception {
String body = "[{\n" +
" \"name\": \"archive_file_search_1\",\n" +
" \"timestamp\": 1359786400000,\n" +
" \"value\": 321,\n" +
" \"tags\": {\"host\": \"server3\"}\n" +
"}]";
YXJSONResponse sta = HttpClientPool.postRequest(YXDefaultServerConfig.KAIROSDB_REST_ADDRESS, body);
return sta.toJSONString();
}
}
\ No newline at end of file
package com.fri.http.rest.resources;
import com.fri.http.rest.config.YXDefaultServerConfig;
import com.fri.http.rest.logging.YXLogging;
import com.fri.http.rest.server.YXHttpRestServer;
import com.fri.http.rest.response.YXJSONResponse;
import org.eclipse.jetty.server.ServerConnector;
import org.omg.CORBA.Any;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.HashMap;
import java.util.logging.Logger;
/**
* Created by zhangdahui on 2017/5/5.
*/
@Path("server")
public class YXServerStatus {
private Logger logger = YXLogging.getLogger(YXDefaultServerConfig.LOGGING_NAME_REQUEST_SERVER);
@GET
@Path("info")
@Produces(MediaType.APPLICATION_JSON)
public String status(@Context HttpServletRequest req, @Context HttpServletResponse resp) throws Exception {
resp.setCharacterEncoding("UTF-8");
YXJSONResponse yxResp = new YXJSONResponse();
HashMap dataMap = new HashMap<String, Any>();
dataMap.put("ThreadInProcess", YXHttpRestServer.jettyServer.getThreadPool().getThreads());
dataMap.put("CurrentQueueSize", ((ServerConnector)YXHttpRestServer.jettyServer.getConnectors()[0]).getAcceptQueueSize());
logger.info(req.getRemoteHost() + ": Status Query");
return yxResp.outPutSuccess(dataMap).toJSONString();
}
@GET
@Path("error")
@Produces(MediaType.APPLICATION_JSON)
public String testError(@Context HttpServletRequest req, @Context HttpServletResponse resp) throws Exception {
resp.setCharacterEncoding("UTF-8");
logger.info(req.getRemoteHost() + ":Got Error");
return new YXJSONResponse().outPutError("0001", "这是一个错误信息测试返回").toJSONString();
}
}
package com.fri.http.rest.response;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import net.sf.json.JSON;
import org.omg.CORBA.Any;
/**
* Created by zhangdahui on 4/27/17.
*/
public class YXJSONResponse {
public long ServerProcessingDur = 0;
public long ServerProcessingFinishStamp = 0;
public boolean Error = false;
public String ReturnCode = "PASS";
public String ReturnMsg = "PASS_DESC";
private long start_stamp = 0;
public JSON RespData = null;
public YXJSONResponse() {
this.start_stamp = System.currentTimeMillis();
}
public YXJSONResponse outPutSuccess(){
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
return this;
}
public YXJSONResponse outPutSuccess(HashMap dataMap){
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.RespData = JSONObject.fromObject(dataMap);
return this;
}
public YXJSONResponse outPutSuccess(ArrayList dataList){
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.Error = false;
this.RespData = JSONArray.fromObject(dataList);
return this;
}
public YXJSONResponse outPutSuccess(JSON json){
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.Error = false;
this.RespData = json;
return this;
}
public YXJSONResponse outPutSuccess(String string){
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.Error = false;
HashMap map = new HashMap<String, Any>();
map.put("string", string);
this.RespData = JSONObject.fromObject(map);
return this;
}
public YXJSONResponse outPutError(String returnCode, String returnMsg){
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.ReturnCode = returnCode;
this.ReturnMsg = returnMsg;
this.Error = true;
return this;
}
public JSONObject toJSON(){
HashMap map = new HashMap<String, Any>();
map.put("ServerProcessingDur", this.ServerProcessingDur);
map.put("ServerProcessingFinishStamp", this.ServerProcessingFinishStamp);
map.put("ReturnCode", this.ReturnCode);
map.put("ReturnMsg", this.ReturnMsg);
map.put("Error", this.Error);
map.put("respData", this.RespData);
return JSONObject.fromObject(map);
}
public String toJSONString(){
return this.toJSON().toString();
}
}
package com.fri.http.rest.server;
import com.fri.http.rest.config.YXDefaultServerConfig;
import com.fri.http.rest.connections.HttpClientPool;
import com.fri.http.rest.logging.YXLogging;
import com.fri.http.rest.resources.YXRestResources;
import com.fri.http.rest.resources.CTIDRestResources;
import com.fri.http.rest.resources.YXServerStatus;
import com.fri.http.rest.utils.TimeUtils;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by zhangdahui on 4/27/17.
*/
public class YXHttpRestServer {
public static Server jettyServer = null;
public static void main(String[] args) throws IOException {
Logger logger = YXLogging.CreateLogger(YXDefaultServerConfig.LOGGING_NAME_HTTP_SERVER, Level.ALL);
YXLogging.CreateLogger(YXDefaultServerConfig.LOGGING_NAME_REQUEST_SERVER, Level.ALL);
YXLogging.CreateLogger(YXDefaultServerConfig.LOGGING_NAME_RESPONSE_SERVER, Level.ALL);
logger.info("-----------------------------------------------------------------------");
logger.info("| YingXin Application Server Framework |");
logger.info("| YingXin " + YXDefaultServerConfig.APPLICATION_NAME + " |");
logger.info("-----------------------------------------------------------------------");
//Server Thread Pool
QueuedThreadPool httpThreadPool = new QueuedThreadPool();
httpThreadPool.setMaxThreads(YXDefaultServerConfig.SERVER_THREAD_POOL_COUNT);
logger.info("-----------------------------------------------------------------------");
logger.info(" Initialize Jetty HTTP Server:" + TimeUtils.currentDateAsString());
//Build HttpServer
jettyServer = new Server(httpThreadPool);
logger.info("|- SERVER_HOST = " + YXDefaultServerConfig.SERVER_HOST);
logger.info("|- SERVER_THREAD_POOL_COUNT = " + YXDefaultServerConfig.SERVER_THREAD_POOL_COUNT);
/*
NCSARequestLog requestLog = new NCSARequestLog(YXLogging.getJettyServerLoggerName());
requestLog.setAppend(true);
requestLog.setExtended(false);
requestLog.setLogLatency(true);
requestLog.setRetainDays(YXDefaultServerConfig.LOGGING_HTTP_REQUEST_REMAIN_DAYS);
jettyServer.setRequestLog(requestLog);
*/
logger.info("-----------------------------------------------------------------------");
logger.info(" Create Http Rest Service Connector");
ServerConnector httpConnector = new ServerConnector(jettyServer);
httpConnector.setHost(YXDefaultServerConfig.SERVER_HOST); //Host IP & Address
httpConnector.setPort(YXDefaultServerConfig.SERVER_PORT); //Port
httpConnector.setIdleTimeout(YXDefaultServerConfig.SERVER_IDLE_TIMEOUT); //Connection idle time out
httpConnector.setStopTimeout(YXDefaultServerConfig.SERVER_STOP_TIMEOUT);
httpConnector.setAcceptQueueSize(YXDefaultServerConfig.SERVER_ACCEPT_QUEUE_SIZE);
logger.info("|- SERVER_PORT = " + YXDefaultServerConfig.SERVER_PORT);
logger.info("|- SERVER_IDLE_TIMEOUT = " + YXDefaultServerConfig.SERVER_IDLE_TIMEOUT);
logger.info("|- SERVER_STOP_TIMEOUT = " + YXDefaultServerConfig.SERVER_STOP_TIMEOUT);
logger.info("|- SERVER_ACCEPT_QUEUE_SIZE = " + YXDefaultServerConfig.SERVER_ACCEPT_QUEUE_SIZE);
logger.info("-----------------------------------------------------------------------");
logger.info(" Create Http Monitor Service Connector");
ServerConnector httpMonitorConnector = new ServerConnector(jettyServer);
httpMonitorConnector.setHost(YXDefaultServerConfig.SERVER_HOST); //Host IP & Address
httpMonitorConnector.setPort(YXDefaultServerConfig.SERVER_MONITOR_PORT); //Port
logger.info("|- SERVER_MONITOR_PORT = " + YXDefaultServerConfig.SERVER_MONITOR_PORT);
//Build Context
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
context.setContextPath("/");
//The following code show how to add two or more rest services in http server
ServletHolder restServlet = context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class, YXDefaultServerConfig.SERVER_REST_ROOT_PATH + "/*");
restServlet.setInitOrder(0);
restServlet.setInitParameter("jersey.config.server.provider.classnames", YXRestResources.class.getCanonicalName());
logger.info("|- Rest Resource Name = " + YXRestResources.class.getCanonicalName());
logger.info("|- Rest Resource Root = " + YXDefaultServerConfig.SERVER_REST_ROOT_PATH + "/*");
ServletHolder monitorServlet = context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class, YXDefaultServerConfig.SERVER_MONITOR_PATH + "/*");
monitorServlet.setInitOrder(1);
monitorServlet.setInitParameter("jersey.config.server.provider.classnames", YXServerStatus.class.getCanonicalName());
logger.info("|- Rest Monitor Name = " + YXServerStatus.class.getCanonicalName());
logger.info("|- Rest Monitor Root = " + YXDefaultServerConfig.SERVER_MONITOR_PATH + "/*");
ServletHolder identityServlet = context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class, YXDefaultServerConfig.SERVER_CTID_IDENTITY_PATH + "/*");
identityServlet.setInitOrder(2);
identityServlet.setInitParameter("jersey.config.server.provider.classnames", CTIDRestResources.class.getCanonicalName());
logger.info("|- Rest Monitor Name = " + CTIDRestResources.class.getCanonicalName());
logger.info("|- Rest Monitor Root = " + YXDefaultServerConfig.SERVER_CTID_IDENTITY_PATH + "/*");
jettyServer.addConnector(httpConnector);
jettyServer.addConnector(httpMonitorConnector);
jettyServer.setHandler(context);
// Start Server
try {
jettyServer.start();
logger.info("-----------------------------------------------------------------------");
logger.info(" Init HttpClient Link Pool");
HttpClientPool.initConnectionPool();
} catch (Exception e) {
logger.info("Exception:" + e.getMessage());
} finally {
try {
Thread.sleep(1000);
if (jettyServer.isRunning()) {
logger.info("Starting Succeeded.");
jettyServer.join();
} else {
logger.info("Starting Failed");
jettyServer.stop();
}
} catch (Exception e) {
logger.info("Exception:" + e.getMessage());
}
}
}
}
package com.fri.http.rest.utils;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
/**
* Created by zhangdahui on 2017/5/1.
*/
public class TimeUtils {
public static SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
public static long currentStamp(){
return System.currentTimeMillis();
}
public static String currentStampAsString(){
return String.valueOf(System.currentTimeMillis());
}
public static String toDateAsString(long stamp){
Timestamp timeStamp = new Timestamp(stamp);
String time = df.format(timeStamp);
return time;
}
public static String currentDateAsString(){
return toDateAsString(currentStamp());
}
}
package com.fri.http.rest.utils;
/**
* Created by zhangdahui on 2017/5/1.
*/
public class UUIDUtils {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment