jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/ReferenceList.java
author mullan
Mon, 26 Sep 2011 17:20:45 -0700
changeset 10694 cf59e2badd14
parent 2 90ce3da70b43
child 18780 f47b920867e7
permissions -rw-r--r--
7088502: Security libraries don't build with javac -Werror Summary: Changes to files in src/share/classes/com/sun/org/apache/xml/internal/security and its subpackages to remove warnings Reviewed-by: mullan Contributed-by: kurchi.subhra.hazra@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * Copyright  2003-2004 The Apache Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *  Licensed under the Apache License, Version 2.0 (the "License");
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *  you may not use this file except in compliance with the License.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *  You may obtain a copy of the License at
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 *      http://www.apache.org/licenses/LICENSE-2.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *  Unless required by applicable law or agreed to in writing, software
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *  distributed under the License is distributed on an "AS IS" BASIS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 *  See the License for the specific language governing permissions and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *  limitations under the License.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
package com.sun.org.apache.xml.internal.security.encryption;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
import java.util.Iterator;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * <code>ReferenceList</code> is an element that contains pointers from a key
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * value of an <code>EncryptedKey</code> to items encrypted by that key value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * (<code>EncryptedData</code> or <code>EncryptedKey</code> elements).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * It is defined as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * <xmp>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * <element name='ReferenceList'>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *     <complexType>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *         <choice minOccurs='1' maxOccurs='unbounded'>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *             <element name='DataReference' type='xenc:ReferenceType'/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *             <element name='KeyReference' type='xenc:ReferenceType'/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *         </choice>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *     </complexType>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * </element>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * </xmp>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * @author Axl Mattheus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * @see Reference
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
public interface ReferenceList {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        /** DATA TAG */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    public static final int DATA_REFERENCE = 0x00000001;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    /** KEY TAG */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    public static final int KEY_REFERENCE  = 0x00000002;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * Adds a reference to this reference list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * @param reference the reference to add.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * @throws IllegalAccessException if the <code>Reference</code> is not an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *   instance of <code>DataReference</code> or <code>KeyReference</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public void add(Reference reference);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * Removes a reference from the <code>ReferenceList</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * @param reference the reference to remove.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    public void remove(Reference reference);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Returns the size of the <code>ReferenceList</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * @return the size of the <code>ReferenceList</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    public int size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * Indicates if the <code>ReferenceList</code> is empty.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * @return <code><b>true</b></code> if the <code>ReferenceList</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     *     empty, else <code><b>false</b></code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    public boolean isEmpty();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * Returns an <code>Iterator</code> over all the <code>Reference</code>s
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * contatined in this <code>ReferenceList</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * @return Iterator.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     */
10694
cf59e2badd14 7088502: Security libraries don't build with javac -Werror
mullan
parents: 2
diff changeset
    90
    public Iterator<Reference> getReferences();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * <code>DataReference</code> factory method. Returns a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * <code>DataReference</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * @param uri
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @return
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    public Reference newDataReference(String uri);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * <code>KeyReference</code> factory method. Returns a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * <code>KeyReference</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @param uri
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public Reference newKeyReference(String uri);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
}