Class GridGateway

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class GridGateway
    extends AbstractSiteData
    This class describes the Grid Gateway into a site.
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Field Detail

      • mType

        private GridGateway.TYPE mType
        The grid type associated with this instance.
      • mContact

        private java.lang.String mContact
        The contact string for the grid gateway.
      • mJobType

        private GridGateway.JOB_TYPE mJobType
        The type of jobs that this grid gateway can accept.
      • mOS

        private SysInfo.OS mOS
        An optional os type for the grid gateway.
      • mOSRelease

        private java.lang.String mOSRelease
        Optional information about the os release.
      • mOSVersion

        private java.lang.String mOSVersion
        Optional information about the version.
      • mGlibc

        private java.lang.String mGlibc
        Optional information about the glibc.
      • mIdleNodes

        private int mIdleNodes
        The number of idle nodes.
      • mTotalNodes

        private int mTotalNodes
        The number of total nodes
    • Constructor Detail

      • GridGateway

        public GridGateway()
        The default constructor.
      • GridGateway

        public GridGateway​(GridGateway.TYPE type,
                           java.lang.String contact,
                           GridGateway.SCHEDULER_TYPE scheduler)
        The overloaded constructor.
        Parameters:
        type - the type of grid gateway.
        contact - the contact string for it.
        scheduler - the underlying scheduler that it talks to.
    • Method Detail

      • setJobType

        public void setJobType​(GridGateway.JOB_TYPE type)
        Sets the type of jobs that run via this grid gateway.
        Parameters:
        type - the job type.
      • getJobType

        public GridGateway.JOB_TYPE getJobType()
        Returns the type of jobs that run via this grid gateway.
        Returns:
        the job type.
      • setType

        public void setType​(GridGateway.TYPE type)
        Sets the type of grid gateway.
        Parameters:
        type - the gateway type.
      • getType

        public GridGateway.TYPE getType()
        Returns the type of this grid gateway.
        Returns:
        the type of grid gateway
      • setContact

        public void setContact​(java.lang.String contact)
        Sets the contact string for the Grid gateway
        Parameters:
        contact - the contact string
      • getContact

        public java.lang.String getContact()
        Returns the contact string for the Grid gateway
        Returns:
        the contact string
      • setTotalNodes

        public void setTotalNodes​(java.lang.String num)
        Sets the number of total nodes that this grid gateway talks to.
        Parameters:
        num - the number of nodes.
      • setTotalNodes

        public void setTotalNodes​(int num)
        Sets the total number of nodes that this grid gateway talks to.
        Parameters:
        num - the number of nodes.
      • getTotalNodes

        public int getTotalNodes()
        Returns the total number of nodes that this grid gateway talks to. If they are not set then -1 is returned.
        Returns:
        the number of nodes, or -1 if not set.
      • setIdleNodes

        public void setIdleNodes​(java.lang.String num)
        Sets the number of idle nodes that this grid gateway talks to.
        Parameters:
        num - the number of nodes.
      • setIdleNodes

        public void setIdleNodes​(int num)
        Sets the number of idle nodes that this grid gateway talks to.
        Parameters:
        num - the number of nodes.
      • getIdleNodes

        public int getIdleNodes()
        Returns the total number of nodes that this grid gateway talks to. If they are not set then -1 is returned.
        Returns:
        the number of nodes, or -1 if not set.
      • setScheduler

        public void setScheduler​(java.lang.String value)
        Sets the the underlying scheduler that gateway talks to. In case the value does not match any of the predefined enumeration, the SCHEDULER_TYPE is set to Unknown.
        Parameters:
        value - the string value
        See Also:
        GridGateway.SCHEDULER_TYPE
      • setScheduler

        public void setScheduler​(GridGateway.SCHEDULER_TYPE scheduler)
        Sets the the underlying scheduler that gateway talks to.
        Parameters:
        scheduler - the scheduler.
      • getScheduler

        public GridGateway.SCHEDULER_TYPE getScheduler()
        Returns the the underlying scheduler that gateway talks to.
        Returns:
        the scheduler.
      • setOS

        public void setOS​(SysInfo.OS os)
        Sets the OS of the nodes that this grid gateway talks to.
        Parameters:
        os - the os
      • getOS

        public SysInfo.OS getOS()
        Returns the OS of the nodes that this grid gateway talks to.
        Returns:
        the os if set else null
      • setOSRelease

        public void setOSRelease​(java.lang.String release)
        Sets the OS release of the site.
        Parameters:
        release - the os releaseof the site.
      • getOSRelease

        public java.lang.String getOSRelease()
        Returns the OS release of the site.
        Returns:
        the OS
      • setOSVersion

        public void setOSVersion​(java.lang.String version)
        Sets the OS version of the site.
        Parameters:
        version - the os versionof the site.
      • getOSVersion

        public java.lang.String getOSVersion()
        Returns the OS version of the site.
        Returns:
        the OS
      • setGlibc

        public void setGlibc​(java.lang.String version)
        Sets the glibc version on the site.
        Parameters:
        version - the glibc version of the site.
      • getGlibc

        public java.lang.String getGlibc()
        Returns the glibc version of the site.
        Returns:
        the OS
      • setArchitecture

        public void setArchitecture​(SysInfo.Architecture arch)
        Sets the architecture of the nodes that this grid gateway talks to.
        Parameters:
        arch - the architecture of the nodes
      • getArchitecture

        public SysInfo.Architecture getArchitecture()
        Returns the architecture of the nodes that this grid gateway talks to.
        Returns:
        the architecture if set else null
      • toXML

        public void toXML​(java.io.Writer writer,
                          java.lang.String indent)
                   throws java.io.IOException
        Writes out the xml description of the object.
        Specified by:
        toXML in class AbstractSiteData
        Parameters:
        writer - is a Writer opened and ready for writing. This can also be a StringWriter for efficient output.
        indent - the indent to be used.
        Throws:
        java.io.IOException - if something fishy happens to the stream.
      • clone

        public java.lang.Object clone()
        Returns the clone of the object.
        Overrides:
        clone in class AbstractSiteData
        Returns:
        the clone
      • accept

        public void accept​(SiteDataVisitor visitor)
                    throws java.io.IOException
        Accepts a Site Data Visitor
        Specified by:
        accept in class AbstractSiteData
        Parameters:
        visitor -
        Throws:
        java.io.IOException - if something fishy happens to the stream.