Esri Geoportal Server
1.0

com.esri.gpt.catalog.publication
Class ResourceProcessor

java.lang.Object
  extended by com.esri.gpt.catalog.publication.ResourceProcessor
Direct Known Subclasses:
AGSProcessor, SingleXmlProcessor

public abstract class ResourceProcessor
extends Object

Super-class for a processor that interacts with a resource for the express purpose of publishing metadata to the catalog.


Constructor Summary
ResourceProcessor(ProcessingContext context)
          Constructs with a supplied processing context.
 
Method Summary
protected  void collectExistingSourceURIs(String pattern, String pattern2)
          Collects document source URIs associated with a parent resource (SQL LIKE).
abstract  Query createQuery(IterationContext context, Criteria criteria)
          Creates iteration query.
protected  void deleteUnreferencedSourceURIs()
          Deletes catalog documents that are no longer referenced by the parent resource.
 ProcessingContext getContext()
          Gets the processing context.
abstract  Native getNativeResource(IterationContext context)
          Gets native resource.
 String getPublicationMethod()
          Gets the publication method.
abstract  void process()
          Invokes processing against the resource.
 void publishMetadata(String resourceUrl, String resourceXml)
          Publishes metadata associated with a resource.
 void publishMetadata(String resourceUrl, String resourceXml, String sourceUri)
          Publishes metadata associated with a resource.
 void setPublicationMethod(String method)
          Sets the publication method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceProcessor

public ResourceProcessor(ProcessingContext context)
Constructs with a supplied processing context.

Parameters:
context - the resource processing context
Method Detail

getContext

public ProcessingContext getContext()
Gets the processing context.

Returns:
the processing context

getPublicationMethod

public String getPublicationMethod()
Gets the publication method.

Returns:
the publication method

setPublicationMethod

public void setPublicationMethod(String method)
Sets the publication method.

Parameters:
method - the publication method

collectExistingSourceURIs

protected void collectExistingSourceURIs(String pattern,
                                         String pattern2)
                                  throws SQLException
Collects document source URIs associated with a parent resource (SQL LIKE).

Parameters:
pattern - the source URI pattern of the parent resource
pattern2 - optional secondary source URI pattern of the parent resource
Throws:
SQLException - if an exception occurs while communicating with the database

deleteUnreferencedSourceURIs

protected void deleteUnreferencedSourceURIs()
                                     throws SQLException,
                                            ImsServiceException,
                                            CatalogIndexException
Deletes catalog documents that are no longer referenced by the parent resource.
Deletion only occurs if at least one URI was processed during this request.

Throws:
SQLException - if an exception occurs while communicating with the database
ImsServiceException - if an exception occurs during delete
CatalogIndexException - if an exception occurs during delete

process

public abstract void process()
                      throws Exception
Invokes processing against the resource.

Throws:
Exception - if an exception occurs

createQuery

public abstract Query createQuery(IterationContext context,
                                  Criteria criteria)
Creates iteration query. Query is being used during synchronization.

Parameters:
context - iteration context
criteria - query criteria or null if no criteria
Returns:
query

getNativeResource

public abstract Native getNativeResource(IterationContext context)
Gets native resource. Native resource is a publishable resource created just for repository definition. Each native resource is Publishable and each repository has to be able to provide one.

Parameters:
context - iteration context
Returns:
native resource.

publishMetadata

public void publishMetadata(String resourceUrl,
                            String resourceXml)
                     throws Exception
Publishes metadata associated with a resource.

Parameters:
resourceUrl - the URL for the resource being published
resourceXml - the resource XML
Throws:
Exception - if an exception occurs

publishMetadata

public void publishMetadata(String resourceUrl,
                            String resourceXml,
                            String sourceUri)
                     throws Exception
Publishes metadata associated with a resource.

Parameters:
resourceUrl - the URL for the resource being published
resourceXml - the resource XML
sourceUri - a URI identifying the source
Throws:
Exception - if an exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.