public VersionedConnection getVersionedConnection(final byte version, final Channel channel, final JMXServiceURL serviceURL) throws IOException { if (supportedVersions.containsKey(version)) { if (version == VersionOne.getVersionIdentifier()) { return VersionOne.getConnection(channel, environment); } else if (version == VersionTwo.getVersionIdentifier()) { return VersionTwo.getConnection(channel, environment, serviceURL); } } else { log.warnf("An attempt has been made to select an unsupported version 0x0%d", version); } throw new IllegalArgumentException("Unsupported protocol version."); }
public VersionedConnection getVersionedConnection(final byte version, final Channel channel, final JMXServiceURL serviceURL) throws IOException { if (supportedVersions.containsKey(version)) { if (version == VersionOne.getVersionIdentifier()) { return VersionOne.getConnection(channel, environment); } else if (version == VersionTwo.getVersionIdentifier()) { return VersionTwo.getConnection(channel, environment, serviceURL); } } else { log.warnf("An attempt has been made to select an unsupported version 0x0%d", version); } throw new IllegalArgumentException("Unsupported protocol version."); }
public VersionedConnection getVersionedConnection(final byte version, final Channel channel, final JMXServiceURL serviceURL) throws IOException { if (supportedVersions.containsKey(version)) { if (version == VersionOne.getVersionIdentifier()) { return VersionOne.getConnection(channel, environment); } else if (version == VersionTwo.getVersionIdentifier()) { return VersionTwo.getConnection(channel, environment, serviceURL); } } else { log.warnf("An attempt has been made to select an unsupported version 0x0%d", version); } throw new IllegalArgumentException("Unsupported protocol version."); }