Revision 3230
Added by Jing Tao almost 17 years ago
ForceReplicationHandler.java | ||
---|---|---|
54 | 54 |
private String action; |
55 | 55 |
private boolean xmlDocument; |
56 | 56 |
private boolean dbactionFlag = true; |
57 |
private String user = null; |
|
58 |
private String ipAddress = null; |
|
59 | 57 |
private ReplicationServerList serverLists = null;//Serverlist |
60 | 58 |
private int homeServerCode = 0; // home server code for the docid |
61 | 59 |
// When a metacat A got forcereplication |
... | ... | |
82 | 80 |
* don't want A to notify B again. B is nofitification of A. |
83 | 81 |
*/ |
84 | 82 |
public ForceReplicationHandler(String docid, String action, boolean xml, |
85 |
String myNotificationServer, String user, String ipAddress)
|
|
83 |
String myNotificationServer) |
|
86 | 84 |
{ |
87 | 85 |
this.docid = docid; |
88 | 86 |
this.action = action; |
89 | 87 |
this.xmlDocument =xml; |
90 |
this.user = user; |
|
91 |
this.ipAddress = ipAddress; |
|
92 | 88 |
// Build a severLists from xml_replication table |
93 | 89 |
this.serverLists = new ReplicationServerList(); |
94 | 90 |
// Get sever code for this docid |
... | ... | |
118 | 114 |
* Use this constructor when the action is implied. |
119 | 115 |
*/ |
120 | 116 |
public ForceReplicationHandler(String docid, boolean xml, |
121 |
String myNotificationServer, String user, String ipAddress)
|
|
117 |
String myNotificationServer )
|
|
122 | 118 |
{ |
123 | 119 |
this.docid = docid; |
124 | 120 |
this.xmlDocument = xml; |
125 |
this.user = user; |
|
126 |
this.ipAddress = ipAddress; |
|
127 | 121 |
dbactionFlag = false; |
128 | 122 |
// Build a severLists from xml_replication table |
129 | 123 |
this.serverLists = new ReplicationServerList(); |
... | ... | |
205 | 199 |
"?action=forcereplicate&server=" + |
206 | 200 |
util.getLocalReplicationServerName()+ |
207 | 201 |
"&docid=" + docid + "&dbaction=" + |
208 |
action+"&ipAddress="+ipAddress);
|
|
202 |
action); |
|
209 | 203 |
//over write the url for delete |
210 | 204 |
if (action != null && action.equals(DELETE)) |
211 | 205 |
{ |
212 | 206 |
comeAndGetIt = new URL("https://" + server + "?action=" + |
213 | 207 |
MetacatReplication.FORCEREPLICATEDELETE + |
214 |
"&docid=" + docid +"&server="+ util.getLocalReplicationServerName()+"&user="+user+"&ipAddress="+ipAddress);
|
|
208 |
"&docid=" + docid +"&server="+ util.getLocalReplicationServerName()); |
|
215 | 209 |
|
216 | 210 |
} |
217 | 211 |
}//if servercode==1 |
... | ... | |
228 | 222 |
"?action=forcereplicate&server=" + |
229 | 223 |
util.getLocalReplicationServerName() + |
230 | 224 |
"&docid=" + docid + "&dbaction=" + |
231 |
action+"&ipAddress="+ipAddress);
|
|
225 |
action); |
|
232 | 226 |
//over write the url for delete |
233 | 227 |
if (action != null && action.equals(DELETE)) |
234 | 228 |
{ |
235 | 229 |
comeAndGetIt = new URL("https://" + server + "?action=" + |
236 | 230 |
MetacatReplication.FORCEREPLICATEDELETE + |
237 |
"&docid=" + docid+"&server="+ util.getLocalReplicationServerName()+"&user="+user+"&ipAddress="+ipAddress);
|
|
231 |
"&docid=" + docid+"&server="+ util.getLocalReplicationServerName()); |
|
238 | 232 |
|
239 | 233 |
} |
240 | 234 |
}//else |
... | ... | |
252 | 246 |
"?action=forcereplicatedatafile&server=" + |
253 | 247 |
util.getLocalReplicationServerName() + |
254 | 248 |
"&docid=" + docid + "&dbaction=" + |
255 |
action+"&ipAddress="+ipAddress);
|
|
249 |
action); |
|
256 | 250 |
//over write the url for delete |
257 | 251 |
if (action != null && action.equals(DELETE)) |
258 | 252 |
{ |
259 | 253 |
comeAndGetIt = new URL("https://" + server + "?action=" + |
260 | 254 |
MetacatReplication.FORCEREPLICATEDELETE + |
261 |
"&docid=" + docid +"&server="+ util.getLocalReplicationServerName()+"&user="+user+"&ipAddress="+ipAddress);
|
|
255 |
"&docid=" + docid +"&server="+ util.getLocalReplicationServerName()); |
|
262 | 256 |
|
263 | 257 |
} |
264 | 258 |
|
... | ... | |
276 | 270 |
"?action=forcereplicatedatafile&server=" + |
277 | 271 |
util.getLocalReplicationServerName() + |
278 | 272 |
"&docid=" + docid + "&dbaction=" + |
279 |
action+"&ipAddress="+ipAddress);
|
|
273 |
action); |
|
280 | 274 |
//over write the url for delete |
281 | 275 |
if (action != null && action.equals(DELETE)) |
282 | 276 |
{ |
283 | 277 |
comeAndGetIt = new URL("https://" + server + "?action=" + |
284 | 278 |
MetacatReplication.FORCEREPLICATEDELETE + |
285 |
"&docid=" + docid+"&server="+ util.getLocalReplicationServerName()+"&user="+user+"&ipAddress="+ipAddress);
|
|
279 |
"&docid=" + docid+"&server="+ util.getLocalReplicationServerName()); |
|
286 | 280 |
|
287 | 281 |
} |
288 | 282 |
|
... | ... | |
303 | 297 |
comeAndGetIt = new URL("https://" + server + |
304 | 298 |
"?action=forcereplicate&server=" + |
305 | 299 |
util.getLocalReplicationServerName()+ |
306 |
"&docid=" + docid+"&ipAddress="+ipAddress);
|
|
300 |
"&docid=" + docid); |
|
307 | 301 |
|
308 | 302 |
}//if homeserver ==1 |
309 | 303 |
else if (replicationServer.getHub()|| |
... | ... | |
316 | 310 |
comeAndGetIt = new URL("https://" + server + |
317 | 311 |
"?action=forcereplicate&server=" + |
318 | 312 |
util.getLocalReplicationServerName() + |
319 |
"&docid=" + docid+"&ipAddress="+ipAddress);
|
|
313 |
"&docid=" + docid); |
|
320 | 314 |
|
321 | 315 |
}//else if |
322 | 316 |
|
... | ... | |
330 | 324 |
comeAndGetIt = new URL("https://" + server + |
331 | 325 |
"?action=forcereplicatedatafile&server=" + |
332 | 326 |
util.getLocalReplicationServerName() + |
333 |
"&docid=" + docid+"&ipAddress="+ipAddress);
|
|
327 |
"&docid=" + docid); |
|
334 | 328 |
}//if |
335 | 329 |
else if (replicationServer.getHub()|| |
336 | 330 |
server.equals(MetacatReplication. |
... | ... | |
342 | 336 |
comeAndGetIt = new URL("https://" + server + |
343 | 337 |
"?action=forcereplicatedatafile&server=" + |
344 | 338 |
util.getLocalReplicationServerName() + |
345 |
"&docid=" + docid+"&ipAddress="+ipAddress);
|
|
339 |
"&docid=" + docid); |
|
346 | 340 |
|
347 | 341 |
}//else |
348 | 342 |
}//else if |
Also available in: Unified diff
Somehow the change went to the head rather than branch. So i rollback the change in head.