public class ServerGroupManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addServers(ServerGroup sg,
java.util.Collection<Server> servers,
User loggedInUser)
Associates a bunch of servers to a server group
|
void |
associateAdmins(ManagedServerGroup sg,
java.util.Collection admins,
User loggedInUser)
Associates a bunch of administrators to a server group
|
void |
associateOrDissociateAdminsByLoginName(ManagedServerGroup group,
java.util.Collection adminLogins,
boolean associate,
User loggedInUser)
Associates/Disocciates a list of admins to a server group
by using User's login name..
|
boolean |
canAccess(User user,
ServerGroup group)
Returns true if the the given user can
administer server groups..
|
ManagedServerGroup |
create(User user,
java.lang.String name,
java.lang.String description)
Create a new Server group
|
void |
dissociateAdmins(ManagedServerGroup sg,
java.util.Collection admins,
User loggedInUser)
Disssociates a bunch of administrators from a server group
|
java.util.Map |
errataCounts(User user,
ServerGroup group)
Returns counts of applicable errata to given server group.
|
static ServerGroupManager |
getInstance()
Singleton Instance to get manager object
|
java.util.List<java.lang.Long> |
listActiveServers(ServerGroup sg,
java.lang.Long threshold)
List all servers that have checked in within a X days
|
java.util.List |
listAdministrators(ManagedServerGroup sg,
User loggedInUser)
Returns the admins of a given servergroup.
|
java.util.List<java.lang.Long> |
listInactiveServers(ServerGroup sg,
java.lang.Long threshold)
List all servers that have not checked in in X days
|
java.util.List |
listNoAdminGroups(User user)
Returns a list of servergroups that have NO administrators
associated to it.
|
java.util.List<Server> |
listServers(ServerGroup sg)
Returns the servers of a given servergroup
|
ManagedServerGroup |
lookup(java.lang.Long id,
User user)
Lookup a ServerGroup by ID and organization.
|
ManagedServerGroup |
lookup(java.lang.String name,
User user)
Lookup a ServerGroup by ID and organization.
|
EntitlementServerGroup |
lookupEntitled(Entitlement ent,
User user)
Returns an EntitlementServerGroup for a given entitlement type
|
void |
remove(User user,
ManagedServerGroup group)
Removes an ServerGroup.
|
void |
removeServers(ServerGroup sg,
java.util.Collection<Server> servers)
Dissociates a bunch of servers from a server group.
|
void |
removeServers(ServerGroup sg,
java.util.Collection<Server> servers,
User loggedInUser)
Dissociates a bunch of servers from a server group
|
void |
validateAccessCredentials(User user,
ServerGroup group,
java.lang.String groupIdentifier)
validates that the given user can access
the given ServerGroup object.
|
void |
validateAdminCredentials(User user)
validates that the given user can administer
a server group.
|
void |
validateOrgAdminCredentials(User user)
validates that the given user can administer
or lookup an entitled server group.
|
public static ServerGroupManager getInstance()
public ManagedServerGroup lookup(java.lang.Long id, User user)
id
- Server group iduser
- logged in user needed for authenticationpublic ManagedServerGroup lookup(java.lang.String name, User user)
name
- Server group nameuser
- logged in user needed for authenticationpublic EntitlementServerGroup lookupEntitled(Entitlement ent, User user)
ent
- the entitlement type desireduser
- logged in user needed for authentication -
needs to be ORG Adminpublic boolean canAccess(User user, ServerGroup group)
user
- the user to check ongroup
- the server group object to authenticate.public void validateAccessCredentials(User user, ServerGroup group, java.lang.String groupIdentifier)
user
- the user to authenticategroup
- the servergroup to authenticategroupIdentifier
- id or group name to use when reporting exception
(group could be null)public void validateAdminCredentials(User user)
user
- the user to authenticatepublic void validateOrgAdminCredentials(User user)
user
- the user to authenticatepublic void remove(User user, ManagedServerGroup group)
user
- user object needed for authenticationgroup
- the group to removepublic ManagedServerGroup create(User user, java.lang.String name, java.lang.String description)
user
- user needed for authenticationname
- the name of the server groupdescription
- the description of the server grouppublic void associateOrDissociateAdminsByLoginName(ManagedServerGroup group, java.util.Collection adminLogins, boolean associate, User loggedInUser)
group
- the Servergroup to associate/dissociate usersadminLogins
- the login names of the users to associate/dissociateassociate
- true if we want to associate false otherwise.loggedInUser
- the logged in user.public void associateAdmins(ManagedServerGroup sg, java.util.Collection admins, User loggedInUser)
sg
- the server group to processadmins
- a collection of users to add as administratorsloggedInUser
- the loggedInUser needed for credentialspublic void dissociateAdmins(ManagedServerGroup sg, java.util.Collection admins, User loggedInUser)
sg
- the server group to processadmins
- a collection of administrators to deassociateloggedInUser
- the loggedInUser needed for credentialspublic void addServers(ServerGroup sg, java.util.Collection<Server> servers, User loggedInUser)
sg
- the server group to processservers
- a collection of servers to add.loggedInUser
- the loggedInUser needed for credentialspublic void removeServers(ServerGroup sg, java.util.Collection<Server> servers, User loggedInUser)
sg
- the server group to processservers
- a collection of servers to dissociateloggedInUser
- the loggedInUser needed for credentialspublic void removeServers(ServerGroup sg, java.util.Collection<Server> servers)
sg
- the server group to processservers
- a collection of servers to dissociatepublic java.util.List listAdministrators(ManagedServerGroup sg, User loggedInUser)
sg
- the server group that you want the admin list for.loggedInUser
- the loggedInUser needed for credentialspublic java.util.List listNoAdminGroups(User user)
user
- ORG_ADMIN user.public java.util.List<Server> listServers(ServerGroup sg)
sg
- the server group to find the servers ofpublic java.util.List<java.lang.Long> listActiveServers(ServerGroup sg, java.lang.Long threshold)
sg
- the sever groupthreshold
- the number of days a system needs to have checked in bypublic java.util.List<java.lang.Long> listInactiveServers(ServerGroup sg, java.lang.Long threshold)
sg
- the sever groupthreshold
- the number of days a system needs to have not checked in bypublic java.util.Map errataCounts(User user, ServerGroup group)
user
- the user to get org fromgroup
- the server group object to get counts