com.adventnet.utils.agent
Class utils

java.lang.Object
  |
  +--com.adventnet.utils.agent.utils

public class utils
extends java.lang.Object

This class contains utility routines to be used by other classes.


Field Summary
static AgentErrorListener ael
          variable having the reference to the user implemented AgentErrorListener.
static int CRITICAL
          Deprecated. this will be no longer needed due to logging. Constant for critical debug messages.
(package private) static boolean DEBUG
           
static int debugLevel
          Deprecated. this will be no longer needed due to logging. variable having debugLevel , by defaullt FATAL.
static int FATAL
          Deprecated. this will be no longer needed due to logging. Constant for fatal debug messages.
static int MESSAGE_TRACE
          Deprecated. this will be no longer needed due to logging. Constant for message tracing debug messages. API users doesn't need to use this.
static int METHOD_TRACE
          Deprecated. this will be no longer needed due to logging. Constant for method tracing debug messages. API users doesn't need to use this.
static int NON_CRITICAL
          Deprecated. this will be no longer needed due to logging. Constant for non-critical debug messages.
(package private) static boolean setupStdOutErrDone
           
 
Constructor Summary
utils()
          The Default Constructor.
 
Method Summary
static long[] addArrays(java.lang.Object objArray1, java.lang.Object objArray2)
          Concatenates two long arrays and returns Long Array.
static int[] addIntArrays(java.lang.Object objArray1, java.lang.Object objArray2)
          Concatenates two int arrays into one Int array.
static int[] addLongArraysReturnInt(java.lang.Object objArray1, java.lang.Object objArray2)
          Concatenates two long array to one int array.
static void arraycopy(byte[] from, int index1, int[] toCopy, int index2, int endIndex)
          Copies the contents of the byte[] from from the starting index index1 to the int[] toCopy from the starting index index2 upto a length of endIndex.
static void arraycopy(int[] from, int index1, byte[] toCopy, int index2, int endIndex)
          Copies the contents of the int[] from from the starting index index1 to the byte[] toCopy from the starting index index2 upto a length of endIndex.
static java.lang.String arrayToString(java.lang.Object longarray)
          Converts long integer OID array to string OID.
static java.lang.String changeToSystemURL(java.lang.String myString)
          Utility method to convert the filePath String with file separators to String with System based File separator
static boolean checkFilePerms(java.lang.String fileName, java.lang.String access)
          checks the file for the appropriate access.
static int compareTo(byte[] byte1, byte[] byte2)
          Compares two byte arrays
static int compareTo(int[] oid1, int[] oid2)
          Compares two Integer arrays
static int compareTo(java.lang.String theString, java.lang.String toCompare)
          The Method compares two Strings.
static int compareToWithMinSize(int[] oid1, int[] oid2)
          This Method Compares Two int Arrays by considering the size of the arrays.
static void debugPrintHigh(java.lang.Object str)
          Deprecated. this will be no longer needed due to logging. debugPrint method for FATAL messages.
static void debugPrintLow(java.lang.Object str)
          Deprecated. this will be no longer needed due to logging. debugPrint method for NON_CRITICAL messages.
static void debugPrintMedium(java.lang.Object str)
          Deprecated. this will be no longer needed due to logging. debugPrint method for CRITICAL messages.
static long[] diffOfArrays(java.lang.Object objLongArray, java.lang.Object objShortArray)
          Difference between two long Arrays useful for getting instance OID etc.
static int[] diffOfIntArrays(java.lang.Object objIntArray, java.lang.Object objIntSmallArray)
          Difference between two int Arrays useful for getting instance OID etc.
static int get_input(java.lang.String mesg)
          This method is to get back the input given in the console.
static java.lang.String[] getArray(java.lang.String str, java.lang.String delim)
          Utility method to split a String with a specified delimiter to separate array elements based on the delimiter
static java.math.BigInteger getBigIntegerFromArray(long[] arr)
          Converts the long[] to it's equivalent BigInteger value.
static java.lang.String getCalendarDateAndTime()
          Gets The Current Day Date Time from the Calendar.
static boolean getDebug()
          Deprecated. this will be no longer needed due to logging. Gets the debug flag.
static int getDebugLevel()
          Deprecated. this will be no longer needed due to logging. Gets the value of debugLevel whether FATAL(1) or CRITICAL(2) or NON_CRITICAL(3).
static java.lang.String getDebugLevelString()
          Deprecated. this will be no longer needed due to logging. Getter for the debugLevel in String.
static int getInt()
          Gets integer from the system input.
static java.lang.String getLine()
          Gets string from the system input.
static java.lang.String getLine(java.lang.String tmp)
          Gets string from the system input.
static long[] getLongArray(long val)
          Splits the long value to long array with two elements.
static long[] getLongArray(java.lang.Object toReturn)
          Utility method used in handling Counter64 dataType.
static java.lang.Long getLongFromArray(long[] arr)
          Converts a long[] array to Long.
static byte[] getMaskBytes(java.lang.String str)
          static method to get the byte Array representation of the Mask Type used in V3 Tables.
static java.lang.String getMaskString(byte[] array)
          static method to get the String representation of the Mask Type retruned by V3 Tables.
(package private) static int getMinSize(byte[] oid1, byte[] oid2)
           
(package private) static int getMinSize(int[] oid1, int[] oid2)
           
static int[] getNextInstance(java.util.Vector entryVector, int[] currentInstance)
          Returns the next Instance (int[]) from the entryVector.
static void handleError(java.lang.Exception e)
          Gives away any errors thrown from the agent to the AgentErrorListener.
static void handleWarning(java.lang.Exception e)
          Gives away any harmless exceptions thrown from the agent to the AgentErrorListener.
static java.lang.String intArrayToString(int[] longarray)
          converts int array to string OID.
static java.lang.String integerArrayToString(java.lang.Object integerArr)
          Converts integer array to String.
static boolean isInSubTree(int[] rootoid, int[] oid)
          Checks whether the OID falls under the rootOID tree.
(package private) static boolean isLessThan(int[] obj1, int[] obj2)
           
static void killAll()
          kills all threads in the currently running thread's threadgroup
static void messageTrace(java.lang.Object str)
          Deprecated. this will be no longer needed due to logging. debugPrint method for MESSAGE_TRACE messages. API users doesn't need to call this.
static void methodTrace(java.lang.Object str)
          Deprecated. this will be no longer needed due to logging. debugPrint method for METHOD_TRACE messages. API users doesn't need to call this.
static int min(int a, int b, int c)
          Finds minimum of 3 integers.
static boolean OIDequals(int[] OID1, int[] OID2)
          Checks to see if two integer OID's are equal.
static boolean OIDequals(long[] OID1, long[] OID2)
          Checks to see if two long OID's are equal.
static void print(java.lang.Object str)
          Method to Print to the standard output.
static void printErr(java.lang.Object str)
          Method to Print to standard error.
static void println(java.lang.Object str)
          Print line to standard output.
static void printlnErr(java.lang.Object str)
          Print line to standard error.
static void printThreads(java.lang.Thread thr)
          Prints the argument thread's threadgroup.
static void setAgentErrorListener(AgentErrorListener e)
          Setter for the AgentErrorListener.
static void setDebug(boolean val)
          Deprecated. this will be no longer needed due to logging. Sets debug ON/OFF.
static void setDebugLevel(int level)
          Deprecated. this will be no longer needed due to logging. Sets debugLevel FATAL or CRITICAL or NON_CRITICAL.
static boolean setDebugLevelByString(java.lang.String debugLevel)
          Deprecated. this will be no longer needed due to logging. Setter for debugLevel by means of String.
static void setupStdOutErr()
          Deprecated. this will be no longer needed due to logging. Makes logs directory for standardoutput and standarderror files.
static void setupStdOutErr(java.io.OutputStream outputStream)
          Deprecated. this will be no longer needed due to logging. redirects output to specified output stream
static void setupStdOutErr(java.lang.String dirStr)
          Deprecated. this will be no longer needed due to logging. Makes specified directory for standard output and standard error files.
static void setupStdOutErr(java.lang.String dirStr, java.lang.String oFileName, java.lang.String eFileName)
          Deprecated. this will be no longer needed due to logging. Makes the specified directory and writes the outputs and errors to the specified fileNames.
static void sort(java.util.Vector toSort)
          It sorts the elements in the Vector.
static java.lang.String stringFirstCharToLower(java.lang.String toChange)
          Converts the first character of a string to LowerCase character.
static java.lang.String stringFirstCharToUpper(java.lang.String toChange)
          Converts the first character of a string to UpperCase character.
static long[] stringToArray(java.lang.String str)
          Converts string OID to array of long data type.
static int[] stringToIntArray(java.lang.String str)
          Converts string OID to array of int data type.
static int[] stringToIntegerArray(java.lang.String str)
          Converts the given string to integer array.
(package private) static void swap(java.util.Vector x, int i, int j)
           
static void wait_in()
          Waits until any key is pressed.
static void wait_in(java.lang.Object str)
          Waits until any key is pressed.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FATAL

public static final int FATAL
Deprecated. this will be no longer needed due to logging. Constant for fatal debug messages.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

CRITICAL

public static final int CRITICAL
Deprecated. this will be no longer needed due to logging. Constant for critical debug messages.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

NON_CRITICAL

public static final int NON_CRITICAL
Deprecated. this will be no longer needed due to logging. Constant for non-critical debug messages.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

METHOD_TRACE

public static final int METHOD_TRACE
Deprecated. this will be no longer needed due to logging. Constant for method tracing debug messages. API users doesn't need to use this.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

MESSAGE_TRACE

public static final int MESSAGE_TRACE
Deprecated. this will be no longer needed due to logging. Constant for message tracing debug messages. API users doesn't need to use this.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

setupStdOutErrDone

static boolean setupStdOutErrDone

DEBUG

static boolean DEBUG

debugLevel

public static int debugLevel
Deprecated. this will be no longer needed due to logging. variable having debugLevel , by defaullt FATAL.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

ael

public static AgentErrorListener ael
variable having the reference to the user implemented AgentErrorListener.
Constructor Detail

utils

public utils()
The Default Constructor.
Method Detail

setDebug

public static void setDebug(boolean val)
Deprecated. this will be no longer needed due to logging. Sets debug ON/OFF.

Parameters:
val - The Value to set (ON/OFF).
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
getDebug().

getDebug

public static boolean getDebug()
Deprecated. this will be no longer needed due to logging. Gets the debug flag.

Returns:
True if the Debug Flag is on else False.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setDebug(boolean val).

setDebugLevel

public static void setDebugLevel(int level)
Deprecated. this will be no longer needed due to logging. Sets debugLevel FATAL or CRITICAL or NON_CRITICAL.

Parameters:
The - DebugLevel to be set (1-FATAL, 2-CRITICAL, 3-NON_CRITICAL).
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
getDebugLevel(), setDebugLevelByString(String debugLevel)

getDebugLevel

public static int getDebugLevel()
Deprecated. this will be no longer needed due to logging. Gets the value of debugLevel whether FATAL(1) or CRITICAL(2) or NON_CRITICAL(3).

Returns:
The Debug Level of the Agent.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setDebugLevel(int Level)

setDebugLevelByString

public static boolean setDebugLevelByString(java.lang.String debugLevel)
Deprecated. this will be no longer needed due to logging. Setter for debugLevel by means of String.

Parameters:
debugLevel - The debugLevel to be set.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setDebugLevel(int level), getDebugLevelString()

getDebugLevelString

public static java.lang.String getDebugLevelString()
Deprecated. this will be no longer needed due to logging. Getter for the debugLevel in String.

Returns:
The Debug level string Value.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setDebugLevel(String debugLevel), getDebugLevel()

debugPrintHigh

public static void debugPrintHigh(java.lang.Object str)
Deprecated. this will be no longer needed due to logging. debugPrint method for FATAL messages.

Parameters:
str - The Object that needs to be shown in the console.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
debugPrintMedium(Object str), debugPrintLow(Object str)

debugPrintMedium

public static void debugPrintMedium(java.lang.Object str)
Deprecated. this will be no longer needed due to logging. debugPrint method for CRITICAL messages.

Parameters:
str - The Object that needs to be shown in the console.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
debugPrintHigh(Object str), debugPrintLow(Object str)

debugPrintLow

public static void debugPrintLow(java.lang.Object str)
Deprecated. this will be no longer needed due to logging. debugPrint method for NON_CRITICAL messages.

Parameters:
str - The Object that needs to be shown in the console.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
debugPrintHigh(Object str), debugPrintMedium(Object str)

methodTrace

public static void methodTrace(java.lang.Object str)
Deprecated. this will be no longer needed due to logging. debugPrint method for METHOD_TRACE messages. API users doesn't need to call this.

Parameters:
str - The message to be shown on the console.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

messageTrace

public static void messageTrace(java.lang.Object str)
Deprecated. this will be no longer needed due to logging. debugPrint method for MESSAGE_TRACE messages. API users doesn't need to call this.

Parameters:
str - The message to be printed.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

print

public static void print(java.lang.Object str)
Method to Print to the standard output.
Parameters:
str - the Object String to be printed.
See Also:
println(Object str), printErr(Object str), printlnErr(Object str)

println

public static void println(java.lang.Object str)
Print line to standard output.
Parameters:
str - The Line to be shown in the console.
See Also:
print(Object str), printErr(Object str), printlnErr(Object str)

printErr

public static void printErr(java.lang.Object str)
Method to Print to standard error.
Parameters:
str - The message to be shown in the console.
See Also:
print(Object str), println(Object str), printlnErr(Object str)

printlnErr

public static void printlnErr(java.lang.Object str)
Print line to standard error.
Parameters:
str - The message line to be shown in the console.
See Also:
print(Object str), println(Object str), printErr(Object str)

wait_in

public static void wait_in()
Waits until any key is pressed.

printThreads

public static void printThreads(java.lang.Thread thr)
Prints the argument thread's threadgroup.
Parameters:
thr - The Thread for which the Thread group is to be printed.

killAll

public static void killAll()
kills all threads in the currently running thread's threadgroup

getInt

public static int getInt()
Gets integer from the system input.
Returns:
The Integer value.

getLine

public static java.lang.String getLine()
Gets string from the system input.
Returns:
The line of String.

getLine

public static java.lang.String getLine(java.lang.String tmp)
Gets string from the system input.
Parameters:
tmp - The system input.
Returns:
The line of String.

checkFilePerms

public static boolean checkFilePerms(java.lang.String fileName,
                                     java.lang.String access)
                              throws FileException
checks the file for the appropriate access.
Parameters:
fileName - The fileName for which the access has to be checked
access - The access to be checked
Returns:
true if the File passes the access permission
Throws:
FileException - based on the failure of access permission

diffOfArrays

public static long[] diffOfArrays(java.lang.Object objLongArray,
                                  java.lang.Object objShortArray)
Difference between two long Arrays useful for getting instance OID etc.
Parameters:
objLongArray - the Long array.
objShortArray - the short array.
Returns:
The difference between the 2 arrays.

diffOfIntArrays

public static int[] diffOfIntArrays(java.lang.Object objIntArray,
                                    java.lang.Object objIntSmallArray)
Difference between two int Arrays useful for getting instance OID etc.
Parameters:
objIntArray - The Integer array.
objIntSmallArray - The integer small array.
Returns:
The int difference between the 2 arrays.

arrayToString

public static java.lang.String arrayToString(java.lang.Object longarray)
Converts long integer OID array to string OID.
Parameters:
longarray - The Long Integer OID array.
Returns:
The String OID.

intArrayToString

public static java.lang.String intArrayToString(int[] longarray)
converts int array to string OID.
Parameters:
longarray - The integer Array to be converted to String OID.
Returns:
The String OID for the array.

stringToArray

public static long[] stringToArray(java.lang.String str)
Converts string OID to array of long data type.
Parameters:
str - The String to be converted to long array.
Returns:
The long array obtained.

stringToIntArray

public static int[] stringToIntArray(java.lang.String str)
Converts string OID to array of int data type.
Parameters:
str - The String OID to be transferred to a Int array.
Returns:
The Resultant Int array.

stringToIntegerArray

public static int[] stringToIntegerArray(java.lang.String str)
Converts the given string to integer array.
Parameters:
str - The String to be converted to integer array.
Returns:
The corresponding Integer Array. for e.g HYTHER will return {72,89,84,72,69,82}.

integerArrayToString

public static java.lang.String integerArrayToString(java.lang.Object integerArr)
Converts integer array to String.
Parameters:
integerArr - The Array of integer to be transferred.
Returns:
The String equality of the Array. for e.g {72,89,84,72,69,82} is returned as HYTHER.

OIDequals

public static boolean OIDequals(long[] OID1,
                                long[] OID2)
Checks to see if two long OID's are equal.
Parameters:
OID1 - The First OID.
OID2 - The Second OID.
Returns:
True If both the OID's are equal else False.

OIDequals

public static boolean OIDequals(int[] OID1,
                                int[] OID2)
Checks to see if two integer OID's are equal.
Parameters:
OID1 - The First Integer OID.
OID2 - The Second Integer OID.
Returns:
True if both the OID's are equal, else False.

addArrays

public static long[] addArrays(java.lang.Object objArray1,
                               java.lang.Object objArray2)
Concatenates two long arrays and returns Long Array.
Parameters:
objArray1 - The First array to be added.
objArray2 - The Second array to add.
Returns:
The Resultant Long Array.

addIntArrays

public static int[] addIntArrays(java.lang.Object objArray1,
                                 java.lang.Object objArray2)
Concatenates two int arrays into one Int array.
Parameters:
objArray1 - The first Int array.
objArray2 - The second Int array.
Returns:
The resultant Int array.

addLongArraysReturnInt

public static int[] addLongArraysReturnInt(java.lang.Object objArray1,
                                           java.lang.Object objArray2)
Concatenates two long array to one int array.
Parameters:
objArray1 - The first long Array.
objArray2 - The second long Array.
Returns:
The resultant int array.

wait_in

public static void wait_in(java.lang.Object str)
Waits until any key is pressed.
Parameters:
str - The String to be shown before pressing a key.

min

public static int min(int a,
                      int b,
                      int c)
Finds minimum of 3 integers.
Parameters:
a - the First Integer to compare.
b - the Second Integer to compare.
c - the Third Integer to compare.
Returns:
The minimun integer among the three integers given.

setupStdOutErr

public static void setupStdOutErr()
Deprecated. this will be no longer needed due to logging. Makes logs directory for standardoutput and standarderror files.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setupStdOutErr(String dirStr), setupStdOutErr(String dirStr, String oFileName, String eFileName), setupStdOutErr(OutputStream outputStream)

setupStdOutErr

public static void setupStdOutErr(java.lang.String dirStr)
Deprecated. this will be no longer needed due to logging. Makes specified directory for standard output and standard error files.

Parameters:
dirStr - The directory to which the files are to be created
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setupStdOutErr(), setupStdOutErr(String dirStr, String oFileName, String eFileName), setupStdOutErr(OutputStream outputStream)

setupStdOutErr

public static void setupStdOutErr(java.lang.String dirStr,
                                  java.lang.String oFileName,
                                  java.lang.String eFileName)
Deprecated. this will be no longer needed due to logging. Makes the specified directory and writes the outputs and errors to the specified fileNames.

Parameters:
dirStr - The directory in which to create the files
oFileName - The outputs fileName
eFileName - The errors fileName
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setupStdOutErr(), setupStdOutErr(String dirStr), setupStdOutErr(OutputStream outputStream)

setupStdOutErr

public static void setupStdOutErr(java.io.OutputStream outputStream)
Deprecated. this will be no longer needed due to logging. redirects output to specified output stream

Parameters:
outputStream - The OutputStream to which the outputs and errors are redirected
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setupStdOutErr(String dirStr), setupStdOutErr(String dirStr, String oFileName, String eFileName), setupStdOutErr()

getCalendarDateAndTime

public static java.lang.String getCalendarDateAndTime()
Gets The Current Day Date Time from the Calendar.
Returns:
String value of Day, Date, Month, Year, Time from the calendar similar to WED, 14, FEB, 2001 16:00:34

isInSubTree

public static boolean isInSubTree(int[] rootoid,
                                  int[] oid)
Checks whether the OID falls under the rootOID tree.
Parameters:
rootoid - The OID of the Root.
oid - the OID to be checked.
Returns:
True if the OID is under the RootOID, ekse False.

getLongArray

public static long[] getLongArray(java.lang.Object toReturn)
Utility method used in handling Counter64 dataType.
Parameters:
toReturn - The Long object to be splitted into long Array of two elements.
Returns:
Long array from Long value.
See Also:
getLongFromArray(long[] arr)

getLongArray

public static long[] getLongArray(long val)
Splits the long value to long array with two elements.
Parameters:
val - The long value to be splitted.
Returns:
long array from long value.

getLongFromArray

public static java.lang.Long getLongFromArray(long[] arr)
Converts a long[] array to Long. Used to handle syntax of type Counter64.
Parameters:
arr - The long array of length 2 to be converted to the corresponding Long Object
Returns:
The Long object by adding the two long array elements
See Also:
getLongArray(Object toReturn)

getBigIntegerFromArray

public static java.math.BigInteger getBigIntegerFromArray(long[] arr)
Converts the long[] to it's equivalent BigInteger value.
Parameters:
arr - the long[] to be converted.
Returns:
The BigInteger value.

setAgentErrorListener

public static void setAgentErrorListener(AgentErrorListener e)
Setter for the AgentErrorListener.
Parameters:
e - The AgentError Listener to be set.

handleError

public static void handleError(java.lang.Exception e)
Gives away any errors thrown from the agent to the AgentErrorListener.
Parameters:
e - The exception type to be handled.

handleWarning

public static void handleWarning(java.lang.Exception e)
Gives away any harmless exceptions thrown from the agent to the AgentErrorListener.
Parameters:
e - The exception type to be handled.

get_input

public static int get_input(java.lang.String mesg)
This method is to get back the input given in the console.
Parameters:
mesg - The message to be given as the input.
Returns:
The input value given.

sort

public static void sort(java.util.Vector toSort)
It sorts the elements in the Vector. This method expects the the elements to be of TableEntry interface and sorts according to the instanceOID.
Parameters:
toSort - the TableEntry vector which to be sorted in ascending order according to the instanceOID.

swap

static void swap(java.util.Vector x,
                 int i,
                 int j)

isLessThan

static boolean isLessThan(int[] obj1,
                          int[] obj2)

compareTo

public static int compareTo(int[] oid1,
                            int[] oid2)
Compares two Integer arrays
Parameters:
oid1 - array of integer of oid
oid2 - array of integer of oid
Returns:
  • -1 if first param is lesser than second
  • 0 if equal
  • 1 if first param is greater than the second param

  • compareTo

    public static int compareTo(byte[] byte1,
                                byte[] byte2)
    Compares two byte arrays
    Parameters:
    byte1 - array of bytes
    byte2 - array of bytes
    Returns:
  • -1 if first param is lesser than second
  • 0 if equal
  • 1 if first param is greater than the second param

  • getMinSize

    static int getMinSize(int[] oid1,
                          int[] oid2)

    getMinSize

    static int getMinSize(byte[] oid1,
                          byte[] oid2)

    getArray

    public static java.lang.String[] getArray(java.lang.String str,
                                              java.lang.String delim)
    Utility method to split a String with a specified delimiter to separate array elements based on the delimiter
    Parameters:
    str - The string to be split
    delim - The delimiter based on which the String is to be split
    Returns:
    String array of the splitted elements

    changeToSystemURL

    public static java.lang.String changeToSystemURL(java.lang.String myString)
    Utility method to convert the filePath String with file separators to String with System based File separator
    Parameters:
    myString - The string to be converted to system based File path
    Returns:
    The String with replaced File separators to system based File separators

    arraycopy

    public static void arraycopy(byte[] from,
                                 int index1,
                                 int[] toCopy,
                                 int index2,
                                 int endIndex)
    Copies the contents of the byte[] from from the starting index index1 to the int[] toCopy from the starting index index2 upto a length of endIndex.
    Parameters:
    from - the source byte array which needs to be copied.
    index1 - the starting index of the source array.
    toCopy - the int[] to which the contents needs to be copied.
    index2 - the starting index of the destination array.
    endIndex - the length of the bytes to be copied to the int array.

    arraycopy

    public static void arraycopy(int[] from,
                                 int index1,
                                 byte[] toCopy,
                                 int index2,
                                 int endIndex)
    Copies the contents of the int[] from from the starting index index1 to the byte[] toCopy from the starting index index2 upto a length of endIndex.
    Parameters:
    from - the source byte array which needs to be copied.
    index1 - the starting index of the source array.
    toCopy - the byte[] to which the contents needs to be copied.
    index2 - the starting index of the destination array.
    endIndex - the length of the bytes to be copied to the int array.

    getNextInstance

    public static int[] getNextInstance(java.util.Vector entryVector,
                                        int[] currentInstance)
    Returns the next Instance (int[]) from the entryVector.
    Parameters:
    entryVector - the vector which contains all the instances.
    currentInstance - the currentInstanceOID.
    Returns:
    nextInst the nextInstance if one exists or null.

    stringFirstCharToUpper

    public static java.lang.String stringFirstCharToUpper(java.lang.String toChange)
    Converts the first character of a string to UpperCase character.
    Parameters:
    toChange - string to convert
    Returns:
    the converted string.

    stringFirstCharToLower

    public static java.lang.String stringFirstCharToLower(java.lang.String toChange)
    Converts the first character of a string to LowerCase character.
    Parameters:
    toChange - string to convert
    Returns:
    the converted string.

    compareTo

    public static int compareTo(java.lang.String theString,
                                java.lang.String toCompare)
    The Method compares two Strings.
    Parameters:
    theString - The First String to Compare.
    toCompare - The String that is to be compared.
    Returns:
    1, -1 based on the Lengths of the Strings, their lexicographic difference if the two Strings are of Same Lengths. 0 if they are equal.

    compareToWithMinSize

    public static int compareToWithMinSize(int[] oid1,
                                           int[] oid2)
    This Method Compares Two int Arrays by considering the size of the arrays.
    Parameters:
    oid1 - the first oid int[]
    oid2 - the second oid int[]
    Returns:
    1 if the first array is greater up the smallest length of two
  • -1 if the Second array is greater up the smallest length of two 0 if they are equal until their least lengths. eg., if intArrays of .1.3.6.1.4.1.5 and .1.3.6.1.4 are compared it will return 0

  • getMaskBytes

    public static byte[] getMaskBytes(java.lang.String str)
    static method to get the byte Array representation of the Mask Type used in V3 Tables. for eg., the String ff will be converted in to the corresponding Mask byte array rep and will be returned.
    Parameters:
    str - the Mask Type String.
    Returns:
    the converted byteArray.
    See Also:
    getMaskString(byte[] array)

    getMaskString

    public static java.lang.String getMaskString(byte[] array)
    static method to get the String representation of the Mask Type retruned by V3 Tables.
    Parameters:
    array - the Mask Type byte [] representation.
    Returns:
    the corresponding String representation.
    See Also:
    getMaskBytes(String str)