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 ApplicationArtifactResolvergetInstance()Gets the application artifact resolver implementation.abstract booleanisEditable(ApplicationArtifact artifact, HttpServletRequest request)Determines whether aresolvedapplication artifact can be edited by the user behind therequest.abstract booleanisEditable(ApplicationContainer container, HttpServletRequest request)Determines whether aresolvedapplication 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 voidsetInstance(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
Optionalif no container exists for the givencontainerIdor the user behind therequesthas no access to it; a containedApplicationContainerotherwise. - 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
Optionalif no artifact exists for the givenartifactIdor the user behind therequesthas no access to it; a containedApplicationArtifactotherwise. - Throws:
OslcWebApplicationException- if the application artifact cannot be determined.- Since:
- 3.8.0
-
isEditable
public abstract boolean isEditable(ApplicationArtifact artifact, HttpServletRequest request)
Determines whether aresolvedapplication artifact can be edited by the user behind therequest.- Parameters:
artifact- the resolved application artifact.request- the current HTTP request.- Returns:
trueif the requesting user has permission to modifyartifact;falseotherwise.
-
isEditable
public abstract boolean isEditable(ApplicationContainer container, HttpServletRequest request)
Determines whether aresolvedapplication artifact container can be edited by the user behind therequest.- Parameters:
container- the resolved application artifact container.request- the current HTTP request.- Returns:
trueif the requesting user has permission to modifycontainer;falseotherwise.- Since:
- 3.8.0
-
-