public class CoreInstance extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CoreInstance.RegistrationInfo |
Modifier and Type | Method and Description |
---|---|
void |
cleanupThisThread() |
void |
close(CoreSession session)
Deprecated.
since 5.9.3, use
CoreSession.close() instead. |
static void |
closeCoreSession(CoreSession session)
Use
CoreSession.close() instead. |
static CoreInstance |
getInstance()
Gets the CoreInstance singleton.
|
int |
getNumberOfSessions()
Gets the number of open sessions.
|
Collection<CoreInstance.RegistrationInfo> |
getRegistrationInfos() |
Collection<CoreInstance.RegistrationInfo> |
getRegistrationInfosLive(boolean onThread) |
CoreSession |
getSession(String sessionId)
Gets an existing open session for the given session id.
|
CoreSession |
open(String repositoryName,
Map<String,Serializable> context)
Deprecated.
since 5.9.3, use
openCoreSession(java.lang.String) instead. |
static CoreSession |
openCoreSession(String repositoryName)
Opens a
CoreSession for the currently logged-in user. |
static CoreSession |
openCoreSession(String repositoryName,
Map<String,Serializable> context)
NOT PUBLIC, DO NOT CALL.
|
static CoreSession |
openCoreSession(String repositoryName,
NuxeoPrincipal principal)
Opens a
CoreSession for the given principal. |
static CoreSession |
openCoreSession(String repositoryName,
Principal principal)
Opens a
CoreSession for the given principal. |
static CoreSession |
openCoreSession(String repositoryName,
String username)
Opens a
CoreSession for the given user. |
static CoreSession |
openCoreSessionSystem(String repositoryName)
Opens a
CoreSession for a system user. |
public static CoreInstance getInstance()
public static CoreSession openCoreSession(String repositoryName) throws ClientException
CoreSession
for the currently logged-in user.
The session must be closed using CoreSession.close()
.
repositoryName
- the repository name, or null
for the default repositoryClientException
public static CoreSession openCoreSession(String repositoryName, String username) throws ClientException
CoreSession
for the given user.
The session must be closed using CoreSession.close()
.
repositoryName
- the repository name, or null
for the default repositoryusername
- the user nameClientException
public static CoreSession openCoreSessionSystem(String repositoryName) throws ClientException
CoreSession
for a system user.
The session must be closed using CoreSession.close()
.
repositoryName
- the repository name, or null
for the default repositoryClientException
@Deprecated public CoreSession open(String repositoryName, Map<String,Serializable> context) throws ClientException
openCoreSession(java.lang.String)
instead.ClientException
public static CoreSession openCoreSession(String repositoryName, Map<String,Serializable> context) throws ClientException
Opens a CoreSession
for the given context.
repositoryName
- the repository name, or null
for the default repositorycontext
- the session open contextClientException
public static CoreSession openCoreSession(String repositoryName, Principal principal) throws ClientException
CoreSession
for the given principal.
The session must be closed using CoreSession.close()
.
repositoryName
- the repository name, or null
for the default repositoryprincipal
- the principalClientException
public static CoreSession openCoreSession(String repositoryName, NuxeoPrincipal principal) throws ClientException
CoreSession
for the given principal.
The session must be closed using CoreSession.close()
.
repositoryName
- the repository name, or null
for the default repositoryprincipal
- the principalClientException
public CoreSession getSession(String sessionId)
The returned CoreSession must not be closed, as it is owned by someone else.
sessionId
- the session idpublic static void closeCoreSession(CoreSession session)
CoreSession.close()
instead.@Deprecated public void close(CoreSession session)
CoreSession.close()
instead.public int getNumberOfSessions()
public Collection<CoreInstance.RegistrationInfo> getRegistrationInfos()
public Collection<CoreInstance.RegistrationInfo> getRegistrationInfosLive(boolean onThread)
public void cleanupThisThread() throws ClientException
ClientException
Copyright © 2015 Nuxeo SA. All rights reserved.