Class TransformationCatalogEntry

  • All Implemented Interfaces:
    CatalogEntry

    public class TransformationCatalogEntry
    extends java.lang.Object
    implements CatalogEntry
    An object of this class corresponds to a tuple in the Transformation Catalog.
    Author:
    Gaurang Mehta
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String mName
      The logical mName of the transformation.
      private java.lang.String mNamespace
      The logical mNamespace of the transformation
      private Notifications mNotifications
      All the notifications associated with the job
      private java.lang.String mPFN
      The physical path on the resource for a particular arch, os and type.
      private Profiles mProfiles
      The profiles associated with the site.
      private java.lang.String mResourceID
      The Id of the resource on which the transformation is installed.
      private SysInfo mSysInfo
      The System Info for the transformation.
      private java.lang.String mVersion
      The mVersion of the transformation.
      private TCType type
      The type of transformation.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        TransformationCatalogEntry()
      The basic constructor
        TransformationCatalogEntry​(java.lang.String namespace, java.lang.String name, java.lang.String version)
      Optimized Constructor
      private TransformationCatalogEntry​(java.lang.String namespace, java.lang.String name, java.lang.String version, java.lang.String resourceID, java.lang.String physicalname, TCType type, Profiles profiles, SysInfo sysinfo)
      Overloaded constructor.
        TransformationCatalogEntry​(java.lang.String namespace, java.lang.String name, java.lang.String version, java.lang.String resourceid, java.lang.String physicalname, TCType type, java.util.List profiles, VDSSysInfo sysinfo)
      Optimized Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addNotification​(Invoke invoke)
      Adds a Invoke object correpsonding to a notification.
      void addNotifications​(Notifications invokes)
      Adds all the notifications passed to the underlying container.
      void addProfile​(Profile profile)
      Allows you to add one profile at a time to the transformation.
      void addProfiles​(Profiles profiles)
      Allows you to add one profile at a time to the transformation.
      void addProfiles​(java.util.List profiles)
      Allows you to add multiple profiles to the transformation.
      java.lang.Object clone()
      creates a new instance of this object and returns you it.
      boolean equals​(TransformationCatalogEntry entry)
      Compares two catalog entries for equality.
      java.lang.String getLogicalName()
      Returns the Name of the logical transformation.
      java.lang.String getLogicalNamespace()
      Returns the Namespace associated with the logical transformation.
      java.lang.String getLogicalTransformation()
      Gets the Fully Qualified Transformation mName in the format NS::Name:Ver.
      java.lang.String getLogicalVersion()
      Returns the mVersion of the logical transformation.
      Notifications getNotifications()
      Returns all the notifications associated with the job.
      java.util.Collection<Invoke> getNotifications​(Invoke.WHEN when)
      Returns a collection of all the notifications that need to be done for a particular condition
      java.lang.String getPhysicalTransformation()
      Returns the physical location of the transformation.
      java.util.List getProfiles()
      Returns the list of profiles associated with the transformation.
      java.util.List getProfiles​(java.lang.String namespace)
      Returns the profiles for a particular Namespace.
      java.lang.String getResourceId()
      Returns the resource where the transformation is located.
      SysInfo getSysInfo()
      Returns the System Information associated with the transformation.
      TCType getType()
      Returns the type of the transformation.
      VDSSysInfo getVDSSysInfo()
      Returns the System Information in the old VDS format associated with the transformation.
      private static java.lang.String joinLFN​(java.lang.String namespace, java.lang.String name, java.lang.String version)
      Joins the 3 components into a fully qualified logical mName of the format NS::NAME:VER
      void setLogicalName​(java.lang.String name)
      Set the logical mName of the transformation.
      void setLogicalNamespace​(java.lang.String namespace)
      Set the logical mNamespace of the transformation.
      void setLogicalTransformation​(java.lang.String logicaltransformation)
      Set the logical transformation with a fully qualified tranformation String of the format NS::NAME:Ver
      void setLogicalTransformation​(java.lang.String namespace, java.lang.String name, java.lang.String version)
      Set the logical transformation by providing the mNamespace, mName and mVersion as seperate strings.
      void setLogicalVersion​(java.lang.String version)
      Set the logical mVersion of the transformation.
      void setPhysicalTransformation​(java.lang.String physicalname)
      Set the physical location of the transformation.
      void setResourceId​(java.lang.String resourceid)
      Set the mResourceID where the transformation is available.
      void setSysInfo​(SysInfo sysinfo)
      Sets the system information for the entry.
      void setType​(TCType type)
      Set the type of the transformation.
      void setVDSSysInfo​(VDSSysInfo sysinfo)
      Set the System Information associated with the transformation.
      private static java.lang.String[] splitLFN​(java.lang.String logicaltransformation)
      Splits the full qualified logical transformation into its components.
      java.lang.String toString()
      gets the String mVersion of the data class
      java.lang.String toTCString()
      Prints out a TC file format String.
      java.lang.String toXML()
      Returns an xml output of the contents of the data class.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • mNamespace

        private java.lang.String mNamespace
        The logical mNamespace of the transformation
      • mVersion

        private java.lang.String mVersion
        The mVersion of the transformation.
      • mName

        private java.lang.String mName
        The logical mName of the transformation.
      • mResourceID

        private java.lang.String mResourceID
        The Id of the resource on which the transformation is installed.
      • mPFN

        private java.lang.String mPFN
        The physical path on the resource for a particular arch, os and type.
      • mProfiles

        private Profiles mProfiles
        The profiles associated with the site.
      • mSysInfo

        private SysInfo mSysInfo
        The System Info for the transformation.
      • type

        private TCType type
        The type of transformation. Takes one of the predefined enumerated type TCType.
      • mNotifications

        private Notifications mNotifications
        All the notifications associated with the job
    • Constructor Detail

      • TransformationCatalogEntry

        public TransformationCatalogEntry()
        The basic constructor
      • TransformationCatalogEntry

        public TransformationCatalogEntry​(java.lang.String namespace,
                                          java.lang.String name,
                                          java.lang.String version)
        Optimized Constructor
        Parameters:
        namespace - String
        name - String
        version - String
      • TransformationCatalogEntry

        public TransformationCatalogEntry​(java.lang.String namespace,
                                          java.lang.String name,
                                          java.lang.String version,
                                          java.lang.String resourceid,
                                          java.lang.String physicalname,
                                          TCType type,
                                          java.util.List profiles,
                                          VDSSysInfo sysinfo)
        Optimized Constructor
        Parameters:
        namespace - String
        name - String
        version - String
        resourceID - String
        physicalname - String
        type - TCType
        profiles - List
        sysinfo - VDSSysInfo
      • TransformationCatalogEntry

        private TransformationCatalogEntry​(java.lang.String namespace,
                                           java.lang.String name,
                                           java.lang.String version,
                                           java.lang.String resourceID,
                                           java.lang.String physicalname,
                                           TCType type,
                                           Profiles profiles,
                                           SysInfo sysinfo)
        Overloaded constructor.
        Parameters:
        namespace - the namespace
        name - the name
        version - the version
        resourceID - the site with which entry is associated
        physicalname - the pfn
        type - the type
        profiles - the profiles passed
        sysinfo - the SystemInformation
    • Method Detail

      • clone

        public java.lang.Object clone()
        creates a new instance of this object and returns you it. A shallow clone. TO DO : Gaurang correct the clone method.
        Overrides:
        clone in class java.lang.Object
        Returns:
        Object
      • toString

        public java.lang.String toString()
        gets the String mVersion of the data class
        Overrides:
        toString in class java.lang.Object
        Returns:
        String
      • toTCString

        public java.lang.String toTCString()
        Prints out a TC file format String.
        Returns:
        String
      • toXML

        public java.lang.String toXML()
        Returns an xml output of the contents of the data class.
        Returns:
        String
      • setLogicalTransformation

        public void setLogicalTransformation​(java.lang.String logicaltransformation)
        Set the logical transformation with a fully qualified tranformation String of the format NS::NAME:Ver
        Parameters:
        logicaltransformation - String
      • setLogicalTransformation

        public void setLogicalTransformation​(java.lang.String namespace,
                                             java.lang.String name,
                                             java.lang.String version)
        Set the logical transformation by providing the mNamespace, mName and mVersion as seperate strings.
        Parameters:
        mNamespace - String
        mName - String
        mVersion - String
      • setLogicalNamespace

        public void setLogicalNamespace​(java.lang.String namespace)
        Set the logical mNamespace of the transformation.
        Parameters:
        mNamespace - String
      • setLogicalName

        public void setLogicalName​(java.lang.String name)
        Set the logical mName of the transformation.
        Parameters:
        mName - String
      • setLogicalVersion

        public void setLogicalVersion​(java.lang.String version)
        Set the logical mVersion of the transformation.
        Parameters:
        mVersion - String
      • setResourceId

        public void setResourceId​(java.lang.String resourceid)
        Set the mResourceID where the transformation is available.
        Parameters:
        mResourceID - String
      • setType

        public void setType​(TCType type)
        Set the type of the transformation.
        Parameters:
        type - TCType
      • setPhysicalTransformation

        public void setPhysicalTransformation​(java.lang.String physicalname)
        Set the physical location of the transformation.
        Parameters:
        mPFN - String
      • setSysInfo

        public void setSysInfo​(SysInfo sysinfo)
        Sets the system information for the entry.
        Parameters:
        sysinfo - the System information
      • setVDSSysInfo

        public void setVDSSysInfo​(VDSSysInfo sysinfo)
        Set the System Information associated with the transformation.
        Parameters:
        sysinfo - VDSSysInfo
      • addNotification

        public void addNotification​(Invoke invoke)
        Adds a Invoke object correpsonding to a notification.
        Parameters:
        invoke - the invoke object containing the notification
      • addNotifications

        public void addNotifications​(Notifications invokes)
        Adds all the notifications passed to the underlying container.
        Parameters:
        invokes - the notifications to be added
      • getNotifications

        public java.util.Collection<Invoke> getNotifications​(Invoke.WHEN when)
        Returns a collection of all the notifications that need to be done for a particular condition
        Parameters:
        when - the condition
        Returns:
      • getNotifications

        public Notifications getNotifications()
        Returns all the notifications associated with the job.
        Returns:
        the notifications
      • addProfiles

        public void addProfiles​(Profiles profiles)
        Allows you to add one profile at a time to the transformation.
        Parameters:
        profile - Profile A single profile consisting of mNamespace, key and value
      • addProfile

        public void addProfile​(Profile profile)
        Allows you to add one profile at a time to the transformation.
        Parameters:
        profile - Profile A single profile consisting of mNamespace, key and value
      • addProfiles

        public void addProfiles​(java.util.List profiles)
        Allows you to add multiple profiles to the transformation.
        Parameters:
        profiles - List of Profile objects containing the profile information.
      • getLogicalTransformation

        public java.lang.String getLogicalTransformation()
        Gets the Fully Qualified Transformation mName in the format NS::Name:Ver.
        Returns:
        String
      • getLogicalNamespace

        public java.lang.String getLogicalNamespace()
        Returns the Namespace associated with the logical transformation.
        Returns:
        String Returns null if no mNamespace associated with the transformation.
      • getLogicalName

        public java.lang.String getLogicalName()
        Returns the Name of the logical transformation.
        Returns:
        String
      • getLogicalVersion

        public java.lang.String getLogicalVersion()
        Returns the mVersion of the logical transformation.
        Returns:
        String Returns null if no mVersion assocaited with the transformation.
      • getResourceId

        public java.lang.String getResourceId()
        Returns the resource where the transformation is located.
        Returns:
        String
      • getType

        public TCType getType()
        Returns the type of the transformation.
        Returns:
        TCType
      • getPhysicalTransformation

        public java.lang.String getPhysicalTransformation()
        Returns the physical location of the transformation.
        Returns:
        String
      • getSysInfo

        public SysInfo getSysInfo()
        Returns the System Information associated with the transformation.
        Returns:
        SysInfo
      • getVDSSysInfo

        public VDSSysInfo getVDSSysInfo()
        Returns the System Information in the old VDS format associated with the transformation.
        Returns:
        VDSSysInfo
      • getProfiles

        public java.util.List getProfiles()
        Returns the list of profiles associated with the transformation.
        Returns:
        List Returns null if no profiles associated.
      • getProfiles

        public java.util.List getProfiles​(java.lang.String namespace)
        Returns the profiles for a particular Namespace.
        Parameters:
        mNamespace - String The mNamespace of the profile
        Returns:
        List List of Profile objects. returns null if none are found.
      • joinLFN

        private static java.lang.String joinLFN​(java.lang.String namespace,
                                                java.lang.String name,
                                                java.lang.String version)
        Joins the 3 components into a fully qualified logical mName of the format NS::NAME:VER
        Parameters:
        mNamespace - String
        mName - String
        mVersion - String
        Returns:
        String
      • splitLFN

        private static java.lang.String[] splitLFN​(java.lang.String logicaltransformation)
        Splits the full qualified logical transformation into its components.
        Parameters:
        logicaltransformation - String
        Returns:
        String[]
      • equals

        public boolean equals​(TransformationCatalogEntry entry)
        Compares two catalog entries for equality.
        Parameters:
        entry - is the entry to compare with
        Returns:
        true if the entries match, false otherwise