Class EventHttpServletRequest
java.lang.Object
org.opencastproject.index.service.impl.util.EventHttpServletRequest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EventHttpServletRequestcreateFromHttpServletRequest(javax.servlet.http.HttpServletRequest request, IngestService ingestService, List<EventCatalogUIAdapter> eventCatalogUIAdapters, String startDatePattern, String startTimePattern) protected static AccessControlListdeserializeJsonToAcl(String json, boolean assumeAllow) De-serialize an JSON into anAccessControlList.protected static MetadataListdeserializeMetadataList(String json, List<EventCatalogUIAdapter> catalogAdapters, String startDatePattern, String startTimePattern) Change the simplified fields of key values provided to the external api into aMetadataList.com.entwinemedia.fn.data.Opt<AccessControlList> getAcl()com.entwinemedia.fn.data.Opt<MediaPackage> com.entwinemedia.fn.data.Opt<MetadataList> com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> voidsetAcl(AccessControlList acl) voidsetMediaPackage(MediaPackage mediaPackage) voidsetMetadataList(MetadataList metadataList) voidsetProcessing(org.json.simple.JSONObject processing) voidsetScheduling(org.json.simple.JSONObject scheduling) voidsetSource(org.json.simple.JSONObject source) static EventHttpServletRequestupdateFromHttpServletRequest(Event event, javax.servlet.http.HttpServletRequest request, List<EventCatalogUIAdapter> eventCatalogUIAdapters, String startDatePattern, String startTimePattern) Load the details of updating an event.
-
Constructor Details
-
EventHttpServletRequest
public EventHttpServletRequest()
-
-
Method Details
-
setAcl
-
setMediaPackage
-
setMetadataList
-
setProcessing
public void setProcessing(org.json.simple.JSONObject processing) -
setScheduling
public void setScheduling(org.json.simple.JSONObject scheduling) -
setSource
public void setSource(org.json.simple.JSONObject source) -
getAcl
-
getMediaPackage
-
getMetadataList
-
getProcessing
public com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> getProcessing() -
getScheduling
public com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> getScheduling() -
getSource
public com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> getSource() -
createFromHttpServletRequest
public static EventHttpServletRequest createFromHttpServletRequest(javax.servlet.http.HttpServletRequest request, IngestService ingestService, List<EventCatalogUIAdapter> eventCatalogUIAdapters, String startDatePattern, String startTimePattern) throws IndexServiceException - Parameters:
request- The multipart request that should result in a newEventingestService- TheIngestServiceto use to ingestEventmedia.eventCatalogUIAdapters- The catalog ui adapters to use for getting the event metadata.startDatePattern- The pattern to use to parse the start date from the request.startTimePattern- The pattern to use to parse the start time from the request.- Returns:
- An
EventHttpServletRequestpopulated from the request. - Throws:
IndexServiceException- Thrown if unable to create the event for an internal reason.IllegalArgumentException- Thrown if the multi part request doesn't have the necessary data.
-
updateFromHttpServletRequest
public static EventHttpServletRequest updateFromHttpServletRequest(Event event, javax.servlet.http.HttpServletRequest request, List<EventCatalogUIAdapter> eventCatalogUIAdapters, String startDatePattern, String startTimePattern) throws IllegalArgumentException, IndexServiceException, NotFoundException Load the details of updating an event.- Parameters:
event- The event to update.request- The multipart request that has the data to load the updated event.eventCatalogUIAdapters- The list of catalog ui adapters to use to load the event metadata.startDatePattern- The pattern to use to parse the start date from the request.startTimePattern- The pattern to use to parse the start time from the request.- Returns:
- The data for the event update
- Throws:
IllegalArgumentException- Thrown if the request to update the event is malformed.IndexServiceException- Thrown if something is unable to load the event data.NotFoundException- Thrown if unable to find a metadata catalog or field that matches an input catalog or field.
-
deserializeJsonToAcl
protected static AccessControlList deserializeJsonToAcl(String json, boolean assumeAllow) throws org.json.simple.parser.ParseException De-serialize an JSON into anAccessControlList.- Parameters:
json- TheAccessControlListto serialize.assumeAllow- Assume that all entries are allows.- Returns:
- An
AccessControlListrepresentation of the Json - Throws:
org.json.simple.parser.ParseException
-
deserializeMetadataList
protected static MetadataList deserializeMetadataList(String json, List<EventCatalogUIAdapter> catalogAdapters, String startDatePattern, String startTimePattern) throws org.json.simple.parser.ParseException, NotFoundException, ParseException Change the simplified fields of key values provided to the external api into aMetadataList.- Parameters:
json- The json string that contains an array of metadata field lists for the different catalogs.startDatePattern- The pattern to use to parse the start date from the json payload.startTimePattern- The pattern to use to parse the start time from the json payload.- Returns:
- A
MetadataListwith the fields populated with the values provided. - Throws:
org.json.simple.parser.ParseException- Thrown if unable to parse the json string.NotFoundException- Thrown if unable to find the catalog or field that the json refers to.ParseException
-