fr.cnes.sitools.datasource.jdbc.dbexplorer
Class DBExplorerResource

java.lang.Object
  extended by org.restlet.resource.UniformResource
      extended by org.restlet.resource.ServerResource
          extended by fr.cnes.sitools.datasource.jdbc.dbexplorer.DBExplorerResource
Direct Known Subclasses:
DataSetWrapperResource

public class DBExplorerResource
extends org.restlet.resource.ServerResource

DBExplorerResource using DataSource for pooled connections

Author:
jp.boignard (AKKA Technologies)

Constructor Summary
DBExplorerResource()
           
 
Method Summary
 void doInit()
           
 java.lang.String getBaseRef()
          Get base reference
 SitoolsSQLDataSource getDataSource()
          Get the DataSource
 int getFetchSize()
          Gets the fetchSize value
 org.restlet.data.Form getForm()
          Get paginated form
 java.lang.String getFromTableName()
          Get the reference
 org.restlet.representation.Representation getHTML()
          Get an HTML representation
 org.restlet.representation.Representation getJSON()
          Get JSON representation
 int getMaxrows()
          Gets the maxrows value
 int getPaginationExtend()
          Read extend request parameter -> integer - 0 by default
 int getPaginationStartRecord()
          Read startRecord request parameter -> integer - 0 by default
 java.lang.String getRecordName()
          Get the record name
 org.restlet.representation.Representation getRepresentation(Response response, org.restlet.data.MediaType media)
          XStream aliases are personalized for each resources
 java.lang.String getSchemaName()
          Get the schema name
 Table getTable()
          Get the table
 java.lang.String getTableName()
          Get the table name
 org.restlet.representation.Representation getXML()
          Get an XML representation
 boolean isDatabaseTarget()
          Returns if target is a database
 boolean isRecordSetTarget()
          Returns if target is a record set
 boolean isRecordTarget()
          Returns if target is a record
 boolean isSchemaTarget()
          Returns if target is a schema
 boolean isTableTarget()
          Returns if target is a table
 org.restlet.representation.Representation processConstraint(org.restlet.data.MediaType media)
          Process constraint
 
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, getOnSent, getVariants, handle, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setOnSent, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods
 
Methods inherited from class org.restlet.resource.UniformResource
getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getQuery, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestEntity, getResponse, getResponseAttributes, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, release, setRequest, setResponse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBExplorerResource

public DBExplorerResource()
Method Detail

isDatabaseTarget

public final boolean isDatabaseTarget()
Returns if target is a database

Returns:
true if database

isSchemaTarget

public final boolean isSchemaTarget()
Returns if target is a schema

Returns:
true if schema

isTableTarget

public final boolean isTableTarget()
Returns if target is a table

Returns:
true if table

isRecordSetTarget

public final boolean isRecordSetTarget()
Returns if target is a record set

Returns:
true if record set

isRecordTarget

public final boolean isRecordTarget()
Returns if target is a record

Returns:
true if record

doInit

public final void doInit()
Overrides:
doInit in class org.restlet.resource.UniformResource

getDataSource

public final SitoolsSQLDataSource getDataSource()
Get the DataSource

Returns:
the DataSource associated

getSchemaName

public final java.lang.String getSchemaName()
Get the schema name

Returns:
the schema name

getTableName

public final java.lang.String getTableName()
Get the table name

Returns:
the table name

getTable

public final Table getTable()
Get the table

Returns:
the table

getRecordName

public final java.lang.String getRecordName()
Get the record name

Returns:
the record name

getFromTableName

public final java.lang.String getFromTableName()
Get the reference

Returns:
the reference

processConstraint

public org.restlet.representation.Representation processConstraint(org.restlet.data.MediaType media)
Process constraint

Parameters:
media - Client preference
Returns:
Representation to be used

getXML

@Get(value="xml")
public org.restlet.representation.Representation getXML()
Get an XML representation

Returns:
an XML representation

getJSON

@Get(value="json")
public org.restlet.representation.Representation getJSON()
Get JSON representation

Returns:
an JSON representation

getHTML

@Get(value="html")
public org.restlet.representation.Representation getHTML()
Get an HTML representation

Returns:
an HTML representation

getBaseRef

public final java.lang.String getBaseRef()
Get base reference

Returns:
base reference

getForm

public final org.restlet.data.Form getForm()
Get paginated form

Returns:
form paginated

getPaginationStartRecord

public final int getPaginationStartRecord()
Read startRecord request parameter -> integer - 0 by default

Returns:
startRecord

getPaginationExtend

public final int getPaginationExtend()
Read extend request parameter -> integer - 0 by default

Returns:
extend

getRepresentation

public final org.restlet.representation.Representation getRepresentation(Response response,
                                                                         org.restlet.data.MediaType media)
XStream aliases are personalized for each resources

Parameters:
response - the response to be transformed
media - the media type to use
Returns:
TODO Optimisation : remonter au niveau DBExplorerApplication les 2 instances xstreamXML et xstreamJSON pour ne pas avoir à les recréer à chaque resource

getFetchSize

public final int getFetchSize()
Gets the fetchSize value

Returns:
the fetchSize

getMaxrows

public final int getMaxrows()
Gets the maxrows value

Returns:
the maxrows


Copyright © 2010-2013 CNES. All Rights Reserved.