1 |
1292
|
tao
|
/**
|
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$'
|
9 |
|
|
* '$Date$'
|
10 |
|
|
* '$Revision$'
|
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 |
5014
|
daigle
|
package edu.ucsb.nceas.metacat.replication;
|
28 |
1292
|
tao
|
|
29 |
6118
|
leinfelder
|
import java.util.Date;
|
30 |
|
|
|
31 |
1292
|
tao
|
/**
|
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 |
6118
|
leinfelder
|
private Date lastCheckedDate = null; //string of last
|
40 |
1292
|
tao
|
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 |
6135
|
leinfelder
|
private boolean systemMetadataReplication = false; //replicate system metadata or not
|
46 |
1292
|
tao
|
private boolean hub = false; //it is hub or not. Hub means the localhost can
|
47 |
|
|
//replcate documents to the server if the
|
48 |
|
|
//document's home server is not localhost
|
49 |
|
|
/**
|
50 |
6135
|
leinfelder
|
* Constructor of ReplicationServer
|
51 |
1292
|
tao
|
*/
|
52 |
|
|
public ReplicationServer()
|
53 |
|
|
{
|
54 |
|
|
this.serverName = null;
|
55 |
|
|
this.lastCheckedDate = null;
|
56 |
|
|
this.replication = false;
|
57 |
|
|
this.dataReplication = false;
|
58 |
|
|
this.hub = false;
|
59 |
|
|
}//constructor
|
60 |
|
|
|
61 |
|
|
/**
|
62 |
|
|
* Get server name
|
63 |
|
|
*/
|
64 |
|
|
public String getServerName()
|
65 |
|
|
{
|
66 |
|
|
return this.serverName;
|
67 |
|
|
}//getServerName
|
68 |
|
|
|
69 |
|
|
/**
|
70 |
|
|
* Set a sting as server name
|
71 |
|
|
* @param myServerName, the string will set to object's serverName
|
72 |
|
|
*/
|
73 |
|
|
public void setServerName(String myServerName)
|
74 |
|
|
{
|
75 |
|
|
this.serverName = myServerName;
|
76 |
|
|
}//setServerName
|
77 |
|
|
|
78 |
|
|
/**
|
79 |
|
|
* Get last checked date
|
80 |
|
|
*/
|
81 |
6118
|
leinfelder
|
public Date getLastCheckedDate()
|
82 |
1292
|
tao
|
{
|
83 |
|
|
return this.lastCheckedDate;
|
84 |
|
|
}//getLastCheckedDate
|
85 |
|
|
|
86 |
|
|
/**
|
87 |
|
|
* Set a string as last checked date
|
88 |
|
|
* @Param myLastCheckedDate, the string will set to object's lastCheckedDate
|
89 |
|
|
*/
|
90 |
6118
|
leinfelder
|
public void setLastCheckedDate(Date myLastCheckedDate)
|
91 |
1292
|
tao
|
{
|
92 |
|
|
this.lastCheckedDate = myLastCheckedDate;
|
93 |
|
|
}//setLastCheckedDate
|
94 |
|
|
|
95 |
|
|
/**
|
96 |
|
|
* Get replication xml or not option
|
97 |
|
|
*/
|
98 |
|
|
public boolean getReplication()
|
99 |
|
|
{
|
100 |
|
|
return this.replication;
|
101 |
|
|
}//getReplication
|
102 |
|
|
|
103 |
|
|
/**
|
104 |
|
|
* Set replication option
|
105 |
|
|
* @param myReplication, the option will set to object's replication
|
106 |
|
|
*/
|
107 |
|
|
public void setReplication(boolean myReplication)
|
108 |
|
|
{
|
109 |
|
|
this.replication = myReplication;
|
110 |
|
|
}//setReplication
|
111 |
|
|
|
112 |
|
|
/**
|
113 |
|
|
* Get datareplication xml or not option
|
114 |
|
|
*/
|
115 |
|
|
public boolean getDataReplication()
|
116 |
|
|
{
|
117 |
|
|
return this.dataReplication;
|
118 |
|
|
}//getDataReplication
|
119 |
|
|
|
120 |
|
|
/**
|
121 |
|
|
* Set data replication option
|
122 |
|
|
* @param myDataReplication, the option will set to object's datareplication
|
123 |
|
|
*/
|
124 |
|
|
public void setDataReplication(boolean myDataReplication)
|
125 |
|
|
{
|
126 |
|
|
this.dataReplication = myDataReplication;
|
127 |
|
|
}//setDataReplication
|
128 |
|
|
|
129 |
6135
|
leinfelder
|
public boolean isSystemMetadataReplication() {
|
130 |
|
|
return systemMetadataReplication;
|
131 |
|
|
}
|
132 |
|
|
|
133 |
|
|
public void setSystemMetadataReplication(boolean systemMetadataReplication) {
|
134 |
|
|
this.systemMetadataReplication = systemMetadataReplication;
|
135 |
|
|
}
|
136 |
|
|
|
137 |
|
|
/**
|
138 |
1292
|
tao
|
* Get hub option
|
139 |
|
|
*/
|
140 |
|
|
public boolean getHub()
|
141 |
|
|
{
|
142 |
|
|
return this.hub;
|
143 |
|
|
}//getHub
|
144 |
|
|
|
145 |
|
|
/**
|
146 |
|
|
* Set hub option
|
147 |
|
|
* @param myHub, the option will set to object's hub option
|
148 |
|
|
*/
|
149 |
|
|
public void setHub(boolean myHub)
|
150 |
|
|
{
|
151 |
|
|
this.hub = myHub;
|
152 |
|
|
}//setHub
|
153 |
|
|
|
154 |
|
|
}//class ReplicationServer
|