|
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.ResourceManagerEJBImpl
public class ResourceManagerEJBImpl
Use this session bean to manipulate Resources, ResourceTypes and ResourceGroups. That is to say, Resources and their derivatives. Alteratively you can say, anything enity that starts with the word Resource. All arguments and return values are value-objects.
Field Summary |
---|
Fields inherited from class org.hyperic.hq.authz.server.session.AuthzSession |
---|
ctx |
Constructor Summary | |
---|---|
ResourceManagerEJBImpl()
|
Method Summary | |
---|---|
void |
_removeResource(AuthzSubject subj,
Resource r,
boolean nullResourceType)
|
Resource |
createResource(AuthzSubject owner,
ResourceType rt,
Resource prototype,
java.lang.Integer instanceId,
java.lang.String name,
boolean system,
Resource parent)
Create a resource. |
void |
createResourceEdges(AuthzSubject subject,
ResourceRelation relation,
AppdefEntityID parent,
AppdefEntityID[] children)
|
void |
createResourceEdges(AuthzSubject subject,
ResourceRelation relation,
AppdefEntityID parent,
AppdefEntityID[] children,
boolean deleteExisting)
|
void |
ejbActivate()
|
void |
ejbCreate()
|
void |
ejbPassivate()
|
void |
ejbRemove()
|
java.util.List |
findAllAppdefPrototypes()
Get all resources which are prototypes of platforms, servers, and services. |
java.util.Map |
findAllViewableInstances(AuthzSubject subject)
Get viewable resources either by "type" OR "resource name" OR "type AND resource name". |
java.util.Collection |
findAncestorResourceEdges(Resource resource,
ResourceRelation relation)
|
java.util.List |
findAppdefPrototypes()
Get all resources which are prototypes of platforms, servers, and services and have a resource of that type in the inventory. |
java.util.Collection |
findChildResourceEdges(Resource resource,
ResourceRelation relation)
|
java.util.Collection |
findDescendantResourceEdges(Resource resource,
ResourceRelation relation)
|
Resource |
findResource(AppdefEntityID aeid)
|
Resource |
findResourceById(java.lang.Integer id)
|
Resource |
findResourceByInstanceId(java.lang.Integer typeId,
java.lang.Integer instanceId)
|
Resource |
findResourceByInstanceId(ResourceType type,
java.lang.Integer instanceId)
Find the Resource that has the given instance ID and ResourceType. |
java.util.Collection |
findResourceByOwner(AuthzSubject owner)
Gets all the Resources owned by the given Subject. |
Resource |
findResourceByTypeAndInstanceId(java.lang.String type,
java.lang.Integer instanceId)
Find the Resource that has the given instance ID and ResourceType name. |
java.util.List |
findResourceEdges(ResourceRelation relation,
java.lang.Integer resourceId,
java.util.List platformTypeIds,
java.lang.String platformName)
|
java.util.Collection |
findResourceEdges(ResourceRelation relation,
java.util.List parentList)
|
java.util.Collection |
findResourceEdges(ResourceRelation relation,
Resource parent)
|
java.util.Collection |
findResourceEdgesByName(java.lang.String name,
ResourceRelation relation)
|
Resource |
findResourcePrototype(AppdefEntityTypeID id)
|
Resource |
findResourcePrototypeByName(java.lang.String name)
Find a resource, acting as a resource prototype. |
java.util.List |
findResourcesByParent(AuthzSubject subject,
Resource res)
Find all the resources which are descendents of the given resource |
java.util.List |
findResourcesOfPrototype(Resource proto,
PageInfo pInfo)
Find all the resources which have the specified prototype |
java.util.List |
findResourcesOfType(int resourceType,
PageInfo pInfo)
Find all the resources of an authz resource type |
ResourceType |
findResourceTypeByName(java.lang.String name)
Find the type that has the given name. |
Resource |
findRootResource()
Find's the root (id=0) resource |
java.util.List |
findViewableInstances(AuthzSubject subject,
java.lang.String typeName,
java.lang.String resName,
java.lang.String appdefTypeStr,
java.lang.Integer typeId,
PageControl pc)
Get viewable resources either by "type" OR "resource name" OR "type AND resource name". |
PageList |
findViewables(AuthzSubject subject,
java.lang.String searchFor,
PageControl pc)
Get viewable resources by "type" OR "resource name" |
PageList |
findViewableSvcResources(AuthzSubject subject,
java.lang.String nameFilter,
PageControl pc)
Get viewable service resources. |
java.util.List |
getAllResourceTypes(AuthzSubject subject,
PageControl pc)
Get all the resource types |
int |
getDescendantResourceEdgeCount(Resource resource,
ResourceRelation relation)
|
static org.hyperic.hq.authz.shared.ResourceManagerLocal |
getOne()
|
ResourceEdge |
getParentResourceEdge(Resource resource,
ResourceRelation relation)
|
int |
getPlatformCountMinusVsphereVmPlatforms()
|
java.lang.Number |
getResourceCount()
Get the # of resources within HQ inventory |
java.lang.Number |
getResourceTypeCount()
Get the # of resource types within HQ inventory |
Resource |
getResourceTypeResource(java.lang.Integer typeId)
Get the Resource entity associated with this ResourceType. |
boolean |
hasChildResourceEdges(Resource resource,
ResourceRelation relation)
|
boolean |
hasResourceRelation(Resource resource,
ResourceRelation relation)
|
boolean |
isResourceChildOf(Resource parent,
Resource child)
|
void |
moveResource(AuthzSubject owner,
Resource target,
Resource destination)
Move a resource. |
void |
removeResource(AuthzSubject subject,
Resource r)
|
void |
removeResourceEdges(AuthzSubject subject,
ResourceRelation relation,
AppdefEntityID parent,
AppdefEntityID[] children)
|
void |
removeResourceEdges(AuthzSubject subject,
ResourceRelation relation,
Resource parent)
|
AppdefEntityID[] |
removeResourcePerms(AuthzSubject subj,
Resource r,
boolean nullResourceType)
Removes the specified resource by nulling out its resourceType. |
void |
resourceHierarchyUpdated(AuthzSubject subj,
java.util.Collection resources)
|
boolean |
resourcesExistOfType(java.lang.String typeName)
Check if there are any resources of a given type |
void |
setResourceOwner(AuthzSubject whoami,
Resource resource,
AuthzSubject newOwner)
|
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 ResourceManagerEJBImpl()
Method Detail |
---|
public ResourceType findResourceTypeByName(java.lang.String name) throws javax.ejb.FinderException
name
- The name of the type you're looking for.
javax.ejb.FinderException
- Unable to find a given or dependent entities.public Resource findResourcePrototypeByName(java.lang.String name)
public boolean resourcesExistOfType(java.lang.String typeName)
public Resource createResource(AuthzSubject owner, ResourceType rt, Resource prototype, java.lang.Integer instanceId, java.lang.String name, boolean system, Resource parent)
public void moveResource(AuthzSubject owner, Resource target, Resource destination)
public java.lang.Number getResourceCount()
public java.lang.Number getResourceTypeCount()
public Resource getResourceTypeResource(java.lang.Integer typeId)
type
- This ResourceType.public Resource findResourceByInstanceId(ResourceType type, java.lang.Integer instanceId)
type
- The ResourceType of the Resource you're looking for.instanceId
- Your ID for the resource you're looking for.
public Resource findResourceByInstanceId(java.lang.Integer typeId, java.lang.Integer instanceId)
public Resource findRootResource()
public Resource findResourceById(java.lang.Integer id)
public Resource findResourceByTypeAndInstanceId(java.lang.String type, java.lang.Integer instanceId)
type
- The ResourceType of the Resource you're looking for.instanceId
- Your ID for the resource you're looking for.
public Resource findResource(AppdefEntityID aeid)
public Resource findResourcePrototype(AppdefEntityTypeID id)
public AppdefEntityID[] removeResourcePerms(AuthzSubject subj, Resource r, boolean nullResourceType) throws VetoException, PermissionException
AppdefBossEJBImpl.removeDeletedResources
. This may be done in
the background via zevent by issuing a ResourcesCleanupZevent
.
r
- Resource
resource to be removed.nullResourceType
- tells the method to null out the resourceType
VetoException
PermissionException
AppdefBossEJBImpl.removeDeletedResources}
,
ResourcesCleanupZevent}
public void _removeResource(AuthzSubject subj, Resource r, boolean nullResourceType)
public void removeResource(AuthzSubject subject, Resource r) throws VetoException
VetoException
public void setResourceOwner(AuthzSubject whoami, Resource resource, AuthzSubject newOwner) throws PermissionException
PermissionException
public java.util.List getAllResourceTypes(AuthzSubject subject, PageControl pc)
subject
- pc
- Paging information for the requestpublic java.util.List findViewableInstances(AuthzSubject subject, java.lang.String typeName, java.lang.String resName, java.lang.String appdefTypeStr, java.lang.Integer typeId, PageControl pc)
subject
-
public PageList findViewables(AuthzSubject subject, java.lang.String searchFor, PageControl pc)
subject
-
public java.util.Map findAllViewableInstances(AuthzSubject subject)
subject
-
public java.util.List findResourcesByParent(AuthzSubject subject, Resource res)
public java.util.List findResourcesOfType(int resourceType, PageInfo pInfo)
resourceType
- 301 for platforms, etc.pInfo
- A pager, using a sort field of ResourceSortField
Resource
spublic java.util.List findResourcesOfPrototype(Resource proto, PageInfo pInfo)
Resource
spublic java.util.List findAppdefPrototypes()
public java.util.List findAllAppdefPrototypes()
public PageList findViewableSvcResources(AuthzSubject subject, java.lang.String nameFilter, PageControl pc)
subject
- pc
- control
public java.util.Collection findResourceByOwner(AuthzSubject owner)
subject
- The owner.
public java.util.Collection findResourceEdges(ResourceRelation relation, java.util.List parentList)
parentList
- List
of Resource
s
Collection
of ResourceEdge
spublic java.util.Collection findResourceEdges(ResourceRelation relation, Resource parent)
Collection
of ResourceEdge
spublic boolean isResourceChildOf(Resource parent, Resource child)
public boolean hasChildResourceEdges(Resource resource, ResourceRelation relation)
public int getDescendantResourceEdgeCount(Resource resource, ResourceRelation relation)
public java.util.Collection findChildResourceEdges(Resource resource, ResourceRelation relation)
public java.util.Collection findDescendantResourceEdges(Resource resource, ResourceRelation relation)
public java.util.Collection findAncestorResourceEdges(Resource resource, ResourceRelation relation)
public java.util.Collection findResourceEdgesByName(java.lang.String name, ResourceRelation relation)
public ResourceEdge getParentResourceEdge(Resource resource, ResourceRelation relation)
public boolean hasResourceRelation(Resource resource, ResourceRelation relation)
public java.util.List findResourceEdges(ResourceRelation relation, java.lang.Integer resourceId, java.util.List platformTypeIds, java.lang.String platformName)
public void createResourceEdges(AuthzSubject subject, ResourceRelation relation, AppdefEntityID parent, AppdefEntityID[] children) throws PermissionException, ResourceEdgeCreateException
PermissionException
ResourceEdgeCreateException
public void createResourceEdges(AuthzSubject subject, ResourceRelation relation, AppdefEntityID parent, AppdefEntityID[] children, boolean deleteExisting) throws PermissionException, ResourceEdgeCreateException
PermissionException
ResourceEdgeCreateException
public void removeResourceEdges(AuthzSubject subject, ResourceRelation relation, AppdefEntityID parent, AppdefEntityID[] children) throws PermissionException
PermissionException
public void removeResourceEdges(AuthzSubject subject, ResourceRelation relation, Resource parent) throws PermissionException
PermissionException
public void resourceHierarchyUpdated(AuthzSubject subj, java.util.Collection resources)
{@link
- Collection} of Resource
spublic int getPlatformCountMinusVsphereVmPlatforms()
AuthzConstants.authzPlatform
minus resources with the prototype of AuthConstants.platformPrototypeVmwareVsphereVm
public static org.hyperic.hq.authz.shared.ResourceManagerLocal 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 |