gov.nasa.pds.harvest.crawler.actions
Class AssociationPublisherAction

java.lang.Object
  extended by gov.nasa.jpl.oodt.cas.crawl.action.CrawlerAction
      extended by gov.nasa.pds.harvest.crawler.actions.AssociationPublisherAction
All Implemented Interfaces:
gov.nasa.jpl.oodt.cas.commons.spring.SpringSetIdInjectionType

public class AssociationPublisherAction
extends gov.nasa.jpl.oodt.cas.crawl.action.CrawlerAction

Class to publish associations to the PDS Registry Service upon successful ingestion of the product.

Author:
mcayanan

Field Summary
 
Fields inherited from class gov.nasa.jpl.oodt.cas.crawl.action.CrawlerAction
LOG, phases
 
Constructor Summary
AssociationPublisherAction(String registryUrl)
          Constructor.
AssociationPublisherAction(String registryUrl, String user, String token)
          Constructor.
 
Method Summary
 AssociationStats getAssociationStats()
           
 boolean performAction(File product, gov.nasa.jpl.oodt.cas.metadata.Metadata productMetadata)
          Publish the association.
 
Methods inherited from class gov.nasa.jpl.oodt.cas.crawl.action.CrawlerAction
getDescription, getId, getPhases, setDescription, setId, setPhases
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociationPublisherAction

public AssociationPublisherAction(String registryUrl)
                           throws RegistryClientException
Constructor.

Parameters:
registryUrl - The URL to the registry service.
Throws:
RegistryClientException

AssociationPublisherAction

public AssociationPublisherAction(String registryUrl,
                                  String user,
                                  String token)
                           throws RegistryClientException
Constructor.

Parameters:
registryUrl - The URL to the registry service.
user - Name of the user authorized to publish the associations.
token - A security token associated with the user.
Throws:
RegistryClientException
Method Detail

getAssociationStats

public AssociationStats getAssociationStats()
Returns:
the association statistics.

performAction

public boolean performAction(File product,
                             gov.nasa.jpl.oodt.cas.metadata.Metadata productMetadata)
                      throws gov.nasa.jpl.oodt.cas.crawl.structs.exceptions.CrawlerActionException
Publish the association.

Specified by:
performAction in class gov.nasa.jpl.oodt.cas.crawl.action.CrawlerAction
Parameters:
product - The file containing the associations.
productMetadata - The metadata associated with the given product.
Returns:
'true' if the associations were registered successfully.
Throws:
gov.nasa.jpl.oodt.cas.crawl.structs.exceptions.CrawlerActionException - If an error occured while performing this action.


Copyright © 2010-2011 Planetary Data System. All Rights Reserved.