Coverage Report - org.openpermis.audit.AccessDecisionRequest
 
Classes in this File Line Coverage Branch Coverage Complexity
AccessDecisionRequest
58%
7/12
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch)
 3  
  * All rights reserved.
 4  
  * 
 5  
  * Licensed under the Open Permis License which accompanies this distribution, 
 6  
  * and is available at http://www.openpermis.org/BSDlicenceKent.txt
 7  
  */
 8  
 package org.openpermis.audit;
 9  
 
 10  
 import java.io.Serializable;
 11  
 import java.net.URI;
 12  
 import java.util.ArrayList;
 13  
 import java.util.Collections;
 14  
 import java.util.List;
 15  
 
 16  
 import org.openpermis.Subject;
 17  
 import org.openpermis.policy.TimeStamp;
 18  
 
 19  
 
 20  
 /**
 21  
  * Encapsulates the parameters of an access decision request for use in auditing messages.
 22  
  * @see org.openpermis.PolicyDecisionPoint#getAccessDecision
 23  
  * @since 0.3.0
 24  
  */
 25  
 public class AccessDecisionRequest
 26  
         implements Serializable
 27  
 {
 28  
 
 29  
         //---- Static
 30  
         
 31  
         /**
 32  
          * @since 0.3.0
 33  
          */
 34  
         private static final long serialVersionUID = -4613418651627169383L;
 35  
         
 36  
         //---- State
 37  
         
 38  
         /**
 39  
          * @since 0.3.0
 40  
          */
 41  
         private final Subject subject;
 42  
         
 43  
         /**
 44  
          * @since 0.3.0
 45  
          */
 46  
         private final URI resourceUri;
 47  
         
 48  
         /**
 49  
          * @since 0.3.0
 50  
          */
 51  
         private final String actionName;
 52  
         
 53  
         /**
 54  
          * @since 0.3.0
 55  
          */
 56  
         private final List<?> arguments;
 57  
 
 58  
         /**
 59  
          * @since 0.3.0
 60  
          */
 61  
         private final TimeStamp timeStamp;
 62  
         
 63  
         //---- Constructors
 64  
         
 65  
         /**
 66  
          * Encapsulates the parameters of an access decision request for use in auditing messages.
 67  
          * <p>Check out {@link org.openpermis.PolicyDecisionPoint#getAccessDecision} for more 
 68  
          * information on the parameters.</p>
 69  
          * @param subject corresponds to the {@code subject} of the access decision request.
 70  
          * @param resourceUri corresponds to the {@code resourceUri} of the access decision request.
 71  
          * @param actionName corresponds to the {@code actionName} of the access decision request.
 72  
          * @param arguments corresponds to the {@code arguments} of the access decision request.
 73  
          * @param timeStamp corresponds to the {@code timeStamp} of the access decision request.
 74  
          * @see org.openpermis.PolicyDecisionPoint#getAccessDecision
 75  
          * @since 0.3.0
 76  
          */
 77  
         @SuppressWarnings("unchecked")
 78  
         public AccessDecisionRequest (
 79  
                 Subject subject,
 80  
                 URI resourceUri,
 81  
                 String actionName,
 82  
                 List<?> arguments,
 83  
                 TimeStamp timeStamp
 84  1
         ) {
 85  1
                 this.subject = subject;
 86  1
                 this.resourceUri = resourceUri;
 87  1
                 this.actionName = actionName;
 88  1
                 this.arguments = Collections.unmodifiableList(new ArrayList(arguments));
 89  1
                 this.timeStamp = timeStamp;
 90  1
         }
 91  
         
 92  
         //---- Methods
 93  
 
 94  
         /**
 95  
          * Returns the subject of an access decision request.
 96  
          * @return the subject requested.
 97  
          * @see org.openpermis.PolicyDecisionPoint#getAccessDecision
 98  
          * @since 0.3.0
 99  
          */
 100  
         public final Subject getSubject () {
 101  0
                 return this.subject;
 102  
         }
 103  
         
 104  
         /**
 105  
          * Returns the resourceUri of an access decision request.
 106  
          * @return the resourceUri requested.
 107  
          * @see org.openpermis.PolicyDecisionPoint#getAccessDecision
 108  
          * @since 0.3.0
 109  
          */
 110  
         public final URI getResourceUri () {
 111  0
                 return this.resourceUri;
 112  
         }
 113  
         
 114  
         /**
 115  
          * Returns the actionName of an access decision request.
 116  
          * @return the actionName requested.
 117  
          * @see org.openpermis.PolicyDecisionPoint#getAccessDecision
 118  
          * @since 0.3.0
 119  
          */
 120  
         public final String getActionName () {
 121  0
                 return this.actionName;
 122  
         }
 123  
         
 124  
         /**
 125  
          * Returns the arguments of an access decision request.
 126  
          * @return the arguments requested.
 127  
          * @see org.openpermis.PolicyDecisionPoint#getAccessDecision
 128  
          * @since 0.3.0
 129  
          */
 130  
         public final List<?> getArguments () {
 131  0
                 return this.arguments;
 132  
         }
 133  
         
 134  
         /**
 135  
          * Returns the timeStamp of an access decision request.
 136  
          * @return the timeStamp requested.
 137  
          * @see org.openpermis.PolicyDecisionPoint#getAccessDecision
 138  
          * @since 0.3.0
 139  
          */
 140  
         public final TimeStamp getTimeStamp () {
 141  0
                 return this.timeStamp;
 142  
         }
 143  
 
 144  
 }