net.conquiris.api.index
Class IndexReport

java.lang.Object
  extended by net.conquiris.api.index.IndexReport
All Implemented Interfaces:
IndexActiveFlag, IndexStartedFlag, IndexStatusProperty

@Immutable
public final class IndexReport
extends Object
implements IndexStatusProperty, IndexStartedFlag, IndexActiveFlag

Conquiris index report.

Author:
Andres Rodriguez

Field Summary
 
Fields inherited from interface net.conquiris.api.index.IndexStatusProperty
INDEX_STATUS
 
Fields inherited from interface net.conquiris.api.index.IndexStartedFlag
INDEX_STARTED
 
Fields inherited from interface net.conquiris.api.index.IndexActiveFlag
INDEX_ACTIVE
 
Method Summary
static IndexReport basic(boolean started, boolean active, IndexStatus status)
          Creates a new basic report.
static IndexReport detailed(boolean started, boolean active, IndexStatus status, Delays delays, IndexInfo info)
          Creates a new detailed report.
 boolean equals(Object obj)
           
 com.google.common.base.Optional<Delays> getDelays()
          Returns the index delay configuration.
 IndexStatus getIndexStatus()
          Returns the last known index status.
 com.google.common.base.Optional<IndexInfo> getInfo()
          Return the index info.
 IndexReportLevel getLevel()
          Returns the report level.
 int hashCode()
           
 boolean isIndexActive()
          Returns true if and only if the service is started and the current policy is to keep the index active.
 boolean isIndexStarted()
          Returns true if and only if the service is started.
static IndexReport normal(boolean started, boolean active, IndexStatus status, Delays delays, IndexInfo info)
          Creates a new normal report.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

basic

public static IndexReport basic(boolean started,
                                boolean active,
                                IndexStatus status)
Creates a new basic report.

Parameters:
started - Whether the index is started.
active - Whether the index is active. If started is false it will be set to false.
status - Last known index status.
Returns:
The created report.

normal

public static IndexReport normal(boolean started,
                                 boolean active,
                                 IndexStatus status,
                                 Delays delays,
                                 IndexInfo info)
Creates a new normal report.

Parameters:
started - Whether the index is started.
active - Whether the index is active. If started is false it will be set to false.
status - Last known index status.
delays - Index delay configuration.
info - Index info.
Returns:
The created report.

detailed

public static IndexReport detailed(boolean started,
                                   boolean active,
                                   IndexStatus status,
                                   Delays delays,
                                   IndexInfo info)
Creates a new detailed report.

Parameters:
started - Whether the index is started.
active - Whether the index is active. If started is false it will be set to false.
status - Last known index status.
delays - Index delay configuration.
info - Index info.
Returns:
The created report.

getLevel

public IndexReportLevel getLevel()
Returns the report level.


getIndexStatus

public IndexStatus getIndexStatus()
Description copied from interface: IndexStatusProperty
Returns the last known index status.

Specified by:
getIndexStatus in interface IndexStatusProperty

isIndexStarted

public boolean isIndexStarted()
Description copied from interface: IndexStartedFlag
Returns true if and only if the service is started.

Specified by:
isIndexStarted in interface IndexStartedFlag

isIndexActive

public boolean isIndexActive()
Description copied from interface: IndexActiveFlag
Returns true if and only if the service is started and the current policy is to keep the index active.

Specified by:
isIndexActive in interface IndexActiveFlag

getDelays

public com.google.common.base.Optional<Delays> getDelays()
Returns the index delay configuration. Absent in basic reports.


getInfo

public com.google.common.base.Optional<IndexInfo> getInfo()
Return the index info. Absent in basic reports and user properties included only in detailed reports.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 Derquinse Projects.. All Rights Reserved.