Package org.wso2.carbon.base
Class ServerConfiguration
java.lang.Object
org.wso2.carbon.base.ServerConfiguration
- All Implemented Interfaces:
ServerConfigurationService
This class stores the configuration of the Carbon Server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant to be used to disable admin services.static final StringConstant to be used for properties storing the axis2 repository location.static final StringConstant to be used for properties storing the port of the command listener.static final StringConstant to be used for properties storing the http port of the servlet transport.static final StringConstant to be used for properties storing whether to truncate log timestamps to microseconds. -
Method Summary
Modifier and TypeMethodDescriptionvoidforceInit(InputStream xmlInputStream) Method to forcibly initialize the server configuration.voidMethod to forcibly initialize the server configuration.voidMethod to forcibly initialize the server configuration.Method to retrieve the Configuration as an XML Document.getFirstProperty(String key) There can be multiple objects with the same key.static ServerConfigurationMethod to retrieve an instance of the server configuration.String[]getProperties(String key) There can be multiple object corresponding to the same object.protected StringgetProtectedValue(String key) voidinit(InputStream xmlInputStream) This initializes the server configuration.voidThis initializes the server configuration.protected booleanisProtectedToken(String key) voidoverrideConfigurationProperty(String key, String value) overrides the configuration property instead of adding the value to the listvoidsetConfigurationProperty(String key, String value) Method to a given key, value pair into the configuration.
-
Field Details
-
AXIS2_CONFIG_REPO_LOCATION
Constant to be used for properties storing the axis2 repository location.- See Also:
-
AXIS2_CONFIG_DISABLE_ADMIN_SERVICES
Constant to be used to disable admin services.- See Also:
-
LOG_MGT_TRUNCATE_TO_MICROSECONDS
Constant to be used for properties storing whether to truncate log timestamps to microseconds.- See Also:
-
HTTP_PORT
Constant to be used for properties storing the http port of the servlet transport.- See Also:
-
COMMAND_LISTENER_PORT
Constant to be used for properties storing the port of the command listener.- See Also:
-
-
Method Details
-
getInstance
Method to retrieve an instance of the server configuration.- Returns:
- instance of the server configuration
-
init
This initializes the server configuration. This method should only be called once, for successive calls, it will be checked.- Parameters:
xmlInputStream- the server configuration file stream.- Throws:
ServerConfigurationException- if the operation failed.
-
init
This initializes the server configuration. This method should only be called once, for successive calls, it will be checked.- Parameters:
configurationXMLLocation- the location of the server configuration file (carbon.xml).- Throws:
ServerConfigurationException- if the operation failed.
-
forceInit
Method to forcibly initialize the server configuration. If there is any configuration loaded, it will not be preserved.- Parameters:
xmlInputStream- the server configuration file stream.- Throws:
ServerConfigurationException- if the operation failed.
-
forceInit
Method to forcibly initialize the server configuration. If there is any configuration loaded, it will not be preserved.- Parameters:
configurationXMLLocation- the location of the server configuration file (carbon.xml).- Throws:
ServerConfigurationException- if the operation failed.
-
forceInit
public void forceInit(String configurationXMLLocation, boolean isLoadedConfigurationPreserved) throws ServerConfigurationException Method to forcibly initialize the server configuration.- Parameters:
configurationXMLLocation- the location of the server configuration file (carbon.xml).isLoadedConfigurationPreserved- whether the currently loaded configuration is preserved.- Throws:
ServerConfigurationException- if the operation failed.
-
setConfigurationProperty
Method to a given key, value pair into the configuration.- Specified by:
setConfigurationPropertyin interfaceServerConfigurationService- Parameters:
key- the key to addvalue- the value
-
overrideConfigurationProperty
overrides the configuration property instead of adding the value to the list- Specified by:
overrideConfigurationPropertyin interfaceServerConfigurationService- Parameters:
key-value-
-
getFirstProperty
There can be multiple objects with the same key. This will return the first String from them- Specified by:
getFirstPropertyin interfaceServerConfigurationService- Parameters:
key- the search key- Returns:
- value corresponding to the given key
-
getProperties
There can be multiple object corresponding to the same object.- Specified by:
getPropertiesin interfaceServerConfigurationService- Parameters:
key- the search key- Returns:
- the properties corresponding to the
key
-
getDocumentElement
Method to retrieve the Configuration as an XML Document.- Specified by:
getDocumentElementin interfaceServerConfigurationService- Returns:
- DOM element containing server configuration.
-
isProtectedToken
-
getProtectedValue
-
getDeniedAdminServices
- Specified by:
getDeniedAdminServicesin interfaceServerConfigurationService
-