edu.isi.pegasus.planner.catalog.site.impl
Class VORS

java.lang.Object
  extended by edu.isi.pegasus.planner.catalog.site.impl.VORS
All Implemented Interfaces:
Catalog, SiteCatalog

public class VORS
extends Object
implements SiteCatalog

The VORS implementation of the Site Catalog interface.

Author:
Atul Kumara, Karan Vahi

Field Summary
static String DEFAULT_VORS_HOST
          The default VORS mVORSHost.
static String DEFAULT_VORS_PORT
          The default VORS mVORSPort.
private  String mGRID
          The Grid for which information is required.
private  LogManager mLogger
          The handle to the log manager.
private  SiteStore mSiteStore
          The SiteStore object where information about the sites is stored.
private  String mVO
          The VO to which the user belongs to.
private  Map<String,VORSVOInfo> mVOInfo
           
private  String mVORSHost
          The mVORSHost where VORS is running.
private  String mVORSPort
          The VORS mVORSPort.
 
Fields inherited from interface edu.isi.pegasus.planner.catalog.SiteCatalog
c_prefix, VERSION
 
Fields inherited from interface edu.isi.pegasus.planner.catalog.Catalog
DB_ALL_PREFIX
 
Constructor Summary
VORS()
          The default constructor.
 
Method Summary
 void close()
          Explicitely free resources before the garbage collection hits.
 boolean connect(Properties props)
          Establishes a link between the implementation and the thing the implementation is build upon.
 int insert(SiteCatalogEntry entry)
          Inserts a new mapping into the Site catalog.
 boolean isClosed()
          Predicate to check, if the connection with the catalog's implementation is still active.
 Set<String> list()
          Lists the site handles for all the sites in the Site Catalog.
 int load(List<String> sites)
          Loads up the Site Catalog implementation with the sites whose site handles are specified.
 SiteCatalogEntry lookup(String handle)
          Retrieves the SiteCatalogEntry for a site.
 int remove(String handle)
          Removes a site catalog entry matching the the handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VORS_HOST

public static final String DEFAULT_VORS_HOST
The default VORS mVORSHost.

See Also:
Constant Field Values

DEFAULT_VORS_PORT

public static final String DEFAULT_VORS_PORT
The default VORS mVORSPort.

See Also:
Constant Field Values

mSiteStore

private SiteStore mSiteStore
The SiteStore object where information about the sites is stored.


mVOInfo

private Map<String,VORSVOInfo> mVOInfo

mVORSHost

private String mVORSHost
The mVORSHost where VORS is running.


mVORSPort

private String mVORSPort
The VORS mVORSPort.


mVO

private String mVO
The VO to which the user belongs to.


mGRID

private String mGRID
The Grid for which information is required.


mLogger

private LogManager mLogger
The handle to the log manager.

Constructor Detail

VORS

public VORS()
The default constructor.

Method Detail

insert

public int insert(SiteCatalogEntry entry)
           throws SiteCatalogException
Description copied from interface: SiteCatalog
Inserts a new mapping into the Site catalog.

Specified by:
insert in interface SiteCatalog
Parameters:
entry - the SiteCatalogEntry object that describes a site.
Returns:
number of insertions, should always be 1. On failure, throw an exception, don't use zero.
Throws:
SiteCatalogException - in case of error.

list

public Set<String> list()
                 throws SiteCatalogException
Description copied from interface: SiteCatalog
Lists the site handles for all the sites in the Site Catalog.

Specified by:
list in interface SiteCatalog
Returns:
A set of site handles.
Throws:
SiteCatalogException - in case of error.

load

public int load(List<String> sites)
         throws SiteCatalogException
Description copied from interface: SiteCatalog
Loads up the Site Catalog implementation with the sites whose site handles are specified. This is a convenience method, that can allow the backend implementations to maintain soft state if required. If the implementation chooses not to implement this, just do an empty implementation. The site handle * is a special handle designating all sites are to be loaded.

Specified by:
load in interface SiteCatalog
Parameters:
sites - the list of sites to be loaded.
Returns:
the number of sites loaded.
Throws:
SiteCatalogException - in case of error.

lookup

public SiteCatalogEntry lookup(String handle)
                        throws SiteCatalogException
Description copied from interface: SiteCatalog
Retrieves the SiteCatalogEntry for a site.

Specified by:
lookup in interface SiteCatalog
Parameters:
handle - the site handle / identifier.
Returns:
SiteCatalogEntry in case an entry is found , or null if no match is found.
Throws:
SiteCatalogException - in case of error.

remove

public int remove(String handle)
           throws SiteCatalogException
Description copied from interface: SiteCatalog
Removes a site catalog entry matching the the handle.

Specified by:
remove in interface SiteCatalog
Parameters:
handle - the site handle / identifier.
Returns:
the number of removed entries.
Throws:
SiteCatalogException - in case of error.

close

public void close()
Description copied from interface: Catalog
Explicitely free resources before the garbage collection hits.

Specified by:
close in interface Catalog

connect

public boolean connect(Properties props)
Description copied from interface: Catalog
Establishes a link between the implementation and the thing the implementation is build upon.

FIXME: The cause for failure is lost without exceptions.

Specified by:
connect in interface Catalog
Parameters:
props - contains all necessary data to establish the link.
Returns:
true if connected now, or false to indicate a failure.

isClosed

public boolean isClosed()
Description copied from interface: Catalog
Predicate to check, if the connection with the catalog's implementation is still active. This helps determining, if it makes sense to call close().

Specified by:
isClosed in interface Catalog
Returns:
true, if the implementation is disassociated, false otherwise.
See Also:
Catalog.close()


Copyright © 2011 The University of Southern California. All Rights Reserved.