ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/core/ConfigurationManagerServant.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/core/ConfigurationManagerServant.java (file contents):
Revision 1.15 by ajm, Sat Mar 3 14:52:56 2001 UTC vs.
Revision 1.17 by tdb, Mon Mar 19 19:12:29 2001 UTC

# Line 1 | Line 1
1   //---PACKAGE DECLARATION---
2 < package uk.ac.ukc.iscream.core;
2 > package uk.org.iscream.core;
3  
4   //---IMPORTS---
5 < import uk.ac.ukc.iscream.util.*;
6 < import uk.ac.ukc.iscream.componentmanager.*;
5 > import uk.org.iscream.util.*;
6 > import uk.org.iscream.componentmanager.*;
7   import java.net.InetAddress;
8   import java.net.UnknownHostException;
9   import java.util.*;
# Line 47 | Line 47 | class ConfigurationManagerServant extends Configuratio
47       */
48      ConfigurationManagerServant() {
49          // assign some local variables
50 <        _configPath = System.getProperty("uk.ac.ukc.iscream.ConfigurationLocation");
51 <        _systemConfigFile = System.getProperty("uk.ac.ukc.iscream.SystemConfigurationFile");
50 >        _configPath = System.getProperty("uk.org.iscream.ConfigurationLocation");
51 >        _systemConfigFile = System.getProperty("uk.org.iscream.SystemConfigurationFile");
52  
53          // load the system config
54          loadSystemConfig();
# Line 92 | Line 92 | class ConfigurationManagerServant extends Configuratio
92          }
93  
94          // search config for group membership
95 <        LinkedList groups = getGroupMembership(source);
95 >        // and obain a list of groups by name
96 >        LinkedList nameGroups = getGroupMembership(source);
97 >        // add the hosts individual config to the start of the list
98 >        nameGroups.addFirst(source);
99          
100 +        // this list will be used to compile the groupings
101 +        LinkedList groups = new LinkedList();
102 +                    
103          // if we are dealing with a Host.<hostname> request, then we also
104          // want to look for ip address details, as configuration entries may relate to it
105          // if we can't resolve it, we don't look.
106 +        LinkedList ipGroups = null;
107          if (source.startsWith("Host.")) {
108              // hostname is after Host.
109              String hostname = source.substring(5);
110              try {
111                  String ip = "Host." + InetAddress.getByName(hostname).getHostAddress();
112 <                LinkedList ipGroups = getGroupMembership(ip);
113 <                groups.addFirst(ip);
112 >                ipGroups = getGroupMembership(ip);
113 >                ipGroups.addFirst(ip);
114 >                // add to our list of groups
115                  groups.addAll(ipGroups);
116              } catch (UnknownHostException e) {
117                  _logger.write(toString(), Logger.ERROR, "could not resolve hostname - " + hostname);
118              }
119          }
120 +        
121 +        // add the rest of the groups to the end        
122 +        groups.addAll(nameGroups);
123  
113        // add the hosts individual config to the start of the list
114        groups.addFirst(source);
115
124          Iterator i = groups.iterator();
125          String fileList = "";
126          while (i.hasNext()) {
# Line 181 | Line 189 | class ConfigurationManagerServant extends Configuratio
189       * Overrides the {@link java.lang.Object#toString() Object.toString()}
190       * method to provide clean logging (every class should have this).
191       *
192 <     * This uses the uk.ac.ukc.iscream.util.FormatName class
192 >     * This uses the uk.org.iscream.util.FormatName class
193       * to format the toString()
194       *
195       * @return the name of this class and its CVS revision

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines