本文整理了Java中org.sakaiproject.tool.api.Session.getUserEid()
方法的一些代码示例,展示了Session.getUserEid()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Session.getUserEid()
方法的具体详情如下:
包路径:org.sakaiproject.tool.api.Session
类名称:Session
方法名:getUserEid
[英]Return the enterprise id of the user associated with this session.
[中]返回与此会话关联的用户的企业id。
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* @inheritDoc
*/
public String getUserEid()
{
return m_session.getUserEid();
}
代码示例来源:origin: sakaiproject/sakai
public String getRemoteUser()
{
// use the "current" setting for this
boolean remoteUser = ((Boolean) threadLocalManager.get(CURRENT_REMOTE_USER)).booleanValue();
if (remoteUser && (m_session != null) && (m_session.getUserEid() != null))
{
return m_session.getUserEid();
}
return super.getRemoteUser();
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-api
public String getRemoteUser()
{
// use the "current" setting for this
boolean remoteUser = ((Boolean) threadLocalManager.get(CURRENT_REMOTE_USER)).booleanValue();
if (remoteUser && (m_session != null) && (m_session.getUserEid() != null))
{
return m_session.getUserEid();
}
return super.getRemoteUser();
}
代码示例来源:origin: org.sakaiproject.hybrid/sakai-hybrid-util
/**
* This is the preferred signature for the createToken methods as it looks
* up the current userId from the current session. Therefore it is a little
* safer.
*
* @param hostname
* Fully qualified domain name or an IP address. See:
* {@link #getSharedSecret(String)}.
* @return token
* @throws IllegalArgumentException
*/
public String createToken(final String hostname) {
LOG.debug("String createToken(final String hostname)");
if (hostname == null || "".equals(hostname)) {
throw new IllegalArgumentException("hostname == null || empty");
}
final Session session = sessionManager.getCurrentSession();
if (session != null) {
return createToken(hostname, session.getUserEid());
} else {
return createToken(hostname, "anonymous");
}
}
代码示例来源:origin: sakaiproject/sakai
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
if (siteId == null) {
siteId = UUID.randomUUID().toString();
}
log.info("Attempting to import: " + zip+ " into "+ siteId);
Session currentSession = sessionManager.getCurrentSession();
String oldId = currentSession.getUserId();
String oldEid = currentSession.getUserEid();
try {
currentSession.setUserId("admin");
currentSession.setUserEid("admin");
archiveService.mergeFromZip(zip, siteId, null);
} catch (Exception e) {
log.warn("Failed to import " + zip + " to " + siteId + " " + e.getMessage());
} finally {
currentSession.setUserId(oldId);
currentSession.setUserEid(oldEid);
}
}
代码示例来源:origin: org.sakaiproject.scheduler/scheduler-component-shared
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
if (siteId == null) {
siteId = UUID.randomUUID().toString();
}
log.info("Attempting to import: " + zip+ " into "+ siteId);
Session currentSession = sessionManager.getCurrentSession();
String oldId = currentSession.getUserId();
String oldEid = currentSession.getUserEid();
try {
currentSession.setUserId("admin");
currentSession.setUserEid("admin");
archiveService.mergeFromZip(zip, siteId, null);
} catch (Exception e) {
log.warn("Failed to import " + zip + " to " + siteId + " " + e.getMessage());
} finally {
currentSession.setUserId(oldId);
currentSession.setUserEid(oldEid);
}
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
user = sessionManager.getCurrentSession().getUserEid();
} catch (Exception e) {
try {
代码示例来源:origin: sakaiproject/sakai
if (!user.equals(currentSession.getUserEid()))
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-api
if (!user.equals(currentSession.getUserEid()))
代码示例来源:origin: org.sakaiproject.metaobj/sakai-metaobj-impl
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
Session sakaiSession = SessionManager.getCurrentSession();
String userId = sakaiSession.getUserId();
String eId = sakaiSession.getUserEid();
try {
sakaiSession.setUserId("admin");
sakaiSession.setUserEid("admin");
boolean updateSchemaHashes = ServerConfigurationService.getBoolean("metaobj.schemahash.update", false);
getStructuredArtifactDefinitionManager().verifySchemaHashes(updateSchemaHashes);
} finally {
sakaiSession.setUserEid(userId);
sakaiSession.setUserId(eId);
}
}
代码示例来源:origin: sakaiproject/sakai
siteId=getUserEidBasedSiteId(session.getUserEid());
代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl
siteId=getUserEidBasedSiteId(session.getUserEid());
内容来源于网络,如有侵权,请联系作者删除!