public TCancelDelegationTokenReq deepCopy() { return new TCancelDelegationTokenReq(this); }
public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); case DELEGATION_TOKEN: return getDelegationToken(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCancelDelegationTokenReq) return this.equals((TCancelDelegationTokenReq)that); return false; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { unsetSessionHandle(); } else { setSessionHandle((TSessionHandle)value); } break; case DELEGATION_TOKEN: if (value == null) { unsetDelegationToken(); } else { setDelegationToken((String)value); } break; } }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); case DELEGATION_TOKEN: return isSetDelegationToken(); } throw new IllegalStateException(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCancelDelegationTokenReq(); struct.req.read(iprot); struct.setReqIsSet(true); } } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetSessionHandle()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); } if (!isSetDelegationToken()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); } // check for sub-struct validity if (sessionHandle != null) { sessionHandle.validate(); } }
struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.delegationToken = iprot.readString(); struct.setDelegationTokenIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); struct.delegationToken = iprot.readString(); struct.setDelegationTokenIsSet(true); } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.req = new TCancelDelegationTokenReq(); struct.req.read(iprot); struct.setReqIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
/** * Performs a deep copy on <i>other</i>. */ public TCancelDelegationTokenReq(TCancelDelegationTokenReq other) { if (other.isSetSessionHandle()) { this.sessionHandle = new TSessionHandle(other.sessionHandle); } if (other.isSetDelegationToken()) { this.delegationToken = other.delegationToken; } }
/** * Performs a deep copy on <i>other</i>. */ public CancelDelegationToken_args(CancelDelegationToken_args other) { if (other.isSetReq()) { this.req = new TCancelDelegationTokenReq(other.req); } }
@Override public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws TException { TCancelDelegationTokenResp resp = new TCancelDelegationTokenResp(); if (hiveAuthFactory == null || !hiveAuthFactory.isSASLKerberosUser()) { resp.setStatus(unsecureTokenErrorStatus()); } else { try { cliService.cancelDelegationToken(new SessionHandle(req.getSessionHandle()), hiveAuthFactory, req.getDelegationToken()); resp.setStatus(OK_STATUS); } catch (HiveSQLException e) { LOG.error("Error canceling delegation token", e); resp.setStatus(HiveSQLException.toTStatus(e)); } } return resp; }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_sessionHandle = true && (isSetSessionHandle()); list.add(present_sessionHandle); if (present_sessionHandle) list.add(sessionHandle); boolean present_delegationToken = true && (isSetDelegationToken()); list.add(present_delegationToken); if (present_delegationToken) list.add(delegationToken); return list.hashCode(); }
public boolean equals(CancelDelegationToken_args that) { if (that == null) return false; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); if (this_present_req || that_present_req) { if (!(this_present_req && that_present_req)) return false; if (!this.req.equals(that.req)) return false; } return true; }
public void cancelDelegationToken(String tokenStr) throws SQLException { TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq(sessHandle, tokenStr); try { TCancelDelegationTokenResp cancelResp = client.CancelDelegationToken(cancelReq); Utils.verifySuccess(cancelResp.getStatus()); return; } catch (TException e) { throw new SQLException("Could not cancel token: " + e.getMessage(), " 08S01", e); } }
@Override public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws TException { TCancelDelegationTokenResp resp = new TCancelDelegationTokenResp(); if (hiveAuthFactory == null || !hiveAuthFactory.isSASLKerberosUser()) { resp.setStatus(unsecureTokenErrorStatus()); } else { try { cliService.cancelDelegationToken(new SessionHandle(req.getSessionHandle()), hiveAuthFactory, req.getDelegationToken()); resp.setStatus(OK_STATUS); } catch (HiveSQLException e) { LOG.error("Error canceling delegation token", e); resp.setStatus(HiveSQLException.toTStatus(e)); } } return resp; }
public boolean equals(TCancelDelegationTokenReq that) { if (that == null) return false; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); if (this_present_sessionHandle || that_present_sessionHandle) { if (!(this_present_sessionHandle && that_present_sessionHandle)) return false; if (!this.sessionHandle.equals(that.sessionHandle)) return false; } boolean this_present_delegationToken = true && this.isSetDelegationToken(); boolean that_present_delegationToken = true && that.isSetDelegationToken(); if (this_present_delegationToken || that_present_delegationToken) { if (!(this_present_delegationToken && that_present_delegationToken)) return false; if (!this.delegationToken.equals(that.delegationToken)) return false; } return true; }
@Override public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException { TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq( sessionHandle.toTSessionHandle(), tokenStr); try { TCancelDelegationTokenResp cancelResp = cliService.CancelDelegationToken(cancelReq); checkStatus(cancelResp.getStatus()); return; } catch (TException e) { throw new HiveSQLException(e); } }