use of org.apache.zookeeper_voltpatches.data.Id in project voltdb by VoltDB.
the class Id method compareTo.
public int compareTo(Object peer_) throws ClassCastException {
if (!(peer_ instanceof Id)) {
throw new ClassCastException("Comparing different types of records.");
}
Id peer = (Id) peer_;
int ret = 0;
ret = scheme.compareTo(peer.scheme);
if (ret != 0)
return ret;
ret = id.compareTo(peer.id);
if (ret != 0)
return ret;
return ret;
}
use of org.apache.zookeeper_voltpatches.data.Id in project voltdb by VoltDB.
the class DigestAuthenticationProvider method handleAuthentication.
public KeeperException.Code handleAuthentication(ServerCnxn cnxn, byte[] authData) {
String id = new String(authData);
try {
String digest = generateDigest(id);
if (digest.equals(superDigest)) {
cnxn.getAuthInfo().add(new Id("super", ""));
}
cnxn.getAuthInfo().add(new Id(getScheme(), digest));
return KeeperException.Code.OK;
} catch (NoSuchAlgorithmException e) {
LOG.error("Missing algorithm", e);
}
return KeeperException.Code.AUTHFAILED;
}
Aggregations