Package org.nuxeo.runtime.api.login
Class LoginComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.runtime.api.login.LoginComponent
- All Implemented Interfaces:
LoginService,Adaptable,Component,Extensible,TimestampedService
Component holding the stack of logged in principals.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ThreadLocal<Deque<Principal>>The thread-local principal stack.static final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidINTERNAL.<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.static PrincipalReturns the last principal from the current principal stack.INTERNAL.booleanisSystemId(Principal principal) static booleanisSystemLogin(Object principal) login()System login, using a private principal that has all privileges.Deprecated.System login, using a private principal that has all privileges.static PrincipalPops the last principal from the current principal stack.static voidpushPrincipal(Principal principal) Pushes the principal to the current principal stack.protected NuxeoLoginContextsystemLogin(String originatingUser) Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
SYSTEM_USERNAME
- See Also:
-
PRINCIPAL_STACK
The thread-local principal stack. The top of the stack (last element) contains the current principal.- Since:
- 11.1
-
-
Constructor Details
-
LoginComponent
public LoginComponent()
-
-
Method Details
-
getAdapter
Description copied from interface:AdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.- Specified by:
getAdapterin interfaceAdaptable- Overrides:
getAdapterin classDefaultComponent- Parameters:
adapter- the adapter class to look up- Returns:
- a object castable to the given class, or
nullif this object does not have an adapter for the given class
-
systemLogin
-
login
Description copied from interface:LoginServiceSystem login, using a private principal that has all privileges. This principal is not stored in any database and cannot be accessed by user.- Specified by:
loginin interfaceLoginService- Returns:
- the login context
-
loginAs
Description copied from interface:LoginServiceSystem login, using a private principal that has all privileges. This principal is not stored in any database and cannot be accessed by user.- Specified by:
loginAsin interfaceLoginService- Parameters:
username- the username that originated the system login- Returns:
- the login context
-
login
@Deprecated public NuxeoLoginContext login(String username, Object credentials) throws LoginException Deprecated.Description copied from interface:LoginServiceClient login using the given username and password.- Specified by:
loginin interfaceLoginService- Throws:
LoginException
-
isSystemId
- Specified by:
isSystemIdin interfaceLoginService
-
isSystemLogin
-
getPrincipalStack
INTERNAL.- Since:
- 11.1
-
clearPrincipalStack
public static void clearPrincipalStack()INTERNAL.- Since:
- 11.1
-
pushPrincipal
Pushes the principal to the current principal stack.- Parameters:
principal- the principal- Since:
- 11.1
-
popPrincipal
Pops the last principal from the current principal stack.- Returns:
- the last principal, or
nullif the stack is empty - Since:
- 11.1
-
getCurrentPrincipal
Returns the last principal from the current principal stack.- Returns:
- the last principal, or
nullif the stack is empty - Since:
- 11.1
-