Package emissary.core

Class IBaseDataObjectHelper


  • public final class IBaseDataObjectHelper
    extends Object
    Utility methods that assist with working with IBaseDataObject's.
    • Method Detail

      • clone

        public static IBaseDataObject clone​(IBaseDataObject iBaseDataObject)
        Clones an IBaseDataObject.
        Parameters:
        iBaseDataObject - the IBaseDataObject to be cloned.
        Returns:
        the clone of the IBaseDataObject passed in.
      • clone

        @Deprecated
        public static IBaseDataObject clone​(IBaseDataObject iBaseDataObject,
                                            boolean fullClone)
        Deprecated.
        Clones an IBaseDataObject equivalently to emissary.core.BaseDataObject.clone(), which duplicates some attributes. A "fullClone" duplicates all attributes.
        Parameters:
        iBaseDataObject - the IBaseDataObject to be cloned.
        fullClone - specifies if all fields should be cloned.
        Returns:
        the clone of the IBaseDataObject passed in.
      • addParentInformationToChild

        public static void addParentInformationToChild​(IBaseDataObject parentIBaseDataObject,
                                                       IBaseDataObject childIBaseDataObject,
                                                       boolean nullifyFileType,
                                                       Set<String> alwaysCopyMetadataKeys,
                                                       String placeKey,
                                                       KffDataObjectHandler kffDataObjectHandler)
        Used to propagate needed parent information to a sprouted child. NOTE: This is taken from emissary.place.MultiFileServerPlace.
        Parameters:
        parentIBaseDataObject - the source of parameters to be copied
        childIBaseDataObject - the destination for parameters to be copied
        nullifyFileType - if true the child fileType is nullified after the copy
        alwaysCopyMetadataKeys - set of metadata keys to always copy from parent to child.
        placeKey - the place key to be added to the transform history.
        kffDataObjectHandler - the kffDataObjectHandler to use to create the kff hashes.
      • addParentInformationToChildren

        public static void addParentInformationToChildren​(IBaseDataObject parent,
                                                          @Nullable
                                                          List<IBaseDataObject> children,
                                                          boolean nullifyFileType,
                                                          Set<String> alwaysCopyMetadataKeys,
                                                          String placeKey,
                                                          KffDataObjectHandler kffDataObjectHandler)
        Used to propagate needed parent information to a sprouted child. NOTE: This is taken from emissary.place.MultiFileServerPlace.
        Parameters:
        parent - the source of parameters to be copied
        children - the destination for parameters to be copied
        nullifyFileType - if true the child fileType is nullified after the copy
        alwaysCopyMetadataKeys - set of metadata keys to always copy from parent to child.
        placeKey - the place key to be added to the transform history.
        kffDataObjectHandler - the kffDataObjectHandler to use to create the kff hashes.
      • addParentInformationToChildExcluding

        public static void addParentInformationToChildExcluding​(IBaseDataObject parentIBaseDataObject,
                                                                IBaseDataObject childIBaseDataObject,
                                                                Pattern excludedParametersPattern)
        Used to propagate needed parent metadata parameter information to a sprouted child except for those parameters whose names are specified in a regular expression pattern.
        Parameters:
        parentIBaseDataObject - the source of parameters to be copied
        childIBaseDataObject - the destination for parameters to be copied
        excludedParametersPattern - compiled regular expression specifying parameter names not to copy down
      • findPreferredDataByRegex

        public static byte[] findPreferredDataByRegex​(IBaseDataObject payload,
                                                      List<Pattern> preferredViewNamePatterns)
        Search for the first preferred view by regular expression or use the primary data if none match
        Parameters:
        payload - the payload to pull data from
        preferredViewNamePatterns - the list of referred view regular expression patterns (null returns data)
      • findPreferredData

        public static byte[] findPreferredData​(IBaseDataObject payload,
                                               List<String> preferredViews)
        Search for the first preferred view that is present or use the primary data if none
        Parameters:
        payload - the payload to pull data from
        preferredViews - the list of preferred views (null returns data)