Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.storage.sql.db
Class EmbeddedFunctions

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.db.EmbeddedFunctions
Direct Known Subclasses:
DerbyFunctions, H2Functions

public class EmbeddedFunctions
extends Object

Functions used as stored procedures for Derby and H2.

Author:
Florent Guillaume

Constructor Summary
EmbeddedFunctions()
           
 
Method Summary
static boolean isAccessAllowed(Connection conn, Serializable id, Set<String> principals, Set<String> permissions)
          Checks if access to a document is allowed.
static boolean isAccessAllowed(Serializable id, Set<String> principals, Set<String> permissions)
          Checks if access to a document is allowed.
static boolean isInTree(Connection conn, Serializable id, Serializable baseId)
          Checks if an id is a (strict) descendant of a given base id.
static boolean isInTree(Serializable id, Serializable baseId)
          Checks if an id is a (strict) descendant of a given base id.
static String parseFullText(String string1, String string2)
          Extracts the words from a string for simple fulltext indexing.
static String parseWord(String string)
           
static Set<String> split(String string)
           
static Set<String> split(String string, char sep)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedFunctions

public EmbeddedFunctions()
Method Detail

isInTree

public static boolean isInTree(Serializable id,
                               Serializable baseId)
                        throws SQLException
Checks if an id is a (strict) descendant of a given base id.

Parameters:
id - the id to check for
baseId - the base id
Throws:
SQLException

isInTree

public static boolean isInTree(Connection conn,
                               Serializable id,
                               Serializable baseId)
                        throws SQLException
Checks if an id is a (strict) descendant of a given base id.

Parameters:
conn - the connection to the database
id - the id to check for
baseId - the base id
Throws:
SQLException

isAccessAllowed

public static boolean isAccessAllowed(Serializable id,
                                      Set<String> principals,
                                      Set<String> permissions)
                               throws SQLException
Checks if access to a document is allowed.

This implements in SQL the ACL-based security policy logic.

Parameters:
id - the id of the document
principals - the allowed identities
permissions - the allowed permissions
Throws:
SQLException

isAccessAllowed

public static boolean isAccessAllowed(Connection conn,
                                      Serializable id,
                                      Set<String> principals,
                                      Set<String> permissions)
                               throws SQLException
Checks if access to a document is allowed.

This implements in SQL the ACL-based security policy logic.

Parameters:
conn - the database connection
id - the id of the document
principals - the allowed identities
permissions - the allowed permissions
Throws:
SQLException

parseFullText

public static String parseFullText(String string1,
                                   String string2)
Extracts the words from a string for simple fulltext indexing.

Parameters:
string1 - the first string
string2 - the second string
Returns:
a string with extracted words

parseWord

public static final String parseWord(String string)

split

public static Set<String> split(String string)

split

public static Set<String> split(String string,
                                char sep)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.