edu.ucsb.nceas.metacat.replication

## Class ReplicationServerList

- java.lang.Object
- - edu.ucsb.nceas.metacat.replication.ReplicationServerList

-     public class ReplicationServerList
      extends java.lang.Object

  A class represent a replication server list in xml_replcation table

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReplicationServerList()` constructor of ReplicationServerList It will build server list.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addToServerListIfItIsNot(java.lang.String givenServerName)` To a given server name, to check if it is in the server list.
    `boolean` | `getDataReplicationValue(java.lang.String givenServerName)` To a given server name, try to get its data file replciation option If couldn't find the server in the server list, false will return
    `boolean` | `getHubValue(java.lang.String givenServerName)` To a given server name, try to get its hub option If couldn't find the server in the server list, false will return
    `java.util.Date` | `getLastCheckedDate(java.lang.String givenServerName)` To a given server name, try to get its lastcheck date.
    `boolean` | `getReplicationValue(java.lang.String givenServerName)` To a given server name, try to get its xml replciation option If couldn't find the server in the server list, false will return
    `boolean` | `isEmpty()` Method to determine the server list is empty or not
    `boolean` | `isGivenServerInList(java.lang.String givenServerName)` Method to determine if a given server in the replication server list
    `ReplicationServer` | `serverAt(int index)` Method to get a server object given a index number
    `int` | `size()` Method to get the size of serverList

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReplicationServerList

          public ReplicationServerList()

      constructor of ReplicationServerList It will build server list. If only local host exists, ther server list will be null

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty()

      Method to determine the server list is empty or not

    - #### size

          public int size()

      Method to get the size of serverList

    - #### serverAt

          public ReplicationServer serverAt(int index)

      Method to get a server object given a index number
      Parameters:
        `index,` - the given index number

    - #### isGivenServerInList

          public boolean isGivenServerInList(java.lang.String givenServerName)

      Method to determine if a given server in the replication server list
      Parameters:
        `givenServerName,` - a server name will be check.

    - #### getLastCheckedDate

          public java.util.Date getLastCheckedDate(java.lang.String givenServerName)

      To a given server name, try to get its lastcheck date. If couldn't find the server in the server list, null will return
      Parameters:
        `givenServerName,` - the server's name which we want to get last checked out date

    - #### getReplicationValue

          public boolean getReplicationValue(java.lang.String givenServerName)

      To a given server name, try to get its xml replciation option If couldn't find the server in the server list, false will return
      Parameters:
        `givenServerName,` - the server's name which we want to get replication value

    - #### getDataReplicationValue

          public boolean getDataReplicationValue(java.lang.String givenServerName)

      To a given server name, try to get its data file replciation option If couldn't find the server in the server list, false will return
      Parameters:
        `givenServerName,` - the server's name which we want to get data file replication value

    - #### getHubValue

          public boolean getHubValue(java.lang.String givenServerName)

      To a given server name, try to get its hub option If couldn't find the server in the server list, false will return
      Parameters:
        `givenServerName,` - the server's name which we want to get hub

    - #### addToServerListIfItIsNot

          public void addToServerListIfItIsNot(java.lang.String givenServerName)

      To a given server name, to check if it is in the server list. If it is not, add it to server list and the xml_replication table This method is for a document was replicated by a hub and the document's home server is not in the replication table. The value for replicate, datareplicate and hub are all false
      Parameters:
        `givenServerName,` - the server's name which want to check

Copyright © 2020 Regents of the University of California. All Rights Reserved.