Class ReplicaCatalog

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class ReplicaCatalog
    extends AbstractSiteData
    This data class describes the Replica Catalog associated with the site.
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Set<java.lang.String> mAliases
      Set of alias names to be used for lookup.
      protected java.util.Collection<Connection> mConnectionParams
      Collection of connection parameters to use for connecting to that replica catalog.
      protected java.lang.String mType
      The type of the replica catalog implementation to use.
      protected java.lang.String mURL
      The url for the catalog.
    • Constructor Summary

      Constructors 
      Constructor Description
      ReplicaCatalog()
      The default constrcutor.
      ReplicaCatalog​(java.lang.String url, java.lang.String type)
      The overloaded constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(SiteDataVisitor visitor)
      Accept the visitor
      void addAlias​(java.lang.String name)
      Adds an alias site handle.
      void addConnection​(Connection connection)
      Adds a connection parameter
      void clearAliases()
      Clears the aliases associates with the replica catalog.
      java.lang.Object clone()
      Returns the clone of the object.
      java.util.Iterator<java.lang.String> getAliasIterator()
      Returns an iterator to aliases associated with the site.
      java.util.Iterator<Connection> getConnectionIterator()
      Returns an iterator to connection params associated with the replica catalog.
      java.lang.String getType()
      Returns the type of replica catalog.
      java.lang.String getURL()
      Returns the url for the replica catalog.
      void initialize​(java.lang.String url, java.lang.String type)
      Initialize the class.
      void setType​(java.lang.String type)
      Sets the type of replica catalog.
      void setURL​(java.lang.String url)
      Sets the url for the replica catalog.
      void toXML​(java.io.Writer writer, java.lang.String indent)
      Writes out the xml description of the object.
      protected void writeAlias​(java.io.Writer writer, java.lang.String indent, java.lang.String value)
      Renders alias as xml
      • Methods inherited from class java.lang.Object

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

      • mURL

        protected java.lang.String mURL
        The url for the catalog.
      • mType

        protected java.lang.String mType
        The type of the replica catalog implementation to use.
      • mConnectionParams

        protected java.util.Collection<Connection> mConnectionParams
        Collection of connection parameters to use for connecting to that replica catalog.
      • mAliases

        protected java.util.Set<java.lang.String> mAliases
        Set of alias names to be used for lookup.
    • Constructor Detail

      • ReplicaCatalog

        public ReplicaCatalog()
        The default constrcutor.
      • ReplicaCatalog

        public ReplicaCatalog​(java.lang.String url,
                              java.lang.String type)
        The overloaded constructor.
        Parameters:
        url - the url for the replica catalog.
        type - the type of replica catalog.
    • Method Detail

      • initialize

        public void initialize​(java.lang.String url,
                               java.lang.String type)
        Initialize the class.
        Parameters:
        url - the url for the replica catalog.
        type - the type of replica catalog.
      • setURL

        public void setURL​(java.lang.String url)
        Sets the url for the replica catalog.
        Parameters:
        url - the url
      • getURL

        public java.lang.String getURL()
        Returns the url for the replica catalog.
        Returns:
        url
      • setType

        public void setType​(java.lang.String type)
        Sets the type of replica catalog.
        Parameters:
        type - the type of replica catalog.
      • getType

        public java.lang.String getType()
        Returns the type of replica catalog.
        Returns:
        type.
      • addAlias

        public void addAlias​(java.lang.String name)
        Adds an alias site handle.
        Parameters:
        name - the site handle to alias to.
      • addConnection

        public void addConnection​(Connection connection)
        Adds a connection parameter
        Parameters:
        connection - the connection parameter.
      • clearAliases

        public void clearAliases()
        Clears the aliases associates with the replica catalog.
      • getAliasIterator

        public java.util.Iterator<java.lang.String> getAliasIterator()
        Returns an iterator to aliases associated with the site.
        Returns:
        Iterator
      • getConnectionIterator

        public java.util.Iterator<Connection> getConnectionIterator()
        Returns an iterator to connection params associated with the replica catalog.
        Returns:
        Iterator
      • 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
      • writeAlias

        protected void writeAlias​(java.io.Writer writer,
                                  java.lang.String indent,
                                  java.lang.String value)
                           throws java.io.IOException
        Renders alias as xml
        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.
        value - the value to use.
        Throws:
        java.io.IOException - if something fishy happens to the stream.
      • accept

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