|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.facetmap.simple.SimpleFacetmap
com.facetmap.sql.SqlFacetmap
public class SqlFacetmap
A Facetmap implementation using a SQL relational database as a persistence layer, and a schema that enables very fast Selection queries in multiple facets.
Supported properties are:
com.facetmap.sql.jdbcDriver
- fully-qualified name of the driver classcom.facetmap.sql.jdbcUrl
- JDBC-protocol URL of the database to use, for example
jdbc:mysql://localhost:3306/databaseName?user=facetmapcom.facetmap.sql.sqlVendor - the
vendor flavor of SQL for your database. Supported values are
mysql; please let us know
if you have a need for another.com.facetmap.sql.tablePrefix - if
set, all tables Facetmap creates in your database will be prefixed
with this value, to avoid namespace conflicts or just for recognition.
| Field Summary | |
|---|---|
protected ConnectionManager |
connectionManager
|
protected SqlFacetSpace |
sqlFacetSpace
|
protected SqlResourceFactory |
sqlResourceFactory
|
protected java.lang.String |
sqlVendor
|
protected java.lang.String |
tableName
|
protected java.lang.String |
tablePrefix
|
protected java.lang.String |
tagTableName
|
| Fields inherited from class com.facetmap.simple.SimpleFacetmap |
|---|
facetSpace, INFO, refCodec, resourceSpace, selectionProps, title |
| Constructor Summary | |
|---|---|
SqlFacetmap(Facetmap sourceData,
java.util.Properties properties)
Creates a SqlFacetmap from source data in another Facetmap object. |
|
SqlFacetmap(Facetmap sourceData,
java.util.Properties properties,
ConnectionManager connectionManager)
Creates a SqlFacetmap that uses a specified Connection management mechanism. |
|
SqlFacetmap(Facetmap sourceData,
java.util.Properties properties,
ConnectionManager connectionManager,
java.util.Collection externalFacets)
Constructor for fully-customizable Facetmap, including custom ConnectionManager and external ResourceIdFacet objects. |
|
| Method Summary | |
|---|---|
FacetSpace |
getFacetSpace()
|
java.lang.String |
getInfo()
Implementation-specific string for this FacetMap class. |
RefCodec |
getRefCodec()
|
ResourceIdFacet |
getResourceIdFacet(java.lang.String id)
Returns a ResourceIdFacet for integrating external queries. |
Selection |
getRootSelection(java.util.Properties props)
Caches root selection for the life of the SimpleFacetmap object, which underscores the intended immutability of SimpleFacetmap. |
Selection |
getSelection(Heading[] headingList,
java.util.Properties props)
This is the basic getSelection call. |
Selection |
getSelection(java.lang.String ref,
java.util.Properties properties)
Get a Selection defined by string ref and subject
to special restrictions in properties. |
SqlSelection |
getSqlSelection(java.sql.Connection connection,
Heading[] headingList,
java.util.Properties properties)
This getSelection allows you to pass in your own live Connection object, for the times when you want Facetmap to use the same Connection that you are using elsewhere in your code. |
SqlSelection |
getSqlSelection(Heading[] headingList,
java.util.Properties properties)
|
void |
notifyAddedResource(int resourceId)
Notify this object that a new Resource has been added to its ResourceSpace, and should be incrementally added to the internal representation of the facetmap. |
void |
notifyResourceToBeDeleted(int resourceId)
Notify this object that a Resource is about to be deleted from its ResourceSpace, and should be removed from the internal representation of the facetmap. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String sqlVendor
protected ConnectionManager connectionManager
protected java.lang.String tablePrefix
protected java.lang.String tableName
protected java.lang.String tagTableName
protected SqlFacetSpace sqlFacetSpace
protected SqlResourceFactory sqlResourceFactory
| Constructor Detail |
|---|
public SqlFacetmap(Facetmap sourceData,
java.util.Properties properties)
throws DataException,
InternalException
DataException
InternalException
public SqlFacetmap(Facetmap sourceData,
java.util.Properties properties,
ConnectionManager connectionManager)
throws DataException,
InternalException
connectionManager - - the object responsible for providing
Connections to SqlFacetmap. (e.g. a connection pool, DataSource, etc)
DataException
InternalExceptionConnectionManager
public SqlFacetmap(Facetmap sourceData,
java.util.Properties properties,
ConnectionManager connectionManager,
java.util.Collection externalFacets)
throws DataException,
InternalException
externalFacets Collection argument.
DataException
InternalException| Method Detail |
|---|
public java.lang.String getInfo()
SimpleFacetmap
getInfo in interface FacetmapgetInfo in class SimpleFacetmappublic ResourceIdFacet getResourceIdFacet(java.lang.String id)
ResourceIdFacet for docs explaining how to do this.
This method is on the Facetmap instead of the FacetSpace, since a ResourceIdFacet is not really part of the FacetSpace to which Resources have been mapped. It is considered an "external facet".
public Selection getRootSelection(java.util.Properties props)
throws InternalException
SimpleFacetmap
getRootSelection in interface FacetmapgetRootSelection in class SimpleFacetmapInternalExceptionFacetmap.getSelection(Heading[], Properties)
public Selection getSelection(Heading[] headingList,
java.util.Properties props)
throws DataException,
InternalException
SimpleFacetmap
getSelection in interface FacetmapgetSelection in class SimpleFacetmapDataException
InternalExceptionFacetmap.getSelection(Heading[])
public Selection getSelection(java.lang.String ref,
java.util.Properties properties)
throws InternalException,
UnknownReferenceException
Facetmapref and subject
to special restrictions in properties. Note that
selection properties are not conveyed by the ref string.
getSelection in interface FacetmapgetSelection in class SimpleFacetmapInternalException
UnknownReferenceException
public SqlSelection getSqlSelection(Heading[] headingList,
java.util.Properties properties)
throws InternalException
InternalException
public SqlSelection getSqlSelection(java.sql.Connection connection,
Heading[] headingList,
java.util.Properties properties)
public RefCodec getRefCodec()
public FacetSpace getFacetSpace()
getFacetSpace in interface FacetmapgetFacetSpace in class SimpleFacetmap
public void notifyAddedResource(int resourceId)
throws InternalException
NOTE: this method will be deprecated in the future. It exposes an event-driven model which is not fully supported by this package, which is why you need to call it explicitly. When the ResourceSpace supports events, this method is likely to be inaccessible.
resourceId - - the ID of the newly added Resource
InternalException
public void notifyResourceToBeDeleted(int resourceId)
throws InternalException
NOTE: this method will be deprecated in the future. It exposes an event-driven model which is not fully supported by this package, which is why you need to call it explicitly. When the ResourceSpace supports events, this method is likely to be inaccessible.
resourceId - - the ID of the Resource about to be deleted
InternalException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||