Class ResourceService


  • public class ResourceService
    extends java.lang.Object
    Resource service
    • Method Detail

      • getInstance

        public static ResourceService getInstance()
        Get the instance of the service
        Returns:
        The instance of the service
      • getResourceTypesList

        public java.util.List<IResourceType> getResourceTypesList()
        Get the list of available resource types
        Returns:
        The list of available resource types
      • isResourceTypeManaged

        public boolean isResourceTypeManaged​(java.lang.String strResourceTypeName)
        Check if a resource type is managed by any provider
        Parameters:
        strResourceTypeName - The resource type
        Returns:
        True if the resource type is managed by any provider, false otherwise
      • resourceTypeCreated

        public void resourceTypeCreated​(java.lang.String strResourceTypeName)
        Declare a resource type as created. This method is used to keep cache up to date.
        Parameters:
        strResourceTypeName - The created resource type
      • resourceTypeRemoved

        public void resourceTypeRemoved​(java.lang.String strResourceTypeName)
        Declare a resource type as removed. This method is used to keep cache up to date.
        Parameters:
        strResourceTypeName - The removed resource type
      • getResource

        public IResource getResource​(java.lang.String strIdResource,
                                     java.lang.String strResourceTypeName)
        Get a resource from its id and type
        Parameters:
        strIdResource - the id of the resource to get
        strResourceTypeName - the type of the resource to get
        Returns:
        The resource, or null if the resource could not be found
      • getListResources

        public java.util.List<IResource> getListResources​(java.lang.String strResourceTypeName)
        Get the list of resources of a given type
        Parameters:
        strResourceTypeName - the resource type
        Returns:
        the list of resource of the given type, or an empty list if not resource was found
      • getResourceProvider

        public IResourceProvider getResourceProvider​(java.lang.String strResourceTypeName)
        Get the resource provider of a resource type
        Parameters:
        strResourceTypeName - The resource provider of a resource type
        Returns:
        The resource provider, or null if no provider was found for the given resource type