com.arsdigita.web
Class Host

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.web.Host

public class Host
extends DomainObject

This class represents info about a single host running a server in a webapp cluster.


Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String ID
           
static String SERVER_NAME
           
static String SERVER_PORT
           
 
Fields inherited from class com.arsdigita.domain.DomainObject
versionId
 
Constructor Summary
protected Host()
           
  Host(DataObject dobj)
           
protected Host(String type)
           
 
Method Summary
static Host create(String serverName, int serverPort)
          Creates a new host
static Host findByServerName(String serverName)
          Find a Host object for a given server.
 BigDecimal getID()
           
 String getServerName()
           
 int getServerPort()
           
 URL getURL()
           
 URL getURL(String path, ParameterMap params)
           
 URL getURL(String scheme, String path, ParameterMap params)
           
 void initialize()
          Called from all of the DomainObject constructors to initalize or validate the new domain object or its encapsulated data object.
static Host retrieve(BigDecimal id)
          Retrieves the host with a given id
static Host retrieve(HttpHost hhost)
          Finds a host using fields from the given HttpHost.
static DomainCollection retrieveAll()
          Retrieves the collection of hosts associated with this server.
 void setServerName(String name)
           
 void setServerPort(int port)
           
 String toString()
          Return the OID plus the flags N,M,D,U depending on whether the object is new, modified, deleted, or unknown.
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, beforeSave, clear, delete, disconnect, equals, get, getBaseDataObjectType, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

ID

public static final String ID
See Also:
Constant Field Values

SERVER_NAME

public static final String SERVER_NAME
See Also:
Constant Field Values

SERVER_PORT

public static final String SERVER_PORT
See Also:
Constant Field Values
Constructor Detail

Host

protected Host()

Host

protected Host(String type)

Host

public Host(DataObject dobj)
Method Detail

initialize

public void initialize()
Description copied from class: DomainObject
Called from all of the DomainObject constructors to initalize or validate the new domain object or its encapsulated data object. This was introduced in order to support efficient validation of the encapsualted data object's type. If the validation is typically performed in class constructors, then redundant validation is performed in superclass constructors. This validation now occurs here.

Overrides:
initialize in class DomainObject

create

public static Host create(String serverName,
                          int serverPort)
Creates a new host

Parameters:
serverName - the fully qualified server hostname
serverPort - the HTTP port number

retrieve

public static Host retrieve(BigDecimal id)
Retrieves the host with a given id

Parameters:
id - the host id

retrieveAll

public static final DomainCollection retrieveAll()
Retrieves the collection of hosts associated with this server.

Returns:
A DomainCollection of Hosts; it cannot be null

retrieve

public static Host retrieve(HttpHost hhost)
Finds a host using fields from the given HttpHost.

Returns:
The Host that corresponds to hhost or null if the host is not found

findByServerName

public static Host findByServerName(String serverName)
Find a Host object for a given server.

Parameters:
serverName - the fully qualified host name, excluding port
Throws:
DataObjectNotFoundException - if no host exists with that name

getID

public BigDecimal getID()

getServerName

public String getServerName()

setServerName

public void setServerName(String name)

getServerPort

public int getServerPort()

setServerPort

public void setServerPort(int port)

toString

public String toString()
Description copied from class: DomainObject
Return the OID plus the flags N,M,D,U depending on whether the object is new, modified, deleted, or unknown. Unknown is for objects that have been invalidated.

Overrides:
toString in class DomainObject

getURL

public URL getURL()

getURL

public URL getURL(String path,
                  ParameterMap params)

getURL

public URL getURL(String scheme,
                  String path,
                  ParameterMap params)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC