1 | package org.greenstone.gsdl3.comms;
|
---|
2 |
|
---|
3 | import org.greenstone.gsdl3.core.ModuleInterface;
|
---|
4 | import org.greenstone.gsdl3.util.*;
|
---|
5 |
|
---|
6 | //XML packages
|
---|
7 | import org.w3c.dom.Node;
|
---|
8 |
|
---|
9 | /** Communicator - base class for Modules that talk via some protocol to other modules
|
---|
10 | *
|
---|
11 | */
|
---|
12 | abstract public class Communicator
|
---|
13 | implements ModuleInterface {
|
---|
14 |
|
---|
15 | /** home directory of local site */
|
---|
16 | protected String site_home_=null;
|
---|
17 | /** name of local site */
|
---|
18 | protected String local_site_name_ = null;
|
---|
19 | /** name of site to connect to */
|
---|
20 | protected String connection_name_=null;
|
---|
21 | /** address of site to connect to */
|
---|
22 | protected String connection_address_=null;
|
---|
23 | /** converter for String to DOM and vice versa */
|
---|
24 | protected XMLConverter converter_= null;
|
---|
25 |
|
---|
26 | public Communicator() {
|
---|
27 | converter_ = new XMLConverter();
|
---|
28 | }
|
---|
29 | public void setSiteHome(String home) {
|
---|
30 | site_home_ = home;
|
---|
31 | }
|
---|
32 | public void setSiteName(String name) {
|
---|
33 | local_site_name_ = name;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public void setConnectionName(String name) {
|
---|
37 | connection_name_=name;
|
---|
38 | }
|
---|
39 |
|
---|
40 | // format of address depends on connection type
|
---|
41 | public void setConnectionAddress(String address){
|
---|
42 | connection_address_ = address;
|
---|
43 | }
|
---|
44 |
|
---|
45 | abstract public boolean configure();
|
---|
46 |
|
---|
47 | abstract public String process(String xml_in);
|
---|
48 |
|
---|
49 | abstract public Node process(Node xml_in);
|
---|
50 | }
|
---|