public TAuthorizable deepCopy() { return new TAuthorizable(this); }
private List<TAuthorizable> fromAuthorizable(List<? extends Authorizable> authorizables) { List<TAuthorizable> tAuthorizables = Lists.newArrayList(); for (Authorizable authorizable : authorizables) { tAuthorizables.add(new TAuthorizable(authorizable.getTypeName(), authorizable.getName())); } return tAuthorizables; }
/** * Performs a deep copy on <i>other</i>. */ public TRenamePrivilegesRequest(TRenamePrivilegesRequest other) { __isset_bitfield = other.__isset_bitfield; this.protocol_version = other.protocol_version; if (other.isSetRequestorUserName()) { this.requestorUserName = other.requestorUserName; } if (other.isSetComponent()) { this.component = other.component; } if (other.isSetServiceName()) { this.serviceName = other.serviceName; } if (other.isSetOldAuthorizables()) { List<TAuthorizable> __this__oldAuthorizables = new ArrayList<TAuthorizable>(other.oldAuthorizables.size()); for (TAuthorizable other_element : other.oldAuthorizables) { __this__oldAuthorizables.add(new TAuthorizable(other_element)); } this.oldAuthorizables = __this__oldAuthorizables; } if (other.isSetNewAuthorizables()) { List<TAuthorizable> __this__newAuthorizables = new ArrayList<TAuthorizable>(other.newAuthorizables.size()); for (TAuthorizable other_element : other.newAuthorizables) { __this__newAuthorizables.add(new TAuthorizable(other_element)); } this.newAuthorizables = __this__newAuthorizables; } }
private TSentryPrivilege getPrivilege() { TSentryPrivilege privilege = new TSentryPrivilege(); privilege.setAction(TEST_ACTION); privilege.setComponent(TEST_COMPONENT); List<TAuthorizable> authorizables = new ArrayList<TAuthorizable>(); authorizables.add(new TAuthorizable("resourceType1", "resourceName1")); authorizables.add(new TAuthorizable("resourceType2", "resourceName2")); authorizables.add(new TAuthorizable("resourceType3", "resourceName3")); privilege.setAuthorizables(authorizables); return privilege; }
/** * Performs a deep copy on <i>other</i>. */ public TListSentryPrivilegesRequest(TListSentryPrivilegesRequest other) { __isset_bitfield = other.__isset_bitfield; this.protocol_version = other.protocol_version; if (other.isSetRequestorUserName()) { this.requestorUserName = other.requestorUserName; } if (other.isSetRoleName()) { this.roleName = other.roleName; } if (other.isSetComponent()) { this.component = other.component; } if (other.isSetServiceName()) { this.serviceName = other.serviceName; } if (other.isSetAuthorizables()) { List<TAuthorizable> __this__authorizables = new ArrayList<TAuthorizable>(other.authorizables.size()); for (TAuthorizable other_element : other.authorizables) { __this__authorizables.add(new TAuthorizable(other_element)); } this.authorizables = __this__authorizables; } }
private List<TAuthorizable> fromAuthorizable(List<? extends Authorizable> authorizables) { List<TAuthorizable> tAuthorizables = Lists.newArrayList(); for (Authorizable authorizable : authorizables) { tAuthorizables.add(new TAuthorizable(authorizable.getTypeName(), authorizable.getName())); } return tAuthorizables; } }
/** * Performs a deep copy on <i>other</i>. */ public TListSentryPrivilegesForProviderRequest(TListSentryPrivilegesForProviderRequest other) { __isset_bitfield = other.__isset_bitfield; this.protocol_version = other.protocol_version; if (other.isSetComponent()) { this.component = other.component; } if (other.isSetServiceName()) { this.serviceName = other.serviceName; } if (other.isSetGroups()) { Set<String> __this__groups = new HashSet<String>(other.groups); this.groups = __this__groups; } if (other.isSetRoleSet()) { this.roleSet = new TSentryActiveRoleSet(other.roleSet); } if (other.isSetAuthorizables()) { List<TAuthorizable> __this__authorizables = new ArrayList<TAuthorizable>(other.authorizables.size()); for (TAuthorizable other_element : other.authorizables) { __this__authorizables.add(new TAuthorizable(other_element)); } this.authorizables = __this__authorizables; } }
private org.apache.sentry.api.generic.thrift.TSentryPrivilege getGMPrivilege() { org.apache.sentry.api.generic.thrift.TSentryPrivilege privilege = new org.apache.sentry.api.generic.thrift.TSentryPrivilege(); privilege.setAction("ACTION"); privilege.setComponent("COMPONENT"); List<TAuthorizable> authorizables = new ArrayList<TAuthorizable>(); authorizables.add(new TAuthorizable("resourceType1", "resourceName1")); authorizables.add(new TAuthorizable("resourceType2", "resourceName2")); privilege.setAuthorizables(authorizables); return privilege; } }
/** * Performs a deep copy on <i>other</i>. */ public TSentryPrivilege(TSentryPrivilege other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetComponent()) { this.component = other.component; } if (other.isSetServiceName()) { this.serviceName = other.serviceName; } if (other.isSetAuthorizables()) { List<TAuthorizable> __this__authorizables = new ArrayList<TAuthorizable>(other.authorizables.size()); for (TAuthorizable other_element : other.authorizables) { __this__authorizables.add(new TAuthorizable(other_element)); } this.authorizables = __this__authorizables; } if (other.isSetAction()) { this.action = other.action; } this.createTime = other.createTime; if (other.isSetGrantorPrincipal()) { this.grantorPrincipal = other.grantorPrincipal; } if (other.isSetGrantOption()) { this.grantOption = other.grantOption; } }
for (int _i42 = 0; _i42 < _list40.size; ++_i42) _elem41 = new TAuthorizable(); _elem41.read(iprot); struct.authorizables.add(_elem41);
for (int _i2 = 0; _i2 < _list0.size; ++_i2) _elem1 = new TAuthorizable(); _elem1.read(iprot); struct.authorizables.add(_elem1);
public TSentryPrivilege fromString(String privilegeStr) throws SentryUserException { privilegeStr = parsePrivilegeString(privilegeStr); if (validate) { validatePrivilegeHierarchy(privilegeStr); } TSentryPrivilege tSentryPrivilege = new TSentryPrivilege(); List<TAuthorizable> authorizables = new LinkedList<TAuthorizable>(); for (String authorizable : SentryConstants.AUTHORIZABLE_SPLITTER.split(privilegeStr)) { KeyValue keyValue = new KeyValue(authorizable); String key = keyValue.getKey(); String value = keyValue.getValue(); Authorizable authz = getAuthorizable(keyValue); if (authz != null) { authorizables.add(new TAuthorizable(authz.getTypeName(), authz.getName())); } else if (PolicyFileConstants.PRIVILEGE_ACTION_NAME.equalsIgnoreCase(key)) { tSentryPrivilege.setAction(value); } else { throw new IllegalArgumentException("Unknown key: " + key); } } if (tSentryPrivilege.getAction() == null) { throw new IllegalArgumentException("Privilege is invalid: action required but not specified."); } tSentryPrivilege.setComponent(component); tSentryPrivilege.setServiceName(service); tSentryPrivilege.setAuthorizables(authorizables); return tSentryPrivilege; }
public TSentryPrivilege fromString(String privilegeStr) throws SentryUserException { privilegeStr = parsePrivilegeString(privilegeStr); if (validate) { validatePrivilegeHierarchy(privilegeStr); } TSentryPrivilege tSentryPrivilege = new TSentryPrivilege(); List<TAuthorizable> authorizables = new LinkedList<TAuthorizable>(); for (String authorizable : SentryConstants.AUTHORIZABLE_SPLITTER.split(privilegeStr)) { KeyValue keyValue = new KeyValue(authorizable); String key = keyValue.getKey(); String value = keyValue.getValue(); Authorizable authz = getAuthorizable(keyValue); if (authz != null) { authorizables.add(new TAuthorizable(authz.getTypeName(), authz.getName())); } else if (PolicyFileConstants.PRIVILEGE_ACTION_NAME.equalsIgnoreCase(key)) { tSentryPrivilege.setAction(value); } else { throw new IllegalArgumentException("Unknown key: " + key); } } if (tSentryPrivilege.getAction() == null) { throw new IllegalArgumentException("Privilege is invalid: action required but not specified."); } tSentryPrivilege.setComponent(component); tSentryPrivilege.setServiceName(service); tSentryPrivilege.setAuthorizables(authorizables); return tSentryPrivilege; }
List<TAuthorizable> newTAuthorizables = Lists.newArrayList(); for (Authorizable authorizable : oldAuthorizables) { oldTAuthorizables.add(new TAuthorizable(authorizable.getTypeName(), authorizable.getName())); request.setOldAuthorizables(oldTAuthorizables); newTAuthorizables.add(new TAuthorizable(authorizable.getTypeName(), authorizable.getName())); request.setNewAuthorizables(newTAuthorizables);
for (int _i68 = 0; _i68 < _list66.size; ++_i68) _elem67 = new TAuthorizable(); _elem67.read(iprot); struct.oldAuthorizables.add(_elem67); for (int _i71 = 0; _i71 < _list69.size; ++_i71) _elem70 = new TAuthorizable(); _elem70.read(iprot); struct.newAuthorizables.add(_elem70);
for (int _i7 = 0; _i7 < _list5.size; ++_i7) _elem6 = new TAuthorizable(); _elem6.read(iprot); struct.authorizables.add(_elem6);
for (int _i95 = 0; _i95 < _list93.size; ++_i95) _elem94 = new TAuthorizable(); _elem94.read(iprot); struct.authorizables.add(_elem94);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TListSentryPrivilegesRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.protocol_version = iprot.readI32(); struct.setProtocol_versionIsSet(true); struct.requestorUserName = iprot.readString(); struct.setRequestorUserNameIsSet(true); struct.roleName = iprot.readString(); struct.setRoleNameIsSet(true); struct.component = iprot.readString(); struct.setComponentIsSet(true); struct.serviceName = iprot.readString(); struct.setServiceNameIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.authorizables = new ArrayList<TAuthorizable>(_list45.size); TAuthorizable _elem46; for (int _i47 = 0; _i47 < _list45.size; ++_i47) { _elem46 = new TAuthorizable(); _elem46.read(iprot); struct.authorizables.add(_elem46); } } struct.setAuthorizablesIsSet(true); } } }
List<TAuthorizable> tAuthorizables = Lists.newArrayList(); for (Authorizable authorizable : authorizables) { tAuthorizables.add(new TAuthorizable(authorizable.getTypeName(), authorizable.getName()));
if (authorizables != null && !authorizables.isEmpty()) { for (Authorizable authorizable : authorizables) { tAuthoriables.add(new TAuthorizable(authorizable.getTypeName(), authorizable.getName()));