public interface UploadHook extends Public
This hook methods MUST BE EXECUTED SYNCHRONOUS at a time. Means if this hook does some concurrent execution inside
the hook methods preProcess(de.espirit.firstspirit.access.BaseContext, de.espirit.firstspirit.access.store.mediastore.Media, de.espirit.firstspirit.access.store.mediastore.File, java.io.InputStream, long)
or
preProcess(de.espirit.firstspirit.access.BaseContext, de.espirit.firstspirit.access.store.mediastore.Media, de.espirit.firstspirit.access.store.mediastore.Picture, de.espirit.firstspirit.access.project.Resolution, java.io.InputStream, long)
and postProcess(de.espirit.firstspirit.access.BaseContext, de.espirit.firstspirit.access.store.mediastore.Media, de.espirit.firstspirit.access.store.mediastore.Picture, long)
or
postProcess(de.espirit.firstspirit.access.BaseContext, de.espirit.firstspirit.access.store.mediastore.Media, de.espirit.firstspirit.access.store.mediastore.File, long)
the hook is responsible for blocking the current thread until the concurrent execution is finished.
NOTE: this hook is only called if a Media
is currently holding a lock.
IMPORTANT: All UploadHook
methods are called with privileged access. Meaning a hook runs with ALL permissions.
If any user permission evaluation is necessary the hook implementation its self is responsible to do that.
The User can be obtained by:
baseContext.requestSpecialist(UserAgent.TYPE).getUser()Get the element permissions:
StoreElement.getPermission()
StoreElement.getPermission(de.espirit.firstspirit.access.User)
StoreElement.getPermission()
StoreElement.getPermission(de.espirit.firstspirit.access.User)
StoreElement.getPermission()
StoreElement.getPermission(de.espirit.firstspirit.access.User)
Modifier and Type | Method and Description |
---|---|
void |
postProcess(BaseContext baseContext,
Media media,
File file,
long length)
Hook method will be called on media upload AFTER the uploaded file is transmitted into the FirstSpirit-Server-Repository.
|
void |
postProcess(BaseContext baseContext,
Media media,
Picture picture,
long length)
Hook method will be called on media upload AFTER the uploaded file is transmitted into the FirstSpirit-Server-Repository.
|
void |
preProcess(BaseContext baseContext,
Media media,
File file,
InputStream inputStream,
long length)
Hook method will be called on media upload BEFORE the uploaded file will be transmitted to the FirstSpirit-Server-Repository.
|
void |
preProcess(BaseContext baseContext,
Media media,
Picture picture,
Resolution resolution,
InputStream inputStream,
long length)
Hook method will be called on media upload BEFORE the uploaded file will be transmitted to the FirstSpirit-Server-Repository.
|
void |
uploadAborted(BaseContext baseContext,
Media media,
MediaElement mediaElement)
This method will be called if an upload has been rejected by any upload-hook instance and this hook has been already executed.
|
void preProcess(@NotNull BaseContext baseContext, @NotNull Media media, @NotNull File file, @NotNull InputStream inputStream, long length) throws UploadRejectedException, IOException
UploadRejectedException
must be thrown.
NOTE:
This hook methods MUST BE EXECUTED SYNCHRONOUS at a time. Means if this method performs concurrent execution,
the method is responsible for blocking the current thread until the concurrent execution is finished.
This methods is only called if a Media
is currently holding a lock.
IMPORTANT: All UploadHook
methods are called with privileged access. Meaning a hook runs with ALL permissions.
If any user permission evaluation is necessary the hook implementation its self is responsible to do that.
baseContext
- a simple context used for firstspirit hotspotsmedia
- the current media value holderfile
- the current media fileinputStream
- the data input-streamlength
- the content lengthIOException
- on errorUploadRejectedException
- on media rejectionvoid preProcess(@NotNull BaseContext baseContext, @NotNull Media media, @NotNull Picture picture, Resolution resolution, @NotNull InputStream inputStream, long length) throws UploadRejectedException, IOException
UploadRejectedException
must be thrown.
NOTE:
This hook methods MUST BE EXECUTED SYNCHRONOUS at a time. Means if this method performs concurrent execution,
the method is responsible for blocking the current thread until the concurrent execution is finished.
This methods is only called if a Media
is currently holding a lock.
IMPORTANT: All UploadHook
methods are called with privileged access. Meaning a hook runs with ALL permissions.
If any user permission evaluation is necessary the hook implementation its self is responsible to do that.
baseContext
- a simple context used for firstspirit hotspotsmedia
- the current media value holderpicture
- the current media pictureresolution
- the current uploaded resolutioninputStream
- the data input-streamlength
- the content lengthIOException
- on errorUploadRejectedException
- on media rejectionvoid postProcess(@NotNull BaseContext baseContext, @NotNull Media media, @NotNull File file, long length)
NOTE:
This hook method MUST BE EXECUTED SYNCHRONOUS at a time. Means if this method performs concurrent execution,
the method is responsible for blocking the current thread until the concurrent execution is finished.
This methods is only called if a Media
is currently holding a lock.
IMPORTANT: All UploadHook
methods are called with privileged access. Meaning a hook runs with ALL permissions.
If any user permission evaluation is necessary the hook implementation its self is responsible to do that.
baseContext
- a simple context used for firstspirit hotspotsmedia
- the current media value holderfile
- the current media filelength
- the content lengthvoid postProcess(@NotNull BaseContext baseContext, @NotNull Media media, @NotNull Picture picture, long length)
NOTE:
This hook method MUST BE EXECUTED SYNCHRONOUS at a time. Means if this method performs concurrent execution,
the method is responsible for blocking the current thread until the concurrent execution is finished.
This methods is only called if a Media
is currently holding a lock.
IMPORTANT: All UploadHook
methods are called with privileged access. Meaning a hook runs with ALL permissions.
If any user permission evaluation is necessary the hook implementation its self is responsible to do that.
baseContext
- a simple context used for firstspirit hotspotsmedia
- the current media value holderpicture
- the current media picturelength
- the content lengthvoid uploadAborted(@NotNull BaseContext baseContext, @NotNull Media media, @NotNull MediaElement mediaElement)
NOTE:
This hook method MUST BE EXECUTED SYNCHRONOUS at a time. Means if this method does some concurrent execution,
the method is responsible for blocking the current thread until the concurrent execution is finished.
This methods is only called if a Media
is currently holding a lock.
IMPORTANT: All UploadHook
methods are called with privileged access. Meaning a hook runs with ALL permissions.
If any user permission evaluation is necessary the hook implementation its self is responsible to do that.
Copyright © 2014 e-Spirit AG. All Rights Reserved. Build 5.0_BETA.500