|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.hq.authz.server.session.AuthzSession
org.hyperic.hq.authz.server.session.ResourceGroupManagerEJBImpl
public class ResourceGroupManagerEJBImpl
Use this session bean to manipulate ResourceGroups, All arguments and return values are value-objects.
Field Summary |
---|
Fields inherited from class org.hyperic.hq.authz.server.session.AuthzSession |
---|
ctx, log |
Constructor Summary | |
---|---|
ResourceGroupManagerEJBImpl()
|
Method Summary | |
---|---|
void |
addResource(AuthzSubject whoami,
Resource resource,
java.util.Collection groups)
Add a resource to a collection of groups |
ResourceGroup |
addResource(AuthzSubject whoami,
ResourceGroup group,
Resource resource)
Add a resource to a group by resource id and resource type |
void |
addResources(AuthzSubject subj,
ResourceGroup group,
java.util.List resources)
|
void |
changeGroupOwner(AuthzSubject subject,
ResourceGroup group,
AuthzSubject newOwner)
Change owner of a group. |
ResourceGroup |
createResourceGroup(AuthzSubject whoami,
ResourceGroup.ResourceGroupCreateInfo cInfo,
java.util.Collection roles,
java.util.Collection resources)
Create a resource group. |
void |
ejbActivate()
|
void |
ejbCreate()
|
void |
ejbPassivate()
|
void |
ejbRemove()
|
java.util.Collection |
findDeletedGroups()
|
PageList |
findGroupsContaining(AuthzSubject subject,
Resource member,
java.util.Collection excludeGroups,
PageInfo pInfo)
Get a list of ResourceGroup s which are compatible with
the specified prototype. |
PageList |
findGroupsNotContaining(AuthzSubject subject,
Resource member,
Resource prototype,
java.util.Collection excGrps,
PageInfo pInfo)
Get a list of ResourceGroup s which are compatable with
the specified prototype. |
ResourceGroup |
findResourceGroupById(AuthzSubject whoami,
java.lang.Integer id)
Find the group that has the given ID. |
ResourceGroup |
findResourceGroupById(java.lang.Integer id)
Find the group that has the given ID. |
ResourceGroup |
findResourceGroupByName(AuthzSubject whoami,
java.lang.String name)
Find the role that has the given name. |
java.util.Collection |
getAllResourceGroups()
Get all ResourceGroup s |
java.util.Collection |
getAllResourceGroups(AuthzSubject subject,
boolean excludeRoot)
Get all the resource groups excluding the root resource group. |
java.util.List |
getAllResourceGroups(AuthzSubject subject,
PageControl pc)
Get all the resource groups including the root resource group. |
AppdefResourceType |
getAppdefResourceType(AuthzSubject subject,
ResourceGroup group)
|
java.util.Collection |
getCompatibleResourceGroups(AuthzSubject subject,
Resource resProto)
Get all compatible resource groups of the given entity type and resource type. |
AppdefGroupValue |
getGroupConvert(AuthzSubject subj,
ResourceGroup g)
Temporary method to convert a ResourceGroup into an AppdefGroupValue |
java.lang.Number |
getGroupCount()
Get the # of groups within HQ inventory |
java.util.Collection |
getGroups(Resource r)
Get all the groups a resource belongs to |
long |
getMaxCollectionInterval(ResourceGroup g,
java.lang.Integer templateId)
Get the maximum collection interval for a scheduled metric within a compatible group of resources. |
java.util.Collection |
getMembers(ResourceGroup g)
Get all the members of a group. |
java.util.Map |
getMemberTypes(ResourceGroup g)
Get the member type counts of a group |
java.util.List |
getMetricsCollecting(ResourceGroup g,
java.lang.Integer templateId)
Return a List of Measurements that are collecting for the given template ID and group. |
int |
getNumMembers(ResourceGroup g)
Get the # of members in a group |
static org.hyperic.hq.authz.shared.ResourceGroupManagerLocal |
getOne()
|
ResourceGroup |
getResourceGroupByResource(Resource resource)
|
AuthzSubject |
getResourceGroupOwner(java.lang.Integer gid)
Get a ResourceGroup owner's AuthzSubjectValue |
PageList |
getResourceGroupsById(AuthzSubject whoami,
java.lang.Integer[] ids,
PageControl pc)
Get the resource groups with the specified ids |
java.util.Collection |
getResources(AuthzSubject whoami,
java.lang.Integer id)
List the resources in this group that the caller is authorized to see. |
boolean |
isMember(ResourceGroup group,
Resource resource)
Returns true if the passed resource is a member of the given group. |
void |
removeGroupsCompatibleWith(Resource proto)
Remove all groups compatable with the specified resource prototype. |
void |
removeResource(AuthzSubject whoami,
Resource resource,
java.util.Collection groups)
Remove a resource from a collection of groups |
void |
removeResourceGroup(AuthzSubject whoami,
ResourceGroup group)
Delete the specified ResourceGroup. |
void |
removeResources(AuthzSubject whoami,
ResourceGroup group,
java.util.Collection resources)
RemoveResources from a group. |
void |
setCriteria(AuthzSubject whoami,
ResourceGroup group,
CritterList critters)
Sets the criteria list for this group. |
void |
setGroupModifiedBy(AuthzSubject whoami,
java.lang.Integer id)
Set a ResourceGroup modifiedBy attribute |
void |
setResources(AuthzSubject whoami,
ResourceGroup group,
java.util.Collection resources)
Change the resource contents of a group to the specified list of resources. |
void |
updateGroup(AuthzSubject whoami,
ResourceGroup group,
java.lang.String name,
java.lang.String description,
java.lang.String location)
Update some of the fundamentals of groups (name, description, location). |
void |
updateGroupType(AuthzSubject subject,
ResourceGroup g,
int groupType,
int groupEntType,
int groupEntResType)
|
Methods inherited from class org.hyperic.hq.authz.server.session.AuthzSession |
---|
findPrototype, findSubjectByAuth, getContainmentRelation, getInitialContext, getNetworkRelation, getOperationDAO, getResourceDAO, getResourceGroupDAO, getResourceTypeDAO, getRoleDAO, getRootResourceType, getSessionContext, getSubjectDAO, getVirtualRelation, lookupSubject, setSessionContext, toPojos |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.ejb.SessionBean |
---|
setSessionContext |
Constructor Detail |
---|
public ResourceGroupManagerEJBImpl()
Method Detail |
---|
public ResourceGroup createResourceGroup(AuthzSubject whoami, ResourceGroup.ResourceGroupCreateInfo cInfo, java.util.Collection roles, java.util.Collection resources) throws GroupCreationException, GroupDuplicateNameException
roles
- List of Role
sresources
- List of Resource
s
GroupCreationException
GroupDuplicateNameException
public ResourceGroup findResourceGroupById(AuthzSubject whoami, java.lang.Integer id) throws PermissionException
whoami
- user requesting to find the group
ResourceGroup
or null if it does not exist
XXX scottmf, why is this method called find() but calls dao.get()???
PermissionException
public ResourceGroup findResourceGroupById(java.lang.Integer id)
public ResourceGroup findResourceGroupByName(AuthzSubject whoami, java.lang.String name) throws PermissionException
whoami
- user requesting to find the groupname
- The name of the role you're looking for.
PermissionException
- whoami does not have viewResourceGroup
on the requested grouppublic java.util.Collection findDeletedGroups()
public void updateGroup(AuthzSubject whoami, ResourceGroup group, java.lang.String name, java.lang.String description, java.lang.String location) throws PermissionException, GroupDuplicateNameException
DuplicateObjectException
- if an attempt to rename the group would
result in a group with the same name.
PermissionException
GroupDuplicateNameException
public void removeGroupsCompatibleWith(Resource proto) throws VetoException
VetoException
- if another subsystem cannot allow it (for
constraint reasons)public void removeResourceGroup(AuthzSubject whoami, ResourceGroup group) throws PermissionException, VetoException
whoami
- The current running user.group
- The group to delete.
PermissionException
VetoException
public void addResources(AuthzSubject subj, ResourceGroup group, java.util.List resources) throws PermissionException, VetoException
PermissionException
VetoException
public ResourceGroup addResource(AuthzSubject whoami, ResourceGroup group, Resource resource) throws PermissionException, VetoException
PermissionException
VetoException
public void addResource(AuthzSubject whoami, Resource resource, java.util.Collection groups) throws PermissionException, VetoException
whoami
- The current running user.resource
- The resourcegroups
- The groups to add to.
PermissionException
VetoException
public void removeResource(AuthzSubject whoami, Resource resource, java.util.Collection groups) throws PermissionException, VetoException
whoami
- The current running user.resource
- The resourcegroups
- The groups to remove from.
PermissionException
VetoException
public void removeResources(AuthzSubject whoami, ResourceGroup group, java.util.Collection resources) throws PermissionException, VetoException
whoami
- The current running user.group
- The group .
PermissionException
VetoException
public void setCriteria(AuthzSubject whoami, ResourceGroup group, CritterList critters) throws PermissionException, GroupException
whoami
- The current running user.group
- This group.critters
- List of critters to associate with this resource group.
PermissionException
- whoami does not own the resource.
GroupException
- critters is not a valid list of criteria.public void setResources(AuthzSubject whoami, ResourceGroup group, java.util.Collection resources) throws PermissionException, VetoException
resources
- A list of Resource
s to be in the group
PermissionException
VetoException
public java.util.Collection getResources(AuthzSubject whoami, java.lang.Integer id)
whoami
- The current running user.groupValue
- This group.pc
- Paging information for the request
public java.util.List getAllResourceGroups(AuthzSubject subject, PageControl pc) throws PermissionException, javax.ejb.FinderException
PermissionException
javax.ejb.FinderException
public java.util.Collection getMembers(ResourceGroup g)
Resource
spublic java.util.Map getMemberTypes(ResourceGroup g)
public java.util.Collection getGroups(Resource r)
ResourceGroup
spublic java.lang.Number getGroupCount()
public boolean isMember(ResourceGroup group, Resource resource)
public int getNumMembers(ResourceGroup g)
public AppdefGroupValue getGroupConvert(AuthzSubject subj, ResourceGroup g)
public AppdefResourceType getAppdefResourceType(AuthzSubject subject, ResourceGroup group)
public PageList findGroupsNotContaining(AuthzSubject subject, Resource member, Resource prototype, java.util.Collection excGrps, PageInfo pInfo)
ResourceGroup
s which are compatable with
the specified prototype.
Do not return any groups contained within 'excludeGroups' (a list of
ResourceGroup
s
prototype
- If specified, the resulting groups must be compatable
with the prototype.pInfo
- Pageinfo with a sort field of type
ResourceGroupSortField
public PageList findGroupsContaining(AuthzSubject subject, Resource member, java.util.Collection excludeGroups, PageInfo pInfo)
ResourceGroup
s which are compatible with
the specified prototype.
Do not return any groups contained within 'excludeGroups' (a list of
ResourceGroup
s
prototype
- If specified, the resulting groups must be compatible
with the prototype.pInfo
- Pageinfo with a sort field of type
ResourceGroupSortField
public java.util.Collection getAllResourceGroups(AuthzSubject subject, boolean excludeRoot) throws PermissionException
PermissionException
public java.util.Collection getAllResourceGroups()
ResourceGroup
s
public java.util.Collection getCompatibleResourceGroups(AuthzSubject subject, Resource resProto) throws javax.ejb.FinderException, PermissionException
javax.ejb.FinderException
PermissionException
public PageList getResourceGroupsById(AuthzSubject whoami, java.lang.Integer[] ids, PageControl pc) throws PermissionException, javax.ejb.FinderException
ids
- the resource group idspc
- Paging information for the request
PermissionException
javax.ejb.FinderException
public void changeGroupOwner(AuthzSubject subject, ResourceGroup group, AuthzSubject newOwner) throws PermissionException
PermissionException
public AuthzSubject getResourceGroupOwner(java.lang.Integer gid) throws javax.ejb.FinderException
gid
- The group id
javax.ejb.FinderException
- Unable to find a group by idpublic ResourceGroup getResourceGroupByResource(Resource resource)
public void setGroupModifiedBy(AuthzSubject whoami, java.lang.Integer id)
whoami
- user requesting to find the groupid
- The ID of the role you're looking for.public void updateGroupType(AuthzSubject subject, ResourceGroup g, int groupType, int groupEntType, int groupEntResType) throws PermissionException
PermissionException
public long getMaxCollectionInterval(ResourceGroup g, java.lang.Integer templateId)
public java.util.List getMetricsCollecting(ResourceGroup g, java.lang.Integer templateId)
g
- The group in question.templateId
- The measurement template to query.
public static org.hyperic.hq.authz.shared.ResourceGroupManagerLocal getOne()
public void ejbCreate() throws javax.ejb.CreateException
javax.ejb.CreateException
public void ejbRemove()
ejbRemove
in interface javax.ejb.SessionBean
public void ejbActivate()
ejbActivate
in interface javax.ejb.SessionBean
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.SessionBean
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |