public final class ServerIdentity extends Object implements ServerIdentityInterface
ServerIdentity serverIdentity = ServerIdentity.getInstance(); serverIdentity.setName(name).setRole(role).setPlatformId(platformId); or ServerIdentity.getInstance().setFromMap(map); or ServerIdentity.getInstance().setFromPropertyFile(file);Where name, role and platformID comes from a configuration file for instance.
ServerIdentity serverIdentity = ServerIdentity.getInstance(); String name = serverIdentity.getName(); String role = serverIdentity.getRole(); int platformId = serverIdentity.getPlatformId();Main usages are for:
Modifier and Type | Class and Description |
---|---|
static class |
ServerIdentity.MAP_KEYNAME
Map key for setFromMap
|
Modifier and Type | Method and Description |
---|---|
int |
getGlobalPlatformId() |
static ServerIdentity |
getInstance() |
String |
getJsonIdentity() |
String |
getLoggerMessagePrepend() |
String |
getName() |
String |
getRole() |
int |
getServerId() |
int |
getSiteId() |
ServerIdentity |
setFromMap(Map<String,Object> map)
Assign the ServerIdentity from a Map where Key are elements from MAP_KEYNAME.
|
ServerIdentity |
setFromPropertyFile(File propertiesFile)
Assign the ServerIdentity from a Property file where Key are elements from MAP_KEYNAME.
|
ServerIdentity |
setFromYamlFile(File yamlFile)
Assign the ServerIdentity from a Yaml file where Key are elements from MAP_KEYNAME.
|
ServerIdentity |
setName(String name) |
ServerIdentity |
setRole(String role) |
ServerIdentity |
setServerId(int serverId)
The PlatformId is a unique name per site (each of the 3 sites of Vitam should have a different id).
|
ServerIdentity |
setSiteId(int siteId)
Set the SideID
|
public final String getLoggerMessagePrepend()
getLoggerMessagePrepend
in interface ServerIdentityInterface
public final String getJsonIdentity()
public static final ServerIdentity getInstance()
public final ServerIdentity setFromPropertyFile(File propertiesFile) throws FileNotFoundException
propertiesFile
- fileFileNotFoundException
- if the property file is not foundpublic final ServerIdentity setFromYamlFile(File yamlFile) throws FileNotFoundException
yamlFile
- fileFileNotFoundException
- if the Yaml file is not foundpublic final ServerIdentity setFromMap(Map<String,Object> map)
map
- the map from which the values are to be setIllegalArgumentException
- map nullpublic final String getName()
getName
in interface ServerIdentityInterface
public final ServerIdentity setName(String name)
name
- the name of the Server to setIllegalArgumentException
- name nullpublic final String getRole()
getRole
in interface ServerIdentityInterface
public final ServerIdentity setRole(String role)
role
- the role of the Server to setIllegalArgumentException
- rolepublic final int getGlobalPlatformId()
getGlobalPlatformId
in interface ServerIdentityInterface
public final ServerIdentity setServerId(int serverId)
serverId
- the platformId of the Vitam Platform to setIllegalArgumentException
- platformId < 0public final int getServerId()
getServerId
in interface ServerIdentityInterface
public final int getSiteId()
getSiteId
in interface ServerIdentityInterface
public final ServerIdentity setSiteId(int siteId)
siteId
- the siteId to setCopyright © 2018 Vitam. All rights reserved.