strolch/src/ch/eitchnet/privilege/handler/SessionHandler.java

62 lines
1.6 KiB
Java
Raw Normal View History

2010-05-20 21:36:16 +02:00
/*
* Copyright (c) 2010
*
* Robert von Burg
* eitch@eitchnet.ch
*
* All rights reserved.
*
*/
package ch.eitchnet.privilege.handler;
2010-05-25 23:15:35 +02:00
import ch.eitchnet.privilege.base.PrivilegeContainerObject;
2010-05-24 21:21:46 +02:00
import ch.eitchnet.privilege.i18n.AccessDeniedException;
2010-06-05 23:06:03 +02:00
import ch.eitchnet.privilege.i18n.PrivilegeException;
2010-05-24 21:21:46 +02:00
import ch.eitchnet.privilege.model.Certificate;
import ch.eitchnet.privilege.model.Restrictable;
2010-05-29 20:47:04 +02:00
import ch.eitchnet.privilege.model.internal.User;
2010-05-24 21:21:46 +02:00
2010-05-20 21:36:16 +02:00
/**
* @author rvonburg
*
*/
2010-05-25 23:15:35 +02:00
public interface SessionHandler extends PrivilegeContainerObject {
2010-05-20 21:36:16 +02:00
2010-05-24 21:21:46 +02:00
/**
* @param certificate
* @param restrictable
2010-06-05 23:06:03 +02:00
*
2010-05-24 21:21:46 +02:00
* @return
*
* @throws AccessDeniedException
* if the {@link Certificate} is not for a currently logged in {@link User} or if the user may not
* perform the action defined by the {@link Restrictable} implementation
2010-06-05 23:06:03 +02:00
* @throws PrivilegeException
* if there is anything wrong with this certificate
2010-05-24 21:21:46 +02:00
*/
public boolean actionAllowed(Certificate certificate, Restrictable restrictable);
2010-06-05 23:06:03 +02:00
/**
* @param certificate
* @return
*
* @throws AccessDeniedException
* if the {@link Certificate} is not for a currently logged in {@link User}
* @throws PrivilegeException
* if there is anything wrong with this certificate
*/
public boolean isCertificateValid(Certificate certificate);
2010-05-24 21:21:46 +02:00
/**
* @param user
* @param password
2010-06-05 23:06:03 +02:00
*
2010-05-24 21:21:46 +02:00
* @return
*
* @throws AccessDeniedException
* if the user credentials are not valid
*/
public Certificate authenticate(String user, String password);
2010-05-20 21:36:16 +02:00
}