Codota Logo
TRoleChanges
Code IndexAdd Codota to your IDE (free)

How to use
TRoleChanges
in
org.apache.sentry.hdfs.service.thrift

Best Java code snippets using org.apache.sentry.hdfs.service.thrift.TRoleChanges (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: apache/incubator-sentry

public TRoleChanges deepCopy() {
 return new TRoleChanges(this);
}
origin: apache/incubator-sentry

public Object getFieldValue(_Fields field) {
 switch (field) {
 case ROLE:
  return getRole();
 case ADD_GROUPS:
  return getAddGroups();
 case DEL_GROUPS:
  return getDelGroups();
 }
 throw new IllegalStateException();
}
origin: apache/incubator-sentry

@Override
public boolean equals(Object that) {
 if (that == null)
  return false;
 if (that instanceof TRoleChanges)
  return this.equals((TRoleChanges)that);
 return false;
}
origin: apache/incubator-sentry

/** 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 ROLE:
  return isSetRole();
 case ADD_GROUPS:
  return isSetAddGroups();
 case DEL_GROUPS:
  return isSetDelGroups();
 }
 throw new IllegalStateException();
}
origin: apache/incubator-sentry

public void validate() throws org.apache.thrift.TException {
 // check for required fields
 if (!isSetRole()) {
  throw new org.apache.thrift.protocol.TProtocolException("Required field 'role' is unset! Struct:" + toString());
 }
 if (!isSetAddGroups()) {
  throw new org.apache.thrift.protocol.TProtocolException("Required field 'addGroups' is unset! Struct:" + toString());
 }
 if (!isSetDelGroups()) {
  throw new org.apache.thrift.protocol.TProtocolException("Required field 'delGroups' is unset! Struct:" + toString());
 }
 // check for sub-struct validity
}
origin: apache/sentry

TRoleChanges addrUpdate = addUpdate.addRoleUpdate(roleName);
for (TSentryGroup g : groups) {
 addrUpdate.addToAddGroups(g.getGroupName());
TRoleChanges delrUpdate = delUpdate.addRoleUpdate(roleName);
for (TSentryGroup g : groups) {
 delrUpdate.addToDelGroups(g.getGroupName());
origin: apache/incubator-sentry

@Override
public void onAlterSentryRoleAddGroups(
  TAlterSentryRoleAddGroupsRequest request) throws SentryPluginException {
 PermissionsUpdate update = new PermissionsUpdate(permSeqNum.incrementAndGet(), false);
 TRoleChanges rUpdate = update.addRoleUpdate(request.getRoleName());
 for (TSentryGroup group : request.getGroups()) {
  rUpdate.addToAddGroups(group.getGroupName());
 }
 permsUpdater.handleUpdateNotification(update);
 LOGGER.debug("Authz Perm preUpdate [" + update.getSeqNum() + ", " + request.getRoleName() + "]..");
}
origin: apache/incubator-sentry

_val109 = new TRoleChanges();
_val109.read(iprot);
struct.roleChanges.put(_key108, _val109);
origin: apache/incubator-sentry

@Override
public void onAlterSentryRoleDeleteGroups(
  TAlterSentryRoleDeleteGroupsRequest request)
    throws SentryPluginException {
 PermissionsUpdate update = new PermissionsUpdate(permSeqNum.incrementAndGet(), false);
 TRoleChanges rUpdate = update.addRoleUpdate(request.getRoleName());
 for (TSentryGroup group : request.getGroups()) {
  rUpdate.addToDelGroups(group.getGroupName());
 }
 permsUpdater.handleUpdateNotification(update);
 LOGGER.debug("Authz Perm preUpdate [" + update.getSeqNum() + ", " + request.getRoleName() + "]..");
}
origin: apache/incubator-sentry

public boolean equals(TRoleChanges that) {
 if (that == null)
  return false;
 boolean this_present_role = true && this.isSetRole();
 boolean that_present_role = true && that.isSetRole();
 if (this_present_role || that_present_role) {
  if (!(this_present_role && that_present_role))
   return false;
  if (!this.role.equals(that.role))
   return false;
 }
 boolean this_present_addGroups = true && this.isSetAddGroups();
 boolean that_present_addGroups = true && that.isSetAddGroups();
 if (this_present_addGroups || that_present_addGroups) {
  if (!(this_present_addGroups && that_present_addGroups))
   return false;
  if (!this.addGroups.equals(that.addGroups))
   return false;
 }
 boolean this_present_delGroups = true && this.isSetDelGroups();
 boolean that_present_delGroups = true && that.isSetDelGroups();
 if (this_present_delGroups || that_present_delGroups) {
  if (!(this_present_delGroups && that_present_delGroups))
   return false;
  if (!this.delGroups.equals(that.delGroups))
   return false;
 }
 return true;
}
origin: apache/incubator-sentry

@Override
public PermissionsUpdate createFullImageUpdate(long currSeqNum) {
 PermissionsUpdate retVal = new PermissionsUpdate(currSeqNum, true);
 for (PrivilegeInfo pInfo : perms.getAllPrivileges()) {
  TPrivilegeChanges pUpdate = retVal.addPrivilegeUpdate(pInfo.getAuthzObj());
  for (Map.Entry<String, FsAction> ent : pInfo.getAllPermissions().entrySet()) {
   pUpdate.putToAddPrivileges(ent.getKey(), ent.getValue().SYMBOL);
  }
 }
 for (RoleInfo rInfo : perms.getAllRoles()) {
  TRoleChanges rUpdate = retVal.addRoleUpdate(rInfo.getRole());
  for (String group : rInfo.getAllGroups()) {
   rUpdate.addToAddGroups(group);
  }
 }
 return retVal;
}
origin: apache/incubator-sentry

_val121 = new TRoleChanges();
_val121.read(iprot);
struct.roleChanges.put(_key120, _val121);
origin: apache/incubator-sentry

@Override
public void onDropSentryRole(TDropSentryRoleRequest request)
  throws SentryPluginException {
 PermissionsUpdate update = new PermissionsUpdate(permSeqNum.incrementAndGet(), false);
 update.addPrivilegeUpdate(PermissionsUpdate.ALL_AUTHZ_OBJ).putToDelPrivileges(
   request.getRoleName(), PermissionsUpdate.ALL_AUTHZ_OBJ);
 update.addRoleUpdate(request.getRoleName()).addToDelGroups(PermissionsUpdate.ALL_GROUPS);
 permsUpdater.handleUpdateNotification(update);
 LOGGER.debug("Authz Perm preUpdate [" + update.getSeqNum() + ", " + request.getRoleName() + "]..");
}
origin: apache/incubator-sentry

private void applyRoleUpdates(PermissionsUpdate update) {
 for (TRoleChanges rUpdate : update.getRoleUpdates()) {
  if (rUpdate.getRole().equals(PermissionsUpdate.ALL_ROLES)) {
   // Request to remove group from all roles
   String groupToRemove = rUpdate.getDelGroups().iterator().next();
   for (RoleInfo rInfo : perms.getAllRoles()) {
    rInfo.delGroup(groupToRemove);
   }
  }
  RoleInfo rInfo = perms.getRoleInfo(rUpdate.getRole());
  for (String group : rUpdate.getAddGroups()) {
   if (rInfo == null) {
    rInfo = new RoleInfo(rUpdate.getRole());
   }
   rInfo.addGroup(group);
  }
  if (rInfo != null) {
   perms.addRoleInfo(rInfo);
   for (String group : rUpdate.getDelGroups()) {
    if (group.equals(PermissionsUpdate.ALL_GROUPS)) {
     perms.delRoleInfo(rInfo.getRole());
     break;
    }
    // If there are no groups to remove, rUpdate.getDelGroups() will
    // return empty list and this code will not be reached
    rInfo.delGroup(group);
   }
  }
 }
}
origin: apache/incubator-sentry

@Override
public int hashCode() {
 HashCodeBuilder builder = new HashCodeBuilder();
 boolean present_role = true && (isSetRole());
 builder.append(present_role);
 if (present_role)
  builder.append(role);
 boolean present_addGroups = true && (isSetAddGroups());
 builder.append(present_addGroups);
 if (present_addGroups)
  builder.append(addGroups);
 boolean present_delGroups = true && (isSetDelGroups());
 builder.append(present_delGroups);
 if (present_delGroups)
  builder.append(delGroups);
 return builder.toHashCode();
}
origin: apache/incubator-sentry

public TRoleChanges addRoleUpdate(String role) {
 if (tPermUpdate.getRoleChanges().containsKey(role)) {
  return tPermUpdate.getRoleChanges().get(role);
 }
 TRoleChanges roleUpdate = new TRoleChanges(role, new LinkedList<String>(),
   new LinkedList<String>());
 tPermUpdate.getRoleChanges().put(role, roleUpdate);
 return roleUpdate;
}
origin: apache/sentry

@Test
public void testCreateDropRoleWithPermUpdate() throws Exception {
 String roleName = "test-drop-role";
 createRole(roleName);
 // Generate the permission del update for dropping role "test-drop-role"
 PermissionsUpdate delUpdate = new PermissionsUpdate(0, false);
 delUpdate.addPrivilegeUpdate(PermissionsUpdate.ALL_AUTHZ_OBJ).putToDelPrivileges(
     new TPrivilegePrincipal(TPrivilegePrincipalType.ROLE, roleName),
     PermissionsUpdate.ALL_AUTHZ_OBJ);
 delUpdate.addRoleUpdate(roleName).addToDelGroups(PermissionsUpdate.ALL_GROUPS);
 // Drop the role and verify.
 sentryStore.dropSentryRole(roleName, delUpdate);
 checkRoleDoesNotExist(roleName);
 // Query the persisted perm change and ensure it equals to the original one
 long lastChangeID = sentryStore.getLastProcessedPermChangeID();
 MSentryPermChange delPermChange = sentryStore.getMSentryPermChangeByID(lastChangeID);
 assertEquals(delUpdate.JSONSerialize(), delPermChange.getPermChange());
}
origin: apache/incubator-sentry

/**
 * Performs a deep copy on <i>other</i>.
 */
public TRoleChanges(TRoleChanges other) {
 if (other.isSetRole()) {
  this.role = other.role;
 }
 if (other.isSetAddGroups()) {
  List<String> __this__addGroups = new ArrayList<String>();
  for (String other_element : other.addGroups) {
   __this__addGroups.add(other_element);
  }
  this.addGroups = __this__addGroups;
 }
 if (other.isSetDelGroups()) {
  List<String> __this__delGroups = new ArrayList<String>();
  for (String other_element : other.delGroups) {
   __this__delGroups.add(other_element);
  }
  this.delGroups = __this__delGroups;
 }
}
origin: apache/incubator-sentry

/**
 * Performs a deep copy on <i>other</i>.
 */
public TPermissionsUpdate(TPermissionsUpdate other) {
 __isset_bitfield = other.__isset_bitfield;
 this.hasfullImage = other.hasfullImage;
 this.seqNum = other.seqNum;
 if (other.isSetPrivilegeChanges()) {
  Map<String,TPrivilegeChanges> __this__privilegeChanges = new HashMap<String,TPrivilegeChanges>();
  for (Map.Entry<String, TPrivilegeChanges> other_element : other.privilegeChanges.entrySet()) {
   String other_element_key = other_element.getKey();
   TPrivilegeChanges other_element_value = other_element.getValue();
   String __this__privilegeChanges_copy_key = other_element_key;
   TPrivilegeChanges __this__privilegeChanges_copy_value = new TPrivilegeChanges(other_element_value);
   __this__privilegeChanges.put(__this__privilegeChanges_copy_key, __this__privilegeChanges_copy_value);
  }
  this.privilegeChanges = __this__privilegeChanges;
 }
 if (other.isSetRoleChanges()) {
  Map<String,TRoleChanges> __this__roleChanges = new HashMap<String,TRoleChanges>();
  for (Map.Entry<String, TRoleChanges> other_element : other.roleChanges.entrySet()) {
   String other_element_key = other_element.getKey();
   TRoleChanges other_element_value = other_element.getValue();
   String __this__roleChanges_copy_key = other_element_key;
   TRoleChanges __this__roleChanges_copy_value = new TRoleChanges(other_element_value);
   __this__roleChanges.put(__this__roleChanges_copy_key, __this__roleChanges_copy_value);
  }
  this.roleChanges = __this__roleChanges;
 }
}
origin: apache/incubator-sentry

TRoleChanges typedOther = (TRoleChanges)other;
lastComparison = Boolean.valueOf(isSetRole()).compareTo(typedOther.isSetRole());
if (lastComparison != 0) {
 return lastComparison;
if (isSetRole()) {
 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, typedOther.role);
 if (lastComparison != 0) {
lastComparison = Boolean.valueOf(isSetAddGroups()).compareTo(typedOther.isSetAddGroups());
if (lastComparison != 0) {
 return lastComparison;
if (isSetAddGroups()) {
 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addGroups, typedOther.addGroups);
 if (lastComparison != 0) {
lastComparison = Boolean.valueOf(isSetDelGroups()).compareTo(typedOther.isSetDelGroups());
if (lastComparison != 0) {
 return lastComparison;
if (isSetDelGroups()) {
 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delGroups, typedOther.delGroups);
 if (lastComparison != 0) {
org.apache.sentry.hdfs.service.thriftTRoleChanges

Most used methods

  • addToAddGroups
  • <init>
    Performs a deep copy on other.
  • addToDelGroups
  • getAddGroups
  • getDelGroups
  • getRole
  • equals
  • isSetAddGroups
    Returns true if field addGroups is set (has been assigned a value) and false otherwise
  • isSetDelGroups
    Returns true if field delGroups is set (has been assigned a value) and false otherwise
  • isSetRole
    Returns true if field role is set (has been assigned a value) and false otherwise
  • read
  • setAddGroups
  • read,
  • setAddGroups,
  • setAddGroupsIsSet,
  • setDelGroups,
  • setDelGroupsIsSet,
  • setRole,
  • setRoleIsSet,
  • toString,
  • unsetAddGroups,
  • unsetDelGroups

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • putExtra (Intent)
  • findViewById (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now