1
|
/**
|
2
|
* '$RCSfile$'
|
3
|
* Purpose: A class represent a server in xml_replcation table
|
4
|
* Copyright: 2000 Regents of the University of California and the
|
5
|
* National Center for Ecological Analysis and Synthesis
|
6
|
* Authors: Jing Tao
|
7
|
*
|
8
|
* '$Author: daigle $'
|
9
|
* '$Date: 2009-08-04 14:30:29 -0700 (Tue, 04 Aug 2009) $'
|
10
|
* '$Revision: 5014 $'
|
11
|
*
|
12
|
* This program is free software; you can redistribute it and/or modify
|
13
|
* it under the terms of the GNU General Public License as published by
|
14
|
* the Free Software Foundation; either version 2 of the License, or
|
15
|
* (at your option) any later version.
|
16
|
*
|
17
|
* This program is distributed in the hope that it will be useful,
|
18
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20
|
* GNU General Public License for more details.
|
21
|
*
|
22
|
* You should have received a copy of the GNU General Public License
|
23
|
* along with this program; if not, write to the Free Software
|
24
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
25
|
*/
|
26
|
|
27
|
package edu.ucsb.nceas.metacat.replication;
|
28
|
|
29
|
/**
|
30
|
* A class express a entry in xml_replication. It include server name,
|
31
|
* lastChechedDate, replication or not, dataReplication or not, hub or not
|
32
|
*/
|
33
|
|
34
|
public class ReplicationServer
|
35
|
{
|
36
|
private String serverName = null; //server name
|
37
|
private String lastCheckedDate = null; //string of last
|
38
|
private boolean replication = false; //replciate xml document or not
|
39
|
private boolean dataReplication = false; //replciate data file or not
|
40
|
//it is relative to replcation
|
41
|
//if replication is false, it should
|
42
|
//be false
|
43
|
private boolean hub = false; //it is hub or not. Hub means the localhost can
|
44
|
//replcate documents to the server if the
|
45
|
//document's home server is not localhost
|
46
|
/**
|
47
|
* Consturctor of ReplicationServer
|
48
|
*/
|
49
|
public ReplicationServer()
|
50
|
{
|
51
|
this.serverName = null;
|
52
|
this.lastCheckedDate = null;
|
53
|
this.replication = false;
|
54
|
this.dataReplication = false;
|
55
|
this.hub = false;
|
56
|
}//constructor
|
57
|
|
58
|
/**
|
59
|
* Get server name
|
60
|
*/
|
61
|
public String getServerName()
|
62
|
{
|
63
|
return this.serverName;
|
64
|
}//getServerName
|
65
|
|
66
|
/**
|
67
|
* Set a sting as server name
|
68
|
* @param myServerName, the string will set to object's serverName
|
69
|
*/
|
70
|
public void setServerName(String myServerName)
|
71
|
{
|
72
|
this.serverName = myServerName;
|
73
|
}//setServerName
|
74
|
|
75
|
/**
|
76
|
* Get last checked date
|
77
|
*/
|
78
|
public String getLastCheckedDate()
|
79
|
{
|
80
|
return this.lastCheckedDate;
|
81
|
}//getLastCheckedDate
|
82
|
|
83
|
/**
|
84
|
* Set a string as last checked date
|
85
|
* @Param myLastCheckedDate, the string will set to object's lastCheckedDate
|
86
|
*/
|
87
|
public void setLastCheckedDate(String myLastCheckedDate)
|
88
|
{
|
89
|
this.lastCheckedDate = myLastCheckedDate;
|
90
|
}//setLastCheckedDate
|
91
|
|
92
|
/**
|
93
|
* Get replication xml or not option
|
94
|
*/
|
95
|
public boolean getReplication()
|
96
|
{
|
97
|
return this.replication;
|
98
|
}//getReplication
|
99
|
|
100
|
/**
|
101
|
* Set replication option
|
102
|
* @param myReplication, the option will set to object's replication
|
103
|
*/
|
104
|
public void setReplication(boolean myReplication)
|
105
|
{
|
106
|
this.replication = myReplication;
|
107
|
}//setReplication
|
108
|
|
109
|
/**
|
110
|
* Get datareplication xml or not option
|
111
|
*/
|
112
|
public boolean getDataReplication()
|
113
|
{
|
114
|
return this.dataReplication;
|
115
|
}//getDataReplication
|
116
|
|
117
|
/**
|
118
|
* Set data replication option
|
119
|
* @param myDataReplication, the option will set to object's datareplication
|
120
|
*/
|
121
|
public void setDataReplication(boolean myDataReplication)
|
122
|
{
|
123
|
this.dataReplication = myDataReplication;
|
124
|
}//setDataReplication
|
125
|
|
126
|
/**
|
127
|
* Get hub option
|
128
|
*/
|
129
|
public boolean getHub()
|
130
|
{
|
131
|
return this.hub;
|
132
|
}//getHub
|
133
|
|
134
|
/**
|
135
|
* Set hub option
|
136
|
* @param myHub, the option will set to object's hub option
|
137
|
*/
|
138
|
public void setHub(boolean myHub)
|
139
|
{
|
140
|
this.hub = myHub;
|
141
|
}//setHub
|
142
|
|
143
|
}//class ReplicationServer
|
144
|
|