androidpn的学习研究(一)androidpn-server服务端相关配置的常识
androidpn的一些基本常识:
ANDROIDPN_HOME=C:\android-push\androidpn-server-0.5.0
启动androidpn服务端:
%ANDROID_HOME%/bin/run.bat
androidpn的数据库日志:
%ANDROID_HOME%/bin/db/androidpn.log
androidpn的数据库配置:
%ANDROID_HOME%/bin/db/androidpn.properties
androidpn的数据库表结构脚本:
%ANDROID_HOME%/bin/db/androidpn.script
androidpn的服务端应用数据库配置:
%ANDROID_HOME%/conf/jdbc.properties
androidpn的服务端应用xmpp配置:
%ANDROID_HOME%/conf/config.properties
androidpn的服务端应用应用hibernate缓存配置:
%ANDROID_HOME%/conf/ehcache.xml
androidpn的服务端应用日志配置:
%ANDROID_HOME%/conf/log4j.xml
androidpn的服务端应用spring配置:
%ANDROID_HOME%/conf/spring-config.xml
androidpn的服务端日志:
%ANDROID_HOME%/logs/androidpn.log (记录发送消息xmpp的格式和调用顺序)
如下:
{DEBUG}[2012-07-2414:40:23,921]<org.apache.mina.core.filterchain.IoFilterEvent>:FiringaMESSAGE_RECEIVEDeventforsession2
{DEBUG}[2012-07-2414:40:23,921]<org.apache.mina.filter.codec.ProtocolCodecFilter>:ProcessingaMESSAGE_RECEIVEDforsession2
{DEBUG}[2012-07-2414:40:23,921]<org.apache.mina.core.filterchain.IoFilterEvent>:EventMESSAGE_RECEIVEDhasbeenfiredforsession2
{DEBUG}[2012-07-2414:40:53,968]<org.apache.mina.filter.executor.OrderedThreadPoolExecutor>:AddingeventMESSAGE_RECEIVEDtosession2
Queue : [MESSAGE_RECEIVED, ]{DEBUG} [2012-07-24 14:40:53,968] <org.apache.mina.core.filterchain.IoFilterEvent> : Firing a MESSAGE_RECEIVED event for session 2
{DEBUG}[2012-07-2414:40:53,968]<org.apache.mina.filter.codec.ProtocolCodecFilter>:ProcessingaMESSAGE_RECEIVEDforsession2
{DEBUG}[2012-07-2414:40:53,968]<org.apache.mina.core.filterchain.IoFilterEvent>:EventMESSAGE_RECEIVEDhasbeenfiredforsession2
{DEBUG}[2012-07-2414:41:06,453]<org.androidpn.server.console.controller.NotificationController>:apiKey=1234567890
{DEBUG}[2012-07-2414:41:06,453]<org.androidpn.server.xmpp.push.NotificationManager>:sendBroadcast()...
{DEBUG} [2012-07-24 14:41:06,453] <org.androidpn.server.xmpp.net.Connection> :SENT: <iq type="set" id="943-1" to="[email protected]/AndroidpnClient"><notification xmlns="androidpn:iq:notification"><id>fdcbd43b</id><apiKey>1234567890</apiKey><title>Dokdo Island</title><message>Dokdo is a Korean island, the far east of the Korean territory. No doubt! No question! Don't mention it any more!说的法撒旦法</message><uri></uri></notification></iq>
{DEBUG}[2012-07-2414:41:06,468]<org.apache.mina.filter.executor.OrderedThreadPoolExecutor>:AddingeventMESSAGE_SENTtosession2
Queue : [MESSAGE_SENT, ]备注:
在hibernate的配置中hibernate.cfg.xml配置中:
<!--( validate | update | create | create-drop )--> <property name="hibernate.hbm2ddl.auto">update</property>
在多次重新运行服务端和客户端之后,可以发现,服务端的脚本中存在有记录客户端id标志的起始值的已经存在的数据信息信息:
在androidpn-server-0.5.0\bin\db\androidpn.script中。
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATEMEMORYTABLEAPN_USER(IDBIGINTGENERATEDBYDEFAULTASIDENTITY(STARTWITH1)NOTNULLPRIMARYKEY,CREATED_DATETIMESTAMP,EMAILVARCHAR(64),NAMEVARCHAR(64),PASSWORDVARCHAR(64),UPDATED_DATETIMESTAMP,USERNAMEVARCHAR(64)NOTNULL,CONSTRAINTSYS_CT_46UNIQUE(USERNAME))
ALTERTABLEAPN_USERALTERCOLUMNIDRESTARTWITH3
CREATEUSERSAPASSWORD""
GRANTDBATOSA
SETWRITE_DELAY10
SETSCHEMAPUBLIC
INSERTINTOAPN_USERVALUES(1,'2012-07-2313:07:50.421000000',NULL,NULL,'4c9cd95e3d3d4874b507fdae64e38b41',NULL,'25a67fa989354bca832513d4a3ad4f3d')
INSERTINTOAPN_USERVALUES(2,'2012-07-2414:34:38.953000000',NULL,NULL,'7b8f51468cb441379d0883e1c4707847',NULL,'ea34751c595443c89be07aa17eab76f3')