APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.provider.certpath

public Class AdjacencyList

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .Iterator, .List

An AdjacencyList is used to store the history of certification paths attempted in constructing a path from an initiator to a target. The AdjacencyList is initialized with a List of Lists, where each sub-List contains objects of type Vertex. A Vertex describes one possible or actual step in the chain building process, and the associated Certificate. Specifically, a Vertex object contains a Certificate and an index value referencing the next sub-list in the process. If the index value is -1 then this Vertex doesn't continue the attempted build path.

Example:

Attempted Paths:

AdjacencyList structure:

The iterator method returns objects of type BuildStep, not objects of type Vertex. A BuildStep contains a Vertex and a result code, accessible via getResult method. There are five result values. POSSIBLE denotes that the current step represents a Certificate that the builder is considering at this point in the build. FOLLOW denotes a Certificate (one of those noted as POSSIBLE) that the builder is using to try extending the chain. BACK represents that a FOLLOW was incorrect, and is being removed from the chain. There is exactly one FOLLOW for each BACK. The values SUCCEED and FAIL mean that we've come to the end of the build process, and there will not be any more entries in the list.

Author
seth proctor
Since
1.4
See Also
sun.security.provider.certpath.BuildStep, sun.security.provider.certpath.Vertex

Field Summary

Modifier and TypeField and Description
private final List<List<Vertex>>
private final ArrayList<BuildStep>

Constructor Summary

AccessConstructor and Description
public
AdjacencyList(List<List<Vertex>>
a List of Lists of Vertex objects
list
)

Constructs a new AdjacencyList based on the specified List.

Method Summary

Modifier and TypeMethod and Description
private boolean
buildList(List<List<Vertex>> theList, int index, BuildStep follow)

Recursive, private method which actually builds the step list from the given adjacency list.

public Iterator<BuildStep>

Returns:

an Iterator over the BuildSteps
iterator
()

Gets an Iterator to iterate over the set of BuildSteps in build-order.

public int
numAttemptedPaths()

Returns the number of attempted paths (useful for debugging).

public String

Returns:

String representation
toString
()

Overrides java.lang.Object.toString.

Prints out a string representation of this AdjacencyList.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

mOrigListback to summary
private final List<List<Vertex>> mOrigList
mStepListback to summary
private final ArrayList<BuildStep> mStepList

Constructor Detail

AdjacencyListback to summary
public AdjacencyList(List<List<Vertex>> list)

Constructs a new AdjacencyList based on the specified List. See the example above.

Parameters
list:List<List<Vertex>>

a List of Lists of Vertex objects

Method Detail

buildListback to summary
private boolean buildList(List<List<Vertex>> theList, int index, BuildStep follow)

Recursive, private method which actually builds the step list from the given adjacency list. Follow is the parent BuildStep that we followed to get here, and if it's null, it means that we're at the start.

iteratorback to summary
public Iterator<BuildStep> iterator()

Gets an Iterator to iterate over the set of BuildSteps in build-order. Any attempts to change the list through the remove method will fail.

Returns:Iterator<BuildStep>

an Iterator over the BuildSteps

numAttemptedPathsback to summary
public int numAttemptedPaths()

Returns the number of attempted paths (useful for debugging).

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Prints out a string representation of this AdjacencyList.

Returns:String

String representation

Annotations
@Override