001/** 002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 003 * 004 * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved 005 * 006 * The contents of this file are subject to the terms 007 * of the Common Development and Distribution License 008 * (the License). You may not use this file except in 009 * compliance with the License. 010 * 011 * You can obtain a copy of the License at 012 * https://opensso.dev.java.net/public/CDDLv1.0.html or 013 * opensso/legal/CDDLv1.0.txt 014 * See the License for the specific language governing 015 * permission and limitations under the License. 016 * 017 * When distributing Covered Code, include this CDDL 018 * Header Notice in each file and include the License file 019 * at opensso/legal/CDDLv1.0.txt. 020 * If applicable, add the following below the CDDL Header, 021 * with the fields enclosed by brackets [] replaced by 022 * your own identifying information: 023 * "Portions Copyrighted [year] [name of copyright owner]" 024 * 025 * $Id: AuthorizationDecisionStatement.java,v 1.2 2008/06/25 05:47:32 qcheng Exp $ 026 * 027 */ 028 029 030package com.sun.identity.saml.assertion; 031 032import java.text.*; 033import java.util.*; 034import org.w3c.dom.*; 035import com.sun.identity.saml.common.SAMLException; 036 037/** 038 *The <code>AuthorizationDecisionStatement</code> element supplies a statement 039 *by the issuer that the request for access by the specified subject to the 040 *specified resource has resulted in the specified decision on the basis of 041 *some optionally specified evidence. 042 * 043 *@supported.all.api 044 */ 045public class AuthorizationDecisionStatement 046 extends AuthorizationDecisionStatementBase { 047 048 /** 049 *Default constructor 050 */ 051 protected AuthorizationDecisionStatement() { 052 super(); 053 } 054 055 /** 056 * Constructs an <code>AuthorizationStatement</code> element from an 057 * existing XML block. 058 * 059 * @param element representing a DOM tree element 060 * @exception SAMLException if there is an error in the sender or in 061 * the element definition. 062 */ 063 public AuthorizationDecisionStatement(Element element) 064 throws SAMLException { 065 super(element); 066 } 067 068 /** 069 * Constructs an instance of <code>AuthorizationDecisionStatement</code>. 070 * 071 * @param subject (required) A Subject object 072 * @param resource (required) A String identifying the resource to which 073 * access authorization is sought. 074 * @param decision (required) The decision rendered by the issuer with 075 * respect to the specified resource. The value is of the 076 * <code>DecisionType</code> simple type. 077 * @param action (required) A List of Action objects specifying the set of 078 * actions authorized to be performed on the specified resource. 079 * @param evidence (optional) An Evidence object representing a set of 080 * assertions that the issuer replied on in making decisions. 081 * @exception SAMLException if there is an error in the sender. 082 */ 083 public AuthorizationDecisionStatement(Subject subject, String resource, 084 int decision, List action, EvidenceBase evidence) 085 throws SAMLException { 086 super(subject, resource, decision, action, evidence); 087 } 088 089 /** 090 * Constructs a <code>AuthorizationDecisionStatement</code> instance. 091 * 092 *@param subject (required) A Subject object 093 *@param resource (required) A String identifying the resource to which 094 * access authorization is sought. 095 *@param decision (required) The decision rendered by the issuer with 096 * respect to the specified resource. The value is of the 097 * <code>DecisionType</code> simple type. 098 *@param action (required) A List of Action objects specifying the set of 099 * actions authorized to be performed on the 100 * specified resource. 101 *@exception SAMLException if there is an error in the sender. 102 */ 103 public AuthorizationDecisionStatement(Subject subject, String resource, 104 int decision, List action) throws SAMLException { 105 super(subject, resource, decision, action); 106 } 107 108 protected EvidenceBase createEvidence(Element evidenceElement) 109 throws SAMLException { 110 return new Evidence(evidenceElement); 111 } 112 113 protected Subject createSubject(Element subjectElement) 114 throws SAMLException { 115 return new Subject(subjectElement); 116 } 117 118 protected Action createAction(Element actionElement) throws SAMLException { 119 return new Action(actionElement); 120 } 121 122 /** 123 * Returns the evidence from <code>AuthorizationStatement</code>. 124 * 125 * @return An Evidence object that the issuer replied on in making decisions. 126 */ 127 public Evidence getEvidence() { 128 return (Evidence)_evidence; 129 } 130 131} 132