Constructor and Description |
---|
ProtocolSignature()
default constructor
|
ProtocolSignature(long version,
int[] methodHashcodes)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int[] |
getMethods() |
static ProtocolSignature |
getProtocolSignature(int clientMethodsHashCode,
long serverVersion,
Class<? extends VersionedProtocol> protocol)
Get a server protocol's signature
|
static ProtocolSignature |
getProtocolSignature(String protocolName,
long version) |
static ProtocolSignature |
getProtocolSignature(VersionedProtocol server,
String protocol,
long clientVersion,
int clientMethodsHash)
Get a server protocol's signature
|
long |
getVersion() |
void |
readFields(DataInput in)
Deserialize the fields of this object from
in . |
static void |
resetCache() |
void |
write(DataOutput out)
Serialize the fields of this object to
out . |
public ProtocolSignature()
public ProtocolSignature(long version, int[] methodHashcodes)
version
- server versionmethodHashcodes
- hash codes of the methods supported by serverpublic long getVersion()
public int[] getMethods()
public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.IOException
public void write(DataOutput out) throws IOException
Writable
out
.write
in interface Writable
out
- DataOuput
to serialize this object into.IOException
public static void resetCache()
public static ProtocolSignature getProtocolSignature(int clientMethodsHashCode, long serverVersion, Class<? extends VersionedProtocol> protocol)
clientMethodsHashCode
- client protocol methods hashcodeserverVersion
- server protocol versionprotocol
- protocolpublic static ProtocolSignature getProtocolSignature(String protocolName, long version) throws ClassNotFoundException
ClassNotFoundException
public static ProtocolSignature getProtocolSignature(VersionedProtocol server, String protocol, long clientVersion, int clientMethodsHash) throws IOException
server
- server implementationprotocol
- server protocolclientVersion
- client's versionclientMethodsHash
- client's protocol's hash codeIOException
- if any error occursCopyright © 2013 Apache Software Foundation. All rights reserved.