org.eclipse.emf.cdo.server
Class CDOServerUtil.RepositoryReadAccessValidator

java.lang.Object
  extended by org.eclipse.emf.cdo.server.CDOServerUtil.RepositoryReadAccessValidator
All Implemented Interfaces:
IRepository.Handler, IRepository.ReadAccessHandler
Enclosing class:
CDOServerUtil

public abstract static class CDOServerUtil.RepositoryReadAccessValidator
extends Object
implements IRepository.ReadAccessHandler

An abstract read-access handler that grants or denies access to single revisions.

Since:
2.0

Constructor Summary
CDOServerUtil.RepositoryReadAccessValidator()
           
 
Method Summary
 void handleRevisionsBeforeSending(ISession session, CDORevision[] revisions, List<CDORevision> additionalRevisions)
          Provides a way to handle revisions that are to be sent to the client.
protected  void throwException(ISession session, List<String> violations)
           
protected  void throwException(String message)
           
protected abstract  String validate(ISession session, CDORevision revision)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDOServerUtil.RepositoryReadAccessValidator

public CDOServerUtil.RepositoryReadAccessValidator()
Method Detail

handleRevisionsBeforeSending

public void handleRevisionsBeforeSending(ISession session,
                                         CDORevision[] revisions,
                                         List<CDORevision> additionalRevisions)
                                  throws RuntimeException
Description copied from interface: IRepository.ReadAccessHandler
Provides a way to handle revisions that are to be sent to the client.

Specified by:
handleRevisionsBeforeSending in interface IRepository.ReadAccessHandler
Parameters:
session - The session that is going to send the revisions.
revisions - The revisions that are requested by the client. If the client must not see any of these revisions an unchecked exception must be thrown.
additionalRevisions - The additional revisions that are to be sent to the client because internal optimizers believe that they will be needed soon. If the client must not see any of these revisions they should be removed from the list.
Throws:
RuntimeException - to indicate that none of the revisions must be sent to the client. This exception will be visible at the client side!

throwException

protected void throwException(ISession session,
                              List<String> violations)
                       throws RuntimeException
Throws:
RuntimeException

throwException

protected void throwException(String message)
                       throws RuntimeException
Throws:
RuntimeException

validate

protected abstract String validate(ISession session,
                                   CDORevision revision)


Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.