gov.nasa.pds.registry.server.connection
Class ConnectionManager

java.lang.Object
  extended by gov.nasa.pds.registry.server.connection.ConnectionManager

public class ConnectionManager
extends Object

Manager to send and receive info from remote registry service. Note that connection to localhost is currently hard wired in.

Author:
jagander, hyunlee

Field Summary
static String DEFAULT_SERVICE_ENDPOINT
          Default location of service endpoint
static Logger logger
           
static Properties props
          Instance of applicaiton properties
static String PROPS_NAME
          Name of properties file that contains override for service endpoint
 
Constructor Summary
ConnectionManager()
           
 
Method Summary
static boolean deletePackage(ViewRegistryPackage registryPackage)
          Removes a RegistryPackage from the registry
static boolean deleteProduct(ViewProduct product)
          Removes an ExtrinsicObject from the registry
static List<ViewAssociation> getAssociations(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.AssociationFilter> query)
           
static ViewAssociations getAssociations(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.AssociationFilter> query, Integer start, Integer numResults)
          Retrieve associations from remote registry service.
static ViewClassificationNodes getClassificationNodes(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.ExtrinsicFilter> query, Integer start, Integer numResults)
          Retrieve classification nodes from remote registry service.
static ViewAuditableEvents getEvents(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.EventFilter> query, Integer start, Integer numResults)
          Retrieve events from remote registry service.
static ViewRegistryPackages getPackages(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.PackageFilter> query, Integer start, Integer numResults)
          Retrieve packages from remote registry service.
static ViewProduct getProduct(String guid)
          Retrieve a product from remote registry service.
static ViewProducts getProducts()
          Get products starting from the first record, with no filtering, the default sort and the default number of records.
static ViewProducts getProducts(Integer start)
          Get products starting from the given record number, with no filtering, the default sort and the default number of records.
static ViewProducts getProducts(Integer start, Integer numResults)
          Get products starting from the given record number and number of records.
static ViewProducts getProducts(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.ExtrinsicFilter> query, Integer start, Integer numResults)
          Retrieve products from remote registry service.
static Properties getProperties()
          Get an instance of the application properties.
static gov.nasa.pds.registry.client.RegistryClient getRegistry()
          Get instance of RegistryClient to work with REST interface of registry.
static List<String> getRegistryServices()
           
static ViewSchemes getSchemes(Integer start, Integer numResults)
          Retrieve schemes from remote registry service.
static ViewServices getServices(Integer start, Integer numResults)
          Retrieve services from remote registry service.
static StatusInformation getStatusInfo()
           
static void postArtifacts()
           
static void postRevision()
           
static void synch()
           
static boolean updatePackage(ViewRegistryPackage registryPackage)
          Updates the given RegistryPackage
static boolean updateProduct(ViewProduct product)
          Updates the given ExtrinsicObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SERVICE_ENDPOINT

public static final String DEFAULT_SERVICE_ENDPOINT
Default location of service endpoint

See Also:
Constant Field Values

PROPS_NAME

public static final String PROPS_NAME
Name of properties file that contains override for service endpoint

See Also:
Constant Field Values

props

public static Properties props
Instance of applicaiton properties


logger

public static Logger logger
Constructor Detail

ConnectionManager

public ConnectionManager()
Method Detail

synch

public static void synch()

getStatusInfo

public static StatusInformation getStatusInfo()

getProducts

public static ViewProducts getProducts()
Get products starting from the first record, with no filtering, the default sort and the default number of records.

See Also:
getProducts(RegistryQuery, Integer, Integer)

getProducts

public static ViewProducts getProducts(Integer start)
Get products starting from the given record number, with no filtering, the default sort and the default number of records.

Returns:
products from the given start
See Also:
getProducts(RegistryQuery, Integer, Integer)

getProducts

public static ViewProducts getProducts(Integer start,
                                       Integer numResults)
Get products starting from the given record number and number of records.

Returns:
given number of products from the given start
See Also:
getProducts(RegistryQuery, Integer, Integer)

getProducts

public static ViewProducts getProducts(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.ExtrinsicFilter> query,
                                       Integer start,
                                       Integer numResults)
Retrieve products from remote registry service. Note that this wraps the returned results in a view-only version of the products so that they may be used on the GWT client side.

Parameters:
query - a query object containing filter and search params for retrieving products
start - start index for retrieved results. Defaults to 1.
numResults - number of results to return. Defaults to 20.
Returns:
given number of products from the given start with the given filter conditions

getServices

public static ViewServices getServices(Integer start,
                                       Integer numResults)
Retrieve services from remote registry service. Note that this wraps the returned results in a view-only version of the services so that they may be used on the GWT client side.

Parameters:
start - start index for retrieved results. Defaults to 1.
numResults - number of results to return. Defaults to 20.
Returns:
given number of services from the given start

getSchemes

public static ViewSchemes getSchemes(Integer start,
                                     Integer numResults)
Retrieve schemes from remote registry service. Note that this wraps the returned results in a view-only version of the schemes so that they may be used on the GWT client side.

Parameters:
start - start index for retrieved results. Defaults to 1.
numResults - number of results to return. Defaults to 20.
Returns:
given number of schemes from the given start

getPackages

public static ViewRegistryPackages getPackages(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.PackageFilter> query,
                                               Integer start,
                                               Integer numResults)
Retrieve packages from remote registry service. Note that this wraps the returned results in a view-only version of the packages so that they may be used on the GWT client side.

Parameters:
start - start index for retrieved results. Defaults to 1.
numResults - number of results to return. Defaults to 20.
Returns:
given number of packages from the given start

updatePackage

public static boolean updatePackage(ViewRegistryPackage registryPackage)
Updates the given RegistryPackage

Parameters:
viewRegistryPackage - a RegistryPackage to update

updateProduct

public static boolean updateProduct(ViewProduct product)
Updates the given ExtrinsicObject

Parameters:
product - an ExtrinsicObject to update

deleteProduct

public static boolean deleteProduct(ViewProduct product)
Removes an ExtrinsicObject from the registry

Parameters:
product - an extrinsic object to remove

deletePackage

public static boolean deletePackage(ViewRegistryPackage registryPackage)
Removes a RegistryPackage from the registry

Parameters:
registryPackage - a RegistryPackage object to remove

getEvents

public static ViewAuditableEvents getEvents(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.EventFilter> query,
                                            Integer start,
                                            Integer numResults)
Retrieve events from remote registry service. Note that this wraps the returned results in a view-only version of the events so that they may be used on the GWT client side.

Parameters:
query - a query object containing filter and search params for retrieving events
start - start index for retrieved results. Defaults to 1.
numResults - number of results to return. Defaults to 20.
Returns:
given number of events from the given start with the given filter conditions

getProduct

public static ViewProduct getProduct(String guid)
Retrieve a product from remote registry service. Note that this wraps the returned results in a view-only version of the products so that they may be used on the GWT client side.

Parameters:
guid - global unique identifier
Returns:
a product with the given guid

getClassificationNodes

public static ViewClassificationNodes getClassificationNodes(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.ExtrinsicFilter> query,
                                                             Integer start,
                                                             Integer numResults)
Retrieve classification nodes from remote registry service. Note that this wraps the returned results in a view-only version of the classification nodes so that they may be used on the GWT client side.

Parameters:
guid - global unique identifier
Returns:
classification nodes with the given guid

getAssociations

public static List<ViewAssociation> getAssociations(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.AssociationFilter> query)

getAssociations

public static ViewAssociations getAssociations(gov.nasa.pds.registry.query.RegistryQuery<gov.nasa.pds.registry.query.AssociationFilter> query,
                                               Integer start,
                                               Integer numResults)
Retrieve associations from remote registry service. Note that this wraps the returned results in a view-only version of the associations so that they may be used on the GWT client side.

Parameters:
query - a query object containing filter and search params for retrieving associations
start - start index for retrieved results. Defaults to 1.
numResults - number of results to return. Defaults to 20.
Returns:
given number of associations from the given start with the given filter conditions

postArtifacts

public static void postArtifacts()

postRevision

public static void postRevision()

getRegistry

public static gov.nasa.pds.registry.client.RegistryClient getRegistry()
Get instance of RegistryClient to work with REST interface of registry. Instantiates if necessary.


getProperties

public static Properties getProperties()
Get an instance of the application properties.


getRegistryServices

public static List<String> getRegistryServices()


Copyright © 2010–2014 Planetary Data System. All rights reserved.