OracleAS Syndication Services API Reference
10g (9.0.4)

Part No. B10399-01

oracle.syndicate.server.cp
Interface CPAdaptor


public interface CPAdaptor

Content Provider Adaptors (CPAdaptor and also referred as Content Connectors) are software components used by Syndication Services to access external content repositories. CPAdaptor is the interface to be implemented by those classes which want to serve as content connectors for Syndication Services. CPAdaptor implementations can be seen as drivers to access certain content repository types such as file systems or WebDAV repositories.

Implementation class of this interface should be designed following the Java Beans specifications. Instances of CPAdaptor will have their properties set according to the values specified during the Content Provider Registration wizard in the Oracle Syndication Services administration. At runtime, Oracle Syndication Service will load the CPAdaptor instance and, before calling any of its methods, set its properties according to what specified at registration time. Only bean properties with simple/primitive types are supported. Typical properties include connection parameters such WebDAV URL. JavaBeans BeanInfo can be used to control which properties will be shown in the administration pages.

The interface defines three main methods: an init method providing some content provider adaptor context, a buildCatalog method providing the list of resources made available by this content provider for offer creation, and a buildPackage/closePackage method pairs to build content package updates.

Since:
release specific (what release of product did this appear in)

Field Summary
static java.lang.String INITIAL_STATE
          Constant used to identify the inital state of a package request.

 

Method Summary
 java.util.Iterator buildCatalog()
          Returns an Iterator of CPOffers encapsulating the resource that the content provider wants to make available for offer creation.
 CPPackage buildPackage(CPPackageRequest pkgReq, CPRequestContext reqCtx)
          Returns the content package associated to the supplied cp offer ID.
 void close()
          perform clean up after CPAdaptor is used
 void closePackage(CPRequestContext reqCtx)
          Call back method to notify a CPAdaptor that a previously built package has been delivered.
 void init(CPContext ctx)
          After instantiation and before setting the properties, the init method will be called.
 boolean ping()
          Returns true if the CP is ready to operate, false if not.

 

Field Detail

INITIAL_STATE

public static final java.lang.String INITIAL_STATE
Constant used to identify the inital state of a package request. CPs can compare supplied states to this constant to verify if a full update is required or if an incremental update is more appropriate.
Method Detail

init

public void init(CPContext ctx)
          throws CPException
After instantiation and before setting the properties, the init method will be called. The supplied CPContext contains accessors for context information to be used by this connector.

ping

public boolean ping()
             throws CPException
Returns true if the CP is ready to operate, false if not. The ping method shold be called after instantiation and and property settings.

buildCatalog

public java.util.Iterator buildCatalog()
                                throws CPException
Returns an Iterator of CPOffers encapsulating the resource that the content provider wants to make available for offer creation. The buildCatalog method will be called when administrators are going through the offer creation process. After selecting a content provider instance, the administrator will be asked to select the content provider resource they want to create an offer for. The list of resources presented to the content provider will be the list of ID of the returned CPOffers. CPOffer instances can be acquired through the CPMessageFactory available thorugh the CPContext supplied in the init method.

buildPackage

public CPPackage buildPackage(CPPackageRequest pkgReq,
CPRequestContext reqCtx)
                       throws CPException
Returns the content package associated to the supplied cp offer ID. The supplied CPRequestContext can be used by the CPAdaptor to store resource associated with the returned CPPackage. Such resources can be released in the closePackage package, when the reqCtx will be re-supplied to the CPAdaptor after tha package has been transmitted. CPPackage instances and CPItem can be acquired through the CPMessageFactory available thorugh the CPContext supplied in the init method.
Parameters:
pkgReq - provides accessors for the package build request including the ID of CPOffer for which the package has to be built
reqCtx - holder of CPAdaptor resource which needs to be allocated for building a package and which needs to be released after package delivery is completed.

closePackage

public void closePackage(CPRequestContext reqCtx)
                  throws CPException
Call back method to notify a CPAdaptor that a previously built package has been delivered. The supplied request context contains the same context instance set by this CPAdaptor during the corresponding corresponding buildPackage call.

close

public void close()
           throws CPException
perform clean up after CPAdaptor is used

Copyright © 2001, 2003, Oracle. All rights reserved.

Copyright © 2001, 2003, Oracle. All rights reserved.