javax.jcr.observation.Event.getUserID()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中javax.jcr.observation.Event.getUserID()方法的一些代码示例,展示了Event.getUserID()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getUserID()方法的具体详情如下:
包路径:javax.jcr.observation.Event
类名称:Event
方法名:getUserID

Event.getUserID介绍

[英]Returns the user ID connected with this event. This is the string returned by javax.jcr.Session#getUserID of the session that caused the event.
[中]返回与此事件连接的用户ID。这是javax返回的字符串。jcr。会话#导致事件的会话的getUserID。

代码示例

代码示例来源:origin: org.fcrepo/fcrepo-kernel

/**
 * @return the user ID of the underlying JCR {@link Event}s
 */
public String getUserID() {
  return e.getUserID();
}

代码示例来源:origin: apache/jackrabbit

/** {@inheritDoc} */
public String getUserID() {
  return event.getUserID();
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr-commons

@Override
public String getUserID() {
  userInfoAccessed();
  return event.getUserID();
}

代码示例来源:origin: apache/jackrabbit

@Override
public String getUserID() {
  userInfoAccessed();
  return event.getUserID();
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public String getUserID() {
  userInfoAccessed();
  return event.getUserID();
}

代码示例来源:origin: org.apache.sling/org.apache.sling.jcr.resource

private ResourceChange createResourceChange(final Event event,
    final String path,
    final ChangeType changeType) {
  final String fullPath = path;
  final boolean isExternal = this.isExternal(event);
  final String userId;
  if (!isExternal) {
    userId = event.getUserID();
  } else {
    userId = null;
  }
  return new JcrResourceChange(changeType, fullPath, isExternal, userId);
}

代码示例来源:origin: org.fcrepo/fcrepo-kernel-modeshape

event.getUserID(), FedoraSessionUserUtil.getUserURI(event.getUserID()), ofEpochMilli(event
    .getDate()), info);

代码示例来源:origin: org.apache.sling/org.apache.sling.distribution.core

createdNode.setProperty("type", event.getType());
createdNode.setProperty("userData", event.getUserData());
createdNode.setProperty("userID", event.getUserID());

代码示例来源:origin: apache/jackrabbit

/**
 * Tests if {@link javax.jcr.observation.Event#getUserID()} returns the same
 * value as {@link javax.jcr.Session#getUserID()}.
 */
public void testGetUserId() throws RepositoryException{
  EventResult result = new EventResult(log);
  addEventListener(result, Event.NODE_ADDED);
  testRootNode.addNode(nodeName1, testNodeType);
  testRootNode.getSession().save();
  Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
  removeEventListener(result);
  assertEquals("Wrong number of events returned", 1, events.length);
  String userId = events[0].getUserID();
  String sessionUId = superuser.getUserID();
  assertEquals("UserId of event is not equal to userId of session", userId, sessionUId);
}

代码示例来源:origin: apache/jackrabbit

writeAtomElement(th, ID, entryid);
String author = firstEvent.getUserID() == null || firstEvent.getUserID().length() == 0 ? null
    : firstEvent.getUserID();
if (author != null) {
  th.startElement(ATOMNS, AUTHOR, AUTHOR, NOATTRS);

代码示例来源:origin: ModeShape/modeshape

/**
 * @see EventTest#testGetUserId()
 * @throws Exception
 */
@Test
public void shouldTestEventTest_testGetUserId() throws Exception {
  // register listener
  SimpleListener listener = addListener(1, Event.NODE_ADDED, null, false, null, null, false);
  // add a node to generate event
  getRoot().addNode("node1", UNSTRUCTURED);
  save();
  // event handling
  listener.waitForEvents();
  removeListener(listener);
  // tests
  checkResults(listener);
  assertThat("UserId of event is not equal to userId of session", listener.getEvents().get(0).getUserID(), is(USER_ID));
}

代码示例来源:origin: apache/jackrabbit

eType.appendChild(getEventType(event.getType()).toXml(document));
DomUtil.addChildElement(eventElem, XML_EVENTUSERID, NAMESPACE, event.getUserID());

代码示例来源:origin: apache/jackrabbit

mixinTypes, e.getUserID(), e.getUserData(), e.getDate(), info);

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-spi2jcr

mixinTypes, e.getUserID(), e.getUserData(), e.getDate(), info);

相关文章