# Class QuorumPeer.QuorumServer

java.lang.Object
org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer

Enclosing class:
  `QuorumPeer`

public static class QuorumPeer.QuorumServer extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`MultipleAddresses`
`addr`
`InetSocketAddress`
`clientAddr`
`MultipleAddresses`
`electionAddr`
`String`
`hostname`
`long`
`id`
`boolean`
`isClientAddrFromStatic`
`QuorumPeer.LearnerType`
`type`

## Constructor Summary

Constructors
Constructor
Description
`QuorumServer(long sid, String addressStr)`
`QuorumServer(long id, InetSocketAddress addr)`
`QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr)`
`QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, InetSocketAddress clientAddr)`
`QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, InetSocketAddress clientAddr, QuorumPeer.LearnerType type)`
`QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, QuorumPeer.LearnerType type)`

## Method Summary

Modifier and Type
Method
Description
`void`
`checkAddressDuplicate(QuorumPeer.QuorumServer s)`
`static String`
`delimitedHostString(InetSocketAddress addr)`
`boolean`
`equals(Object o)`
`long`
`getId()`
`int`
`hashCode()`
`void`
`recreateSocketAddresses()`
Performs a DNS lookup for server address and election address.
`String`
`toString()`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### addr

public MultipleAddresses addr

### electionAddr

public MultipleAddresses electionAddr

### clientAddr

public InetSocketAddress clientAddr

### id

public long id

### hostname

public String hostname

### type

public QuorumPeer.LearnerType type

### isClientAddrFromStatic

public boolean isClientAddrFromStatic

## Constructor Details

### QuorumServer

public QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, InetSocketAddress clientAddr)

### QuorumServer

public QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr)

### QuorumServer

public QuorumServer(long id, InetSocketAddress addr)

### QuorumServer

public QuorumServer(long sid, String addressStr) throws QuorumPeerConfig.ConfigException

Throws:
  `QuorumPeerConfig.ConfigException`

### QuorumServer

public QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, QuorumPeer.LearnerType type)

### QuorumServer

public QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, InetSocketAddress clientAddr, QuorumPeer.LearnerType type)

## Method Details

### getId

public long getId()

### recreateSocketAddresses

public void recreateSocketAddresses()
Performs a DNS lookup for server address and election address. If the DNS lookup fails, this.addr and electionAddr remain unmodified.

### delimitedHostString

public static String delimitedHostString(InetSocketAddress addr)

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### checkAddressDuplicate

public void checkAddressDuplicate(QuorumPeer.QuorumServer s) throws KeeperException.BadArgumentsException

Throws:
  `KeeperException.BadArgumentsException`