Class Parameters

java.lang.Object
net.bull.javamelody.internal.common.Parameters

public final class Parameters extends Object
Classe d'accès aux paramètres du monitoring.
Author:
Emeric Vernat
  • Field Details

    • PARAMETER_SYSTEM_PREFIX

      public static final String PARAMETER_SYSTEM_PREFIX
      See Also:
    • TEMPORARY_DIRECTORY

      public static final File TEMPORARY_DIRECTORY
    • JAVA_VERSION

      public static final String JAVA_VERSION
    • JAVAMELODY_VERSION

      public static final String JAVAMELODY_VERSION
  • Method Details

    • initialize

      public static void initialize(FilterConfig config)
    • initialize

      public static void initialize(ServletContext context)
    • initJdbcDriverParameters

      public static void initJdbcDriverParameters(String connectUrl, Properties connectInfo)
    • getServletContext

      public static ServletContext getServletContext()
      Returns:
      Contexte de servlet de la webapp, soit celle monitorée ou soit celle de collecte.
    • getLastConnectUrl

      public static String getLastConnectUrl()
    • getLastConnectInfo

      public static Properties getLastConnectInfo()
    • getCollectorUrlsByApplications

      public static Map<String,List<URL>> getCollectorUrlsByApplications() throws IOException
      Returns:
      Nom et urls des applications telles que paramétrées dans un serveur de collecte.
      Throws:
      IOException - e
    • getApplicationsByAggregationApplication

      public static Map<String,List<String>> getApplicationsByAggregationApplication() throws IOException
      Throws:
      IOException
    • addCollectorApplication

      public static void addCollectorApplication(String application, List<URL> urls) throws IOException
      Throws:
      IOException
    • addCollectorAggregationApplication

      public static void addCollectorAggregationApplication(String aggregationApplication, List<String> aggregatedApplications) throws IOException
      Throws:
      IOException
    • removeCollectorApplication

      public static void removeCollectorApplication(String application) throws IOException
      Throws:
      IOException
    • getCollectorApplicationsFile

      public static File getCollectorApplicationsFile()
    • parseUrls

      public static List<URL> parseUrls(String value) throws MalformedURLException
      Throws:
      MalformedURLException
    • getMonitoringPath

      public static String getMonitoringPath()
    • getHostName

      public static String getHostName()
      Returns:
      nom réseau de la machine
    • getHostAddress

      public static String getHostAddress()
      Returns:
      adresse ip de la machine
    • getResourcePath

      public static String getResourcePath(String fileName)
      Parameters:
      fileName - Nom du fichier de resource.
      Returns:
      Chemin complet d'une resource.
    • getResolutionSeconds

      public static int getResolutionSeconds()
      Returns:
      Résolution en secondes des courbes et période d'appels par le serveur de collecte le cas échéant.
    • getStorageDirectory

      public static File getStorageDirectory(String application)
      Parameters:
      application - Nom de l'application
      Returns:
      Répertoire de stockage des compteurs et des données pour les courbes.
    • isNoDatabase

      public static boolean isNoDatabase()
      Booléen selon que le paramètre no-database vaut true.
      Returns:
      boolean
    • isSystemActionsEnabled

      public static boolean isSystemActionsEnabled()
      Booléen selon que le paramètre system-actions-enabled vaut true.
      Returns:
      boolean
    • isPdfEnabled

      public static boolean isPdfEnabled()
    • isCounterHidden

      public static boolean isCounterHidden(String counterName)
      Retourne false si le paramètre displayed-counters n'a pas été défini ou si il contient le compteur dont le nom est paramètre, et retourne true sinon (c'est-à-dire si le paramètre displayed-counters est défini et si il ne contient pas le compteur dont le nom est paramètre).
      Parameters:
      counterName - Nom du compteur
      Returns:
      boolean
    • getCurrentApplication

      public static String getCurrentApplication()
      Returns:
      Nom de l'application courante et nom du sous-répertoire de stockage dans une application monitorée.
    • getContextPath

      public static String getContextPath(ServletContext context)
    • getParameterValue

      public static String getParameterValue(Parameter parameter)
      Recherche la valeur d'un paramètre qui peut être défini par ordre de priorité croissant :
      - dans les paramètres d'initialisation du filtre (fichier web.xml dans la webapp)
      - dans les paramètres du contexte de la webapp avec le préfixe "javamelody." (fichier xml de contexte dans Tomcat)
      - dans les variables d'environnement du système d'exploitation avec le préfixe "javamelody."
      - dans les propriétés systèmes avec le préfixe "javamelody." (commande de lancement java).
      Parameters:
      parameter - Enum du paramètre
      Returns:
      valeur du paramètre ou null si pas de paramètre défini
    • getParameterValueByName

      public static String getParameterValueByName(String parameterName)