Class CIM_ML

java.lang.Object
com.ferrumx.formatter.cim.CIM_ML

public class CIM_ML extends Object
This class queries all the WMI Classes based on the attributes passed to it's one of the four methods called by the methods in other packages.

Supports Multi-line parsing of output from the power-shell Is recommended for extracting multiple properties at once For single property extraction, see CIM_SL

Author:
Egg-03
  • Method Summary

    Modifier and Type
    Method
    Description
    static Map<String,String>
    getPropertiesAndTheirValues(String win32Class, String property)
    Internally runs the command "Get-CimInstance -ClassName win32Class | Select-Object property | Format-List where the parameters are provided by the calling methods
    static Map<String,String>
    getPropertiesAndTheirValuesWhere(String win32Class, String determinantProperty, String determinantValue, String extractProperty)
    Internally runs the command "Get-CimInstance -ClassName win32Class | Where-Object {$_.determinantProperty -eq determinantValue} | Select-Object extractProperty | Format-List where the parameters are provided by the calling methods
    static List<String>
    getPropertyValue(String win32Class, String property)
    Internally runs the command "Get-CimInstance -ClassName win32Class | Select-Object property | Format-List where the parameters are provided by the calling methods
    static List<String>
    getPropertyValueWhere(String win32Class, String determinantProperty, String determinantValue, String extractProperty)
    Internally runs the command "Get-CimInstance -ClassName win32Class | Where-Object {$_.determinantProperty -eq determinantValue} | Select-Object extractProperty | Format-List where the parameters are provided by the calling methods

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getPropertyValue

      public static List<String> getPropertyValue(String win32Class, String property) throws IOException, IndexOutOfBoundsException, ShellException, InterruptedException
      Internally runs the command "Get-CimInstance -ClassName win32Class | Select-Object property | Format-List where the parameters are provided by the calling methods
      Parameters:
      win32Class - the class name passed to by the method calling it
      property - name passed to by the method calling it
      Returns:
      a list of property values requested by the method calling it. The values returned belong to the property defined by Property
      Throws:
      IOException - in case of general I/O errors
      IndexOutOfBoundsException - in case of text parsing issues from power-shell
      ShellException - if any internal command used in the power-shell throws errors
      InterruptedException - if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();
    • getPropertyValueWhere

      public static List<String> getPropertyValueWhere(String win32Class, String determinantProperty, String determinantValue, String extractProperty) throws IOException, IndexOutOfBoundsException, ShellException, InterruptedException
      Internally runs the command "Get-CimInstance -ClassName win32Class | Where-Object {$_.determinantProperty -eq determinantValue} | Select-Object extractProperty | Format-List where the parameters are provided by the calling methods
      Parameters:
      win32Class - the class name passed to by the calling method
      determinantProperty - a filtering parameter, passed to by the calling method
      determinantValue - the value of the filtering parameter, also passed to by the calling method
      extractProperty - the property name whose value is to be extracted, provided by the calling method.
      Returns:
      a list of values requested by the method calling it. The values returned are the values of the property extractProperty
      Throws:
      IOException - in case of general I/O errors
      IndexOutOfBoundsException - in case of text parsing issues from power-shell
      ShellException - if any internal command used in the power-shell throws errors
      InterruptedException - if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();
    • getPropertiesAndTheirValues

      public static Map<String,String> getPropertiesAndTheirValues(String win32Class, String property) throws IOException, IndexOutOfBoundsException, ShellException, InterruptedException
      Internally runs the command "Get-CimInstance -ClassName win32Class | Select-Object property | Format-List where the parameters are provided by the calling methods
      Parameters:
      win32Class - the class name passed to by the calling method
      property - a list of properties requested for a particular class. The properties requested by the calling methods can be found in their respective class descriptions
      Returns:
      a Map of the attribute values requested by the calling method
      Throws:
      IOException - in case of general I/O errors
      IndexOutOfBoundsException - in case of text parsing issues from power-shell
      ShellException - if any internal command used in the power-shell throws errors
      InterruptedException - if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();
    • getPropertiesAndTheirValuesWhere

      public static Map<String,String> getPropertiesAndTheirValuesWhere(String win32Class, String determinantProperty, String determinantValue, String extractProperty) throws IOException, IndexOutOfBoundsException, ShellException, InterruptedException
      Internally runs the command "Get-CimInstance -ClassName win32Class | Where-Object {$_.determinantProperty -eq determinantValue} | Select-Object extractProperty | Format-List where the parameters are provided by the calling methods
      Parameters:
      win32Class - win32Class the class-name passed to by the calling method
      determinantProperty - a filtering parameter, passed to by the calling method
      determinantValue - the value of the filtering parameter, also passed to by the calling method
      extractProperty - a list of properties requested for a particular class. The properties requested by the calling methods can be found in their respective class descriptions
      Returns:
      a Map of the attribute values requested by the calling method
      Throws:
      IOException - in case of general I/O errors
      IndexOutOfBoundsException - in case of text parsing issues from power-shell
      ShellException - if any internal command used in the power-shell throws errors
      InterruptedException - if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();