Ontimize Document Management 0.035EN

com.ontimize.dms.jcr
Class JcrServerBase

java.lang.Object
  extended by com.ontimize.dms.jcr.JcrServerBase
All Implemented Interfaces:
JcrServer

public abstract class JcrServerBase
extends java.lang.Object
implements JcrServer

JCR Ontimize Server implementation.

Provides a simple access to JCR main objects.

Since:
22/12/2008, 29/12/2008 XPath query., 29/01/2009 Groups cache., 18/03/2009 Multiple sessions., 12/05/2009 Change contructor to allow a properties map., 08/01/2010 Load a properties to check classpath., 15/01/2010 Allows to enabled Data Store Garbage Collector., 27/01/2010 Allows internal sessions and user., 08/02/2010 Set a default repository configuration file., 24/02/2010 Clear repository in a internal thread., 03/03/2010 Changes in clear with Jackrabbit 2.x., 30/09/2010 Changes to allow a custom connector., 20/01/2011 Connection check thread.

Field Summary
static java.lang.String CONTENT_ALIAS_KEY
          Optional.
protected static java.lang.String DEFAULT_CONTENT_ALIAS_PATH
           
protected  java.lang.String host
           
protected static int INTERNAL_SESSION_ID
           
protected static java.lang.String INTERNAL_USER_ID
           
static java.lang.String MSG_CONTENT_ALIAS
           
static java.lang.String MSG_HOST
           
static java.lang.String MSG_HOST_NULL
           
protected static java.lang.String MSG_INIT_TIME
           
static java.lang.String MSG_LOCATOR_NULL
           
static java.lang.String MSG_NAME
           
static java.lang.String MSG_NAME_NULL
           
static java.lang.String MSG_PORT
           
static java.lang.String MSG_PORT_INVALID
           
static java.lang.String MSG_PORT_NULL
           
static java.lang.String MSG_PROPERTIES_NULL
           
static java.lang.String MSG_PWD
           
static java.lang.String MSG_PWD_NULL
           
static java.lang.String MSG_RESET_INIT_1
           
static java.lang.String MSG_RESET_INIT_2
           
static java.lang.String MSG_RESET_NODE
           
static java.lang.String MSG_RESET_SESSION_NULL
           
protected static java.lang.String MSG_SESSION_MSG
           
static java.lang.String MSG_USER
           
static java.lang.String MSG_USER_NULL
           
protected  java.lang.String name
           
protected  java.lang.String port
           
protected  java.lang.String pwd
           
protected  java.lang.String user
           
 
Constructor Summary
JcrServerBase()
           
 
Method Summary
abstract  void clear()
          Clears the repository Data Store unreferenced entries.
 void close()
          Closes the current JCR repository.
protected  java.lang.String createConnectionString()
           
protected abstract  JcrSession createSession(int sessionId)
           
protected  void doReset(JcrSession session)
           
protected  java.lang.String getContentAlias()
           
protected  java.lang.String getHostValue()
           
protected  Session getInnerSession()
           
 EntityReferenceLocator getLocator()
           
protected  java.lang.String getNameValue()
           
protected  java.lang.String getPortValue()
           
protected  java.lang.String getPwdValue()
           
protected  JcrSession getServerSession()
           
 JcrSession getSession(int sessionId)
           
 int getSessionId()
          Returns the internal server session.
 java.lang.String getUser()
          Returns the internal server user.
 java.lang.String getUser(int sessionId)
           
protected  java.lang.String getUserValue()
           
 void init()
           
 void load(java.util.Map properties)
           
 void reset()
          Resets all the nodes locks (directories and files).
protected  void setContentAlias(java.lang.String alias)
           
protected  void setHostValue(java.lang.String host)
           
 void setLocator(EntityReferenceLocator locator)
           
protected  void setNameValue(java.lang.String name)
           
protected  void setPortValue(java.lang.String port)
           
protected  void setPwdValue(java.lang.String pwd)
           
protected  void setServerSession(JcrSession session)
           
protected  void setUserValue(java.lang.String user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_ALIAS_KEY

public static final java.lang.String CONTENT_ALIAS_KEY
Optional. Path with the properties file path.

See Also:
Constant Field Values

DEFAULT_CONTENT_ALIAS_PATH

protected static final java.lang.String DEFAULT_CONTENT_ALIAS_PATH
See Also:
Constant Field Values

MSG_INIT_TIME

protected static final java.lang.String MSG_INIT_TIME
See Also:
Constant Field Values

MSG_SESSION_MSG

protected static final java.lang.String MSG_SESSION_MSG
See Also:
Constant Field Values

MSG_PROPERTIES_NULL

public static final java.lang.String MSG_PROPERTIES_NULL
See Also:
Constant Field Values

MSG_LOCATOR_NULL

public static final java.lang.String MSG_LOCATOR_NULL
See Also:
Constant Field Values

MSG_CONTENT_ALIAS

public static final java.lang.String MSG_CONTENT_ALIAS
See Also:
Constant Field Values

MSG_RESET_SESSION_NULL

public static final java.lang.String MSG_RESET_SESSION_NULL
See Also:
Constant Field Values

MSG_RESET_INIT_1

public static final java.lang.String MSG_RESET_INIT_1
See Also:
Constant Field Values

MSG_RESET_INIT_2

public static final java.lang.String MSG_RESET_INIT_2
See Also:
Constant Field Values

MSG_RESET_NODE

public static final java.lang.String MSG_RESET_NODE
See Also:
Constant Field Values

MSG_HOST

public static final java.lang.String MSG_HOST
See Also:
Constant Field Values

MSG_HOST_NULL

public static final java.lang.String MSG_HOST_NULL
See Also:
Constant Field Values

MSG_PORT

public static final java.lang.String MSG_PORT
See Also:
Constant Field Values

MSG_PORT_NULL

public static final java.lang.String MSG_PORT_NULL
See Also:
Constant Field Values

MSG_PORT_INVALID

public static final java.lang.String MSG_PORT_INVALID
See Also:
Constant Field Values

MSG_NAME

public static final java.lang.String MSG_NAME
See Also:
Constant Field Values

MSG_NAME_NULL

public static final java.lang.String MSG_NAME_NULL
See Also:
Constant Field Values

MSG_USER

public static final java.lang.String MSG_USER
See Also:
Constant Field Values

MSG_USER_NULL

public static final java.lang.String MSG_USER_NULL
See Also:
Constant Field Values

MSG_PWD

public static final java.lang.String MSG_PWD
See Also:
Constant Field Values

MSG_PWD_NULL

public static final java.lang.String MSG_PWD_NULL
See Also:
Constant Field Values

INTERNAL_USER_ID

protected static final java.lang.String INTERNAL_USER_ID
See Also:
Constant Field Values

INTERNAL_SESSION_ID

protected static final int INTERNAL_SESSION_ID
See Also:
Constant Field Values

host

protected java.lang.String host

port

protected java.lang.String port

name

protected java.lang.String name

user

protected java.lang.String user

pwd

protected java.lang.String pwd
Constructor Detail

JcrServerBase

public JcrServerBase()
Method Detail

load

public void load(java.util.Map properties)
          throws java.lang.Exception
Specified by:
load in interface JcrServer
Throws:
java.lang.Exception

init

public void init()
          throws java.lang.Exception
Specified by:
init in interface JcrServer
Throws:
java.lang.Exception

getLocator

public EntityReferenceLocator getLocator()
Specified by:
getLocator in interface JcrServer

setLocator

public void setLocator(EntityReferenceLocator locator)
Specified by:
setLocator in interface JcrServer

getUser

public java.lang.String getUser()
Description copied from interface: JcrServer

Returns the internal server user.

By default, returns server

Specified by:
getUser in interface JcrServer
Returns:
Internal server user.

getUser

public java.lang.String getUser(int sessionId)
                         throws RepositoryException
Specified by:
getUser in interface JcrServer
Throws:
RepositoryException

getSessionId

public int getSessionId()
Description copied from interface: JcrServer

Returns the internal server session.

By default, returns -1.

Specified by:
getSessionId in interface JcrServer
Returns:
Internal server session.

getServerSession

protected JcrSession getServerSession()
                               throws RepositoryException
Throws:
RepositoryException

getInnerSession

protected Session getInnerSession()

setServerSession

protected void setServerSession(JcrSession session)

getSession

public JcrSession getSession(int sessionId)
                      throws RepositoryException
Specified by:
getSession in interface JcrServer
Throws:
RepositoryException

createSession

protected abstract JcrSession createSession(int sessionId)
                                     throws RepositoryException
Throws:
RepositoryException

reset

public void reset()
           throws RepositoryException
Description copied from interface: JcrServer

Resets all the nodes locks (directories and files).

Removes the status flags in all the repository.

Specified by:
reset in interface JcrServer
Throws:
RepositoryException - if JCR exception ocurrs.

doReset

protected void doReset(JcrSession session)
                throws RepositoryException
Throws:
RepositoryException

clear

public abstract void clear()
                    throws RepositoryException
Description copied from interface: JcrServer

Clears the repository Data Store unreferenced entries.

The data store never deletes entries except when running data store garbage collection.

Specified by:
clear in interface JcrServer
Throws:
RepositoryException - if JCR exception ocurrs.
See Also:
DataStore

close

public void close()
Description copied from interface: JcrServer

Closes the current JCR repository.

Specified by:
close in interface JcrServer

getContentAlias

protected java.lang.String getContentAlias()

setContentAlias

protected void setContentAlias(java.lang.String alias)

getHostValue

protected java.lang.String getHostValue()

getPortValue

protected java.lang.String getPortValue()

getNameValue

protected java.lang.String getNameValue()

getUserValue

protected java.lang.String getUserValue()

getPwdValue

protected java.lang.String getPwdValue()

setHostValue

protected void setHostValue(java.lang.String host)

setPortValue

protected void setPortValue(java.lang.String port)

setNameValue

protected void setNameValue(java.lang.String name)

setUserValue

protected void setUserValue(java.lang.String user)

setPwdValue

protected void setPwdValue(java.lang.String pwd)

createConnectionString

protected java.lang.String createConnectionString()

Ontimize Document Management