com.eurotech.framework.core.system
Class SystemServiceImpl

java.lang.Object
  extended by com.eurotech.framework.core.system.SystemServiceImpl
All Implemented Interfaces:
SystemService

public class SystemServiceImpl
extends Object
implements SystemService


Field Summary
 
Fields inherited from interface com.eurotech.framework.system.SystemService
CONFIG_CONSOLE_DEVICE_MANAGE_SERVICE_IGNORE, ESF_CONFIG, ESF_PROPS_FILE, KEY_BIOS_VERSION, KEY_DEVICE_NAME, KEY_ESF_DATA_DIR, KEY_ESF_HAVE_NET_ADMIN, KEY_ESF_HAVE_WEB_INTER, KEY_ESF_HOME_DIR, KEY_ESF_NAME, KEY_ESF_PLUGINS_DIR, KEY_ESF_SNAPSHOTS_COUNT, KEY_ESF_SNAPSHOTS_DIR, KEY_ESF_STYLE_DIR, KEY_ESF_TMP_DIR, KEY_ESF_VERSION, KEY_FILE_SEP, KEY_FIRMWARE_VERSION, KEY_JAVA_HOME, KEY_JAVA_VENDOR, KEY_JAVA_VERSION, KEY_JAVA_VM_INFO, KEY_JAVA_VM_NAME, KEY_JAVA_VM_VERSION, KEY_MODEL_ID, KEY_MODEL_NAME, KEY_OS_ARCH, KEY_OS_DISTRO, KEY_OS_DISTRO_VER, KEY_OS_NAME, KEY_OS_VER, KEY_OSGI_FW_NAME, KEY_OSGI_FW_VERSION, KEY_PART_NUMBER, KEY_PLATFORM, KEY_PRIMARY_NET_IFACE, KEY_SERIAL_NUM, OS_CLOUDBEES, OS_LINUX, OS_MAC_OSX, UNKNOWN, UNSUPPORTED
 
Constructor Summary
SystemServiceImpl()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext)
           
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
           
 String getBiosVersion()
          Gets the BIOS version of the device.
 org.osgi.framework.Bundle[] getBundles()
          Returns the OSGi bundles currently installed
 List<String> getDeviceManagementServiceIgnore()
          Returns a list of services that should be ignored by the Everyware Cloud Console
 String getDeviceName()
          Returns a friendly name assigned to this device.
 String getEsfDataDirectory()
          Gets the location where all ESF persistent data should be stored.
 String getEsfHome()
          Gets the location where the ESF root directory is stored in the filesystem.
 String getEsfName()
           
 String getEsfPluginsDirectory()
           
 int getEsfSnapshotsCount()
          Returns the maximum number of snapshots to be retained in the file system.
 String getEsfSnapshotsDirectory()
          Gets the location where all Configuration Snapshots will be stored.
 String getEsfStyleDirectory()
          Gets the location where all custom style information is stored.
 String getEsfTemporaryConfigDirectory()
          Gets the location where all volatile ESF specific configuration and status information should be stored.
 String getEsfVersion()
          Gets the product version for this unit.
 String getEsfWebEnabled()
           
 String getFileSeparator()
          Gets the system file separator used by the filesystem.
 String getFirmwareVersion()
          Gets the firmware version.
 long getFreeMemory()
          Returns the free memory for Java instance.
 String getJavaHome()
          Gets the location where the JVM is stored in the filesystem.
 String getJavaVendor()
          Gets the vendor of the Java VM that is currently being used.
 String getJavaVersion()
          Gets the Java version that is currently being used.
 String getJavaVmInfo()
          Gets the Java Virtual Machine information that is currently being used.
 String getJavaVmName()
          Gets the Java Virtual Machine name that is currently being used.
 String getJavaVmVersion()
          Gets the Java Virtual Machine version that is currently being used.
 String getModelId()
          Gets the model identification of the device.
 String getModelName()
          Gets the model name of the device.
 int getNumberOfProcessors()
          Returns the number of processors visible to this Java platform.
 String getOsArch()
          Gets the Operating System architecture for the system.
 String getOsDistro()
          Gets the Operating System Distribution name if appropriate.
 String getOsDistroVersion()
          Gets the Operating System Distribution version if appropriate.
 String getOsgiFwName()
          Gets the name of the OSGI Framework that is currently being used.
 String getOsgiFwVersion()
          Gets the version of the OSGI Framework that is currently being used.
 String getOsName()
          Gets the Operating System name for the system.
 String getOsVersion()
          Gets the Operating System version for the system.
 String getPartNumber()
          Gets the part number.
 String getPlatform()
          Gets the platform name ESF is running on.
 String getPrimaryMacAddress()
          Gets the primary MAC address of the system
 String getPrimaryNetworkInterfaceName()
          Gets the name of the 'primary' network interface.
 Properties getProperties()
          Returns all EsfProperties for this system.
 String getSerialNumber()
          Gets the serial number of the device.
 long getTotalMemory()
          Returns the total memory visible to this Java instance.
 void setNetworkService(NetworkService networkService)
           
 void unsetNetworkService(NetworkService networkService)
           
 void updated(Map<String,Object> properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemServiceImpl

public SystemServiceImpl()
Method Detail

setNetworkService

public void setNetworkService(NetworkService networkService)

unsetNetworkService

public void unsetNetworkService(NetworkService networkService)

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext)

deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)

updated

public void updated(Map<String,Object> properties)

getProperties

public Properties getProperties()
Returns all EsfProperties for this system. The returned instances is initialized by loading the esf.properties file. Properties defined at the System level - for example using the java -D command line flag - are used to overwrite the values loaded from the esf.properties file in a hierarchical configuration fashion.

Specified by:
getProperties in interface SystemService

getPrimaryMacAddress

public String getPrimaryMacAddress()
Description copied from interface: SystemService
Gets the primary MAC address of the system

Specified by:
getPrimaryMacAddress in interface SystemService
Returns:

getPrimaryNetworkInterfaceName

public String getPrimaryNetworkInterfaceName()
Description copied from interface: SystemService
Gets the name of the 'primary' network interface.

Specified by:
getPrimaryNetworkInterfaceName in interface SystemService
Returns:

getPlatform

public String getPlatform()
Description copied from interface: SystemService
Gets the platform name ESF is running on. This could be catalyst, duracor1200, helios, isis, proteus, etc.

Specified by:
getPlatform in interface SystemService
Returns:
The platform name.

getOsArch

public String getOsArch()
Description copied from interface: SystemService
Gets the Operating System architecture for the system.

Specified by:
getOsArch in interface SystemService
Returns:
The Operating System architecture as defined by the Java System property os.arch.

getOsName

public String getOsName()
Description copied from interface: SystemService
Gets the Operating System name for the system.

Specified by:
getOsName in interface SystemService
Returns:
The Operating System name as defined by the Java System property os.name.

getOsVersion

public String getOsVersion()
Description copied from interface: SystemService
Gets the Operating System version for the system.

Specified by:
getOsVersion in interface SystemService
Returns:
The Operating System version as defined by the Java System property os.version.

getOsDistro

public String getOsDistro()
Description copied from interface: SystemService
Gets the Operating System Distribution name if appropriate.

Specified by:
getOsDistro in interface SystemService
Returns:
A String representing the Operating System Distribution name if appropriate.

getOsDistroVersion

public String getOsDistroVersion()
Description copied from interface: SystemService
Gets the Operating System Distribution version if appropriate.

Specified by:
getOsDistroVersion in interface SystemService
Returns:
A String representing the Operating System Distribution version if appropriate.

getJavaVendor

public String getJavaVendor()
Description copied from interface: SystemService
Gets the vendor of the Java VM that is currently being used.

Specified by:
getJavaVendor in interface SystemService
Returns:
The Java Runtime version as defined by the Java System property java.vendor.

getJavaVersion

public String getJavaVersion()
Description copied from interface: SystemService
Gets the Java version that is currently being used.

Specified by:
getJavaVersion in interface SystemService
Returns:
The Java version as defined by the Java System property java.version.

getJavaVmName

public String getJavaVmName()
Description copied from interface: SystemService
Gets the Java Virtual Machine name that is currently being used.

Specified by:
getJavaVmName in interface SystemService
Returns:
The Java Virtual Machine name as defined by the Java System property java.vm.name.

getJavaVmVersion

public String getJavaVmVersion()
Description copied from interface: SystemService
Gets the Java Virtual Machine version that is currently being used.

Specified by:
getJavaVmVersion in interface SystemService
Returns:
The Java Virtual Machine version as defined by the Java System property java.vm.version.

getJavaVmInfo

public String getJavaVmInfo()
Description copied from interface: SystemService
Gets the Java Virtual Machine information that is currently being used.

Specified by:
getJavaVmInfo in interface SystemService
Returns:
The Java Virtual Machine version as defined by the Java System property java.vm.version.

getOsgiFwName

public String getOsgiFwName()
Description copied from interface: SystemService
Gets the name of the OSGI Framework that is currently being used.

Specified by:
getOsgiFwName in interface SystemService
Returns:
The OSGI Framework Name as defined by the System property osgi.framework.name.

getOsgiFwVersion

public String getOsgiFwVersion()
Description copied from interface: SystemService
Gets the version of the OSGI Framework that is currently being used.

Specified by:
getOsgiFwVersion in interface SystemService
Returns:
The OSGI Framework Version as defined by the System property osgi.framework.version.

getNumberOfProcessors

public int getNumberOfProcessors()
Description copied from interface: SystemService
Returns the number of processors visible to this Java platform.

Specified by:
getNumberOfProcessors in interface SystemService
Returns:

getTotalMemory

public long getTotalMemory()
Description copied from interface: SystemService
Returns the total memory visible to this Java instance.

Specified by:
getTotalMemory in interface SystemService
Returns:

getFreeMemory

public long getFreeMemory()
Description copied from interface: SystemService
Returns the free memory for Java instance.

Specified by:
getFreeMemory in interface SystemService
Returns:

getFileSeparator

public String getFileSeparator()
Description copied from interface: SystemService
Gets the system file separator used by the filesystem.

Specified by:
getFileSeparator in interface SystemService
Returns:
The system file separator used by the system.

getJavaHome

public String getJavaHome()
Description copied from interface: SystemService
Gets the location where the JVM is stored in the filesystem.

Specified by:
getJavaHome in interface SystemService
Returns:
The location of the root JVM directory.

getEsfName

public String getEsfName()

getEsfVersion

public String getEsfVersion()
Description copied from interface: SystemService
Gets the product version for this unit. The product version is defined as the version in the release.xml file. The release.xml file is stored in /etc/esf/ and has the format: PRODUCT_NAME_release-VERSION-VERSION_NUMBER.xml For example this is a valid product name: helios_denali_release-1.2.3.xml. The version number would be 1.2.3. This would be an invalid product name: my-product-name_release-1.2.3.xml. This is because the product name has '-' characters in it. They should be '_' to be valid. So, the correct representation would be: my_product_name_release-1.2.3.xml. It's version number would be 1.2.3. The use of '-' characters should only be used immediately before the version number and the use of '.' characters should only be used immediately after the version number.

Specified by:
getEsfVersion in interface SystemService
Returns:
The version number as denoted in the release.xml file.

getEsfHome

public String getEsfHome()
Description copied from interface: SystemService
Gets the location where the ESF root directory is stored in the filesystem.

Specified by:
getEsfHome in interface SystemService
Returns:
The root ESF directory.

getEsfPluginsDirectory

public String getEsfPluginsDirectory()

getEsfDataDirectory

public String getEsfDataDirectory()
Description copied from interface: SystemService
Gets the location where all ESF persistent data should be stored.

Specified by:
getEsfDataDirectory in interface SystemService
Returns:
The location of the persistent ESF data directory root.

getEsfTemporaryConfigDirectory

public String getEsfTemporaryConfigDirectory()
Description copied from interface: SystemService
Gets the location where all volatile ESF specific configuration and status information should be stored. The convention for each bundle that has filesystem dependencies is for those filesystem components to be stored in the configuration directory root followed by a file separator followed by the project name that needs some configuration. This will keep separate configuration components tied to their appropriate projects.

Specified by:
getEsfTemporaryConfigDirectory in interface SystemService
Returns:
The location of the volatile ESF configuration and status directory root.

getEsfSnapshotsDirectory

public String getEsfSnapshotsDirectory()
Description copied from interface: SystemService
Gets the location where all Configuration Snapshots will be stored. It is recommended for this directory not to be volatile so that the configuration information can survive reboots and service configuration can be restored.

Specified by:
getEsfSnapshotsDirectory in interface SystemService
Returns:
The location of the volatile ESF configuration and status directory root.

getEsfSnapshotsCount

public int getEsfSnapshotsCount()
Description copied from interface: SystemService
Returns the maximum number of snapshots to be retained in the file system. When the maximum number is reached, a garbage collector will deleted the older snapshots.

Specified by:
getEsfSnapshotsCount in interface SystemService
Returns:
maximum number of snapshots to be retained.

getEsfStyleDirectory

public String getEsfStyleDirectory()
Description copied from interface: SystemService
Gets the location where all custom style information is stored.

Specified by:
getEsfStyleDirectory in interface SystemService
Returns:
The location of the custom style directory.

getEsfWebEnabled

public String getEsfWebEnabled()
Specified by:
getEsfWebEnabled in interface SystemService

getBiosVersion

public String getBiosVersion()
Description copied from interface: SystemService
Gets the BIOS version of the device.

Specified by:
getBiosVersion in interface SystemService
Returns:
BIOS version.

getDeviceName

public String getDeviceName()
Description copied from interface: SystemService
Returns a friendly name assigned to this device.

Specified by:
getDeviceName in interface SystemService
Returns:

getFirmwareVersion

public String getFirmwareVersion()
Description copied from interface: SystemService
Gets the firmware version.

Specified by:
getFirmwareVersion in interface SystemService
Returns:
Firmware version.

getModelId

public String getModelId()
Description copied from interface: SystemService
Gets the model identification of the device.

Specified by:
getModelId in interface SystemService
Returns:
Model ID.

getModelName

public String getModelName()
Description copied from interface: SystemService
Gets the model name of the device.

Specified by:
getModelName in interface SystemService
Returns:
Model name.

getPartNumber

public String getPartNumber()
Description copied from interface: SystemService
Gets the part number.

Specified by:
getPartNumber in interface SystemService
Returns:
Part number.

getSerialNumber

public String getSerialNumber()
Description copied from interface: SystemService
Gets the serial number of the device.

Specified by:
getSerialNumber in interface SystemService
Returns:
Serial number.

getBundles

public org.osgi.framework.Bundle[] getBundles()
Description copied from interface: SystemService
Returns the OSGi bundles currently installed

Specified by:
getBundles in interface SystemService
Returns:

getDeviceManagementServiceIgnore

public List<String> getDeviceManagementServiceIgnore()
Description copied from interface: SystemService
Returns a list of services that should be ignored by the Everyware Cloud Console

Specified by:
getDeviceManagementServiceIgnore in interface SystemService
Returns:


Copyright © 2013. All Rights Reserved.