- All Implemented Interfaces:
Serializable
,Comparable<SystemContext>
,Constable
Describes the context within a system's environment regarding host, user and
application contexts as well as the currently invoked Java runtime session.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSpecifies an application specific granularity.Specifies a Java runtime invokcation's session and an application specific granularity.Specifies a host specific granularity.Specifies an application on a host specific granularity.Specifies a Java runtime invokcation's session for an application on a host specific granularity.Specifies a Java runtime invokcation's session for a host specific granularity.Specifies a user on a host specific granularity.Specifies an application for a user on a host specific granularity.Specifies a Java runtime invokcation's session for an application for a user on a host specific granularity.Specifies a Java runtime invokcation's session for a user on a host specific granularity.Specifies a Java runtime invokcation's session specific granularity, valid just for the current invocation of the Java runtime.Specifies a user specific granularity.Specifies a user specific granularity.Specifies a Java runtime invokcation's session and a user specific granularity.Specifies a Java runtime invokcation's session for a user specific granularity. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether the granularity is on an application level.boolean
Determines whether the granularity is on a host level.boolean
Determines whether the granularity is on a session level, e.g. valid just for the lifetime of the current runtime Java's invocation.boolean
Determines whether the granularity is on a user level.int
Creates an TID most probably unique as specified by the enumeration instance this method is invoked on.int
toContextId
(String aSeed) Creates an TID most probably unique as specified by the enumeration instance this method is invoked on.int[]
toContextIds
(int aIdLength) Creates an array of IDs most probably unique as specified by the provided argument this method is invoked on.int[]
toContextIds
(int aIdLength, String aSeed) Creates an array of IDs most probably unique as specified by the provided argument this method is invoked on.char[]
Creates aString
most probably unique as specified by the enumeration instance this method is invoked on.char[]
toContextSequence
(char[] aSeed) Creates aString
most probably unique as specified by the enumeration instance this method is invoked on.char[]
toContextSequence
(String aSeed) Creates aString
most probably unique as specified by the enumeration instance this method is invoked on.Creates aString
most probably unique as specified by the enumeration instance this method is invoked on.toContextString
(char[] aSeed) Creates aString
most probably unique as specified by the enumeration instance this method is invoked on.toContextString
(String aSeed) Creates aString
most probably unique as specified by the enumeration instance this method is invoked on.char[]
toInvertible
(char[] aText) Obfuscates (applies a simple invertible XOR function on) the given text with theSystemContext
element's contextString
(as oftoContextString()
).char[]
toObfuscated
(String aText) Obfuscates (applies a simple invertible XOR function on) the given text with theSystemContext
element's contextString
(as oftoContextString()
).static SystemContext
Returns the enum constant of this class with the specified name.static SystemContext[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
APPLICATION
Specifies an application specific granularity. -
USER_APPLICATION
Specifies a user specific granularity. -
HOST_USER_APPLICATION
Specifies an application for a user on a host specific granularity. -
HOST_APPLICATION
Specifies an application on a host specific granularity. -
USER
Specifies a user specific granularity. -
HOST_USER
Specifies a user on a host specific granularity. -
HOST
Specifies a host specific granularity. -
SESSION
Specifies a Java runtime invokcation's session specific granularity, valid just for the current invocation of the Java runtime. -
APPLICATION_SESSION
Specifies a Java runtime invokcation's session and an application specific granularity. -
USER_APPLICATION_SESSION
Specifies a Java runtime invokcation's session and a user specific granularity. -
HOST_USER_APPLICATION_SESSION
Specifies a Java runtime invokcation's session for an application for a user on a host specific granularity. -
HOST_APPLICATION_SESSION
Specifies a Java runtime invokcation's session for an application on a host specific granularity. -
USER_SESSION
Specifies a Java runtime invokcation's session for a user specific granularity. -
HOST_USER_SESSION
Specifies a Java runtime invokcation's session for a user on a host specific granularity. -
HOST_SESSION
Specifies a Java runtime invokcation's session for a host specific granularity.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isHostLevel
public boolean isHostLevel()Determines whether the granularity is on a host level.- Returns:
- True in case of being on a host level, else false.
-
isUserLevel
public boolean isUserLevel()Determines whether the granularity is on a user level.- Returns:
- True in case of being on a user level, else false.
-
isApplicationLevel
public boolean isApplicationLevel()Determines whether the granularity is on an application level.- Returns:
- True in case of being on an application level, else false.
-
isSessionLevel
public boolean isSessionLevel()Determines whether the granularity is on a session level, e.g. valid just for the lifetime of the current runtime Java's invocation.- Returns:
- True in case of being on a session level, else false.
-
toContextString
Creates aString
most probably unique as specified by the enumeration instance this method is invoked on. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Returns:
- The calculated system's
String
.
-
toContextString
Creates aString
most probably unique as specified by the enumeration instance this method is invoked on. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Parameters:
aSeed
- A seed to alter the TID individually.- Returns:
- The calculated system's
String
.
-
toContextString
Creates aString
most probably unique as specified by the enumeration instance this method is invoked on. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Parameters:
aSeed
- A seed to alter the TID individually.- Returns:
- The calculated system's
String
.
-
toContextSequence
public char[] toContextSequence()Creates aString
most probably unique as specified by the enumeration instance this method is invoked on. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Returns:
- The calculated system's
String
.
-
toContextSequence
Creates aString
most probably unique as specified by the enumeration instance this method is invoked on. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Parameters:
aSeed
- A seed to alter the TID individually.- Returns:
- The calculated system's
String
.
-
toContextSequence
public char[] toContextSequence(char[] aSeed) Creates aString
most probably unique as specified by the enumeration instance this method is invoked on. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Parameters:
aSeed
- A seed to alter the TID individually.- Returns:
- The calculated system's
String
.
-
toContextId
public int toContextId()Creates an TID most probably unique as specified by the enumeration instance this method is invoked on. Succeeding calls of this method on the same machine returns the same value. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Returns:
- The calculated system's TID.
-
toContextId
Creates an TID most probably unique as specified by the enumeration instance this method is invoked on. Succeeding calls of this method on the same machine with the same arguments returns the same value. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. System.out.println(System.getenv("PROCESSOR_ARCHITECTURE")); System.out.println(System.getenv("PROCESSOR_ARCHITEW6432")); System.getProperty("os.arch"); The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Parameters:
aSeed
- A seed to alter the TID individually.- Returns:
- The calculated system's TID.
-
toContextIds
public int[] toContextIds(int aIdLength) Creates an array of IDs most probably unique as specified by the provided argument this method is invoked on. Succeeding calls of this method on the same machine with the same arguments returns the same values. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Parameters:
aIdLength
- The number of IDs to be generated.- Returns:
- The calculated system's TID.
-
toContextIds
Creates an array of IDs most probably unique as specified by the provided argument this method is invoked on. Succeeding calls of this method on the same machine with the same arguments returns the same values. Attention: The result my vary depending on the user under which the application is being executed! Supports the environment variableEnvironmentVariable.HOST_SEED
as well as the system propertySystemProperty.HOST_SEED
. The enumeration value specifies the context for the created TID, e.g. which system properties to take into account.- Parameters:
aIdLength
- The number of IDs to be generated.aSeed
- A seed to alter the TID individually.- Returns:
- The calculated system's TID.
-
toObfuscated
Obfuscates (applies a simple invertible XOR function on) the given text with theSystemContext
element's contextString
(as oftoContextString()
). Applying this operation to the result of this operation results in the original text (invertible function).- Parameters:
aText
- The text to be obfuscated (inverted).- Returns:
- The obfuscated (inverted) text.
-
toInvertible
public char[] toInvertible(char[] aText) Obfuscates (applies a simple invertible XOR function on) the given text with theSystemContext
element's contextString
(as oftoContextString()
). Applying this operation to the result of this operation results in the original text (invertible function).- Parameters:
aText
- The text to be obfuscated (inverted).- Returns:
- The obfuscated (inverted) text.
-