Coverage Report - org.openpermis.Subject
 
Classes in this File Line Coverage Branch Coverage Complexity
Subject
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport
 3  
  *                     (http://www.vbs.admin.ch)
 4  
  * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch)
 5  
  * All rights reserved.
 6  
  *
 7  
  * Licensed under the Open Permis License which accompanies this distribution,
 8  
  * and is available at http://www.openpermis.org/BSDlicenceKent.txt
 9  
  */
 10  
 package org.openpermis;
 11  
 
 12  
 import java.util.Set;
 13  
 
 14  
 import org.openpermis.basic.TimePeriod;
 15  
 import org.openpermis.policy.Identifiable;
 16  
 import org.openpermis.policy.Role;
 17  
 import org.openpermis.policy.TimeStamp;
 18  
 
 19  
 /**
 20  
  * A subject is an entity that requests access to resources.
 21  
  * @since 0.1.0
 22  
  */
 23  
 public interface Subject
 24  
         extends Identifiable
 25  
 {
 26  
 
 27  
         //---- Methods
 28  
 
 29  
         /**
 30  
          * Returns a subset of all roles held by this subject at the current time.
 31  
          * @param timeStamp the current time, a {@link TimeStamp}.
 32  
          * @param roles a set of {@link Role}s.
 33  
          * @return a subset of <code>roles</code> containing only those roles that have
 34  
          * been assigned to this subject.
 35  
          * @since 0.3.0
 36  
          */
 37  
         Set<Role> getAssignedRoles (TimeStamp timeStamp, Set<Role> roles);
 38  
         
 39  
         /**
 40  
          * Returns the subjects who issued the role to this.
 41  
          * @param role a {@link Role}. The subject assumes that it previously confirmed
 42  
          * with {@link #getAssignedRoles(TimeStamp, Set)} to have this role.
 43  
          * @return the subjects who issued the role to this.
 44  
          * @since 0.3.0
 45  
          */
 46  
         Set<Subject> getIssuersOf (Role role);
 47  
         
 48  
         /**
 49  
          * Returns the {@link TimePeriod} of the specific role assignment consisting of issuer and role.
 50  
          * @param role a {@link Role} that was assigned.
 51  
          * @param issuer a {@link Subject} that assigned the role.
 52  
          * @return the {@link TimePeriod} of the specific role assignment consisting of issuer and role.
 53  
          * @since 0.3.0
 54  
          */
 55  
         TimePeriod getValidityOf (Role role, Subject issuer);
 56  
 
 57  
 }