org.nhindirect.stagent
Class NHINDAddressCollection

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<NHINDAddress>
              extended by org.nhindirect.stagent.NHINDAddressCollection
All Implemented Interfaces:
Serializable, Cloneable, Iterable<NHINDAddress>, Collection<NHINDAddress>, List<NHINDAddress>, RandomAccess

public class NHINDAddressCollection
extends ArrayList<NHINDAddress>

A collection of NHINDAddresses.

Author:
Greg Meyer, Umesh Madan
See Also:
Serialized Form

Field Summary
static TrustEnforcementStatus DefaultMinTrustStatus
           
 
Constructor Summary
NHINDAddressCollection()
          Constructs an empty collection.
 
Method Summary
static NHINDAddressCollection create(Collection<NHINDAddress> source)
          Generates an instance of an NHINDAddressCollection from a collection of NHINDAddress addresses.
 Collection<X509Certificate> getCertificates()
          Gets a collection of all certificates associated with all of the addresses in the collection.
 X509Certificate getFirstCertificate()
          Gets the first available certificate the certificate collection.
 Collection<NHINDAddress> getTrusted()
          Gets all addresses in the collection that are trusted.
 Collection<NHINDAddress> getTrusted(TrustEnforcementStatus minTrustStatus)
          Gets all addresses in the collection that meet the minimum trust status.
 Collection<NHINDAddress> getUntrusted()
          Gets all addresses in the collection that are not trusted.
 Collection<NHINDAddress> getUntrusted(TrustEnforcementStatus minTrustStatus)
          Gets all addresses in the collection that do not meet the minimum trust status.
 boolean isTrusted()
          Indicates if the collection has any addresses that are trusted.
 boolean isTrusted(TrustEnforcementStatus minTrustStatus)
          Indicates if the collection has any addresses that meet the minimum trust status.
static NHINDAddressCollection parse(String addressesLine, AddressSource source)
          Parses an message router header to a collection of address.
 void removeUntrusted()
          Removes all addresses from the collection that are note trusted.
 void removeUntrusted(TrustEnforcementStatus minTrustStatus)
          Removes all addresses from the collection that do not meet the minimum trust status.
 void setSource(AddressSource source)
          Sets the address source type of all addresses in the collection.
 Collection<javax.mail.internet.InternetAddress> toInternetAddressCollection()
          Converts the collection an instance of a Collection object.
 String toString()
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

DefaultMinTrustStatus

public static final TrustEnforcementStatus DefaultMinTrustStatus
Constructor Detail

NHINDAddressCollection

public NHINDAddressCollection()
Constructs an empty collection.

Method Detail

getCertificates

public Collection<X509Certificate> getCertificates()
Gets a collection of all certificates associated with all of the addresses in the collection.

Returns:
A collection of all certificates associated with all of the addresses in the collection.

getFirstCertificate

public X509Certificate getFirstCertificate()
Gets the first available certificate the certificate collection. This is generally used to choose a certificate for validating a message signature.

Returns:
The first available certificate the certificate collection.

getTrusted

public Collection<NHINDAddress> getTrusted()
Gets all addresses in the collection that are trusted.

Returns:
All addresses in the collection that are trusted.

getTrusted

public Collection<NHINDAddress> getTrusted(TrustEnforcementStatus minTrustStatus)
Gets all addresses in the collection that meet the minimum trust status.

Parameters:
minTrustStatus - The minimum trust status.
Returns:
All addresses in the collection that are trusted.

getUntrusted

public Collection<NHINDAddress> getUntrusted()
Gets all addresses in the collection that are not trusted.

Returns:
All addresses in the collection that are not trusted.

getUntrusted

public Collection<NHINDAddress> getUntrusted(TrustEnforcementStatus minTrustStatus)
Gets all addresses in the collection that do not meet the minimum trust status.

Parameters:
minTrustStatus - The minimum trust status.
Returns:
All addresses in the collection that are not trusted.

isTrusted

public boolean isTrusted()
Indicates if the collection has any addresses that are trusted.

Returns:
True if the collection contains any addresses that are trusted. False otherwise.

isTrusted

public boolean isTrusted(TrustEnforcementStatus minTrustStatus)
Indicates if the collection has any addresses that meet the minimum trust status.

Parameters:
minTrustStatus - The minimum trust status.
Returns:
True if the collection contains any addresses that eet the minimum trust status. False otherwise.

removeUntrusted

public void removeUntrusted()
Removes all addresses from the collection that are note trusted.


removeUntrusted

public void removeUntrusted(TrustEnforcementStatus minTrustStatus)
Removes all addresses from the collection that do not meet the minimum trust status.


toInternetAddressCollection

public Collection<javax.mail.internet.InternetAddress> toInternetAddressCollection()
Converts the collection an instance of a Collection object.

Returns:

setSource

public void setSource(AddressSource source)
Sets the address source type of all addresses in the collection.

Parameters:
source - The address source type to apply to all addresses in the collection.

toString

public String toString()
Overrides:
toString in class AbstractCollection<NHINDAddress>

create

public static NHINDAddressCollection create(Collection<NHINDAddress> source)
Generates an instance of an NHINDAddressCollection from a collection of NHINDAddress addresses.

Parameters:
source - A collection of NHINDAddress addresses to seed this object with.
Returns:
n instance of an NHINDAddressCollection object containing all of the source addresses.

parse

public static NHINDAddressCollection parse(String addressesLine,
                                           AddressSource source)
Parses an message router header to a collection of address. The addressline may or may not include the header name.

Parameters:
addressesLine - The raw message header. The header name does not need to be included, but should use the proper header delimiter if it is included.
source - The address source type of the address line.
Returns:
A collection of addresses parsed from the address line.


Copyright © 2010-2015 NHIN Direct. All Rights Reserved.