public class ServerGroupFactory extends HibernateFactory
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NULL_DESCRIPTION |
| Constructor and Description |
|---|
ServerGroupFactory() |
| Modifier and Type | Method and Description |
|---|---|
static ManagedServerGroup |
create(java.lang.String name,
java.lang.String description,
Org org)
Creates a new ServerGroup object and
persists it to the database before returning it
|
static java.lang.Long |
getCurrentMembers(ServerGroup sg)
Returns the value listed by current members column
on the rhnServerGroup table..
|
protected org.apache.log4j.Logger |
getLogger()
Get the Logger for the derived class so log messages show up on the
correct class
|
static java.util.List<java.lang.Long> |
listActiveServerIds(ServerGroup sg,
java.lang.Long threshold)
Returns a list of active server Ids associated to this servergroup
Here active implies that the system has checked in after
sysdate - threshold
|
static java.util.List |
listAdministeredServerGroups(User user)
Returns the ServerGroups that the user can administer.
|
static java.util.List |
listAdministrators(ServerGroup sg)
Returns the admins of a given serverGroup.
|
static java.util.List<EntitlementServerGroup> |
listEntitlementGroups(Org org)
Returns the list of Entitlement ServerGroups associated to a server.
|
static java.util.List<EntitlementServerGroup> |
listEntitlementGroups(Server s)
Returns the list of Entitlement ServerGroups associated to a server.
|
static java.util.List<java.lang.Long> |
listInactiveServerIds(ServerGroup sg,
java.lang.Long threshold)
Returns a list of Inactive server Ids associated to this servergroup
Here inactive implies that the system has checked in before
sysdate - threshold
|
static java.util.List<ManagedServerGroup> |
listManagedGroups(Org org)
Returns the list of Managed ServerGroups associated to a server.
|
static java.util.List<ManagedServerGroup> |
listManagedGroups(Server s)
Returns the list of Managed ServerGroups associated to a server.
|
static java.util.List |
listNoAdminGroups(Org org)
Returns a list of ServerGroups that have NO administrators
|
static java.util.List<Server> |
listServers(ServerGroup sg)
Returns the servers of a given serverGroup.
|
static ManagedServerGroup |
lookupByIdAndOrg(java.lang.Long id,
Org org)
Lookup a ServerGroup by ID and organization.
|
static ManagedServerGroup |
lookupByNameAndOrg(java.lang.String name,
Org org)
Lookup a ServerGroup by Name and organization.
|
static EntitlementServerGroup |
lookupEntitled(Entitlement ent,
Org org)
Retrieves a specific group from the server groups for this org
|
static EntitlementServerGroup |
lookupEntitled(Org org,
ServerGroupType typeIn)
Returns an EntitlementServerGroup for the given org
and servergroup type.
|
static void |
remove(ServerGroup group)
Remove an server group
|
static void |
save(ServerGroup group)
Insert or update a ServerGroup
|
addConfigurator, blobToByteArray, byteArrayToBlob, closeSession, closeSessionFactory, commitTransaction, createSessionFactory, createSessionFactory, executeCallableMode, executeSelectMode, getBlobContents, getByteArrayContents, getObject, getSession, initialize, inTransaction, isClosed, isInitialized, listObjectsByNamedQuery, listObjectsByNamedQuery, listObjectsByNamedQuery, lockObject, lookupObjectByNamedQuery, lookupObjectByNamedQuery, reload, removeObject, rollbackTransaction, saveObject, saveObject, stringToByteArraypublic static final java.lang.String NULL_DESCRIPTION
protected org.apache.log4j.Logger getLogger()
HibernateFactorygetLogger in class HibernateFactorypublic static java.util.List listAdministeredServerGroups(User user)
user - User whose ServerGroups are sought.public static void save(ServerGroup group)
group - the ServerGroup to savepublic static ManagedServerGroup lookupByIdAndOrg(java.lang.Long id, Org org)
id - Server group idorg - Organizationpublic static ManagedServerGroup lookupByNameAndOrg(java.lang.String name, Org org)
name - Server group nameorg - Organizationpublic static EntitlementServerGroup lookupEntitled(Org org, ServerGroupType typeIn)
org - the org to look attypeIn - the server group type to look atpublic static EntitlementServerGroup lookupEntitled(Entitlement ent, Org org)
ent - The entitlement of the desired servergrouporg - The org in which the server group belongspublic static void remove(ServerGroup group)
group - to removepublic static ManagedServerGroup create(java.lang.String name, java.lang.String description, Org org)
name - name of the server group (cant be null)description - description of servergroup (non-null)org - the org of the server grouppublic static java.util.List listNoAdminGroups(Org org)
org - org of the current user.public static java.util.List listAdministrators(ServerGroup sg)
sg - the serverGroup to find the admins ofpublic static java.util.List<Server> listServers(ServerGroup sg)
sg - the serverGroup to find the servers ofpublic static java.lang.Long getCurrentMembers(ServerGroup sg)
sg - the server group to get the current members ofpublic static java.util.List<EntitlementServerGroup> listEntitlementGroups(Server s)
s - the server to find the server groups ofpublic static java.util.List<ManagedServerGroup> listManagedGroups(Server s)
s - the server to find the server groups ofpublic static java.util.List<EntitlementServerGroup> listEntitlementGroups(Org org)
org - the Org to find the server groups ofpublic static java.util.List<ManagedServerGroup> listManagedGroups(Org org)
org - the org to find the server groups ofpublic static java.util.List<java.lang.Long> listActiveServerIds(ServerGroup sg, java.lang.Long threshold)
sg - the server group to check systems onthreshold - the threshold to check onpublic static java.util.List<java.lang.Long> listInactiveServerIds(ServerGroup sg, java.lang.Long threshold)
sg - the server group to check systems onthreshold - the threshold to check on