thinkmap.server
Class ThinkmapServerApplication

java.lang.Object
  extended by thinkmap.server.ThinkmapServerApplication

public class ThinkmapServerApplication
extends Object

A Thinkmap Server Application.


Field Summary
protected  HttpServlet servlet
           
protected  String uri
           
 
Constructor Summary
ThinkmapServerApplication()
           
 
Method Summary
 void addIndex(DataSourceIndex dsi)
           
 void contextInit()
           
 DataSourceIndex createIndex()
           
 String getAccessControlAllowOrigin()
           
 ThinkmapConfig getConfig()
           
 IDataSource getDataSource()
           
 IStreamFormat getDefaultStreamFormat()
           
 DataSourceIndex getIndex()
           
 boolean getKeepStatistics()
           
 int getLogErrors()
          Deprecated. this attribute is depricated and is no longer used.
 IDataSource getRoot()
           
 int getSearchHistory()
          Gets the number of searches that this datasource will retain.
 boolean getSendServletAttributes()
           
 boolean getServeXML()
          Deprecated. this attribute is depricated and is no longer used.
 StatisticsWrapper getStatistics()
          Get the StatisticsWrapper, if statistics are being collected.
 URL getStyleSheetURL()
           
 String getURI()
          Returns the URI of this Server Application, once it has been initialized.
 boolean isAccessControlAllowCredentials()
           
 boolean isCaching()
          Determine if this caches responses.
 void setAccessControlAllowCredentials(boolean accessControlAllowCredentials)
           
 void setAccessControlAllowOrigin(String accessControlAllowOrigin)
           
 void setCaching(boolean b)
          Set whether or not this caches responses.
 void setConfig(ThinkmapConfig config)
           
 void setContext(IThinkmapContext context)
           
 void setDataSource(IDataSource ds)
          The data source used by this application
 void setDefaultStreamFormat(String formatName)
          Sets the default stream format for this wrapper.
 void setKeepStatistics(boolean b)
          Set to true if this DataSourceWrapper should retain statistics for the DataSource it contains.
 void setLogErrors(int i)
          Deprecated. this attribute is depricated and is no longer used.
 void setSearchHistory(int i)
          Sets the number of searches that this datasource will retain in it's statistics.
 void setSendServletAttributes(boolean b)
          Set this to true if your datasource needs to get a reference to the Servlet or the ServletRequest.
 void setServeXML(boolean b)
          Deprecated. this attribute is depricated and is no longer used.
 void setStyleSheet(URL url)
          Deprecated. this attribute is depricated and is no longer used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servlet

protected HttpServlet servlet

uri

protected String uri
Constructor Detail

ThinkmapServerApplication

public ThinkmapServerApplication()
Method Detail

setContext

public void setContext(IThinkmapContext context)

contextInit

public void contextInit()
                 throws Exception
Throws:
Exception

getURI

public String getURI()
Returns the URI of this Server Application, once it has been initialized.

Returns:
the URI of this Server Application, once it has been initialized.

getStatistics

public StatisticsWrapper getStatistics()
Get the StatisticsWrapper, if statistics are being collected. This may return null if statistics have not been configured.

Returns:
statistics wrapper

getRoot

public IDataSource getRoot()

createIndex

public DataSourceIndex createIndex()

addIndex

public void addIndex(DataSourceIndex dsi)

setStyleSheet

public void setStyleSheet(URL url)
Deprecated. this attribute is depricated and is no longer used.

This attribute is depricated and is no longer used.

Parameters:
url - this attribute is depricated and is no longer used.

getStyleSheetURL

public URL getStyleSheetURL()

setLogErrors

public void setLogErrors(int i)
Deprecated. this attribute is depricated and is no longer used.

This attribute is depricated.

Parameters:
i - this attribute is depricated and is no longer used.

getLogErrors

public int getLogErrors()
Deprecated. this attribute is depricated and is no longer used.


setServeXML

public void setServeXML(boolean b)
Deprecated. this attribute is depricated and is no longer used.

This attribute is depricated.

Parameters:
i - this attribute is depricated and is no longer used.

getServeXML

public boolean getServeXML()
Deprecated. this attribute is depricated and is no longer used.

This attribute is depricated.


setSendServletAttributes

public void setSendServletAttributes(boolean b)
Set this to true if your datasource needs to get a reference to the Servlet or the ServletRequest. If this is set to true, the datasource will always get passed two attributes, "Servlet" which will be a reference to the DataSourceServlet and "Servlet.request", which is a reference to the current HttpRequest that is serving the datasource. This option is "false" by default, as it can introduce problems if the datasource being served tries to serialize the attributes (as the RemoteDataSource does).

Parameters:
b - true true if your datasource needs to get a reference to the ServletRequest

getSendServletAttributes

public boolean getSendServletAttributes()

setDefaultStreamFormat

public void setDefaultStreamFormat(String formatName)
                            throws InstantiationException,
                                   IllegalAccessException,
                                   ClassNotFoundException
Sets the default stream format for this wrapper. The argument must be the name of a subclass of thinkmap.client.datasource.stream.IStreamFormat Formats are normally negotiated between the client and the server, and the default is only used as a last resort if the server cannot negotiate a protocol. The default format is the BinaryStreamFormat.

Parameters:
formatName - the name of the format to register
Throws:
InstantiationException - if there was a problem instantiating the IStreamFormat
IllegalAccessException - if there was a problem instantiating the IStreamFormat
ClassNotFoundException - if there was a problem finding the IStreamFormat class
See Also:
IStreamFormat

getDefaultStreamFormat

public IStreamFormat getDefaultStreamFormat()

setKeepStatistics

public void setKeepStatistics(boolean b)
Set to true if this DataSourceWrapper should retain statistics for the DataSource it contains.

Parameters:
b - true if this DataSourceWrapper should retain statistics.

getKeepStatistics

public boolean getKeepStatistics()

setSearchHistory

public void setSearchHistory(int i)
Sets the number of searches that this datasource will retain in it's statistics. This is useful to see a history of what people are searching for. The default is 0.

Parameters:
i - the number of search terms to retain.

getSearchHistory

public int getSearchHistory()
Gets the number of searches that this datasource will retain.

Returns:
the number of searches that this datasource will retain

setCaching

public void setCaching(boolean b)
Set whether or not this caches responses. If caching is on, the servlet will send a stored response if it matches a previous request.

Parameters:
b - true if this should cache responses

isCaching

public boolean isCaching()
Determine if this caches responses.

Returns:
true if this caches responses

getDataSource

public IDataSource getDataSource()

setDataSource

public void setDataSource(IDataSource ds)
The data source used by this application


setConfig

public void setConfig(ThinkmapConfig config)

getConfig

public ThinkmapConfig getConfig()

getIndex

public DataSourceIndex getIndex()

setAccessControlAllowOrigin

public void setAccessControlAllowOrigin(String accessControlAllowOrigin)

getAccessControlAllowOrigin

public String getAccessControlAllowOrigin()

isAccessControlAllowCredentials

public boolean isAccessControlAllowCredentials()

setAccessControlAllowCredentials

public void setAccessControlAllowCredentials(boolean accessControlAllowCredentials)


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.