Class ProtocolCollection
- java.lang.Object
- 
- org.firebirdsql.gds.ng.wire.ProtocolCollection
 
- 
- All Implemented Interfaces:
- java.lang.Iterable<ProtocolDescriptor>
 
 public final class ProtocolCollection extends java.lang.Object implements java.lang.Iterable<ProtocolDescriptor> Collection of protocols for a connect request.In general use getDefaultCollection()to retrieve the default collection.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtocolCollectioncreate(ProtocolDescriptor... descriptors)Creates a ProtocolCollection with the specified ProtocolDescriptors.static ProtocolCollectiongetDefaultCollection()Returns the default ProtocolCollection.intgetProtocolCount()ProtocolDescriptorgetProtocolDescriptor(int protocolVersion)java.util.List<java.lang.Integer>getProtocolVersions()Get a list with the protocol versions in this collection.java.util.Iterator<ProtocolDescriptor>iterator()
 
- 
- 
- 
Method Detail- 
iteratorpublic java.util.Iterator<ProtocolDescriptor> iterator() - Specified by:
- iteratorin interface- java.lang.Iterable<ProtocolDescriptor>
 
 - 
getProtocolDescriptorpublic ProtocolDescriptor getProtocolDescriptor(int protocolVersion) - Parameters:
- protocolVersion- Version of the protocol
- Returns:
- ProtocolDescriptor for the specified version, or null if the version is not in this ProtocolCollection
 
 - 
getProtocolCountpublic int getProtocolCount() - Returns:
- The protocol count
 
 - 
getProtocolVersionspublic java.util.List<java.lang.Integer> getProtocolVersions() Get a list with the protocol versions in this collection.The returned List is created fresh on every call. Changes to the list have no effect on this object. - Returns:
- Protocol version numbers
 
 - 
createpublic static ProtocolCollection create(ProtocolDescriptor... descriptors) Creates a ProtocolCollection with the specified ProtocolDescriptors.If descriptorscontains multiple implementations with the same value forProtocolDescriptor.getVersion(), then the first implementation with the highest value forProtocolDescriptor.getWeight()will be loaded into the collection.- Parameters:
- descriptors- Vararg parameter with ProtocolDescriptors
- Returns:
- ProtocolCollection
 
 - 
getDefaultCollectionpublic static ProtocolCollection getDefaultCollection() Returns the default ProtocolCollection.The default ProtocolCollection is created when this class is loaded by the classloader. This implementation uses the ServiceLoaderto load the default collection based on allProtocolDescriptorimplementations found using all the/META-INF/services/org.firebirdsql.gds.ng.wire.ProtocolDescriptorin the classpath. If multiple implementations with the same value forProtocolDescriptor.getVersion()are found, then the first implementation with the highest value forProtocolDescriptor.getWeight()will be loaded into the default collection.- Returns:
- The default ProtocolCollection
- See Also:
- create(ProtocolDescriptor...)
 
 
- 
 
-