This implementation includes:
1. Communication protocol between Aupd.java server and client
2, Autoupdateserver.java service side of the monitoring process
3, Aupdsrvproc.java service-side service thread, for processing the client's automatic upgrade request
4, Clientverparser.java service-side service thread to resolve client version information class
5, Autoupdateclient.java client's automatic upgrade request process
6, Config.java for server and client to read local configuration files of the class
7, Updfile.java for file transfer files to the image
This implementation uses DOM4J as an engine for interpreting XML
Aupd.java:
1/** *//********************************************************************
2 * Project name:rochoc<p>
3 * Package name:com.rochoc.autoupdate<p>
4 * File name:autoupdprotocol.java<p>
5 * Creator:kfzx-luoc<p>
6 * Written date:2008-12-22<p>
7 * Program function (Class) Description:<p>
8 * Defines the communication protocol for automatic escalation of client and server
9 * Program Change Date:
10 * Change Author:
11 * Change Note:
12********************************************************************/
13package com.rochoc.autoupdate;
14
15/** *//**
* @author Kfzx-luoc
17 *
TODO To change the template for this generated type comment go to
* Window-preferences-java-code Style-code Templates
20 * *
21public class Aupd
22{
23/** *//**
24 * Meaningless Operation
25 * *
public static final String none = "None";
27
28/** *//**
29 * Send client version information
30 * *
public static final String send_client_version = "Sendcver";
32
33/** *//**
34 * Receive client version information
35 * *
public static final String received_client_version = "Recdcver";
37
38/** *//**
39 * Send file Full path
40 * *
the public static final String Send_file_absoult = "SENDFILE";
42
43/** *//**
44 * Receive file full path
45 * *
public static final String Received_file_absoult = "Recdfile";
47
48/** *//**
49 * Start File transfer
50 * *
Wuyi public static final String start_transmit = "STARTTSM";
52
53/** *//**
54 * End File Transfer
55 * *
public static final String terminate_transmit = "TERMTSMT";
57
58/** *//**
59 * Update failed
60 * *
-public static final String updated_failure = "Updefail";
62
63/** *//**
64 * Updated successfully
65 */
public static final String updated_successful = "UPDESUCC";
67
68/** *//**
69 * No need to update
70 * *
public static final String notneed_updated = "NNEEDUPD";
72
73/** *//**
74 * is ready to receive the updated file
75 * *
the public static final String ready_to_update = "Readytup";
77
78/** *//**
79 * End link
80 * *
Bayi public static final String BYE = "Byebyeok";
82
83/** *//**
84 * Data area offset
85 * *
public static final int data_offset = 5;
87
88/** *//**
89 * File data block size
90 * *
-public static final int data_size = 1024;
92
93/** *//**
94 * Send buffer size
95 * *
public static final int buffer_size = data_size + 1 + 4; [0] bit is a sign bit, distinguishing data and COMMAND + 4 bit length
97
98/** *//**
99 * Data Segment Identification
100 * *
public static final int mark_data_sect = 0;
102/** *//**
103 * Command Segment Identification
104 * *
public static final int cmd_data_sect = 1;
106
107/** *//**
108 * Data segment End Identification
109 * *
public static final int mark_data_end = 127;
111}
112