Package com.sodius.oslc.server.process
Class ApplicationArtifactResolver
- java.lang.Object
-
- com.sodius.oslc.server.process.ApplicationArtifactResolver
-
public abstract class ApplicationArtifactResolver extends Object
Allows to resolve application-native artifacts.- Since:
- 3.1.0
- See Also:
ApplicationArtifact
-
-
Constructor Summary
Constructors Constructor Description ApplicationArtifactResolver()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ApplicationArtifactResolver
getInstance()
Gets the application artifact resolver implementation.abstract boolean
isEditable(ApplicationArtifact artifact, HttpServletRequest request)
Determines whether aresolved
application artifact can be edited by the user behind therequest
.abstract boolean
isEditable(ApplicationContainer container, HttpServletRequest request)
Determines whether aresolved
application artifact container can be edited by the user behind therequest
.abstract Optional<ApplicationArtifact>
resolve(String artifactId, String artifactType, ApplicationContainer container, HttpServletRequest request)
Resolves an application-native artifact.abstract Optional<ApplicationContainer>
resolveContainer(String containerId, HttpServletRequest request)
Resolves an application-native artifact container.static void
setInstance(ApplicationArtifactResolver resolver)
Sets (or replaces) the application artifact resolver.
-
-
-
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 givencontainerId
or the user behind therequest
has no access to it; a containedApplicationContainer
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 artifactApplicationArtifact.getType()
.container
- the artifact's container.request
- the current HTTP request.- Returns:
- an empty
Optional
if no artifact exists for the givenartifactId
or the user behind therequest
has no access to it; a containedApplicationArtifact
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 aresolved
application artifact can be edited by the user behind therequest
.- Parameters:
artifact
- the resolved application artifact.request
- the current HTTP request.- Returns:
true
if the requesting user has permission to modifyartifact
;false
otherwise.
-
isEditable
public abstract boolean isEditable(ApplicationContainer container, HttpServletRequest request)
Determines whether aresolved
application artifact container can be edited by the user behind therequest
.- Parameters:
container
- the resolved application artifact container.request
- the current HTTP request.- Returns:
true
if the requesting user has permission to modifycontainer
;false
otherwise.- Since:
- 3.8.0
-
-