public class ServerConfiguration extends Object implements ServerConfigurationAccessor
Provides the configuration parameters for the network file servers (SMB/CIFS, FTP and NFS).
Constructor and Description |
---|
ServerConfiguration(String name)
Construct a server configuration object
|
Modifier and Type | Method and Description |
---|---|
void |
addConfigSection(ConfigSection config)
Add a configuration section
|
void |
addListener(ConfigurationListener listener)
Add a configuration change listener
|
void |
addServer(NetworkServer srv)
Add a server to the list of active servers
|
void |
closeConfiguration()
Close the configuration
|
NetworkServer |
findServer(String proto)
Find an active server using the protocol name
|
protected int |
fireConfigurationChange(int id,
Object newVal)
Notify all registered configuration change listeners of a configuration change
|
ConfigSection |
getConfigSection(String name)
Return the required configuration section
|
Platform.Type |
getPlatformType()
Return the platform type
|
String |
getPlatformTypeString()
Return the platform type as a string
|
NetworkServer |
getServer(int idx)
Return the server at the specified index
|
String |
getServerName()
Return the server name
|
boolean |
hasConfigSection(String name)
Check if the specified configuration section name is available
|
boolean |
hasConfigurationListeners()
Check if there are any configuration change listeners
|
boolean |
isServerRunning(String proto)
Check if the specified protocol server exists and is running
|
boolean |
isUpdated()
Determine if the server configuration has been updated since loaded
|
void |
loadConfiguration(String location)
Load the configuration from the specified location.
|
int |
numberOfServers()
Return the number of active servers
|
void |
removeAllConfigSections()
Remove all configuration sections
|
ConfigSection |
removeConfigSection(String name)
Remove a configuration section
|
void |
removeListener(ConfigurationListener listener)
Remove a configuration change listener
|
NetworkServer |
removeServer(String proto)
Remove an active server
|
void |
saveConfiguration(String location)
Save the configuration to the specified location.
|
void |
setServerName(String name)
Set the server name
|
protected void |
setUpdated(boolean upd)
Set or clear the updated configuration flag
|
public ServerConfiguration(String name)
name
- Stringpublic final void addConfigSection(ConfigSection config)
config
- ConfigSectionpublic final boolean hasConfigSection(String name)
name
- Stringpublic final ConfigSection getConfigSection(String name)
ServerConfigurationAccessor
getConfigSection
in interface ServerConfigurationAccessor
name
- Stringpublic final ConfigSection removeConfigSection(String name)
name
- Stringpublic final void removeAllConfigSections()
public final String getServerName()
ServerConfigurationAccessor
getServerName
in interface ServerConfigurationAccessor
public final void addServer(NetworkServer srv)
srv
- NetworkServerpublic final NetworkServer findServer(String proto)
proto
- Stringpublic final NetworkServer removeServer(String proto)
proto
- Stringpublic final int numberOfServers()
public final boolean isServerRunning(String proto)
ServerConfigurationAccessor
isServerRunning
in interface ServerConfigurationAccessor
proto
- Stringpublic final Platform.Type getPlatformType()
public final String getPlatformTypeString()
public final NetworkServer getServer(int idx)
idx
- intpublic final boolean isUpdated()
protected final void setUpdated(boolean upd)
upd
- booleanpublic final void setServerName(String name)
name
- Stringpublic final void addListener(ConfigurationListener listener)
listener
- ConfigurationListenerpublic final void removeListener(ConfigurationListener listener)
listener
- ConfigurationListenerpublic final boolean hasConfigurationListeners()
protected final int fireConfigurationChange(int id, Object newVal) throws InvalidConfigurationException
id
- intnewVal
- ObjectInvalidConfigurationException
public void loadConfiguration(String location) throws IOException, InvalidConfigurationException
location
- StringIOException
InvalidConfigurationException
public void saveConfiguration(String location) throws IOException
location
- StringIOException
public void closeConfiguration()
Copyright © 2005–2017 Alfresco Software. All rights reserved.