public final class ClientHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_GLOBAL_CLIENT_ID
The Constant DEFAULT_GLOBAL_CLIENT_ID defines the default id for the global client.
|
Modifier and Type | Method and Description |
---|---|
static void |
assertIsCurrentClientGlobal() |
static String |
createUniqueClientId()
Creates a (worldwide) unique ID to be used as unique identifier for a client.
|
static ClientTO |
getClient(String clientId)
Get the details of a client that has the given ID.
|
static Timestamp |
getCreationDate() |
static ClientTO |
getCurrentClient()
Get the client that is associated with the current thread.
|
static String |
getCurrentClientId()
Get the ID of the client which is associated with the current thread.
|
static Locale |
getDefaultLanguage()
Return the default language defined in the client configuration properties
|
static String |
getGlobalClientId()
Return the ID of the global client.
|
static boolean |
isClientGlobal(ClientTO client)
Checks if the given client is the global client.
|
static boolean |
isClientGlobal(String clientId)
Checks if the given ID is the ID of the global client
|
static boolean |
isCurrentClientGlobal()
Checks if the current client is global.
|
public static final String DEFAULT_GLOBAL_CLIENT_ID
public static void assertIsCurrentClientGlobal() throws AuthorizationException
AuthorizationException
- Thrown, when the current client is not the global client.public static String createUniqueClientId()
public static ClientTO getClient(String clientId)
clientId
- the ID of the clientpublic static Timestamp getCreationDate()
Timestamp
of the creation date of the current client.public static ClientTO getCurrentClient()
CommunoteRuntime#isInitialized()
returns true, the global client will be returned. Otherwise null is returned.public static String getCurrentClientId()
public static Locale getDefaultLanguage()
public static String getGlobalClientId()
public static boolean isClientGlobal(ClientTO client)
client
- the client. Can be null.public static boolean isClientGlobal(String clientId)
clientId
- the ID of the client to test. Can be null.public static boolean isCurrentClientGlobal()
Copyright © 2019 Communote team. All rights reserved.