org.jmythapi.protocol.response.impl
Class FreeSpaceList

java.lang.Object
  extended by org.jmythapi.impl.AData<E>
      extended by org.jmythapi.protocol.response.impl.AMythResponse<E>
          extended by org.jmythapi.protocol.response.impl.AFreeSpace<FreeSpaceList.Props>
              extended by org.jmythapi.protocol.response.impl.FreeSpaceList
All Implemented Interfaces:
Cloneable, Iterable<IFreeSpaceListEntry>, IPropertyAware<FreeSpaceList.Props>, IVersionable, ISendable, IBasicFreeSpace, IFreeSpaceList, IMythResponse<FreeSpaceList.Props>

public class FreeSpaceList
extends AFreeSpace<FreeSpaceList.Props>
implements Iterable<IFreeSpaceListEntry>, IFreeSpaceList

Since:
17

Nested Class Summary
 class FreeSpaceList.Entry
           
static class FreeSpaceList.Props
           
 
Field Summary
 
Fields inherited from class org.jmythapi.impl.AData
logger, propsClass, protoVersion, respArgs
 
Constructor Summary
FreeSpaceList(IMythPacket packet)
           
 
Method Summary
 List<IFreeSpaceListEntry> asList()
          Returns a list, containing one entry for each backend storage-group.
protected  void checkSize(List<String> responseArgs)
          The size of the response array must be a multiple of IFreeSpaceListEntry.EntryProps.values().size().
 IFreeSpaceListEntry get(int idx)
          Gets the entry at the given index.
 Long getTotalSpace()
          Gets the total space on file system.
 Long getUsedSpace()
          Gets the used space on file system.
 Iterator<IFreeSpaceListEntry> iterator()
           
 int size()
          Returns the number of entries contained in this list
 String toString()
          Returns the content of this data object as a formatted string.
 
Methods inherited from class org.jmythapi.protocol.response.impl.AFreeSpace
getFreeSpace
 
Methods inherited from class org.jmythapi.protocol.response.impl.AMythResponse
decodeProperty, encodeProperty, getExpectedSize, getPacket, getProperties, getProperty, getPropertyIndex
 
Methods inherited from class org.jmythapi.impl.AData
clone, equals, getPropertyClass, getPropertyCount, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValueObject, getPropertyValues, getVersionNr, hashCode, init, postProcessArguments, setPropertyValue, setPropertyValue, setPropertyValueObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jmythapi.protocol.response.IFreeSpaceList
getFreeSpace
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 
Methods inherited from interface org.jmythapi.IPropertyAware
getPropertyClass, getPropertyCount, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValues, setPropertyValue, setPropertyValue, setPropertyValueObject
 

Constructor Detail

FreeSpaceList

public FreeSpaceList(IMythPacket packet)
Method Detail

checkSize

protected void checkSize(List<String> responseArgs)
                  throws IllegalArgumentException
The size of the response array must be a multiple of IFreeSpaceListEntry.EntryProps.values().size(). There is no size value at the beginning of the response list (e.g. as available for program-lists).

Overrides:
checkSize in class AMythResponse<FreeSpaceList.Props>
Parameters:
responseArgs - the response-argument-list
Throws:
IllegalArgumentException - if expected arguments are missing.

getTotalSpace

public Long getTotalSpace()
Description copied from interface: IBasicFreeSpace
Gets the total space on file system.

Specified by:
getTotalSpace in interface IBasicFreeSpace
Specified by:
getTotalSpace in interface IFreeSpaceList
Specified by:
getTotalSpace in class AFreeSpace<FreeSpaceList.Props>
Returns:
total space

getUsedSpace

public Long getUsedSpace()
Description copied from interface: IBasicFreeSpace
Gets the used space on file system.

Specified by:
getUsedSpace in interface IBasicFreeSpace
Specified by:
getUsedSpace in interface IFreeSpaceList
Specified by:
getUsedSpace in class AFreeSpace<FreeSpaceList.Props>
Returns:
used space

asList

public List<IFreeSpaceListEntry> asList()
Description copied from interface: IFreeSpaceList
Returns a list, containing one entry for each backend storage-group.

Specified by:
asList in interface IFreeSpaceList
Returns:
a list of entries.

get

public IFreeSpaceListEntry get(int idx)
Description copied from interface: IFreeSpaceList
Gets the entry at the given index.

Specified by:
get in interface IFreeSpaceList
Parameters:
idx - the index of the entry
Returns:
the entry

size

public int size()
Description copied from interface: IFreeSpaceList
Returns the number of entries contained in this list

Specified by:
size in interface IFreeSpaceList
Returns:
the list size

iterator

public Iterator<IFreeSpaceListEntry> iterator()
Specified by:
iterator in interface Iterable<IFreeSpaceListEntry>

toString

public String toString()
Description copied from class: AData

Returns the content of this data object as a formatted string.

E.g.
 <0>TOTAL_RAM_MB: 1002 | <1>FREE_RAM_MB: 474 | <2>TOTAL_VM_MB: 853 | <3>FREE_VM_MB: 853
 

Overrides:
toString in class AData<FreeSpaceList.Props>


Copyright © 2008-2013. All Rights Reserved.