wt.clients.site
Class SiteInfoMaster

java.lang.Object
  extended bywt.clients.site.SiteInfoMaster

public class SiteInfoMaster
extends Object


Nested Class Summary
 class SiteInfoMaster.GUISite
           
 
Field Summary
private  Enumeration _hashEnumeration
           
private static Site _localSite
           
private  Hashtable _sitesHash
           
 
Constructor Summary
SiteInfoMaster()
           
 
Method Summary
 void addSite(String name, String url, WTUser user, String description, boolean isMaster, boolean isReplica, boolean isProdReplPeer)
          Add a site to the database
private  void addSiteToDB(Site theSite, boolean genKeys)
           
 void deleteSite(String siteName)
          Delete a site from the database
 byte[] exportKey(String siteName)
           
 void generateKeyPair(String siteName)
          Generate a pair of access keys for the site
 Enumeration getAllSites()
           
private static Site getLocalSite()
           
private  Site getSite(Long objID)
           
private  Site getSite(String siteName)
           
 SiteInfoMaster.GUISite getSiteByName(String siteName)
           
 String getSiteDesc(String siteName)
          Return the description for the site given the name
 long getSiteObjectID(String siteName)
          Return the internal object ID for the site
 void importKey(String siteName, byte[] keyArray)
           
private  void initSites()
           
 boolean isSiteLocal(Site theSite)
           
 boolean isSiteLocal(String siteName)
          Is the site local to this server?
 boolean isSiteReplicaOnly(String siteName)
           
 void printAllSites()
          Utility function to print a list of all existing sites to standard output.
 void reset()
           
 void updateSite(long siteID, String name, String url, WTUser user, String description, boolean isMaster, boolean isReplica, boolean isProdReplPeer)
          Add an existing site in the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sitesHash

private Hashtable _sitesHash

_hashEnumeration

private Enumeration _hashEnumeration

_localSite

private static Site _localSite
Constructor Detail

SiteInfoMaster

public SiteInfoMaster()
               throws WTException
Method Detail

getAllSites

public Enumeration getAllSites()

getSiteByName

public SiteInfoMaster.GUISite getSiteByName(String siteName)

getSiteDesc

public String getSiteDesc(String siteName)
Return the description for the site given the name

Returns:
description string for this site

getSiteObjectID

public long getSiteObjectID(String siteName)
Return the internal object ID for the site

Returns:
the object ID

generateKeyPair

public void generateKeyPair(String siteName)
                     throws WTException
Generate a pair of access keys for the site

Throws:
WTException

addSite

public void addSite(String name,
                    String url,
                    WTUser user,
                    String description,
                    boolean isMaster,
                    boolean isReplica,
                    boolean isProdReplPeer)
             throws WTException,
                    WTPropertyVetoException
Add a site to the database

Throws:
WTException
WTPropertyVetoException

updateSite

public void updateSite(long siteID,
                       String name,
                       String url,
                       WTUser user,
                       String description,
                       boolean isMaster,
                       boolean isReplica,
                       boolean isProdReplPeer)
                throws WTException,
                       WTPropertyVetoException
Add an existing site in the database

Throws:
WTException
WTPropertyVetoException

deleteSite

public void deleteSite(String siteName)
                throws WTException
Delete a site from the database

Throws:
WTException

addSiteToDB

private void addSiteToDB(Site theSite,
                         boolean genKeys)
                  throws WTException,
                         WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

importKey

public void importKey(String siteName,
                      byte[] keyArray)
               throws WTException
Throws:
WTException

exportKey

public byte[] exportKey(String siteName)
                 throws WTException
Throws:
WTException

printAllSites

public void printAllSites()
Utility function to print a list of all existing sites to standard output.


initSites

private void initSites()
                throws WTException
Throws:
WTException

reset

public void reset()
           throws WTException
Throws:
WTException

isSiteLocal

public boolean isSiteLocal(String siteName)
Is the site local to this server?

Returns:

isSiteLocal

public boolean isSiteLocal(Site theSite)

isSiteReplicaOnly

public boolean isSiteReplicaOnly(String siteName)

getLocalSite

private static Site getLocalSite()
                          throws WTException
Throws:
WTException

getSite

private Site getSite(String siteName)

getSite

private Site getSite(Long objID)