dist1.acb.common.database
Class CBL

java.lang.Object
  extended bydist1.acb.common.database.CBL
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class CBL
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

CBL

Version:
$Revision: 1.2 $
Author:
Gergana Krumova
See Also:
Serialized Form

Field Summary
static byte BIT_INSYSTEM
          If a CBL is in system (is joined to the system), first bit of the corresponding state is 1
static byte BIT_PRIMARY
          If a CBL is primary, second bit of the corresponding state is 1
static byte STATE_BACKUP
          The CBL is backup (and online)
static byte STATE_OFFLINE
          The CBL is offline
static byte STATE_PRIMARY
          The CBL is primary (and online)
 
Constructor Summary
CBL(java.lang.String name, java.lang.String host, int port, byte state, int clientport, int adminport)
          Creates a new CBL object.
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
          Compare names of CBL's
 int getAdminport()
          Getter for property adminport.
 int getClientport()
          Getter for property clientport.
 java.lang.String getHost()
          Getter for property host.
 java.lang.String getName()
          Getter for property name.
 int getPort()
          Getter for property port.
 byte getState()
          Getter for property state.
 boolean isInSystem()
          Test the atribute state if the CBL in the system (is joined)
 boolean isPrimary()
          Test the atribute state if it is primary CBL
 void setAdminport(int adminport)
          Setter for property adminport.
 void setClientport(int clientport)
          Setter for property clientport.
 void setHost(java.lang.String host)
          Setter for property host.
 void setName(java.lang.String name)
          Setter for property name.
 void setPort(int port)
          Setter for property port.
 void setState(byte state)
          Setter for property state.
 java.lang.String toString()
          String representation of the object
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BIT_INSYSTEM

public static final byte BIT_INSYSTEM
If a CBL is in system (is joined to the system), first bit of the corresponding state is 1

See Also:
Constant Field Values

BIT_PRIMARY

public static final byte BIT_PRIMARY
If a CBL is primary, second bit of the corresponding state is 1

See Also:
Constant Field Values

STATE_PRIMARY

public static final byte STATE_PRIMARY
The CBL is primary (and online)

See Also:
Constant Field Values

STATE_BACKUP

public static final byte STATE_BACKUP
The CBL is backup (and online)

See Also:
Constant Field Values

STATE_OFFLINE

public static final byte STATE_OFFLINE
The CBL is offline

See Also:
Constant Field Values
Constructor Detail

CBL

public CBL(java.lang.String name,
           java.lang.String host,
           int port,
           byte state,
           int clientport,
           int adminport)
Creates a new CBL object.

Parameters:
name - Name of the CBL
host - Address of the CBL
port - Port of the CBL
state - State of the CBL
clientport - Port for ACBpoint's requests
adminport - Port for CBLcc's requests
Method Detail

setAdminport

public void setAdminport(int adminport)
Setter for property adminport.

Parameters:
adminport - New value of property adminport.

getAdminport

public int getAdminport()
Getter for property adminport.

Returns:
Value of property adminport.

setClientport

public void setClientport(int clientport)
Setter for property clientport.

Parameters:
clientport - New value of property clientport.

getClientport

public int getClientport()
Getter for property clientport.

Returns:
Value of property clientport.

setHost

public void setHost(java.lang.String host)
Setter for property host.

Parameters:
host - New value of property host.

getHost

public java.lang.String getHost()
Getter for property host.

Returns:
Value of property host.

isInSystem

public boolean isInSystem()
Test the atribute state if the CBL in the system (is joined)

Returns:
true if the server is in the system

setName

public void setName(java.lang.String name)
Setter for property name.

Parameters:
name - New value of property name.

getName

public java.lang.String getName()
Getter for property name.

Returns:
Value of property name.

setPort

public void setPort(int port)
Setter for property port.

Parameters:
port - New value of property port.

getPort

public int getPort()
Getter for property port.

Returns:
Value of property port.

isPrimary

public boolean isPrimary()
Test the atribute state if it is primary CBL

Returns:
true if the server is primary

setState

public void setState(byte state)
Setter for property state.

Parameters:
state - New value of property state.

getState

public byte getState()
Getter for property state.

Returns:
Value of property state.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Returns:
a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned

equals

public boolean equals(java.lang.Object obj)
Compare names of CBL's

Parameters:
obj - A CBL
Returns:
true, if obj in not null and obj instanceof CBL and ((CBL) obj).name.compareTo(name) == 0

toString

public java.lang.String toString()
String representation of the object

Returns:
The string


Copyright © 2004 Phoenix Team (CMU/AIT). All Rights Reserved.