org.apache.oodt.cas.curation.service
Class CurationService

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.oodt.cas.curation.service.CurationService
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, CuratorConfMetKeys
Direct Known Subclasses:
DirectoryResource, IngestionResource, MetadataResource, PolicyResource, SystemResource

public class CurationService
extends javax.servlet.http.HttpServlet
implements CuratorConfMetKeys

The Main Curation Web Service responsible for providing basic tools and functionality for performing ingestion into the CAS filemgr, and management of the staging area for ingestion.

Version:
$Revision: 980344 $
Author:
pramirez, mattmann
See Also:
Serialized Form

Field Summary
protected static CurationServiceConfig config
           
protected static String FORMAT_HTML
           
protected static String FORMAT_JSON
           
protected  SingleSignOn sso
           
protected static String UNKNOWN_OUT_FORMAT
           
 
Fields inherited from interface org.apache.oodt.cas.curation.servlet.CuratorConfMetKeys
CATALOG_FACTORY_CLASS, CRAWLER_CONF_FILE, DEFAULT_TRANSFER_FACTORY, FM_PROPS, FM_URL, MET_AREA_PATH, MET_EXTENSION, MET_EXTRACTOR_CONF_UPLOAD_PATH, POLICY_UPLOAD_PATH, PROJECT_DISPLAY_NAME, SSO_IMPL_CLASS, STAGING_AREA_PATH
 
Constructor Summary
CurationService()
          Default Constructor.
 
Method Summary
protected  String cleansePath(String path)
           
protected  void configureSingleSignOn(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Configures the web context persistence layer for the CAS SSO so that all services (HttpServlets) that extend this implementation get the ability to configure an SSO object for free, essentially.
 String getDirectoryAreaAsJSON(String base, String path, boolean showFiles)
          Gets the staging area as a JSON formatted response object.
protected  String[] getFilesInDirectory(String directory, boolean showFiles)
           
 void init(javax.servlet.ServletConfig conf)
           
protected  void sendRedirect(String page, javax.ws.rs.core.UriInfo uriInfo, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected static CurationServiceConfig config

FORMAT_JSON

protected static final String FORMAT_JSON
See Also:
Constant Field Values

FORMAT_HTML

protected static final String FORMAT_HTML
See Also:
Constant Field Values

UNKNOWN_OUT_FORMAT

protected static final String UNKNOWN_OUT_FORMAT
See Also:
Constant Field Values

sso

protected SingleSignOn sso
Constructor Detail

CurationService

public CurationService()
Default Constructor.

Method Detail

init

public void init(javax.servlet.ServletConfig conf)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

getDirectoryAreaAsJSON

public String getDirectoryAreaAsJSON(String base,
                                     String path,
                                     boolean showFiles)
Gets the staging area as a JSON formatted response object.

Parameters:
base - The base directory to read files from, should be the staging area root.
path - The particular child path within the staging area.
showFiles - Whether or not to show File.isFile() files or not.
Returns:
A String representation formatting using JSONObject.toString().

getFilesInDirectory

protected String[] getFilesInDirectory(String directory,
                                       boolean showFiles)

sendRedirect

protected void sendRedirect(String page,
                            javax.ws.rs.core.UriInfo uriInfo,
                            javax.servlet.http.HttpServletResponse response)
                     throws IOException
Throws:
IOException

cleansePath

protected String cleansePath(String path)
                      throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

configureSingleSignOn

protected void configureSingleSignOn(javax.servlet.http.HttpServletRequest req,
                                     javax.servlet.http.HttpServletResponse res)
Configures the web context persistence layer for the CAS SSO so that all services (HttpServlets) that extend this implementation get the ability to configure an SSO object for free, essentially.

Parameters:
req - The HTTP request object.
res - The HTTP response object.


Copyright © 1999-2013
Apache OODT. All Rights Reserved.