notification.setId(1L); notification.setOwnerType(TSentryPrincipalType.ROLE); notification.setOwnerName(OWNER); notification.setAuthorizable(authorizable); notification.setEventType(EventType.CREATE_DATABASE.toString());
notification.setOwnerName(ADMIN_USER); sentryServiceHandler.sentry_notify_hms_event(notification); notification.setOwnerName(OWNER); sentryServiceHandler.sentry_notify_hms_event(notification);
notification.setId(1L); notification.setOwnerType(TSentryPrincipalType.ROLE); notification.setOwnerName(OWNER); notification.setAuthorizable(authorizable); notification.setEventType(EventMessage.EventType.CREATE_TABLE.toString()); notification.setOwnerName(ADMIN_USER); sentryServiceHandler.sentry_notify_hms_event(notification); Mockito.verify( sentryStore, Mockito.times(1)).alterSentryGrantOwnerPrivilege(ADMIN_USER, SentryPrincipalType.USER, ownerPrivilege, null); notification.setOwnerName(OWNER); notification.setOwnerType(TSentryPrincipalType.USER); sentryServiceHandler.sentry_notify_hms_event(notification);
public long notifyHmsEvent(String requestorUserName, long eventId, String eventType, TSentryPrincipalType ownerType, String ownerName, TSentryAuthorizable authorizable) throws SentryUserException { TSentryHmsEventNotification request = new TSentryHmsEventNotification(); try { request.setProtocol_version(ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT); request.setRequestorUserName(requestorUserName); request.setId(eventId); request.setEventType(eventType); request.setOwnerType(ownerType); request.setOwnerName(ownerName); request.setAuthorizable(authorizable); TSentryHmsEventNotificationResponse response = client.sentry_notify_hms_event(request); Status.throwIfNotOk(response.getStatus()); return response.getId(); } catch (TException e) { throw new SentryUserException(THRIFT_EXCEPTION_MESSAGE, e); } }
notification.setId(1L); notification.setOwnerType(TSentryPrincipalType.ROLE); notification.setOwnerName(OWNER); notification.setAuthorizable(authorizable); notification.setEventType(EventType.CREATE_DATABASE.toString()); notification.setOwnerName(ADMIN_USER); sentryServiceHandler.sentry_notify_hms_event(notification); Mockito.verify(
unsetOwnerName(); } else { setOwnerName((String)value);