Class TPT


  • public class TPT
    extends java.lang.Object
    A common class, that builds up the third party state for the sites from the properties file.
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  TPT.TPTState
      An inner class that holds the third party state for a particular site.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ALL_SITES
      The constant to apply to all sites.
      static java.lang.String ALL_TPT_PROPERTY
      The property name to get the sites for which all transfers need to be TPT.
      static java.lang.String ALL_TPT_REMOTE_PROPERTY
      The property name to get the sites for which all TPT transfers need to be executed on the remote site.
      static java.lang.String INTER_TPT_PROPERTY
      The property name to get the sites for which inter site transfers need to be TPT.
      static java.lang.String INTER_TPT_REMOTE_PROPERTY
      The property name to get the sites for which inter site TPT transfers need to be executed on the remote site.
      private LogManager mLogger
      The handle to the logging object.
      private static java.util.Map mPropertyTable
      An internal table that maps third party transfer type to the corresponding property.
      private PegasusProperties mProps
      The handle to the properties object holding the properties relevant to Pegasus.
      private java.util.Map mStateMap
      The map indexed by site name, that contains the state for all the sites.
      static java.lang.String STAGE_IN_TPT_PROPERTY
      The property name to get the sites for which stage-in transfers need to be TPT.
      static java.lang.String STAGE_IN_TPT_REMOTE_PROPERTY
      The property name to get the sites for which stage-in TPT transfers need to be executed on the remote site.
      static java.lang.String STAGE_OUT_TPT_PROPERTY
      The property name to get the sites for which stage-out transfers need to be TPT.
      static java.lang.String STAGE_OUT_TPT_REMOTE_PROPERTY
      The property name to get the sites for which stage-out TPT transfers need to be executed on the remote site.
    • Constructor Summary

      Constructors 
      Constructor Description
      TPT()
      The default constructor.
      TPT​(PegasusProperties properties)
      The overloaded constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void buildState()
      Builds up the third party state for all the sites.
      private void buildState​(int type)
      Adds to the existing state table, state information for a particular type of transfers.
      private boolean containsKey​(java.lang.String site)
      Returns whether there is an entry for a particular site or not.
      private TPT.TPTState get​(java.lang.String site)
      Returns the TPT state for a particular site.
      private java.util.Set getThirdPartySites​(java.lang.String value)
      Returns a set of third party sites.
      boolean interThirdParty​(java.lang.String site)
      Returns a boolean indicating whether to use third party transfers for inter site transfers or not.
      boolean interThirdPartyRemote​(java.lang.String site)
      Returns a boolean indicating whether to execute third party transfers for inter site on remote site or not.
      void print()
      Prints out the third party state for the various sites.
      private static java.util.Map propertyTable()
      Singleton access to the type table Contains the mapping of a property to the third party transfer type
      private void put​(java.lang.String site, TPT.TPTState state)
      Inserts an entry in to the State Map, that maintains state of various sites.
      boolean stageInThirdParty​(java.lang.String site)
      Returns a boolean indicating whether to use third party transfers for stage-in transfers or not.
      boolean stageInThirdPartyRemote​(java.lang.String site)
      Returns a boolean indicating whether to execute third party transfers for stage-in on remote site or not.
      boolean stageOutThirdParty​(java.lang.String site)
      Returns a boolean indicating whether to use third party transfers for stage-out transfers or not.
      boolean stageOutThirdPartyRemote​(java.lang.String site)
      Returns a boolean indicating whether to execute third party transfers for stage-out on remote site or not.
      • Methods inherited from class java.lang.Object

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

      • ALL_SITES

        public static final java.lang.String ALL_SITES
        The constant to apply to all sites.
        See Also:
        Constant Field Values
      • ALL_TPT_PROPERTY

        public static final java.lang.String ALL_TPT_PROPERTY
        The property name to get the sites for which all transfers need to be TPT.
        See Also:
        Constant Field Values
      • STAGE_IN_TPT_PROPERTY

        public static final java.lang.String STAGE_IN_TPT_PROPERTY
        The property name to get the sites for which stage-in transfers need to be TPT.
        See Also:
        Constant Field Values
      • INTER_TPT_PROPERTY

        public static final java.lang.String INTER_TPT_PROPERTY
        The property name to get the sites for which inter site transfers need to be TPT.
        See Also:
        Constant Field Values
      • STAGE_OUT_TPT_PROPERTY

        public static final java.lang.String STAGE_OUT_TPT_PROPERTY
        The property name to get the sites for which stage-out transfers need to be TPT.
        See Also:
        Constant Field Values
      • ALL_TPT_REMOTE_PROPERTY

        public static final java.lang.String ALL_TPT_REMOTE_PROPERTY
        The property name to get the sites for which all TPT transfers need to be executed on the remote site.
        See Also:
        Constant Field Values
      • STAGE_IN_TPT_REMOTE_PROPERTY

        public static final java.lang.String STAGE_IN_TPT_REMOTE_PROPERTY
        The property name to get the sites for which stage-in TPT transfers need to be executed on the remote site.
        See Also:
        Constant Field Values
      • INTER_TPT_REMOTE_PROPERTY

        public static final java.lang.String INTER_TPT_REMOTE_PROPERTY
        The property name to get the sites for which inter site TPT transfers need to be executed on the remote site.
        See Also:
        Constant Field Values
      • STAGE_OUT_TPT_REMOTE_PROPERTY

        public static final java.lang.String STAGE_OUT_TPT_REMOTE_PROPERTY
        The property name to get the sites for which stage-out TPT transfers need to be executed on the remote site.
        See Also:
        Constant Field Values
      • mPropertyTable

        private static java.util.Map mPropertyTable
        An internal table that maps third party transfer type to the corresponding property.
      • mProps

        private PegasusProperties mProps
        The handle to the properties object holding the properties relevant to Pegasus.
      • mLogger

        private LogManager mLogger
        The handle to the logging object.
      • mStateMap

        private java.util.Map mStateMap
        The map indexed by site name, that contains the state for all the sites.
    • Constructor Detail

      • TPT

        public TPT()
        The default constructor.
      • TPT

        public TPT​(PegasusProperties properties)
        The overloaded constructor.
        Parameters:
        properties - handle to the properties required.
    • Method Detail

      • propertyTable

        private static java.util.Map propertyTable()
        Singleton access to the type table Contains the mapping of a property to the third party transfer type
        Returns:
        map
      • buildState

        public void buildState()
        Builds up the third party state for all the sites. This reflects what is set in the properties file.
      • buildState

        private void buildState​(int type)
        Adds to the existing state table, state information for a particular type of transfers.
        Parameters:
        type - the type of transfer.
      • stageInThirdParty

        public boolean stageInThirdParty​(java.lang.String site)
        Returns a boolean indicating whether to use third party transfers for stage-in transfers or not.
        Returns:
        boolean
      • interThirdParty

        public boolean interThirdParty​(java.lang.String site)
        Returns a boolean indicating whether to use third party transfers for inter site transfers or not.
        Returns:
        boolean
      • stageOutThirdParty

        public boolean stageOutThirdParty​(java.lang.String site)
        Returns a boolean indicating whether to use third party transfers for stage-out transfers or not.
        Returns:
        boolean
      • stageInThirdPartyRemote

        public boolean stageInThirdPartyRemote​(java.lang.String site)
        Returns a boolean indicating whether to execute third party transfers for stage-in on remote site or not.
        Returns:
        boolean
      • interThirdPartyRemote

        public boolean interThirdPartyRemote​(java.lang.String site)
        Returns a boolean indicating whether to execute third party transfers for inter site on remote site or not.
        Returns:
        boolean
      • stageOutThirdPartyRemote

        public boolean stageOutThirdPartyRemote​(java.lang.String site)
        Returns a boolean indicating whether to execute third party transfers for stage-out on remote site or not.
        Returns:
        boolean
      • print

        public void print()
        Prints out the third party state for the various sites.
      • containsKey

        private boolean containsKey​(java.lang.String site)
        Returns whether there is an entry for a particular site or not.
        Parameters:
        site - the site handle for a site.
        Returns:
        boolean
      • put

        private void put​(java.lang.String site,
                         TPT.TPTState state)
        Inserts an entry in to the State Map, that maintains state of various sites.
        Parameters:
        site - the site handle for a site.
        state - the thirdparty state for the site.
      • get

        private TPT.TPTState get​(java.lang.String site)
        Returns the TPT state for a particular site.
        Parameters:
        site - the site handle for the site.
        Returns:
        state the third party state for the site if there is an entry, else null.
      • getThirdPartySites

        private java.util.Set getThirdPartySites​(java.lang.String value)
        Returns a set of third party sites. An empty set is returned if value is null.
        Parameters:
        value - the value in the properties file.
        Returns:
        Set containing the names of the pools.