1 6 7 package SOFA.SOFAnet.Search.RMI; 8 9 import java.util.*; 10 import java.io.Serializable ; 11 import SOFA.SOFAnet.Repository.NodeNameFilter; 12 import SOFA.SOFAnet.Repository.ShareGroups; 13 14 18 public class RMISearchConfiguration implements Cloneable , Serializable 19 { 20 private NodeNameFilter nodeFilter; 21 private List connections; 22 23 public static class Connection implements Cloneable , Serializable 24 { 25 private String nodeName; 26 private ShareGroups shareGroups; 27 28 public Connection(String nodeName, ShareGroups shareGroups) 29 { 30 this.nodeName = nodeName; 31 this.shareGroups = shareGroups; 32 } 33 34 public Object clone() 35 { 36 try 37 { 38 return super.clone(); 39 } 40 catch (CloneNotSupportedException e) 41 { 42 throw new InternalError (); 43 } 44 } 45 46 public String toString() 47 { 48 return nodeName; 49 } 50 51 public String getNodeName() 52 { 53 return nodeName; 54 } 55 56 public ShareGroups getShareGroups() 57 { 58 return shareGroups; 59 } 60 61 public void setNodeName(String nodeName) 62 { 63 this.nodeName = nodeName; 64 } 65 66 public void setShareGroups(ShareGroups shareGroups) 67 { 68 this.shareGroups = shareGroups; 69 } 70 } 71 72 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 clone() 85 { 86 RMISearchConfiguration clone = null; 87 try 88 { 89 clone = (RMISearchConfiguration)super.clone(); 90 } 91 catch (CloneNotSupportedException e) 92 { 93 throw new InternalError (); 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 |