Table of Contents

Class Lease

Namespace
Microsoft.ServiceBus.Messaging
Assembly
Microsoft.ServiceBus.dll

Contains partition ownership information.

public class Lease
Inheritance
Lease
Inherited Members

Constructors

Lease()

Initializes a new instance of the Lease class.

public Lease()

Lease(Lease)

Initializes a new instance of the Lease class with the specified Lease(Lease) value.

public Lease(Lease source)

Parameters

source Lease

The specified Lease(Lease) value.

Properties

Epoch

Gets or sets the epoch year of the lease, which is a value you can use to determine the most recent owner of a partition between competing nodes.

public long Epoch { get; set; }

Property Value

long

The epoch year of the lease.

Offset

Gets or sets the current value for the offset in the stream.

public string Offset { get; set; }

Property Value

string

The lease offset.

Owner

Gets or sets the host owner for the partition.

public string Owner { get; set; }

Property Value

string

The host owner of the partition.

PartitionId

Gets the ID of the partition to which this lease belongs.

public string PartitionId { get; set; }

Property Value

string

The partition identifier.

SequenceNumber

Gets or sets the last checkpointed sequence number in the stream.

public long SequenceNumber { get; set; }

Property Value

long

Returns long.

Token

Gets or sets the lease token that manages concurrency between hosts. You can use this token to guarantee single access to any resource needed by the IEventProcessor object.

public string Token { get; set; }

Property Value

string

The lease token.

Methods

Equals(object)

Determines whether this instance is equal to the specified object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare.

Returns

bool

true if this instance is equal to the specified object; otherwise, false.

GetHashCode()

Returns the hash code of the current instance.

public override int GetHashCode()

Returns

int

The hash code of the current instance.

IsExpired()

Determines whether the lease is expired.

public virtual bool IsExpired()

Returns

bool

true if the lease is expired; otherwise, false.