KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xml > internal > security > encryption > ReferenceList


1 /*
2  * Copyright 2003-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17 package com.sun.org.apache.xml.internal.security.encryption;
18
19
20 import java.util.Iterator JavaDoc;
21
22
23 /**
24  * <code>ReferenceList</code> is an element that contains pointers from a key
25  * value of an <code>EncryptedKey</code> to items encrypted by that key value
26  * (<code>EncryptedData</code> or <code>EncryptedKey</code> elements).
27  * <p>
28  * It is defined as follows:
29  * <xmp>
30  * <element name='ReferenceList'>
31  * <complexType>
32  * <choice minOccurs='1' maxOccurs='unbounded'>
33  * <element name='DataReference' type='xenc:ReferenceType'/>
34  * <element name='KeyReference' type='xenc:ReferenceType'/>
35  * </choice>
36  * </complexType>
37  * </element>
38  * </xmp>
39  *
40  * @author Axl Mattheus
41  * @see Reference
42  */

43 public interface ReferenceList {
44     /** DATA TAG */
45     public static final int DATA_REFERENCE = 0x00000001;
46     /** KEY TAG */
47     public static final int KEY_REFERENCE = 0x00000002;
48
49     /**
50      * Adds a reference to this reference list.
51      *
52      * @param reference the reference to add.
53      * @throws IllegalAccessException if the <code>Reference</code> is not an
54      * instance of <code>DataReference</code> or <code>KeyReference</code>.
55      */

56     public void add(Reference reference);
57
58     /**
59      * Removes a reference from the <code>ReferenceList</code>.
60      *
61      * @param reference the reference to remove.
62      */

63     public void remove(Reference reference);
64
65     /**
66      * Returns the size of the <code>ReferenceList</code>.
67      *
68      * @return the size of the <code>ReferenceList</code>.
69      */

70     public int size();
71
72     /**
73      * Indicates if the <code>ReferenceList</code> is empty.
74      *
75      * @return <code><b>true</b></code> if the <code>ReferenceList</code> is
76      * empty, else <code><b>false</b></code>.
77      */

78     public boolean isEmpty();
79
80     /**
81      * Returns an <code>Iterator</code> over all the <code>Reference</code>s
82      * contatined in this <code>ReferenceList</code>.
83      *
84      * @return Iterator.
85      */

86     public Iterator JavaDoc getReferences();
87
88     /**
89      * <code>DataReference</code> factory method. Returns a
90      * <code>DataReference</code>.
91      * @param uri
92      * @return
93      */

94     public Reference newDataReference(String JavaDoc uri);
95
96     /**
97      * <code>KeyReference</code> factory method. Returns a
98      * <code>KeyReference</code>.
99      * @param uri
100      * @return
101      */

102     public Reference newKeyReference(String JavaDoc uri);
103 }
104
Popular Tags