Class LoggingConfigImpl

java.lang.Object
com.sun.common.util.logging.LoggingConfigImpl
All Implemented Interfaces:
LoggingConfig, org.glassfish.hk2.api.PostConstruct

@Service @Contract public class LoggingConfigImpl extends Object implements LoggingConfig, org.glassfish.hk2.api.PostConstruct
Implementation of Logging Commands
Author:
Naman Mehta
  • Constructor Details

    • LoggingConfigImpl

      public LoggingConfigImpl()
  • Method Details

    • postConstruct

      public void postConstruct()
      Specified by:
      postConstruct in interface org.glassfish.hk2.api.PostConstruct
    • setupConfigDir

      public void setupConfigDir(File file, File installDir)
    • setLoggingProperty

      public String setLoggingProperty(String propertyName, String propertyValue) throws IOException
      setLoggingProperty() sets an existing propertyName to be propertyValue if the property doesn't exist the property will be added. The logManager readConfiguration is not called in this method.
      Specified by:
      setLoggingProperty in interface LoggingConfig
      Parameters:
      propertyName - Name of the property to set
      propertyValue - Value to set
      Throws:
      IOException - If an I/O error occurs
    • setLoggingProperty

      public String setLoggingProperty(String propertyName, String propertyValue, String targetConfigName) throws IOException
      setLoggingProperty() sets an existing propertyName to be propertyValue if the property doesn't exist the property will be added. The logManager readConfiguration is not called in this method.
      Specified by:
      setLoggingProperty in interface LoggingConfig
      Parameters:
      propertyName - Name of the property to set
      propertyValue - Value to set
      Throws:
      IOException - If an I/O error occurs
    • updateLoggingProperties

      public Map<String,String> updateLoggingProperties(Map<String,String> properties) throws IOException
      update the properties to new values. properties is a Map of names of properties and their corresponding value. If the property does not exist then it is added to the logging.properties file.
      Specified by:
      updateLoggingProperties in interface LoggingConfig
      Parameters:
      properties - Map of the name and value of property to add or update
      Throws:
      IOException - If an I/O error occurs
    • updateLoggingProperties

      public Map<String,String> updateLoggingProperties(Map<String,String> properties, String targetConfigName) throws IOException
      Description copied from interface: LoggingConfig
      Update the properties to new values for given target. properties is a Map of names of properties and their coresponding value. If the property does not exist then it is added to the logging.properties file.
      Specified by:
      updateLoggingProperties in interface LoggingConfig
      Parameters:
      properties - Map of the name and value of property to add or update
      Throws:
      IOException
    • getLoggingProperties

      public Map<String,String> getLoggingProperties(String targetConfigName) throws IOException
      Return a Map of all the properties and corresponding values in the logging.properties file for given target.
      Specified by:
      getLoggingProperties in interface LoggingConfig
      Parameters:
      targetConfigName - Target config name
      Returns:
      the properties and corresponding values in the logging.properties file for given target server.
      Throws:
      IOException - If an I/O error occurs
    • getLoggingProperties

      public Map<String,String> getLoggingProperties() throws IOException
      Return a Map of all the properties and corresponding values in the logging.properties file.
      Specified by:
      getLoggingProperties in interface LoggingConfig
      Returns:
      the properties and corresponding values in the logging.properties file.
      Throws:
      IOException - If an I/O error occurs
    • deleteLoggingProperties

      public Map<String,String> deleteLoggingProperties(Collection<String> properties) throws IOException
      Description copied from interface: LoggingConfig
      Delete the properties from logging.properties file.
      Specified by:
      deleteLoggingProperties in interface LoggingConfig
      Throws:
      IOException
    • deleteLoggingProperties

      public Map<String,String> deleteLoggingProperties(Collection<String> properties, String target) throws IOException
      Description copied from interface: LoggingConfig
      Delete the properties from logging.properties file.
      Specified by:
      deleteLoggingProperties in interface LoggingConfig
      Throws:
      IOException
    • createZipFile

      public String createZipFile(String sourceDir) throws IOException
      Creating zip file for given log files
      Specified by:
      createZipFile in interface LoggingConfig
      Parameters:
      sourceDir - Source directory from which needs to create zip
      Throws:
      IOException - if an I/O error occurs
    • createZipFile

      public String createZipFile(String sourceDir, String zipFileName) throws IOException
      Creating zip file for given log files
      Parameters:
      sourceDir - Source directory from which needs to create zip
      zipFileName - zip file name which need to be created
      Throws:
      IOException - If an I/O error occurs
    • getLoggingFileDetails

      public String getLoggingFileDetails() throws IOException
      Return a logging file details in the logging.properties file.
      Throws:
      IOException - If an I/O error occurs
    • getLoggingFileDetails

      public String getLoggingFileDetails(String targetConfigName) throws IOException
      Returns:
      a logging file details in the logging.properties file for given target.
      Throws:
      IOException - If an I/O error occurs
    • getDefaultLoggingProperties

      public Map<String,String> getDefaultLoggingProperties() throws IOException
      Returns:
      a Map of all the properties and corresponding values from the logging.properties file from template.
      Throws:
      IOException - If an I/O error occurs