@Override public void read(org.apache.thrift.protocol.TProtocol prot, list_sentry_privileges_by_authorizable_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TListSentryPrivilegesByAuthResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } }
public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); case PRIVILEGES_MAP_BY_AUTH: return getPrivilegesMapByAuth(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { unsetStatus(); } else { setStatus((org.apache.sentry.service.thrift.TSentryResponseStatus)value); } break; case PRIVILEGES_MAP_BY_AUTH: if (value == null) { unsetPrivilegesMapByAuth(); } else { setPrivilegesMapByAuth((Map<String,TSentryPrivilegeMap>)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 STATUS: return isSetStatus(); case PRIVILEGES_MAP_BY_AUTH: return isSetPrivilegesMapByAuth(); } throw new IllegalStateException(); }
@Override public TListSentryPrivilegesByAuthResponse list_sentry_privileges_by_authorizable(TListSentryPrivilegesByAuthRequest request) throws TException { TListSentryPrivilegesByAuthResponse response = new TListSentryPrivilegesByAuthResponse(); Map<String, TSentryPrivilegeMap> authRoleMap = Maps.newHashMap(); response.setPrivilegesMapByAuth(authRoleMap); response.setStatus(Status.OK()); } catch (SentryAccessDeniedException e) { LOGGER.error(e.getMessage(), e); response.setStatus(Status.AccessDenied(e.getMessage(), e)); } catch (SentryThriftAPIMismatchException e) { LOGGER.error(e.getMessage(), e); response.setStatus(Status.THRIFT_VERSION_MISMATCH(e.getMessage(), e)); } catch (Exception e) { String msg = "Unknown error for request: " + request + ", message: " + e.getMessage(); LOGGER.error(msg, e); response.setStatus(Status.RuntimeError(msg, e));
struct.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.setPrivilegesMapByAuthIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
public TListSentryPrivilegesByAuthResponse deepCopy() { return new TListSentryPrivilegesByAuthResponse(this); }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetStatus()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); } // check for sub-struct validity if (status != null) { status.validate(); } }
public void write(org.apache.thrift.protocol.TProtocol oprot, TListSentryPrivilegesByAuthResponse struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.status != null) { oprot.writeFieldBegin(STATUS_FIELD_DESC); struct.status.write(oprot); oprot.writeFieldEnd(); } if (struct.privilegesMapByAuth != null) { if (struct.isSetPrivilegesMapByAuth()) { oprot.writeFieldBegin(PRIVILEGES_MAP_BY_AUTH_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.privilegesMapByAuth.size())); for (Map.Entry<String, TSentryPrivilegeMap> _iter142 : struct.privilegesMapByAuth.entrySet()) { oprot.writeString(_iter142.getKey()); _iter142.getValue().write(oprot); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TListSentryPrivilegesByAuthResponse struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map144 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.privilegesMapByAuth = new HashMap<String,TSentryPrivilegeMap>(2*_map144.size); String _key145; TSentryPrivilegeMap _val146; for (int _i147 = 0; _i147 < _map144.size; ++_i147) { _key145 = iprot.readString(); _val146 = new TSentryPrivilegeMap(); _val146.read(iprot); struct.privilegesMapByAuth.put(_key145, _val146); } } struct.setPrivilegesMapByAuthIsSet(true); } } }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TListSentryPrivilegesByAuthResponse) return this.equals((TListSentryPrivilegesByAuthResponse)that); return false; }
@Override public String toString() { StringBuilder sb = new StringBuilder("TListSentryPrivilegesByAuthResponse("); boolean first = true; sb.append("status:"); if (this.status == null) { sb.append("null"); } else { sb.append(this.status); } first = false; if (isSetPrivilegesMapByAuth()) { if (!first) sb.append(", "); sb.append("privilegesMapByAuth:"); if (this.privilegesMapByAuth == null) { sb.append("null"); } else { sb.append(this.privilegesMapByAuth); } first = false; } sb.append(")"); return sb.toString(); }
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); } }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_status = true && (isSetStatus()); list.add(present_status); if (present_status) list.add(status); boolean present_privilegesMapByAuth = true && (isSetPrivilegesMapByAuth()); list.add(present_privilegesMapByAuth); if (present_privilegesMapByAuth) list.add(privilegesMapByAuth); return list.hashCode(); }
/** * Performs a deep copy on <i>other</i>. */ public list_sentry_privileges_by_authorizable_result(list_sentry_privileges_by_authorizable_result other) { if (other.isSetSuccess()) { this.success = new TListSentryPrivilegesByAuthResponse(other.success); } }
public boolean equals(list_sentry_privileges_by_authorizable_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TListSentryPrivilegesByAuthResponse struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetPrivilegesMapByAuth()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPrivilegesMapByAuth()) { { oprot.writeI32(struct.privilegesMapByAuth.size()); for (Map.Entry<String, TSentryPrivilegeMap> _iter143 : struct.privilegesMapByAuth.entrySet()) { oprot.writeString(_iter143.getKey()); _iter143.getValue().write(oprot); } } } }
Status.throwIfNotOk(response.getStatus()); return response.getPrivilegesMapByAuth(); } catch (TException e) { throw new SentryUserException(THRIFT_EXCEPTION_MESSAGE, e);
public boolean equals(TListSentryPrivilegesByAuthResponse that) { if (that == null) return false; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); if (this_present_status || that_present_status) { if (!(this_present_status && that_present_status)) return false; if (!this.status.equals(that.status)) return false; } boolean this_present_privilegesMapByAuth = true && this.isSetPrivilegesMapByAuth(); boolean that_present_privilegesMapByAuth = true && that.isSetPrivilegesMapByAuth(); if (this_present_privilegesMapByAuth || that_present_privilegesMapByAuth) { if (!(this_present_privilegesMapByAuth && that_present_privilegesMapByAuth)) return false; if (!this.privilegesMapByAuth.equals(that.privilegesMapByAuth)) return false; } return true; }
public void read(org.apache.thrift.protocol.TProtocol iprot, list_sentry_privileges_by_authorizable_result 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 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new TListSentryPrivilegesByAuthResponse(); struct.success.read(iprot); struct.setSuccessIsSet(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(); }