org.apache.xml.security.encryption.ReferenceList Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.xml.security.encryption;
import java.util.Iterator;
/**
* ReferenceList
is an element that contains pointers from a key
* value of an EncryptedKey
to items encrypted by that key value
* (EncryptedData
or EncryptedKey
elements).
*
* It is defined as follows:
*
*
*
*
*
*
*
*
*
*
*
* @author Axl Mattheus
* @see Reference
*/
public interface ReferenceList {
/** DATA TAG */
int DATA_REFERENCE = 0x00000001;
/** KEY TAG */
int KEY_REFERENCE = 0x00000002;
/**
* Adds a reference to this reference list.
*
* @param reference the reference to add.
* @throws IllegalAccessException if the Reference
is not an
* instance of DataReference
or KeyReference
.
*/
void add(Reference reference);
/**
* Removes a reference from the ReferenceList
.
*
* @param reference the reference to remove.
*/
void remove(Reference reference);
/**
* Returns the size of the ReferenceList
.
*
* @return the size of the ReferenceList
.
*/
int size();
/**
* Indicates if the ReferenceList
is empty.
*
* @return true
if the ReferenceList
is
* empty, else false
.
*/
boolean isEmpty();
/**
* Returns an Iterator
over all the Reference
s
* contained in this ReferenceList
.
*
* @return Iterator.
*/
Iterator getReferences();
/**
* DataReference
factory method. Returns a
* DataReference
.
* @param uri
* @return a DataReference
.
*/
Reference newDataReference(String uri);
/**
* KeyReference
factory method. Returns a
* KeyReference
.
* @param uri
* @return a KeyReference
.
*/
Reference newKeyReference(String uri);
}