From: Vásáry Dániel Date: Wed, 24 Jun 2020 13:13:21 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=6e801a07c01c249b31d15ee07cea09dfbbb77bac;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31866 --- diff --git a/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF b/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF index b147adf7..2c39e4bf 100644 --- a/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF +++ b/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF @@ -33,7 +33,6 @@ Export-Package: user.commons, user.commons.nexio.server.protocol, user.commons.nosql, user.commons.octopus, - user.commons.peablebeach, user.commons.rcc, user.commons.remotestore, user.commons.rest, diff --git a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MarinaAPI.wsdl b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MarinaAPI.wsdl deleted file mode 100644 index d35ffb38..00000000 --- a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MarinaAPI.wsdl +++ /dev/null @@ -1,1402 +0,0 @@ - - - - - - - - - - Conforms to type 'lastModifiedDateTimeRange'. - - - - - - - - - - The event id type can only be one of the valid listed types used in retrieval of events. - - - - - - - - - - - Valid position enums that can be used in an event id for event retrieval. - - - - - - - - - - The event id value can either be a specific UID or position enum. - - - - - - One or more of the configurable fields can be set.and are used to retrieve extra config information - - - - - - - - - - Specifies the component to retrieve the extra config from - - - - - - - - - - - - Container that encapsulates the request to "get config" message to send to API - - - - - - - - - - - - - - - - Container encapsulating the request to set config and response to the "getConfig" - - - - - - - - - - - - - - - - - - - - - - Conforms to type 'media'. - - - - - - - - - - Conforms to type 'config'. - - - - - - - - - - Conforms to type 'mediaUsageList' - - - - - - - - - - Conforms to type 'deleteMedia' - - - - - - - - - - Conforms to type 'media'. - - - - - - - - - - Conforms to type 'media'. - - - - - - - - - - Conforms to type 'media'. - - - - - - - - - - Conforms to type 'dateTimecodeRange'. - - - - - - - - - - Conforms to type 'dateTimecodeRange'. - - - - - - - - - - Conforms to type 'dateTimecodeRange'. - - - - - - - - - - Conforms to type 'mediaUsage'. - - - - - - - - - - Conforms to type 'MediaInstance'. - - - - - - - - - - - - - - - - - - Used to return information on available media. - - - - - Used to return information on unavailable media. - - - - - Heartbeat id used to track heartbeat responses. - - - - - String used to hold list name for list query commands. Can also be a channel name from which the active list will be used. - - - - - Event count of queried lists or number of events to return. - - - - - Event count of queried lists or number of events to return. - - - - - Event count of queried lists or number of events to return. - - - - - Event count of queried events with no aux xml to return. - - - - - Conforms to type 'playlistPrimaryEvent'. - - - - - - - - - - Position of the event to query. - - - - - Key of the event to query. - - - - - Container for an event list. - - - - - - - - - - Conforms to type 'job'. - - - - - - - - - - Conforms to type 'scheduled job'. - - - - - - - - - - Id of an automation job. - - - - - Id of a scheduled automation job. - - - - - Flag used to indicate there are more events after the last event in an event list returned by a call that returns multiple events. - - - - - Event id used to retrieve events. - - - - - Next event id returned by command. - - - - - A list of event ids. - - - - - - - - - - Container element for an event id list. - - - - - - - - - - Container for an event id list for events that have been deleted. - - - - - - - - - - Container for an event id list for events that have not been queried. - - - - - - - - - - For events that return event XML set this flag to true for child events to be returned. - - - - - Conforms to type 'componentTag'. - - - - - - - - - - For events that return component information set this flag to true to include active objects that aren't hosted. - - - - - Conforms to complex type 'componentList'. - - - - - - - - - - An enumeration of different update types performed on an event. - - - - - - - - - - - - - - Object containing all parameters returned by the getContiguousListEvents method. - - - - - - The number of events contained in the event list container. - - - - - A list of events returned using the passed in query parameters. - - - - - A flag to indicate whether there are more events available after the last event returned in the event list container. - - - - - The event id key for the next event in the list after the last event contained in the event list container. - - - - - - - - Object containing all parameters returned by the getNonContiguousListEvents method. - - - - - - A list of events returned using the passed in query parameters. - - - - - The number of events contained in the event list container. - - - - - A list of event id's for events that have been deleted from the list of events to query. - - - - - The number of events contained in the deleted events event id list container. - - - - - A list of event id's for events that were not queried this will always be a subset of the list of event id's passed in to query. - - - - - The number of events contained in the non-queried events event id list container. - - - - - - - - Object containing all parameters returned by the getListEventChanges method. - - - - - - A list of event id's for events that have changed and meet the filters provided. - - - - - The number of events contained in the returned event id list container. - - - - - - - - Object containing all parameters returned by the getListEventChangesAuxXML method. - - - - - - - - - - - - - When set to true we return back to the caller a list of all events that contained no aux xml. - - - - - Container element for a list of media items. - - - - - - - - - - - Container element for a list of jobs. - - - - - - - - - - - Container element for a list of scheduled jobs. - - - - - - - - - - - Container element for a media item relating to jobs. - - - - - - - - - - Container element for a media item relating to scheduled jobs. - - - - - - - - - - Container element for the get job request. - - - - - - - - - - Container element for the get scheduled job request. - - - - - - - - - - Container element for the get Custom View request. - - - - - - - - - - - - - - Contains a list of media from the get Custom View request. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Inserts or updates media and/or media instance metadata in the marina database. - - - - - Returns metadata for the specified media/media instances. See definition of pbs:media. -The media key must be specified and optionally media instance keys (mediaSets). -If no media instances are requested, metadata for all instances are returned. - - - - - Returns playout usage of the specified media. -The media key must be specified and optionally media instance keys (media sets). -If no instances are specified the usage of all instances of that media are returned. - - - - - Returns the playout usage for all media within a specified timecode range. - - - - - The heartbeat ID is client generated and is echoed back to the caller by the PBS API. - - - - - - - - - Returns the 'event' event with the queried event id and list. - - - - - Returns the 'playlistPrimaryEvent' event with an event id of 'eventKey' including the -next 'nEventCount' events in an 'eventList'. - - - - - Returns a list of events specified in 'eventIdList'. -Deleted/missing events are returned in the 'deletedEvents' eventIdList. -If more events are queried than the maximum configured amount then non-queried -events are returned in the 'nonQueriedEvents' eventIdList getNonContiguousListEvents -can then be called again passing in the list. When this list is empty all events were -queried. - - - - - Returns a list of event ids for all events that have changed in the specified list -between the specified dates/times filtered by an event type. -Note: It is possible this method will return more events than is supported by -getNonContiguousListEvents. - - - - - Returns a list of components that meet the filter requirements. - - - - - Returns the job id of the created/updated job on success. -Note: You must send the job uid on an update. - - - - - - Returns the job id of the created/updated scheduled job on success. - Note: You must send the job uid on an update. - - - - - - Delete a job using the id returned by 'insertUpdateJob'. - - - - - Delete a job using the id returned by 'insertUpdateJob'. - - - - - Delete a media instance (or multiple media instances). -The media key must be specified and optionally media instance keys (media sets). -If no instances are specified, all instances of that media will be deleted from all the media sets. - - - - - Return the updated jobs database auxillary XML. At the moment this is just used for -returning reconcile keys for a given list of deleted event UIDs. Events with no aux -xml stored for them can be returned by setting the include empty aux xml events flag -and will be returned in an event id list. - - - - - - - - - - - - - - - - - Returns a job list of all jobs whose state has changed between the dates/times. - - - - - Returns a job list of all scheduled jobs whose state has changed between the dates/times. - - - - - Returns a list of all the automation jobs and their current state relating to the media. - - - - - Returns a list of all the scheduled jobs and their current state relating to the media. - - - - - Returns the job with the queried job id and type. - - - - - Returns the scheduled job with the queried job id and type. - - - - - Returns metadata for the specified media instance. See definition of pbs:mediaInstance. -The media key must be specified and optionally media instance keys (mediaSets). -If no media instances are requested, metadata for all instances are returned. - - - - - Returns a medialist of rows returned by the specified custom view - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MediaUsageComparator.java b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MediaUsageComparator.java deleted file mode 100644 index 56451493..00000000 --- a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MediaUsageComparator.java +++ /dev/null @@ -1,42 +0,0 @@ -package user.commons.peablebeach; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -import pb.wsclient.MediaInstanceUsage; -import pb.wsclient.MediaUsage; -import pb.wsclient.MediaUsage.MediaInstancesUsage; - -class MediaUsageComparator implements Comparator { - - //Compares its two arguments for order. - @Override - public int compare(MediaUsage mu1, MediaUsage mu2) { - String mu1FirstTime = getEarliestUsageTime(mu1); - String mu2FirstTime = getEarliestUsageTime(mu2); - return mu1FirstTime.compareTo(mu2FirstTime); - } - - //Indicates whether some other object is "equal to" this comparator. - @Override - public boolean equals(Object obj) { - return false; - } - - private String getEarliestUsageTime(MediaUsage mu) { - MediaInstancesUsage muUsage = mu.getMediaInstancesUsage(); - List muUsageList = muUsage.getMediaInstanceUsage(); - List sortedEarliest = new ArrayList(); - for (MediaInstanceUsage usage : muUsageList) { - sortedEarliest.add(usage.getEarliestUsageTime()); - } - Collections.sort(sortedEarliest); - if (sortedEarliest.size() > 0) { - return sortedEarliest.get(0); - } else { - return null; - } - } -} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/PBMissingMaterialSrc.java b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/PBMissingMaterialSrc.java deleted file mode 100644 index 860d13a5..00000000 --- a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/PBMissingMaterialSrc.java +++ /dev/null @@ -1,202 +0,0 @@ -package user.commons.peablebeach; - -//import pb.wsclient; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Date; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; - -import javax.xml.ws.BindingProvider; - -import org.apache.commons.lang.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import pb.wsclient.DateTimecodeRange; -import pb.wsclient.DateTimecodeRangeContainer; -import pb.wsclient.GetCustomViewRequestContainer; -import pb.wsclient.GetCustomViewResponseContainer; -import pb.wsclient.Media; -import pb.wsclient.MediaList; -import pb.wsclient.MediaType; -import pb.wsclient.MediaUsage; -import pb.wsclient.MediaUsageList; -import pb.wsclient.MediaUsageListContainer; -import pb.wsclient.PBClientTest; -import pb.wsclient.PBSMarinaAPI; -import pb.wsclient.PBSMarinaAPIService; - -/** - * PebbleBeach missing material source. Soap ws hivasokkal kerdezi le a hianyzo allomanyokat. - */ -public class PBMissingMaterialSrc { - private static final Logger logger = LogManager.getLogger(); - private SimpleDateFormat sdf_range = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:'00'"); - private URL wsdlURL = null; - private PBSMarinaAPI primaryMarinaAPI = null; - private PBSMarinaAPI secondaryMarinaAPI = null; - private int rangeForwardHours = 24; - - private PBSMarinaAPI createPBMarinaAPI(String endPointUrl, URL wsdlURL, String soapUserId, String soapUserPassword) throws Exception { - PBSMarinaAPIService api = new PBSMarinaAPIService(wsdlURL); - PBSMarinaAPI bpsPort = api.getPBSMarinaAPISOAPPort(); - BindingProvider bindingProvider = (BindingProvider) bpsPort; - - Map context = bindingProvider.getRequestContext(); - context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endPointUrl); - - if (StringUtils.isNotBlank(soapUserId) && StringUtils.isNotBlank(soapUserPassword)) { - context.put(BindingProvider.USERNAME_PROPERTY, soapUserId); //pbs - context.put(BindingProvider.PASSWORD_PROPERTY, soapUserPassword); //pbs - } - return bpsPort; - } - - /*** - * A PeableBeach altal lehetseges missing material statuszu mediak nevei, amik nincsenek a BeachPool-ban - * - * @param poolContent - * Egyszintu BeachPool lista - * @throws Exception - */ - public LinkedHashSet getPossibelMissingMaterialNames(List poolContent) throws Exception { - //get sortable - List sortedMediaUsages = querySortableMedias(); - //sort by earliestusagetime - Collections.sort(sortedMediaUsages, new MediaUsageComparator()); - //normalize - LinkedHashSet result = normalizeName(sortedMediaUsages); - //collect more - LinkedHashSet otherMedias = queryOtherMedias(result); - result.addAll(otherMedias); - //get only realy missing - if (poolContent != null) - result.removeAll(poolContent); - return result; - - } - - public void init(String primaryEndPoint, String primaryUserName, String primaryPassword, String secondaryEndPoint, String secondaryUserName, - String secondaryPassword, int rangeForwardHours) throws Exception { - this.wsdlURL = PBClientTest.class.getClassLoader().getResource("MarinaAPI.wsdl"); - this.primaryMarinaAPI = createPBMarinaAPI(primaryEndPoint, this.wsdlURL, primaryUserName, primaryPassword); - if (StringUtils.isNotBlank(secondaryEndPoint)) - this.secondaryMarinaAPI = createPBMarinaAPI(secondaryEndPoint, this.wsdlURL, secondaryUserName, secondaryPassword); - - this.rangeForwardHours = rangeForwardHours; - } - - /*** - * A nem ures media neveket kisbetusse konvertalja - * - * @param mediaUsages - * @return - */ - private LinkedHashSet normalizeName(List mediaUsages) { - LinkedHashSet result = new LinkedHashSet(); - for (MediaUsage mediaUsage : mediaUsages) { - String name = normalizeName(mediaUsage.getMediaName()); - if (StringUtils.isNotBlank(name)) - result.add(name); - } - return result; - } - - private String normalizeName(String mediaName) { - String result = null; - if (StringUtils.isNotBlank(mediaName)) { - result = mediaName.trim().toLowerCase(); - } - return result; - } - - private LinkedHashSet queryOtherMedias(LinkedHashSet missingMediaFileNames) throws Exception { - - LinkedHashSet ret = new LinkedHashSet(); - - //SOAP Request - GetCustomViewRequestContainer cvReqContainer = new GetCustomViewRequestContainer(); - GetCustomViewRequestContainer.MarinaCustomAPI customApi = new GetCustomViewRequestContainer.MarinaCustomAPI(); - cvReqContainer.setMarinaCustomAPI(customApi); - customApi.setView("cxvMissingMediaPlaylistCache"); //config +++++ - - GetCustomViewResponseContainer cvContainer = null; - try { - //call ws - cvContainer = primaryMarinaAPI.getCustomView(cvReqContainer); - } catch (Exception e) { - logger.error("", e); - if (secondaryMarinaAPI != null) { - cvContainer = secondaryMarinaAPI.getCustomView(cvReqContainer); - } - } - - //remove existing media files from list - if (cvContainer != null) { - MediaList mediaList = cvContainer.getMediaList(); - if (mediaList != null) { - for (Media media : mediaList.getMedia()) { - //CI12345 -> ci12345.mxf - String mediaName = media.getMediaName(); - - if (StringUtils.isNotBlank(mediaName)) { - mediaName = normalizeName(mediaName); - if (!missingMediaFileNames.contains(mediaName)) { - ret.add(mediaName); - } - } else { - logger.error("PBMissingMaterialSrc.getCustomViewMediaList empty filename: " + media.getMediaName()); - } - - } - } - } - return ret; - } - - private List querySortableMedias() throws Exception { - List result = new ArrayList(); - - DateTimecodeRangeContainer rangec = new DateTimecodeRangeContainer(); - DateTimecodeRange range = new DateTimecodeRange(); - - long now = System.currentTimeMillis(); - Calendar cal = Calendar.getInstance(); - cal.setTimeInMillis(now); - cal.add(Calendar.HOUR_OF_DAY, this.rangeForwardHours); //24 - - String fromDateStr = sdf_range.format(new Date(now)); - String toDateStr = sdf_range.format(cal.getTime()); - - //1. SOAP query missing media list - - range.setStart(fromDateStr); //now "2019-03-26T10:00:00:00" - range.setEnd(toDateStr); //now + x hours "2019-03-29T10:00:00:00" - rangec.setDateTimecodeRange(range); - - MediaUsageListContainer mulc = null; - try { - mulc = primaryMarinaAPI.getMediaUsageByUTRange(rangec, false, true); - } catch (Exception e) { - logger.error("", e); - if (secondaryMarinaAPI != null) { - mulc = secondaryMarinaAPI.getMediaUsageByUTRange(rangec, false, true); - } - } - - MediaUsageList mul = mulc.getMediaUsageList(); - - List mediaList = mul.getMediaUsage(); - for (MediaUsage mu : mediaList) { - if (MediaType.VIDEO.equals(mu.getMediaType())) - result.add(mu); - } - return result; - } - -}