Search in sources :

Example 1 with ThriftMessageUtil

use of org.apache.accumulo.core.util.ThriftMessageUtil in project accumulo by apache.

the class AuthenticationTokenIdentifier method readFields.

@Override
public void readFields(DataInput in) throws IOException {
    int length = in.readInt();
    if (length > 0) {
        ThriftMessageUtil msgUtil = new ThriftMessageUtil();
        byte[] serialized = new byte[length];
        in.readFully(serialized);
        var tAuthTokenId = msgUtil.deserialize(serialized, new TAuthenticationTokenIdentifier());
        populateFields(tAuthTokenId);
    }
}
Also used : TAuthenticationTokenIdentifier(org.apache.accumulo.core.securityImpl.thrift.TAuthenticationTokenIdentifier) ThriftMessageUtil(org.apache.accumulo.core.util.ThriftMessageUtil)

Example 2 with ThriftMessageUtil

use of org.apache.accumulo.core.util.ThriftMessageUtil in project accumulo by apache.

the class AuthenticationTokenIdentifier method readFields.

@Override
public void readFields(DataInput in) throws IOException {
    int length = in.readInt();
    if (length > 0) {
        ThriftMessageUtil msgUtil = new ThriftMessageUtil();
        byte[] serialized = new byte[length];
        in.readFully(serialized);
        impl = new TAuthenticationTokenIdentifier();
        msgUtil.deserialize(serialized, impl);
    }
}
Also used : TAuthenticationTokenIdentifier(org.apache.accumulo.core.security.thrift.TAuthenticationTokenIdentifier) ThriftMessageUtil(org.apache.accumulo.core.util.ThriftMessageUtil)

Example 3 with ThriftMessageUtil

use of org.apache.accumulo.core.util.ThriftMessageUtil in project accumulo by apache.

the class AuthenticationTokenIdentifier method write.

@Override
public void write(DataOutput out) throws IOException {
    if (null != impl) {
        ThriftMessageUtil msgUtil = new ThriftMessageUtil();
        ByteBuffer serialized = msgUtil.serialize(impl);
        out.writeInt(serialized.limit());
        ByteBufferUtil.write(out, serialized);
    } else {
        out.writeInt(0);
    }
}
Also used : ByteBuffer(java.nio.ByteBuffer) ThriftMessageUtil(org.apache.accumulo.core.util.ThriftMessageUtil)

Example 4 with ThriftMessageUtil

use of org.apache.accumulo.core.util.ThriftMessageUtil in project accumulo by apache.

the class AuthenticationTokenIdentifier method write.

@Override
public void write(DataOutput out) throws IOException {
    ThriftMessageUtil msgUtil = new ThriftMessageUtil();
    ByteBuffer serialized = msgUtil.serialize(impl);
    out.writeInt(serialized.limit());
    ByteBufferUtil.write(out, serialized);
}
Also used : ByteBuffer(java.nio.ByteBuffer) ThriftMessageUtil(org.apache.accumulo.core.util.ThriftMessageUtil)

Example 5 with ThriftMessageUtil

use of org.apache.accumulo.core.util.ThriftMessageUtil in project accumulo by apache.

the class AuthenticationKey method readFields.

@Override
public void readFields(DataInput in) throws IOException {
    int length = WritableUtils.readVInt(in);
    if (length == 0) {
        return;
    }
    ThriftMessageUtil util = new ThriftMessageUtil();
    byte[] bytes = new byte[length];
    in.readFully(bytes);
    authKey = util.deserialize(bytes, new TAuthenticationKey());
    secret = AuthenticationTokenSecretManager.createSecretKey(authKey.getSecret());
}
Also used : TAuthenticationKey(org.apache.accumulo.core.securityImpl.thrift.TAuthenticationKey) ThriftMessageUtil(org.apache.accumulo.core.util.ThriftMessageUtil)

Aggregations

ThriftMessageUtil (org.apache.accumulo.core.util.ThriftMessageUtil)6 ByteBuffer (java.nio.ByteBuffer)3 TAuthenticationTokenIdentifier (org.apache.accumulo.core.security.thrift.TAuthenticationTokenIdentifier)1 TAuthenticationKey (org.apache.accumulo.core.securityImpl.thrift.TAuthenticationKey)1 TAuthenticationTokenIdentifier (org.apache.accumulo.core.securityImpl.thrift.TAuthenticationTokenIdentifier)1