com.friendshipsystems.fsshresourcemanager.config
Class FHost

java.lang.Object
  extended by com.friendshipsystems.fsshresourcemanager.utils.FDBObject
      extended by com.friendshipsystems.fsshresourcemanager.config.FHost

public class FHost
extends com.friendshipsystems.fsshresourcemanager.utils.FDBObject

This class represents the configured hosts.

Author:
FRIENDSHIP SYSTEMS

Constructor Summary
FHost()
           
FHost(java.lang.String name, int port, int numberOfCPUs, int mbMemory, FOperatingSystem os, java.lang.String tempDir, java.lang.String sftpRoot, java.lang.Boolean isActive, java.lang.Boolean supportsX)
           
 
Method Summary
 void addApplication(FApplication app)
           
 boolean cloneAppsFrom(FHost from)
           
 boolean equals(java.lang.Object o)
           
 void freeProcessor()
           
 void freeProcessors(int cpus)
           
 java.util.Set<FApplication> getApplications()
           
static FHost getHost(int id)
           
static FHost getHost(java.lang.String name)
           
 java.lang.String getHostName()
           
static java.util.List<FHost> getHosts()
           
static java.util.List<FHost> getHostsByOs(FOperatingSystem os)
           
 int getId()
           
 java.lang.Boolean getIsActive()
           
 java.lang.Boolean getKnownHost()
           
 int getMbMemory()
           
 int getNumberOfFreeProcessors()
           
 int getNumberOfLockedProcessors()
           
 int getNumberOfProcessors()
           
 int getNumberOfUsedProcessors()
           
 FOperatingSystem getOs()
           
 java.lang.String getPassword()
           
 int getPort()
           
 java.lang.String getPortX()
           
static java.util.List<FHost> getPotentialHosts()
           
 java.lang.String getSftpRoot()
           
 java.lang.Boolean getSupportsX()
           
 java.lang.String getTempDir()
           
 java.lang.String getUserName()
           
 int getXPort(int index)
           
 java.lang.Boolean hasAuth()
           
 int hashCode()
           
 void removeApplication(FApplication app)
           
 java.lang.Boolean save()
           
 void setHostName(java.lang.String hostName)
           
 void setIsActive(java.lang.Boolean isActive)
           
 void setKnownHost(java.lang.Boolean knownHost)
           
 void setMbMemory(int mbMemory)
           
 void setNumberOfLockedProcessors(int mNumberOfLockedProcessors)
           
 void setNumberOfProcessors(int numberOfProcessors)
           
 void setNumberOfUsedProcessors(int numberOfUsedProcessors)
           
 void setOs(FOperatingSystem os)
           
 void setPassword(java.lang.String password)
           
 void setPort(int port)
           
 void setPortX(java.lang.String xPort)
           
 void setSftpRoot(java.lang.String sftpRoot)
           
 void setSupportsX(java.lang.Boolean supportsX)
           
 void setTempDir(java.lang.String tempDir)
           
 void setUserName(java.lang.String userName)
           
 java.util.Map<java.lang.String,java.lang.Object> toMap()
           
 java.lang.Boolean update()
           
 java.lang.Boolean useProcessor()
           
 java.lang.Boolean useProcessors(int cpus)
           
 
Methods inherited from class com.friendshipsystems.fsshresourcemanager.utils.FDBObject
delete
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FHost

public FHost()

FHost

public FHost(java.lang.String name,
             int port,
             int numberOfCPUs,
             int mbMemory,
             FOperatingSystem os,
             java.lang.String tempDir,
             java.lang.String sftpRoot,
             java.lang.Boolean isActive,
             java.lang.Boolean supportsX)
Method Detail

getHosts

public static java.util.List<FHost> getHosts()

getHost

public static FHost getHost(java.lang.String name)

getHost

public static FHost getHost(int id)

getHostsByOs

public static java.util.List<FHost> getHostsByOs(FOperatingSystem os)

getPotentialHosts

public static java.util.List<FHost> getPotentialHosts()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

save

public java.lang.Boolean save()
Overrides:
save in class com.friendshipsystems.fsshresourcemanager.utils.FDBObject

update

public java.lang.Boolean update()
Overrides:
update in class com.friendshipsystems.fsshresourcemanager.utils.FDBObject

hasAuth

public java.lang.Boolean hasAuth()

toMap

public java.util.Map<java.lang.String,java.lang.Object> toMap()
Specified by:
toMap in class com.friendshipsystems.fsshresourcemanager.utils.FDBObject

getId

public int getId()
Returns:
the id

setHostName

public void setHostName(java.lang.String hostName)
Parameters:
hostName - the hostName to set

getHostName

public java.lang.String getHostName()
Returns:
the hostName

setNumberOfProcessors

public void setNumberOfProcessors(int numberOfProcessors)
Parameters:
numberOfProcessors - the numberOfProcessors to set

getNumberOfProcessors

public int getNumberOfProcessors()
Returns:
the numberOfProcessors

setMbMemory

public void setMbMemory(int mbMemory)
Parameters:
mbMemory - the mbMemory to set

getMbMemory

public int getMbMemory()
Returns:
the mbMemory

setOs

public void setOs(FOperatingSystem os)
Parameters:
os - the FOperatingSystem to set

getOs

public FOperatingSystem getOs()
Returns:
the osId

setIsActive

public void setIsActive(java.lang.Boolean isActive)
Parameters:
isActive - the isActive to set

getIsActive

public java.lang.Boolean getIsActive()
Returns:
the isActive

setSupportsX

public void setSupportsX(java.lang.Boolean supportsX)
Parameters:
supportsX - the supportsX to set

getSupportsX

public java.lang.Boolean getSupportsX()
Returns:
the supportsX

getApplications

public java.util.Set<FApplication> getApplications()
Returns:
the applications

addApplication

public void addApplication(FApplication app)
Parameters:
app -

removeApplication

public void removeApplication(FApplication app)
Parameters:
app -

setTempDir

public void setTempDir(java.lang.String tempDir)
Parameters:
tempDir - the tempDir to set

getTempDir

public java.lang.String getTempDir()
Returns:
the tempDir

setSftpRoot

public void setSftpRoot(java.lang.String sftpRoot)
Parameters:
sftpRoot - the sftpRoot to set

getSftpRoot

public java.lang.String getSftpRoot()
Returns:
the sftpRoot

useProcessor

public java.lang.Boolean useProcessor()

useProcessors

public java.lang.Boolean useProcessors(int cpus)

freeProcessor

public void freeProcessor()

freeProcessors

public void freeProcessors(int cpus)

setNumberOfUsedProcessors

public void setNumberOfUsedProcessors(int numberOfUsedProcessors)
Parameters:
numberOfUsedProcessors - the numberOfUsedProcessors to set

getNumberOfUsedProcessors

public int getNumberOfUsedProcessors()
Returns:
the numberOfUsedProcessors

getNumberOfFreeProcessors

public int getNumberOfFreeProcessors()

setKnownHost

public void setKnownHost(java.lang.Boolean knownHost)
Parameters:
knownHost - the knownHost to set

getKnownHost

public java.lang.Boolean getKnownHost()
Returns:
the knownHost

setPassword

public void setPassword(java.lang.String password)
Parameters:
password - the password to set

getPassword

public java.lang.String getPassword()
Returns:
the password

setUserName

public void setUserName(java.lang.String userName)
Parameters:
userName - the userName to set

getUserName

public java.lang.String getUserName()
Returns:
the userName

setPort

public void setPort(int port)
Parameters:
port - the port to set

getPort

public int getPort()
Returns:
the port

setNumberOfLockedProcessors

public void setNumberOfLockedProcessors(int mNumberOfLockedProcessors)

getNumberOfLockedProcessors

public int getNumberOfLockedProcessors()

cloneAppsFrom

public boolean cloneAppsFrom(FHost from)

setPortX

public void setPortX(java.lang.String xPort)
Parameters:
xPort - the xPort to set

getPortX

public java.lang.String getPortX()
Returns:
the xPort

getXPort

public int getXPort(int index)