Class ApplicationArtifactResolver


  • public abstract class ApplicationArtifactResolver
    extends Object
    Allows to resolve application-native artifacts.
    Since:
    3.1.0
    See Also:
    ApplicationArtifact
    • Constructor Detail

      • ApplicationArtifactResolver

        public ApplicationArtifactResolver()
    • Method Detail

      • getInstance

        public static ApplicationArtifactResolver getInstance()
        Gets the application artifact resolver implementation.
        Returns:
        the application artifact resolver implementation.
        Throws:
        NullPointerException - if no implementation has been configured.
      • setInstance

        public static void setInstance​(ApplicationArtifactResolver resolver)
        Sets (or replaces) the application artifact resolver.
        Parameters:
        resolver - application artifact resolver.
      • resolveContainer

        public abstract Optional<ApplicationContainer> resolveContainer​(String containerId,
                                                                        HttpServletRequest request)
        Resolves an application-native artifact container.
        Parameters:
        containerId - the artifact's container ID.
        request - the current HTTP request.
        Returns:
        an empty Optional if no container exists for the given containerId or the user behind the request has no access to it; a contained ApplicationContainer otherwise.
        Throws:
        OslcWebApplicationException - if the application artifact cannot be determined.
        Since:
        3.8.0
      • resolve

        public abstract Optional<ApplicationArtifact> resolve​(String artifactId,
                                                              String artifactType,
                                                              ApplicationContainer container,
                                                              HttpServletRequest request)
        Resolves an application-native artifact.
        Parameters:
        artifactId - the native artifact's ID.
        artifactType - the artifact ApplicationArtifact.getType().
        container - the artifact's container.
        request - the current HTTP request.
        Returns:
        an empty Optional if no artifact exists for the given artifactId or the user behind the request has no access to it; a contained ApplicationArtifact otherwise.
        Throws:
        OslcWebApplicationException - if the application artifact cannot be determined.
        Since:
        3.8.0
      • isEditable

        public abstract boolean isEditable​(ApplicationArtifact artifact,
                                           HttpServletRequest request)
        Determines whether a resolved application artifact can be edited by the user behind the request.
        Parameters:
        artifact - the resolved application artifact.
        request - the current HTTP request.
        Returns:
        true if the requesting user has permission to modify artifact; false otherwise.
      • isEditable

        public abstract boolean isEditable​(ApplicationContainer container,
                                           HttpServletRequest request)
        Determines whether a resolved application artifact container can be edited by the user behind the request.
        Parameters:
        container - the resolved application artifact container.
        request - the current HTTP request.
        Returns:
        true if the requesting user has permission to modify container; false otherwise.
        Since:
        3.8.0