KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnet > Search > RMI > RMISearchConfiguration


1 /*
2  * RMISearchConfiguration.java
3  *
4  * Created on 21. květen 2004, 13:33
5  */

6
7 package SOFA.SOFAnet.Search.RMI;
8
9 import java.util.*;
10 import java.io.Serializable JavaDoc;
11 import SOFA.SOFAnet.Repository.NodeNameFilter;
12 import SOFA.SOFAnet.Repository.ShareGroups;
13
14 /**
15  *
16  * @author Ladislav Sobr
17  */

18 public class RMISearchConfiguration implements Cloneable JavaDoc, Serializable JavaDoc
19 {
20   private NodeNameFilter nodeFilter;
21   private List connections;
22   
23   public static class Connection implements Cloneable JavaDoc, Serializable JavaDoc
24   {
25     private String JavaDoc nodeName;
26     private ShareGroups shareGroups;
27     
28     public Connection(String JavaDoc nodeName, ShareGroups shareGroups)
29     {
30       this.nodeName = nodeName;
31       this.shareGroups = shareGroups;
32     }
33
34     public Object JavaDoc clone()
35     {
36       try
37       {
38         return super.clone();
39       }
40       catch (CloneNotSupportedException JavaDoc e)
41       {
42         throw new InternalError JavaDoc();
43       }
44     }
45     
46     public String JavaDoc toString()
47     {
48       return nodeName;
49     }
50     
51     public String JavaDoc getNodeName()
52     {
53       return nodeName;
54     }
55     
56     public ShareGroups getShareGroups()
57     {
58       return shareGroups;
59     }
60     
61     public void setNodeName(String JavaDoc nodeName)
62     {
63       this.nodeName = nodeName;
64     }
65     
66     public void setShareGroups(ShareGroups shareGroups)
67     {
68       this.shareGroups = shareGroups;
69     }
70   }
71   
72   /** Creates a new instance of RMISearchConfiguration */
73   public RMISearchConfiguration()
74   {
75     reset();
76   }
77
78   public void reset()
79   {
80     nodeFilter = null;
81     connections = Collections.synchronizedList(new LinkedList());
82   }
83   
84   public Object JavaDoc clone()
85   {
86     RMISearchConfiguration clone = null;
87     try
88     {
89       clone = (RMISearchConfiguration)super.clone();
90     }
91     catch (CloneNotSupportedException JavaDoc e)
92     {
93       throw new InternalError JavaDoc();
94     }
95     clone.connections = Collections.synchronizedList(new LinkedList());
96     clone.connections.addAll(connections);
97     return clone;
98   }
99   
100   public NodeNameFilter getNodeFilter()
101   {
102     return nodeFilter;
103   }
104   
105   public List getConnections()
106   {
107     return connections;
108   }
109   
110   public void setNodeFilter(NodeNameFilter nodeFilter)
111   {
112     this.nodeFilter = nodeFilter;
113   }
114   
115   public void setConnections(List connections)
116   {
117     this.connections = connections;
118   }
119 }
120
Popular Tags