Class StreamingProviderDataEntityFactory
- java.lang.Object
-
- org.silverpeas.core.webapi.media.streaming.StreamingProviderDataEntityFactory
-
@Service @Singleton public class StreamingProviderDataEntityFactory extends Object
This factory permits to instantiate the rightStreamingProviderDataEntity
instance from aOembedDataEntity
decoded from the response of a streaming provider about a full URL of a streaming.If the factory is not able to construct a
StreamingProviderDataEntity
from oembed data, then a default one is instantiated.When some specific behaviors MUST be taken into account for streamings of a provider, then a specific constructor override of
StreamingProviderDataEntity
MUST be implemented and indicated to factory by usingregisterConstructor(String, BiFunction)
method. AsYoutubeDataEntity
for example.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Constructor Description StreamingProviderDataEntityFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StreamingProviderDataEntityFactory
get()
void
registerConstructor(String providerName, BiFunction<StreamingProvider,OembedDataEntity,StreamingProviderDataEntity> constructor)
Registers a newStreamingProviderDataEntity
constructor.protected void
setupDefaults()
Registers default constructors ofStreamingProviderDataEntity
of Silverpeas's server.
-
-
-
Method Detail
-
get
public static StreamingProviderDataEntityFactory get()
-
setupDefaults
@PostConstruct protected void setupDefaults()
Registers default constructors ofStreamingProviderDataEntity
of Silverpeas's server.
-
registerConstructor
public void registerConstructor(String providerName, BiFunction<StreamingProvider,OembedDataEntity,StreamingProviderDataEntity> constructor)
Registers a newStreamingProviderDataEntity
constructor.It permits to external projects to defined theirs own constructors if needed.
- Parameters:
providerName
- name of streaming provider (lowercase).constructor
- the constructor ofStreamingProviderDataEntity
.
-
-