org.apache.stanbol.contenthub.web.resources
Class SemanticIndexManagerResource

java.lang.Object
  extended by org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
      extended by org.apache.stanbol.contenthub.web.resources.SemanticIndexManagerResource

public class SemanticIndexManagerResource
extends BaseStanbolResource

This class the the web resource to handle the RESTful requests and HTML view of the LDProgram management facilities within Contenthub.

Author:
anil.pacaci, anil.sinaci

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
BaseStanbolResource.MenuItem
 
Field Summary
 
Fields inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
LINK_RESOURCES, NAVIGATION_LINKS, ROOT_URL, SCRIPT_RESOURCES, servletContext, STATIC_RESOURCES_ROOT_URL, uriInfo
 
Constructor Summary
SemanticIndexManagerResource(javax.servlet.ServletContext context)
           
 
Method Summary
 javax.ws.rs.core.Response deleteProgram(java.lang.String programName, javax.ws.rs.core.HttpHeaders headers)
          HTTP DELETE method to delete an LDPath program.
 java.util.List<LDProgram> getLdPrograms()
           
 javax.ws.rs.core.Response getProgramByName(java.lang.String programName, javax.ws.rs.core.HttpHeaders headers)
          HTTP GET method to retrieve an LDPath program, given its name.
 javax.ws.rs.core.Response handleCorsPreflight(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response handleCorsPreflightExists(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response handleCorsPreflightProgram(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response isManagedProgram(java.lang.String programName, javax.ws.rs.core.HttpHeaders headers)
          HTTP GET method to check whether an LDPath program exists in Contenthub or not.
 javax.ws.rs.core.Response retrieveAllPrograms(javax.ws.rs.core.HttpHeaders headers)
          HTTP GET method which returns all LDPath programs residing in Contenthub.
 javax.ws.rs.core.Response submitProgram(java.lang.String programName, java.lang.String program, javax.ws.rs.core.HttpHeaders headers)
          HTTP POST method which saves an LDPath program into the persistent store of Contenthub.
 
Methods inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
getMainMenuItems, getNavigationLinks, getPublicBaseUri, getRegisteredLinkResources, getRegisteredScriptResources, getRootUrl, getStaticRootUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemanticIndexManagerResource

public SemanticIndexManagerResource(@Context
                                    javax.servlet.ServletContext context)
Method Detail

handleCorsPreflight

public javax.ws.rs.core.Response handleCorsPreflight(@Context
                                                     javax.ws.rs.core.HttpHeaders headers)

handleCorsPreflightProgram

public javax.ws.rs.core.Response handleCorsPreflightProgram(@Context
                                                            javax.ws.rs.core.HttpHeaders headers)

handleCorsPreflightExists

public javax.ws.rs.core.Response handleCorsPreflightExists(@Context
                                                           javax.ws.rs.core.HttpHeaders headers)

retrieveAllPrograms

public javax.ws.rs.core.Response retrieveAllPrograms(@Context
                                                     javax.ws.rs.core.HttpHeaders headers)
HTTP GET method which returns all LDPath programs residing in Contenthub. LDPath programs are uniquely identified by their names. Returning JSON string presents each LDPath program in string format aligned with its name.

Parameters:
headers - HTTP headers
Returns:
JSON string of name:program pairs.

submitProgram

public javax.ws.rs.core.Response submitProgram(java.lang.String programName,
                                               java.lang.String program,
                                               @Context
                                               javax.ws.rs.core.HttpHeaders headers)
                                        throws LDPathException
HTTP POST method which saves an LDPath program into the persistent store of Contenthub.

Parameters:
programName - Unique name to identify the LDPath program
program - The LDPath program.
headers - HTTP Headers
Returns:
HTTP OK(200) or BAD REQUEST(400)
Throws:
LDPathException

getProgramByName

public javax.ws.rs.core.Response getProgramByName(java.lang.String programName,
                                                  @Context
                                                  javax.ws.rs.core.HttpHeaders headers)
HTTP GET method to retrieve an LDPath program, given its name.

Parameters:
programName - The name of the LDPath program to be retrieved.
headers - HTTP headers
Returns:
LDPath program in String format or HTTP NOT FOUND(404)

deleteProgram

public javax.ws.rs.core.Response deleteProgram(java.lang.String programName,
                                               @Context
                                               javax.ws.rs.core.HttpHeaders headers)
HTTP DELETE method to delete an LDPath program.

Parameters:
programName - The name of the LDPath program.
headers - HTTP headers
Returns:
HTTP OK(200)

isManagedProgram

public javax.ws.rs.core.Response isManagedProgram(java.lang.String programName,
                                                  @Context
                                                  javax.ws.rs.core.HttpHeaders headers)
HTTP GET method to check whether an LDPath program exists in Contenthub or not.

Parameters:
programName - The name of the LDPath program.
headers - HTTP headers
Returns:
HTTP OK(200) or HTTP NOT FOUND(404)

getLdPrograms

public java.util.List<LDProgram> getLdPrograms()


Copyright © 2011-2012 The Apache Software Foundation. All Rights Reserved.