Package org.rhq.core.system

Examples of org.rhq.core.system.FileSystemInfo


        long totalFreeDiskSpace = 0;
        long totalUsedDiskSpace = 0;

        for (String path : paths) {
            try {
                FileSystemInfo fileSystemInfo  = this.getResourceContext().getSystemInformation().getFileSystem(path);
                if (!visitedMountPoints.contains(fileSystemInfo.getMountPoint())) {
                    visitedMountPoints.add(fileSystemInfo.getMountPoint());

                    //contrary to Sigar documentation this values are reported in MB and not bytes
                    totalDiskSpace += fileSystemInfo.getFileSystemUsage().getTotal();
                    totalFreeDiskSpace += fileSystemInfo.getFileSystemUsage().getFree();
                    totalUsedDiskSpace += fileSystemInfo.getFileSystemUsage().getUsed();
                }
            } catch (Exception e) {
                log.error("Unable to determine file system usage information for data file location " + path, e);
            }
        }
View Full Code Here


    public void stop() {
    }

    public AvailabilityType getAvailability() {
        FileSystemInfo fileSystemInfo = getFileSystemInfo();
        if (fileSystemInfo != null && fileSystemInfo.getFileSystem() != null
            && this.resourceContext.getResourceKey().equals(fileSystemInfo.getFileSystem().getDirName())) {
            return AvailabilityType.UP;
        } else {
            return AvailabilityType.DOWN;
        }
    }
View Full Code Here

            return AvailabilityType.DOWN;
        }
    }

    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) throws Exception {
        FileSystemInfo fileSystemInfo = getFileSystemInfo();
        for (MeasurementScheduleRequest request : requests) {
            try {
                switch (request.getDataType()) {
                    case TRAIT:
                        Object object = ObjectUtil.lookupDeepAttributeProperty(fileSystemInfo, request.getName());
View Full Code Here

TOP

Related Classes of org.rhq.core.system.FileSystemInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.