org.oclc.da.gdfr.registryprototype.atom
Class IWSACollectionBasedAtomHandler

java.lang.Object
  extended by org.oclc.da.gdfr.registryprototype.atom.IWSACollectionBasedAtomHandler

public class IWSACollectionBasedAtomHandler
extends java.lang.Object

IWSA Collection -based implementation that stores entries and media-entries to an RFA supported database. Implemented using org.oclc.da.gdfr.registryprototype.atom.IWSACollectionBasedAtomService.


Field Summary
 java.lang.String ATOM_ENTRY_XSL
           
 java.lang.String ATOM_FEED_XSL
           
 java.lang.String DEPOSIT_XSL
           
 int XSL_TIMEOUT_SECONDS
           
 
Constructor Summary
IWSACollectionBasedAtomHandler()
          Contruct handler for one request, using specified file storage directory.
 
Method Summary
 void deleteEntry(java.lang.String[] pathInfo)
          Delete entry specified by pathInfo.
 IWSACollectionBasedCollection findCollectionByHandle(java.lang.String collectionName)
           
 DataObject getCollection(java.lang.String[] pathInfo)
          Get collection specified by pathinfo.
 DataObject getEntry(java.lang.String[] pathInfo)
          Get entry specified by pathInfo.
 DataObject getIntrospection()
          Return introspection document
 boolean isCollectionURI(java.lang.String[] pathInfo)
          Return true if specified pathinfo represents URI of a collection.
 boolean isEntryURI(java.lang.String[] pathInfo)
          Return true if specified pathinfo represents URI of an Atom entry.
 boolean isIntrospectionURI(java.lang.String[] pathInfo)
          Return true if specified pathinfo represents URI of introspection doc.
 DataObject postEntry(java.lang.String[] pathInfo, DataObject entry, java.lang.String authenticatedUser)
          Create a new entry specified by pathInfo and posted entry.
 DataObject putEntry(java.lang.String[] pathInfo, DataObject entry, java.lang.String authenticatedUser)
          Update entry specified by pathInfo and posted entry.
 boolean validateUser(java.lang.String login, java.lang.String password)
          Method used for validating user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATOM_FEED_XSL

public final java.lang.String ATOM_FEED_XSL
See Also:
Constant Field Values

ATOM_ENTRY_XSL

public final java.lang.String ATOM_ENTRY_XSL
See Also:
Constant Field Values

DEPOSIT_XSL

public final java.lang.String DEPOSIT_XSL
See Also:
Constant Field Values

XSL_TIMEOUT_SECONDS

public final int XSL_TIMEOUT_SECONDS
See Also:
Constant Field Values
Constructor Detail

IWSACollectionBasedAtomHandler

public IWSACollectionBasedAtomHandler()
Contruct handler for one request, using specified file storage directory.

Parameters:
req - Request to be handled.
uploaddir - File storage upload dir.
Method Detail

validateUser

public boolean validateUser(java.lang.String login,
                            java.lang.String password)
Method used for validating user. Developers can overwrite this method and use credentials stored in Database or LDAP to confirm if the user is allowed to access this service.

Parameters:
login - user submitted login id
password - user submitted password

getIntrospection

public DataObject getIntrospection()
                            throws RegistryException
Return introspection document

Returns:
AtomService object with workspaces and collections.
Throws:
com.sun.syndication.propono.atom.server.RegistryException - Unexpected exception.
RegistryException

getCollection

public DataObject getCollection(java.lang.String[] pathInfo)
                         throws RegistryException
Get collection specified by pathinfo.

Parameters:
pathInfo - Path info from Servlet request.
Returns:
ROME feed representing collection.
Throws:
com.sun.syndication.propono.atom.server.RegistryException - Invalid collection or other exception.
RegistryException

postEntry

public DataObject postEntry(java.lang.String[] pathInfo,
                            DataObject entry,
                            java.lang.String authenticatedUser)
                     throws RegistryException
Create a new entry specified by pathInfo and posted entry. We save the submitted Atom entry verbatim, but we do set the id and reset the update time.

Parameters:
entry - Entry to be added to collection.
pathInfo - Path info from Servlet request.
Returns:
Entry as represented on server.
Throws:
com.sun.syndication.propono.atom.server.RegistryException - On invalid collection or other error.
RegistryException

getEntry

public DataObject getEntry(java.lang.String[] pathInfo)
                    throws RegistryException
Get entry specified by pathInfo.

Parameters:
pathInfo - Path info portion of URL
Returns:
Atom Entry object or null if one wasn't found
Throws:
RegistryException

putEntry

public DataObject putEntry(java.lang.String[] pathInfo,
                           DataObject entry,
                           java.lang.String authenticatedUser)
                    throws RegistryException
Update entry specified by pathInfo and posted entry.

Parameters:
entry -
pathInfo - Path info portion of URL
Throws:
com.sun.syndication.propono.atom.server.RegistryException
RegistryException

deleteEntry

public void deleteEntry(java.lang.String[] pathInfo)
                 throws RegistryException
Delete entry specified by pathInfo.

Parameters:
pathInfo - Path info portion of URL
Throws:
RegistryException

isIntrospectionURI

public boolean isIntrospectionURI(java.lang.String[] pathInfo)
Return true if specified pathinfo represents URI of introspection doc.


isCollectionURI

public boolean isCollectionURI(java.lang.String[] pathInfo)
Return true if specified pathinfo represents URI of a collection.


isEntryURI

public boolean isEntryURI(java.lang.String[] pathInfo)
Return true if specified pathinfo represents URI of an Atom entry.


findCollectionByHandle

public IWSACollectionBasedCollection findCollectionByHandle(java.lang.String collectionName)


Copyright © 2008 OCLC Online Computer Library Center, Inc.. All Rights Reserved.