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: leinfelder $'
|
9
|
* '$Date: 2011-12-21 13:00:40 -0800 (Wed, 21 Dec 2011) $'
|
10
|
* '$Revision: 6814 $'
|
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
|
import java.util.Date;
|
30
|
|
31
|
/**
|
32
|
* A class express a entry in xml_replication. It include server name,
|
33
|
* lastChechedDate, replication or not, dataReplication or not, hub or not
|
34
|
*/
|
35
|
|
36
|
public class ReplicationServer
|
37
|
{
|
38
|
private String serverName = null; //server name
|
39
|
private Date lastCheckedDate = null; //string of last
|
40
|
private boolean replication = false; //replciate xml document or not
|
41
|
private boolean dataReplication = false; //replciate data file or not
|
42
|
//it is relative to replcation
|
43
|
//if replication is false, it should
|
44
|
//be false
|
45
|
private boolean hub = false; //it is hub or not. Hub means the localhost can
|
46
|
//replcate documents to the server if the
|
47
|
//document's home server is not localhost
|
48
|
/**
|
49
|
* Constructor of ReplicationServer
|
50
|
*/
|
51
|
public ReplicationServer()
|
52
|
{
|
53
|
this.serverName = null;
|
54
|
this.lastCheckedDate = null;
|
55
|
this.replication = false;
|
56
|
this.dataReplication = false;
|
57
|
this.hub = false;
|
58
|
}//constructor
|
59
|
|
60
|
/**
|
61
|
* Get server name
|
62
|
*/
|
63
|
public String getServerName()
|
64
|
{
|
65
|
return this.serverName;
|
66
|
}//getServerName
|
67
|
|
68
|
/**
|
69
|
* Set a sting as server name
|
70
|
* @param myServerName, the string will set to object's serverName
|
71
|
*/
|
72
|
public void setServerName(String myServerName)
|
73
|
{
|
74
|
this.serverName = myServerName;
|
75
|
}//setServerName
|
76
|
|
77
|
/**
|
78
|
* Get last checked date
|
79
|
*/
|
80
|
public Date getLastCheckedDate()
|
81
|
{
|
82
|
return this.lastCheckedDate;
|
83
|
}//getLastCheckedDate
|
84
|
|
85
|
/**
|
86
|
* Set a string as last checked date
|
87
|
* @Param myLastCheckedDate, the string will set to object's lastCheckedDate
|
88
|
*/
|
89
|
public void setLastCheckedDate(Date myLastCheckedDate)
|
90
|
{
|
91
|
this.lastCheckedDate = myLastCheckedDate;
|
92
|
}//setLastCheckedDate
|
93
|
|
94
|
/**
|
95
|
* Get replication xml or not option
|
96
|
*/
|
97
|
public boolean getReplication()
|
98
|
{
|
99
|
return this.replication;
|
100
|
}//getReplication
|
101
|
|
102
|
/**
|
103
|
* Set replication option
|
104
|
* @param myReplication, the option will set to object's replication
|
105
|
*/
|
106
|
public void setReplication(boolean myReplication)
|
107
|
{
|
108
|
this.replication = myReplication;
|
109
|
}//setReplication
|
110
|
|
111
|
/**
|
112
|
* Get datareplication xml or not option
|
113
|
*/
|
114
|
public boolean getDataReplication()
|
115
|
{
|
116
|
return this.dataReplication;
|
117
|
}//getDataReplication
|
118
|
|
119
|
/**
|
120
|
* Set data replication option
|
121
|
* @param myDataReplication, the option will set to object's datareplication
|
122
|
*/
|
123
|
public void setDataReplication(boolean myDataReplication)
|
124
|
{
|
125
|
this.dataReplication = myDataReplication;
|
126
|
}//setDataReplication
|
127
|
|
128
|
|
129
|
/**
|
130
|
* Get hub option
|
131
|
*/
|
132
|
public boolean getHub()
|
133
|
{
|
134
|
return this.hub;
|
135
|
}//getHub
|
136
|
|
137
|
/**
|
138
|
* Set hub option
|
139
|
* @param myHub, the option will set to object's hub option
|
140
|
*/
|
141
|
public void setHub(boolean myHub)
|
142
|
{
|
143
|
this.hub = myHub;
|
144
|
}//setHub
|
145
|
|
146
|
}//class ReplicationServer
|
147
|
|