congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
org.apache.sentry.provider.db.log.entity
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.sentry.provider.db.log.entity

Best Java code snippets using org.apache.sentry.provider.db.log.entity (Showing top 20 results out of 315)

origin: apache/incubator-sentry

private GMAuditMetadataLogEntity createCommonGMAMLE(Configuration conf,
  TSentryResponseStatus responseStatus, String userName, String requestClassName,
  String component) {
 GMAuditMetadataLogEntity gmamle = new GMAuditMetadataLogEntity();
 setCommAttrForAMLE(gmamle, conf, responseStatus, userName, requestClassName);
 gmamle.setComponent(component);
 return gmamle;
}
origin: apache/incubator-sentry

private DBAuditMetadataLogEntity createCommonHAMLE(Configuration conf,
  TSentryResponseStatus responseStatus, String userName, String requestClassName) {
 DBAuditMetadataLogEntity hamle = new DBAuditMetadataLogEntity();
 setCommAttrForAMLE(hamle, conf, responseStatus, userName, requestClassName);
 return hamle;
}
origin: apache/sentry

private GMAuditMetadataLogEntity createCommonGMAMLE(Configuration conf,
  TSentryResponseStatus responseStatus, String userName, String requestClassName,
  String component) {
 GMAuditMetadataLogEntity gmamle = new GMAuditMetadataLogEntity();
 setCommAttrForAMLE(gmamle, conf, responseStatus, userName, toOperationType(requestClassName),
  toObjectType(requestClassName));
 gmamle.setComponent(component);
 return gmamle;
}
origin: apache/sentry

private void assertCommon(GMAuditMetadataLogEntity amle, String allowedExcepted,
  String operationExcepted, String operationTextExcepted, String objectTypeExcepted,
  Map<String, String> privilegesExcepted) {
 assertEquals(ServerConfig.SENTRY_SERVICE_NAME_DEFAULT, amle.getServiceName());
 assertEquals(TEST_IP, amle.getIpAddress());
 assertEquals(TEST_USER_NAME, amle.getUserName());
 assertEquals(TEST_IMPERSONATOR, amle.getImpersonator());
 assertEquals(allowedExcepted, amle.getAllowed());
 assertEquals(operationExcepted, amle.getOperation());
 assertEquals(operationTextExcepted, amle.getOperationText());
 assertEquals(objectTypeExcepted, amle.getObjectType());
 assertPrivilegesMap(privilegesExcepted, amle.getPrivilegesMap());
}
origin: apache/sentry

private void setCommAttrForAMLE(AuditMetadataLogEntity amle, Configuration conf,
  TSentryResponseStatus responseStatus, String userName, String operationType, String objectType) {
 amle.setUserName(userName);
 amle.setServiceName(conf.get(ServerConfig.SENTRY_SERVICE_NAME,
   ServerConfig.SENTRY_SERVICE_NAME_DEFAULT).trim());
 amle.setImpersonator(ThriftUtil.getImpersonator());
 amle.setIpAddress(ThriftUtil.getIpAddress());
 amle.setOperation(operationType);
 amle.setEventTime(Long.toString(System.currentTimeMillis()));
 amle.setAllowed(isAllowed(responseStatus));
 amle.setObjectType(objectType);
}
origin: apache/incubator-sentry

@Test
public void testToJsonFormatLog() throws Throwable {
 DBAuditMetadataLogEntity amle = new DBAuditMetadataLogEntity("serviceName", "userName",
   "impersonator", "ipAddress", "operation", "eventTime", "operationText", "allowed",
   "objectType", "component", "databaseName", "tableName", "columnName", "resourcePath");
 String jsonAuditLog = amle.toJsonFormatLog();
 ContainerNode rootNode = AuditMetadataLogEntity.parse(jsonAuditLog);
 assertEntryEquals(rootNode, Constants.LOG_FIELD_SERVICE_NAME, "serviceName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_USER_NAME, "userName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_IMPERSONATOR,
   "impersonator");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_IP_ADDRESS, "ipAddress");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_OPERATION, "operation");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_EVENT_TIME, "eventTime");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_OPERATION_TEXT,
   "operationText");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_ALLOWED, "allowed");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_DATABASE_NAME,
   "databaseName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_TABLE_NAME, "tableName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_COLUMN_NAME, "columnName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_RESOURCE_PATH,
   "resourcePath");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_OBJECT_TYPE, "objectType");
}
origin: apache/sentry

private DBAuditMetadataLogEntity createCommonHAMLE(Configuration conf,
  TSentryResponseStatus responseStatus, String userName, String requestClassName) {
 DBAuditMetadataLogEntity hamle = new DBAuditMetadataLogEntity();
 setCommAttrForAMLE(hamle, conf, responseStatus, userName, toOperationType(requestClassName),
  toObjectType(requestClassName));
 return hamle;
}
origin: apache/sentry

public JsonLogEntity createJsonLogEntity(
  TAlterSentryRoleAddGroupsRequest request,
  TAlterSentryRoleAddGroupsResponse response, Configuration conf) {
 DBAuditMetadataLogEntity hamle = createCommonHAMLE(conf, response.getStatus(),
   request.getRequestorUserName(), request.getClass().getName());
 String groups = getGroupsStr(request.getGroupsIterator());
 hamle.setOperationText(CommandUtil.createCmdForRoleAddGroup(request.getRoleName(), groups));
 return hamle;
}
origin: apache/sentry

public JsonLogEntity createJsonLogEntity(TAlterSentryRoleAddUsersRequest request,
  TAlterSentryRoleAddUsersResponse response, Configuration conf) {
 AuditMetadataLogEntity amle = createCommonHAMLE(conf, response.getStatus(),
   request.getRequestorUserName(), request.getClass().getName());
 String users = getUsersStr(request.getUsersIterator());
 amle.setOperationText(CommandUtil.createCmdForRoleAddUser(request.getRoleName(), users));
 return amle;
}
origin: apache/incubator-sentry

public JsonLogEntity createJsonLogEntity(
  org.apache.sentry.provider.db.generic.service.thrift.TDropSentryRoleRequest request,
  org.apache.sentry.provider.db.generic.service.thrift.TDropSentryRoleResponse response,
  Configuration conf) {
 GMAuditMetadataLogEntity gmamle = createCommonGMAMLE(conf, response.getStatus(),
   request.getRequestorUserName(), request.getClass().getName(), request.getComponent());
 gmamle.setOperationText(CommandUtil.createCmdForCreateOrDropRole(request.getRoleName(), false));
 return gmamle;
}
origin: apache/sentry

public GMAuditMetadataLogEntity(String serviceName, String userName, String impersonator,
  String ipAddress, String operation, String eventTime, String operationText, String allowed,
  String objectType, String component, Map<String, String> privilegesMap) {
 setCommonAttr(serviceName, userName, impersonator, ipAddress, operation, eventTime,
   operationText, allowed, objectType, component);
 this.privilegesMap = privilegesMap;
}
origin: apache/sentry

public DBAuditMetadataLogEntity(String serviceName, String userName, String impersonator,
  String ipAddress, String operation, String eventTime, String operationText, String allowed,
  String objectType, String component, String databaseName, String tableName,
  String columnName, String resourcePath) {
 setCommonAttr(serviceName, userName, impersonator, ipAddress, operation, eventTime,
   operationText, allowed, objectType, component);
 this.databaseName = databaseName;
 this.tableName = tableName;
 this.columnName = columnName;
 this.resourcePath = resourcePath;
}
origin: apache/sentry

 private void info(JsonLogEntity jsonLogEntity) throws Exception {
  AUDIT_LOGGER.info(jsonLogEntity.toJsonFormatLog());
 }
}
origin: apache/incubator-sentry

private void assertCommon(GMAuditMetadataLogEntity amle, String allowedExcepted,
  String operationExcepted, String operationTextExcepted, String objectTypeExcepted,
  Map<String, String> privilegesExcepted) {
 assertEquals(ServerConfig.SENTRY_SERVICE_NAME_DEFAULT, amle.getServiceName());
 assertEquals(TEST_IP, amle.getIpAddress());
 assertEquals(TEST_USER_NAME, amle.getUserName());
 assertEquals(TEST_IMPERSONATOR, amle.getImpersonator());
 assertEquals(allowedExcepted, amle.getAllowed());
 assertEquals(operationExcepted, amle.getOperation());
 assertEquals(operationTextExcepted, amle.getOperationText());
 assertEquals(objectTypeExcepted, amle.getObjectType());
 assertPrivilegesMap(privilegesExcepted, amle.getPrivilegesMap());
}
origin: apache/sentry

@Test
public void testToJsonFormatLog() throws Throwable {
 DBAuditMetadataLogEntity amle = new DBAuditMetadataLogEntity("serviceName", "userName",
   "impersonator", "ipAddress", "operation", "eventTime", "operationText", "allowed",
   "objectType", "component", "databaseName", "tableName", "columnName", "resourcePath");
 String jsonAuditLog = amle.toJsonFormatLog();
 ContainerNode rootNode = AuditMetadataLogEntity.parse(jsonAuditLog);
 assertEntryEquals(rootNode, Constants.LOG_FIELD_SERVICE_NAME, "serviceName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_USER_NAME, "userName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_IMPERSONATOR,
   "impersonator");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_IP_ADDRESS, "ipAddress");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_OPERATION, "operation");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_EVENT_TIME, "eventTime");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_OPERATION_TEXT,
   "operationText");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_ALLOWED, "allowed");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_DATABASE_NAME,
   "databaseName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_TABLE_NAME, "tableName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_COLUMN_NAME, "columnName");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_RESOURCE_PATH,
   "resourcePath");
 assertEntryEquals(rootNode, Constants.LOG_FIELD_OBJECT_TYPE, "objectType");
}
origin: apache/sentry

public JsonLogEntity createJsonLogEntity(
  TAlterSentryRoleDeleteGroupsRequest request,
  TAlterSentryRoleDeleteGroupsResponse response, Configuration conf) {
 DBAuditMetadataLogEntity hamle = createCommonHAMLE(conf, response.getStatus(),
   request.getRequestorUserName(), request.getClass().getName());
 String groups = getGroupsStr(request.getGroupsIterator());
 hamle.setOperationText(CommandUtil.createCmdForRoleDeleteGroup(request.getRoleName(), groups));
 return hamle;
}
origin: apache/sentry

private DBAuditMetadataLogEntity createCommonHAMLE(Configuration conf,
 TSentryResponseStatus responseStatus, String userName, String operationType, String objectType) {
 DBAuditMetadataLogEntity hamle = new DBAuditMetadataLogEntity();
 setCommAttrForAMLE(hamle, conf, responseStatus, userName, operationType, objectType);
 return hamle;
}
origin: apache/incubator-sentry

public GMAuditMetadataLogEntity(String serviceName, String userName, String impersonator,
  String ipAddress, String operation, String eventTime, String operationText, String allowed,
  String objectType, String component, Map<String, String> privilegesMap) {
 setCommonAttr(serviceName, userName, impersonator, ipAddress, operation, eventTime,
   operationText, allowed, objectType, component);
 this.privilegesMap = privilegesMap;
}
origin: apache/incubator-sentry

public DBAuditMetadataLogEntity(String serviceName, String userName, String impersonator,
  String ipAddress, String operation, String eventTime, String operationText, String allowed,
  String objectType, String component, String databaseName, String tableName,
  String columnName, String resourcePath) {
 setCommonAttr(serviceName, userName, impersonator, ipAddress, operation, eventTime,
   operationText, allowed, objectType, component);
 this.databaseName = databaseName;
 this.tableName = tableName;
 this.columnName = columnName;
 this.resourcePath = resourcePath;
}
origin: apache/incubator-sentry

public JsonLogEntity createJsonLogEntity(
  TAlterSentryRoleDeleteGroupsRequest request,
  TAlterSentryRoleDeleteGroupsResponse response, Configuration conf) {
 DBAuditMetadataLogEntity hamle = createCommonHAMLE(conf, response.getStatus(),
   request.getRequestorUserName(), request.getClass().getName());
 String groups = getGroupsStr(request.getGroupsIterator());
 hamle.setOperationText(CommandUtil.createCmdForRoleDeleteGroup(request.getRoleName(), groups));
 return hamle;
}
org.apache.sentry.provider.db.log.entity

Most used classes

  • AuditMetadataLogEntity
  • DBAuditMetadataLogEntity
  • GMAuditMetadataLogEntity
  • JsonLogEntityFactory
  • JsonLogEntity
  • TestGMAuditMetadataLogEntity,
  • TestJsonLogEntityFactory,
  • TestJsonLogEntityFactoryGM
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now