public class HostDAO
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private org.hibernate.Session |
ss |
Constructor and Description |
---|
HostDAO()
Constructor of the class - only thing to do here is to open session to DB
|
Modifier and Type | Method and Description |
---|---|
void |
closeSession()
Method for closing the session - it flushes database connection
|
void |
deleteHost(Host host)
Method providing functionality for host deleting
|
Host |
findHost(java.lang.String host)
Method returning Host whose hostname matches the search criteria
|
java.util.List<Host> |
getAllHosts()
Method returning list of all hosts
|
java.util.List<Host> |
getHostsByGroup(java.lang.String groupname)
Method returning list of hosts in certain group
|
java.lang.Boolean |
newHost(Host host)
Method creating new host in database
|
void |
updateHost(Host host)
Method providing functionality for host updating
|
public HostDAO()
public java.util.List<Host> getAllHosts()
public Host findHost(java.lang.String host)
host
- name of the host - hostnamepublic java.util.List<Host> getHostsByGroup(java.lang.String groupname)
groupname
- Name of the grouppublic java.lang.Boolean newHost(Host host)
host
- Host to be createdpublic void updateHost(Host host)
host
- Host to be updatedpublic void deleteHost(Host host)
host
- Host to be deletedpublic void closeSession()