Methods Summary |
---|
static void | QuickSort(int[] a, int lo0, int hi0)This is a generic version of C.A.R Hoare's Quick Sort
algorithm. This will handle arrays that are already
sorted, and arrays with duplicate keys.
If you think of a one dimensional array as going from
the lowest index on the left to the highest index on the right
then the parameters to this function are lowest index or
left and highest index or right. The first time you call
this function it will be with the parameters 0, a.length - 1.
int lo = lo0;
int hi = hi0;
int mid;
if ( hi0 > lo0) {
/* Arbitrarily establishing partition element as the midpoint of
* the array.
*/
mid = a[ ( lo0 + hi0 ) / 2 ];
// loop through the array until indices cross
while( lo <= hi ) {
/* find the first element that is greater than or equal to
* the partition element starting from the left Index.
*/
while( ( lo < hi0 ) && ( a[lo] < mid ))
++lo;
/* find an element that is smaller than or equal to
* the partition element starting from the right Index.
*/
while( ( hi > lo0 ) && ( a[hi] > mid ))
--hi;
// if the indexes have not crossed, swap
if( lo <= hi ) {
swap(a, lo, hi);
++lo;
--hi;
}
}
/* If the right index has not reached the left side of array
* must now sort the left partition.
*/
if( lo0 < hi )
QuickSort( a, lo0, hi );
/* If the left index has not reached the right side of array
* must now sort the right partition.
*/
if( lo < hi0 )
QuickSort( a, lo, hi0 );
}
|
public abstract void | check(SnmpMibSubRequest req, int depth)Generic handling of the check operation.
You can override this method if you need to implement some
specific policies for minimizing the accesses made to some remote
underlying resources, or if you need to implement some consistency
checks between the different values provided in the varbind list.
|
void | findHandlingNode(com.sun.jmx.snmp.SnmpVarBind varbind, long[] oid, int depth, SnmpRequestTree handlers)Find the node which handles a varbind, and register it in the
SnmpRequestTree. This method is a pure internal method. You should
never try to call it directly.
throw noSuchObjectException;
|
long[] | findNextHandlingNode(com.sun.jmx.snmp.SnmpVarBind varbind, long[] oid, int pos, int depth, SnmpRequestTree handlers, AcmChecker checker)Find the node which handles the leaf that immediately follows the
given varbind OID, and register the it in the SnmpRequestTree.
This method is a pure internal method. You should never try to call
it directly.
throw noSuchObjectException;
|
public abstract void | get(SnmpMibSubRequest req, int depth)Generic handling of the get operation.
You can override this method if you need to implement some
specific policies for minimizing the accesses made to some remote
underlying resources.
|
protected static final int | getNextIdentifier(int[] table, long value)This will give the first element greater than value
in a sorted array.
If there is no element of the array greater than value ,
the method will throw a SnmpStatusException .
final int[] a = table;
final int val= (int) value;
if (a == null)
throw noSuchObjectException;
int low= 0;
int max= a.length;
int curr= low + (max-low)/2;
int elmt= 0;
// Basic check
//
if (max < 1)
throw noSuchObjectException;
if (a[max-1] <= val)
throw noSuchObjectException;
while (low <= max) {
elmt= a[curr];
if (val == elmt) {
// We ned to get the next index ...
//
curr++;
return a[curr];
}
if (elmt < val) {
low= curr +1;
} else {
max= curr -1;
}
curr= low + (max-low)/2;
}
return a[curr];
|
public long | getNextVarId(long id, java.lang.Object userData)Get the next OID arc corresponding to a readable scalar variable,
a branch leading to a subgroub, or a table.
return getNextIdentifier(varList,id);
|
public long | getNextVarId(long id, java.lang.Object userData, int pduVersion)Get the next OID arc corresponding to a readable scalar variable,
a branch leading to a subgroub, or a table, possibly skipping over
those arcs that must not or cannot be returned.
Calls {@link #getNextVarId(long,java.lang.Object)} until
{@link #skipVariable(long,java.lang.Object,int)} returns false.
long varid=id;
do {
varid = getNextVarId(varid,userData);
} while (skipVariable(varid,userData,pduVersion));
return varid;
|
public void | getRootOid(java.util.Vector result)Computes the root OID of the MIB.
return;
|
public abstract void | set(SnmpMibSubRequest req, int depth)Generic handling of the set operation.
You can override this method if you need to implement some
specific policies for minimizing the accesses made to some remote
underlying resources.
|
protected boolean | skipVariable(long id, java.lang.Object userData, int pduVersion)Hook for subclasses.
The default implementation of this method is to always return
false. Subclasses should redefine this method so that it returns
true when:
- the variable is a leaf that is not instantiated,
- or the variable is a leaf whose type cannot be returned by that
version of the protocol (e.g. an Counter64 with SNMPv1).
return false;
|
public static void | sort(int[] array)Sorts the specified integer array.
QuickSort(array, 0, array.length - 1);
|
private static final void | swap(int[] a, int i, int j)
int T;
T = a[i];
a[i] = a[j];
a[j] = T;
|