public class Native
extends java.lang.Object
eib4java
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_PATH_DELIMITER |
static java.lang.String |
CORDYS_CLASSPATH_FILE |
Constructor and Description |
---|
Native() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
_getJDKHome()
If the java.jdk.home property is configured in cordys properties then its
value is returned.
|
static boolean |
addToClassPath(java.lang.String classpath,
boolean prepend)
Appends/Prepends the classpath specified to Cordys Classpath
|
static void |
closeKey()
For internal use only.
|
static java.lang.String |
convertDateToUTCString(java.util.Date date)
Returns the date in UTC string form ie., YYYY-MM-DDTHH:MM:SS.ffffffffff
The fractional part is the remainder after calculation till seconds. |
static java.lang.String |
convertDateToUTCString(java.util.Date date,
boolean trim)
Returns the date in UTC string form ie., YYYY-MM-DDTHH:MM:SS.ffffffffff
The fractional part is the remainder after calculation till seconds. |
static java.lang.String |
convertDateToUTCString(long date)
Returns the date in UTC string form ie., YYYY-MM-DDTHH:MM:SS.ffffffffff
The fractional part is the remainder after calculation till seconds. |
static java.lang.String |
convertDateToUTCString(long date,
boolean trim)
Returns the date in UTC string form ie., YYYY-MM-DDTHH:MM:SS.ffffffffff
The fractional part is the remainder after calculation till seconds. |
static java.lang.String |
convertDateToUTCString(long date,
int nanos)
Returns the date in UTC string form ie., YYYY-MM-DDTHH:MM:SS.ffffffffff
The fractional part contains the nanos after removing trailing zeros |
static java.lang.String |
convertDateToUTCString(long date,
int nanos,
boolean trim)
Returns the date in UTC string form ie., YYYY-MM-DDTHH:MM:SS.ffffffffff
The fractional part contains the nanos |
static long |
convertUTCStringToMillis(java.lang.String cordysDate)
Returns the number of milliseconds since January 1, 1970, 00:00:00
|
static long[] |
convertUTCStringToMillisWithNanos(java.lang.String cordysDate)
Returns the number of milliseconds since January 1, 1970, 00:00:00 and the fraction part
|
static java.sql.Timestamp |
convertUTCStringToTimestamp(java.lang.String cordysDate)
Returns
java.sql.Timestamp from date in UTC string format ie., YYYY-MM-DDTHH:MM:SS.ffffffffff |
static java.lang.String |
createGuid()
Returns a Global Unique Identifier.
|
static byte[] |
decodeBinBase64(byte[] bytes,
int length)
Deprecated.
|
static byte[] |
encodeBinBase64(byte[] bytes,
int length)
Deprecated.
|
static java.lang.String |
getBaseCordysClassPath() |
static java.lang.String |
getBCPClassPath() |
static java.lang.String |
getCordysClassPath()
Builds a String that contains the following entries in the same order
|
static java.util.Enumeration |
getDomainUsers()
Method to get the list of domain users and return them as an enumeration.
|
static java.lang.String |
getEnvValue(java.lang.String name)
For internal use only.
|
static int |
getKeyType(java.lang.String name) |
static java.lang.String |
getKeyValue(java.lang.String name)
For internal use only.
|
static java.lang.String |
getPhysicalAddressOfNetworkInterface(java.lang.String interfaceDisplayName)
Get the physical / hardware address of the give interface display name.
|
static int |
getProcessId()
Retrieves the (OS dependent) identifier of the current process (usually of the Java VM).
|
static long |
getResidentMemoryUsage()
Returns the total number of bytes the process (this current running process)
has in use in resident (non swapped) memory.
|
static long |
getResidentMemoryUsage(int pid) |
static double |
getTotalCpuTime()
Returns the total number of milliseconds the process (this current running process)
has been scheduled in user and kernel mode per cpu.
|
static double |
getTotalCpuTime(int pid) |
static int |
getType(java.lang.String name)
For internal use only.
|
static java.lang.String |
getUTCDate(long date,
int nanos)
Deprecated.
since BCP 4.2 C1
use convertDateToUTCString(long,int)
|
static java.lang.String |
getVariable(java.lang.String name) |
static long |
getVirtualMemoryUsage()
Returns the total number of bytes the process (this current running process)
has in use in virtual memory.
|
static long |
getVirtualMemoryUsage(int pid) |
static void |
killProcess(int processId,
boolean killChildProcesses)
Kills the process with the specified ID, and subprocesses of this process.
|
static boolean |
openKey(java.lang.String key,
java.lang.String subKey,
java.lang.String mode)
For internal use only.
|
static boolean |
processExists(int processId)
Determines if the process exists or not.
|
static boolean |
removeFromClassPath(java.lang.String classpath)
Removes the specified classpath from bcp.classpath file
|
static boolean |
setKeyValue(java.lang.String name,
java.lang.String value,
int type)
For internal use only.
|
static void |
setPermission(int access)
Adds permission to write to the file to its owner and to other
users who are in the file's group, but not to other users in
Linux.
|
static void |
setVariable(java.lang.String name,
java.lang.String value) |
static int |
writeToFileWithLock(java.lang.String fileName,
byte[] bytes,
int sizeOfBytes) |
public static java.lang.String CLASS_PATH_DELIMITER
public static java.lang.String CORDYS_CLASSPATH_FILE
public static java.lang.String getUTCDate(long date, int nanos)
public static java.lang.String convertDateToUTCString(long date)
date
- the number of millisecondspublic static java.lang.String convertDateToUTCString(long date, boolean trim)
date
- the number of millisecondstrim
- specifies whether to remove the trailing zerospublic static java.lang.String convertDateToUTCString(java.util.Date date)
date
- the date to be formattedpublic static java.lang.String convertDateToUTCString(java.util.Date date, boolean trim)
date
- the date to be formattedtrim
- specifies whether to remove the trailing zerospublic static java.lang.String convertDateToUTCString(long date, int nanos)
date
- the number of milliseconds to convert to Stringnano
- fraction of second part of Timepublic static java.lang.String convertDateToUTCString(long date, int nanos, boolean trim)
date
- the number of milliseconds to convert to Stringnano
- fraction of second part of Timetrim
- specifies whether to remove the trailing zerospublic static java.sql.Timestamp convertUTCStringToTimestamp(java.lang.String cordysDate)
java.sql.Timestamp
from date in UTC string format ie., YYYY-MM-DDTHH:MM:SS.ffffffffffpublic static long convertUTCStringToMillis(java.lang.String cordysDate)
String
- cordysDate Date in UTC string format(YYYY-MM-DDTHH:MM:SS.fffffffff)public static long[] convertUTCStringToMillisWithNanos(java.lang.String cordysDate)
String
- cordysDate Date in UTC string format(YYYY-MM-DDTHH:MM:SS.fffffffff)@Deprecated public static byte[] encodeBinBase64(byte[] bytes, int length)
@Deprecated public static byte[] decodeBinBase64(byte[] bytes, int length)
public static int getProcessId()
public static double getTotalCpuTime(int pid)
public static double getTotalCpuTime()
public static long getResidentMemoryUsage(int pid)
public static long getResidentMemoryUsage()
public static long getVirtualMemoryUsage(int pid)
public static long getVirtualMemoryUsage()
public static void killProcess(int processId, boolean killChildProcesses)
public static boolean processExists(int processId)
processId
- public static java.lang.String createGuid()
public static java.lang.String getVariable(java.lang.String name)
public static int getKeyType(java.lang.String name)
public static void setVariable(java.lang.String name, java.lang.String value)
public static java.util.Enumeration getDomainUsers()
public static java.lang.String getEnvValue(java.lang.String name)
public static java.lang.String getKeyValue(java.lang.String name)
public static boolean setKeyValue(java.lang.String name, java.lang.String value, int type)
public static int getType(java.lang.String name)
public static boolean openKey(java.lang.String key, java.lang.String subKey, java.lang.String mode)
public static void closeKey()
public static int writeToFileWithLock(java.lang.String fileName, byte[] bytes, int sizeOfBytes)
public static java.lang.String getCordysClassPath()
The environment CLASSPATH variable Appends files under the/ext folder Appends all entries in the bcp.classpath file
public static java.lang.String getBaseCordysClassPath()
public static boolean addToClassPath(java.lang.String classpath, boolean prepend)
classpath
- string value of classpath that needs to be appended or
prependedprepend
- If true prepends the classpath else appendspublic static boolean removeFromClassPath(java.lang.String classpath)
classpath
- string representation of classpath that needs to be
removedpublic static java.lang.String getBCPClassPath()
public static java.lang.String getPhysicalAddressOfNetworkInterface(java.lang.String interfaceDisplayName)
interfaceDisplayName
- public static java.lang.String _getJDKHome()
public static void setPermission(int access)
access
- is the desired permission and should be in octal format,e.g. 0755
e.g. Native.setPermission(0775)