Class Tm1Identity
java.lang.Object
io.skipcheck.tm1.client.session.Tm1Identity
Who a session is: the identity a
Tm1SessionPool keys its sessions by. In TM1
the identity is fixed when the session logs in, so one identity is one session.
serviceAccount(): the pool's own credentials, as they are.impersonating(String): the pool's credentials, acting as a TM1 user throughTM1-Impersonate.withCredentials(String, Tm1Authenticator): a user's own credentials, such as their CAM passport.
Two identities are equal when they're the same kind and their names match as TM1
matches user names, ignoring case and spaces, so impersonating("Alice") and
impersonating("alice") share a session.
For a user's own credentials, the credentials must be equal too. A name is only what
the caller says, and it's TM1 that checks credentials, at login: if the name alone
found the session, anyone giving a logged-in user's name would get that user's session
without TM1 ever seeing what they offered, and a corrected password or a renewed
passport would never be used. So different credentials for the same name get a session
of their own, and TM1 accepts or refuses them. See Tm1Authenticator for which
authenticators are equal to one another.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionThe user's own credentials, forTm1Identity.Kind.OWN_CREDENTIALS.booleaninthashCode()static Tm1Identityimpersonating(String user) The pool's credentials, acting as TM1 useruser.kind()What kind of identity this is.name()The user's name, as given; empty for the service account.static Tm1IdentityThe pool's own credentials, with no impersonation.toString()static Tm1IdentitywithCredentials(String name, Tm1Authenticator authenticator) A user logging in with their own credentials.
-
Method Details
-
serviceAccount
The pool's own credentials, with no impersonation.- Returns:
- the identity
-
impersonating
The pool's credentials, acting as TM1 useruser. The pool's credentials must be an administrator's or a data administrator's, and administrators can't be impersonated; seeTm1Session.Builder.impersonate(String).- Parameters:
user- the TM1 user to act as- Returns:
- the identity
- Throws:
IllegalArgumentException- ifuseris blank or has a control character
-
withCredentials
A user logging in with their own credentials.- Parameters:
name- who the credentials belong to, for the pool's key and for logs, such as the user nameauthenticator- their credentials. Pass one that is equal each time, or the same object: an authenticator the pool hasn't seen for this name gets a new session- Returns:
- the identity
-
kind
-
name
-
authenticator
The user's own credentials, forTm1Identity.Kind.OWN_CREDENTIALS.- Returns:
- the authenticator, or empty for the other kinds
-
equals
-
hashCode
-
toString
-