gov.nasa.pds.harvest.ingest
Class RegistryIngester

java.lang.Object
  extended by gov.nasa.pds.harvest.ingest.RegistryIngester
All Implemented Interfaces:
gov.nasa.jpl.oodt.cas.filemgr.ingest.Ingester

public class RegistryIngester
extends Object
implements gov.nasa.jpl.oodt.cas.filemgr.ingest.Ingester

Class that supports ingestion of PDS4 products into the PDS registry.

Author:
mcayanan

Constructor Summary
RegistryIngester(String packageGuid)
          Default constructor.
RegistryIngester(String packageGuid, gov.nasa.pds.registry.client.SecurityContext securityContext, String user, String password)
          Constructor.
 
Method Summary
 gov.nasa.pds.registry.model.ExtrinsicObject getExtrinsic(URL registry, String lid, String version)
          Gets the extrinsic object with the given LID and VID.
 boolean hasAssociation(URL registry, gov.nasa.pds.registry.model.Association association)
          Determines if an association already exists in the registry.
 boolean hasProduct(URL registry, File productFile)
          Method not used at this time.
 boolean hasProduct(URL registry, String lid)
          Determines whether a product is already in the registry.
 boolean hasProduct(URL registry, String lid, String vid)
          Determines whether a version of a product is already in the registry.
 String ingest(URL registry, File sourceFile, gov.nasa.pds.registry.model.Association association, String targetReference)
          Ingests an association to the registry.
 String ingest(URL registry, File sourceFile, FileObject fileObject, gov.nasa.jpl.oodt.cas.metadata.Metadata met)
          Ingest the given file object to the registry.
 String ingest(URL registry, File prodFile, gov.nasa.jpl.oodt.cas.metadata.Metadata met)
          Ingests the product into the registry.
 String ingest(URL fmUrl, File prodFile, gov.nasa.jpl.oodt.cas.metadata.MetExtractor extractor, File metConfFile)
          Method not implemented at this time.
 void ingest(URL fmUrl, List<String> prodFiles, gov.nasa.jpl.oodt.cas.metadata.MetExtractor extractor, File metConfFile)
          Method not implemented at this time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryIngester

public RegistryIngester(String packageGuid)
Default constructor.

Parameters:
packageGuid - The GUID of the registry package to associate to the products being registered.

RegistryIngester

public RegistryIngester(String packageGuid,
                        gov.nasa.pds.registry.client.SecurityContext securityContext,
                        String user,
                        String password)
Constructor.

Parameters:
packageGuid - The GUID of the registry package to associate to the products being registered.
securityContext - An object containing keystore information.
user - An authorized user.
password - The password associated with the user.
Method Detail

hasProduct

public boolean hasProduct(URL registry,
                          File productFile)
                   throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.CatalogException
Method not used at this time.

Specified by:
hasProduct in interface gov.nasa.jpl.oodt.cas.filemgr.ingest.Ingester
Throws:
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.CatalogException

hasProduct

public boolean hasProduct(URL registry,
                          String lid)
                   throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.CatalogException
Determines whether a product is already in the registry.

Specified by:
hasProduct in interface gov.nasa.jpl.oodt.cas.filemgr.ingest.Ingester
Parameters:
registry - The URL to the registry service.
lid - The PDS4 logical identifier.
Returns:
'true' if the logical identifier was found in the registry. 'false' otherwise.
Throws:
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.CatalogException - exception ignored.

hasProduct

public boolean hasProduct(URL registry,
                          String lid,
                          String vid)
                   throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.CatalogException
Determines whether a version of a product is already in the registry.

Parameters:
registry - The URL to the registry service.
lid - The PDS4 logical identifier.
vid - The version of the product.
Returns:
'true' if the logical identifier and version was found in the registry.
Throws:
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.CatalogException - If an error occurred while talking to the ingester.

ingest

public String ingest(URL registry,
                     File prodFile,
                     gov.nasa.jpl.oodt.cas.metadata.Metadata met)
              throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException
Ingests the product into the registry.

Specified by:
ingest in interface gov.nasa.jpl.oodt.cas.filemgr.ingest.Ingester
Parameters:
registry - The URL to the registry service.
prodFile - The PDS4 product file.
met - The metadata to register.
Returns:
The URL of the registered product.
Throws:
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException - If an error occurred while ingesting the product.

ingest

public String ingest(URL registry,
                     File sourceFile,
                     FileObject fileObject,
                     gov.nasa.jpl.oodt.cas.metadata.Metadata met)
              throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException
Ingest the given file object to the registry.

Parameters:
registry - The url of the registry.
sourceFile - The source file of the file object.
fileObject - The file object to register.
met - The file object metadata.
Returns:
the guid of the registered file object.
Throws:
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException

ingest

public String ingest(URL registry,
                     File sourceFile,
                     gov.nasa.pds.registry.model.Association association,
                     String targetReference)
              throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException
Ingests an association to the registry.

Parameters:
registry - The url of the registry.
sourceFile - The source file.
association - The association to register.
targetReference - The lidvid of the target reference.
Returns:
A guid if the ingestion was successful.
Throws:
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException - If an error occurred while ingesting the association.

hasAssociation

public boolean hasAssociation(URL registry,
                              gov.nasa.pds.registry.model.Association association)
                       throws gov.nasa.pds.registry.exception.RegistryClientException
Determines if an association already exists in the registry.

Parameters:
association - The association.
Returns:
true if the association exists.
Throws:
gov.nasa.pds.registry.exception.RegistryClientException
gov.nasa.pds.registry.exception.RegistryServiceException

getExtrinsic

public gov.nasa.pds.registry.model.ExtrinsicObject getExtrinsic(URL registry,
                                                                String lid,
                                                                String version)
                                                         throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException
Gets the extrinsic object with the given LID and VID.

Parameters:
registry - The registry url.
lid - The LID to look up in the registry.
version - The version of the product to look up.
Returns:
The extrinsic object that matches the given LID and VID.
Throws:
gov.nasa.pds.registry.exception.RegistryClientException
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException

ingest

public String ingest(URL fmUrl,
                     File prodFile,
                     gov.nasa.jpl.oodt.cas.metadata.MetExtractor extractor,
                     File metConfFile)
              throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException
Method not implemented at this time.

Specified by:
ingest in interface gov.nasa.jpl.oodt.cas.filemgr.ingest.Ingester
Throws:
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException

ingest

public void ingest(URL fmUrl,
                   List<String> prodFiles,
                   gov.nasa.jpl.oodt.cas.metadata.MetExtractor extractor,
                   File metConfFile)
            throws gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException
Method not implemented at this time.

Specified by:
ingest in interface gov.nasa.jpl.oodt.cas.filemgr.ingest.Ingester
Throws:
gov.nasa.jpl.oodt.cas.filemgr.structs.exceptions.IngestException


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