public abstract class AbstractJCRScalingMapper extends TransactionalMapper implements JCRImapConstants
Mapper.Transaction<T>, Mapper.VoidTransaction
Modifier and Type | Field and Description |
---|---|
static String |
MAILBOXES_PATH |
NODE_DELIMITER
Constructor and Description |
---|
AbstractJCRScalingMapper(MailboxSessionJCRRepository repository,
MailboxSession mSession,
int scaling) |
Modifier and Type | Method and Description |
---|---|
protected void |
begin()
Begin is not supported by level 1 JCR implementations, however we refresh the session
|
protected void |
commit()
Just call save on the underlying JCR Session, because level 1 JCR implementation does not offer Transactions
|
protected String |
constructUserPathPart(String username)
Construct the user node path part, using the specified scaling factor.
|
protected javax.jcr.Node |
createUserPathStructure(javax.jcr.Node parent,
String username)
Create the needed Node structure for the given username using the given Node as parent.
|
void |
endRequest()
Logout from open JCR Session
|
protected org.slf4j.Logger |
getLogger()
Return the logger
|
protected javax.jcr.Session |
getSession()
Return the JCR Session
|
protected void |
rollback()
Rollback is not supported by level 1 JCR implementations, so just do nothing
|
execute
public static final String MAILBOXES_PATH
public AbstractJCRScalingMapper(MailboxSessionJCRRepository repository, MailboxSession mSession, int scaling)
protected org.slf4j.Logger getLogger()
protected javax.jcr.Session getSession() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void begin() throws MailboxException
begin
in class TransactionalMapper
MailboxException
protected void commit() throws MailboxException
commit
in class TransactionalMapper
MailboxException
protected void rollback() throws MailboxException
rollback
in class TransactionalMapper
MailboxException
public void endRequest()
endRequest
in interface Mapper
protected String constructUserPathPart(String username)
PAD
So if you use a scaling of 2 it will look like:
foo:
f/fo/foo
fo:
f/fo/fo
f:
f/f_/fusername
- protected javax.jcr.Node createUserPathStructure(javax.jcr.Node parent, String username) throws javax.jcr.RepositoryException
constructUserPathPart(String)
for create the needed node path and split
it when a NODE_DELIMITER was foundparent
- username
- javax.jcr.RepositoryException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.