Interface TargetResolver
-
- All Known Implementing Classes:
TargetResolverImpl
public interface TargetResolver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isContainerTarget(Target target)
Returns true if object is aTarget
for a container being used to check operations on a different childTargetType
within it.<T> @NonNull com.atlassian.fugue.Option<T>
resolveContainerHibernateObject(Target target, Class<T> expectedType)
Get the target hibernate object for the container relating to the specified target.<T> @NonNull com.atlassian.fugue.Option<T>
resolveHibernateObject(Target target, Class<T> expectedType)
Get the target hibernate object, if this target is one that has a specific object (not a container)<T> @NonNull T
resolveModelObject(Target target, Class<T> expectedType)
Get the target model object (e.g.
-
-
-
Method Detail
-
resolveModelObject
<T> @NonNull T resolveModelObject(Target target, Class<T> expectedType)
Get the target model object (e.g. Content), if this target is one that has a specific model object (not a container)- Type Parameters:
T
- the class type to cast the model object to after resolving the target to a model object- Returns:
- the result of resolving the model object, cast to T
- Throws:
UnsupportedTargetException
- if target is an unsupported type for resolving model objects, or is a container targetBadRequestException
-
resolveHibernateObject
<T> @NonNull com.atlassian.fugue.Option<T> resolveHibernateObject(Target target, Class<T> expectedType)
Get the target hibernate object, if this target is one that has a specific object (not a container)- Returns:
- an option containing the hibernate object, or an empty option if the types are correct but the hibernate ID doesn't exist in the database
- Throws:
UnsupportedTargetException
- if target is an unsupported type for resolving hibernate objects (e.g. is a container target)BadRequestException
- See Also:
resolveContainerHibernateObject(com.atlassian.confluence.api.model.permissions.Target, Class)
-
resolveContainerHibernateObject
<T> @NonNull com.atlassian.fugue.Option<T> resolveContainerHibernateObject(Target target, Class<T> expectedType)
Get the target hibernate object for the container relating to the specified target.- If this target is a container target, get that container's hibernate object.
- If this target is one that has a specific object (not a container), get that object's container's hibernate object.
- Returns:
- an option containing the hibernate object, or an empty option if the types are correct but the hibernate ID doesn't exist in the database
- Throws:
UnsupportedTargetException
- if target is an unsupported type for resolving container hibernate objects (e.g. not a container target, or is an unsuitable kind of model object)BadRequestException
- See Also:
resolveHibernateObject(com.atlassian.confluence.api.model.permissions.Target, Class)
-
isContainerTarget
boolean isContainerTarget(Target target)
Returns true if object is aTarget
for a container being used to check operations on a different childTargetType
within it.- Returns:
- true if it's a container target, false otherwise
- See Also:
Target.forChildrenOfContainer(com.atlassian.confluence.api.model.content.Container, com.atlassian.confluence.api.model.permissions.TargetType)
-
-