Project

General

Profile

« Previous | Next » 

Revision 2579

Added by Jing Tao about 19 years ago

Use a util class to get local replication url.

View differences:

src/edu/ucsb/nceas/metacat/ForceReplicationHandler.java
186 186
                                                                    + server);
187 187
                comeAndGetIt = new URL("https://" + server +
188 188
                                 "?action=forcereplicate&server=" +
189
                                 util.getOption("server") +
190
                                 util.getOption("replicationpath") +
189
                                  util.getLocalReplicationServerName()+
191 190
                                 "&docid=" + docid + "&dbaction=" +
192 191
                                  action);
193 192
                //over write the url for delete
......
195 194
                {
196 195
                  comeAndGetIt = new URL("https://" + server + "?action=" +
197 196
                                   MetacatReplication.FORCEREPLICATEDELETE +
198
                                  "&docid=" + docid +"&server="+ util.getOption("server")+
199
                                   util.getOption("replicationpath"));
197
                                  "&docid=" + docid +"&server="+ util.getLocalReplicationServerName());
200 198

  
201 199
                }
202 200
              }//if servercode==1
......
211 209
                                                                    + server);
212 210
                comeAndGetIt = new URL("https://" + server +
213 211
                                 "?action=forcereplicate&server=" +
214
                                 util.getOption("server") +
215
                                 util.getOption("replicationpath") +
212
                                 util.getLocalReplicationServerName() +
216 213
                                 "&docid=" + docid + "&dbaction=" +
217 214
                                  action);
218 215
                //over write the url for delete
......
220 217
               {
221 218
                  comeAndGetIt = new URL("https://" + server + "?action=" +
222 219
                            MetacatReplication.FORCEREPLICATEDELETE +
223
                           "&docid=" + docid+"&server="+ util.getOption("server")+
224
                           util.getOption("replicationpath"));
220
                           "&docid=" + docid+"&server="+ util.getLocalReplicationServerName());
225 221

  
226 222
                }
227 223
              }//else
......
237 233
                                                                      + server);
238 234
                comeAndGetIt = new URL("https://" + server +
239 235
                                 "?action=forcereplicatedatafile&server=" +
240
                                 util.getOption("server") +
241
                                 util.getOption("replicationpath") +
236
                                 util.getLocalReplicationServerName() +
242 237
                                 "&docid=" + docid + "&dbaction=" +
243 238
                                  action);
244 239
                //over write the url for delete
......
246 241
               {
247 242
                 comeAndGetIt = new URL("https://" + server + "?action=" +
248 243
                                 MetacatReplication.FORCEREPLICATEDELETE +
249
                                 "&docid=" + docid +"&server="+ util.getOption("server")+
250
                                util.getOption("replicationpath") );
244
                                 "&docid=" + docid +"&server="+ util.getLocalReplicationServerName());
251 245

  
252 246
               }
253 247

  
......
263 257
                                                                      + server);
264 258
                comeAndGetIt = new URL("https://" + server +
265 259
                                 "?action=forcereplicatedatafile&server=" +
266
                                 util.getOption("server") +
267
                                 util.getOption("replicationpath") +
260
                                 util.getLocalReplicationServerName() +
268 261
                                 "&docid=" + docid + "&dbaction=" +
269 262
                                  action);
270 263
                //over write the url for delete
......
272 265
               {
273 266
                  comeAndGetIt = new URL("https://" + server + "?action=" +
274 267
                         MetacatReplication.FORCEREPLICATEDELETE +
275
                        "&docid=" + docid+"&server="+ util.getOption("server")+
276
                       util.getOption("replicationpath") );
268
                        "&docid=" + docid+"&server="+ util.getLocalReplicationServerName());
277 269

  
278 270
               }
279 271

  
......
293 285
              {
294 286
                comeAndGetIt = new URL("https://" + server +
295 287
                                 "?action=forcereplicate&server=" +
296
                                 util.getOption("server") +
297
                                 util.getOption("replicationpath") +
288
                                 util.getLocalReplicationServerName()+
298 289
                                 "&docid=" + docid);
299 290

  
300 291
              }//if homeserver ==1
......
307 298
                // If the server is homeserver of the docid, replication it too
308 299
                comeAndGetIt = new URL("https://" + server +
309 300
                                 "?action=forcereplicate&server=" +
310
                                 util.getOption("server") +
311
                                 util.getOption("replicationpath") +
301
                                 util.getLocalReplicationServerName() +
312 302
                                 "&docid=" + docid);
313 303

  
314 304
              }//else if
......
322 312
              {
323 313
                comeAndGetIt = new URL("https://" + server +
324 314
                                 "?action=forcereplicatedatafile&server=" +
325
                                 util.getOption("server") +
326
                                 util.getOption("replicationpath") +
315
                                 util.getLocalReplicationServerName() +
327 316
                                 "&docid=" + docid);
328 317
              }//if
329 318
              else if (replicationServer.getHub()||
......
335 324
                // If the server is homeserver of the docid, replication it too
336 325
                comeAndGetIt = new URL("https://" + server +
337 326
                                 "?action=forcereplicatedatafile&server=" +
338
                                 util.getOption("server") +
339
                                 util.getOption("replicationpath") +
327
                                 util.getLocalReplicationServerName() +
340 328
                                 "&docid=" + docid);
341 329

  
342 330
              }//else

Also available in: Unified diff