Class ServerConfiguration

    • Field Detail

      • AXIS2_CONFIG_REPO_LOCATION

        public static final String AXIS2_CONFIG_REPO_LOCATION
        Constant to be used for properties storing the axis2 repository location.
        See Also:
        Constant Field Values
      • HTTP_PORT

        public static final String HTTP_PORT
        Constant to be used for properties storing the http port of the servlet transport.
        See Also:
        Constant Field Values
      • COMMAND_LISTENER_PORT

        public static final String COMMAND_LISTENER_PORT
        Constant to be used for properties storing the port of the command listener.
        See Also:
        Constant Field Values
    • Method Detail

      • getInstance

        public static ServerConfiguration getInstance()
        Method to retrieve an instance of the server configuration.
        Returns:
        instance of the server configuration
      • init

        public void init​(InputStream xmlInputStream)
                  throws ServerConfigurationException
        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

        public void init​(String configurationXMLLocation)
                  throws ServerConfigurationException
        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

        public void forceInit​(InputStream xmlInputStream)
                       throws ServerConfigurationException
        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

        public void forceInit​(String configurationXMLLocation)
                       throws ServerConfigurationException
        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.
      • getFirstProperty

        public String getFirstProperty​(String key)
        There can be multiple objects with the same key. This will return the first String from them
        Specified by:
        getFirstProperty in interface ServerConfigurationService
        Parameters:
        key - the search key
        Returns:
        value corresponding to the given key
      • getProperties

        public String[] getProperties​(String key)
        There can be multiple object corresponding to the same object.
        Specified by:
        getProperties in interface ServerConfigurationService
        Parameters:
        key - the search key
        Returns:
        the properties corresponding to the key
      • isProtectedToken

        protected boolean isProtectedToken​(String key)
      • getProtectedValue

        protected String getProtectedValue​(String key)