Search in sources :

Example 1 with Verifier

use of org.apache.hadoop.oncrpc.security.Verifier in project hadoop by apache.

the class TestRpcCall method testConstructor.

@Test
public void testConstructor() {
    Credentials credential = new CredentialsNone();
    Verifier verifier = new VerifierNone();
    int rpcVersion = RpcCall.RPC_VERSION;
    int program = 2;
    int version = 3;
    int procedure = 4;
    RpcCall call = new RpcCall(0, RpcMessage.Type.RPC_CALL, rpcVersion, program, version, procedure, credential, verifier);
    assertEquals(0, call.getXid());
    assertEquals(RpcMessage.Type.RPC_CALL, call.getMessageType());
    assertEquals(rpcVersion, call.getRpcVersion());
    assertEquals(program, call.getProgram());
    assertEquals(version, call.getVersion());
    assertEquals(procedure, call.getProcedure());
    assertEquals(credential, call.getCredential());
    assertEquals(verifier, call.getVerifier());
}
Also used : VerifierNone(org.apache.hadoop.oncrpc.security.VerifierNone) CredentialsNone(org.apache.hadoop.oncrpc.security.CredentialsNone) Verifier(org.apache.hadoop.oncrpc.security.Verifier) Credentials(org.apache.hadoop.oncrpc.security.Credentials) Test(org.junit.Test)

Example 2 with Verifier

use of org.apache.hadoop.oncrpc.security.Verifier in project hadoop by apache.

the class TestRpcAcceptedReply method testConstructor.

@Test
public void testConstructor() {
    Verifier verifier = new VerifierNone();
    RpcAcceptedReply reply = new RpcAcceptedReply(0, ReplyState.MSG_ACCEPTED, verifier, AcceptState.SUCCESS);
    assertEquals(0, reply.getXid());
    assertEquals(RpcMessage.Type.RPC_REPLY, reply.getMessageType());
    assertEquals(ReplyState.MSG_ACCEPTED, reply.getState());
    assertEquals(verifier, reply.getVerifier());
    assertEquals(AcceptState.SUCCESS, reply.getAcceptState());
}
Also used : VerifierNone(org.apache.hadoop.oncrpc.security.VerifierNone) Verifier(org.apache.hadoop.oncrpc.security.Verifier) Test(org.junit.Test)

Example 3 with Verifier

use of org.apache.hadoop.oncrpc.security.Verifier in project hadoop by apache.

the class RpcAcceptedReply method read.

public static RpcAcceptedReply read(int xid, ReplyState replyState, XDR xdr) {
    Verifier verifier = Verifier.readFlavorAndVerifier(xdr);
    AcceptState acceptState = AcceptState.fromValue(xdr.readInt());
    return new RpcAcceptedReply(xid, replyState, verifier, acceptState);
}
Also used : Verifier(org.apache.hadoop.oncrpc.security.Verifier)

Example 4 with Verifier

use of org.apache.hadoop.oncrpc.security.Verifier in project hadoop by apache.

the class RpcDeniedReply method read.

public static RpcDeniedReply read(int xid, ReplyState replyState, XDR xdr) {
    Verifier verifier = Verifier.readFlavorAndVerifier(xdr);
    RejectState rejectState = RejectState.fromValue(xdr.readInt());
    return new RpcDeniedReply(xid, replyState, rejectState, verifier);
}
Also used : Verifier(org.apache.hadoop.oncrpc.security.Verifier)

Aggregations

Verifier (org.apache.hadoop.oncrpc.security.Verifier)4 VerifierNone (org.apache.hadoop.oncrpc.security.VerifierNone)2 Test (org.junit.Test)2 Credentials (org.apache.hadoop.oncrpc.security.Credentials)1 CredentialsNone (org.apache.hadoop.oncrpc.security.CredentialsNone)1