public class TransactionCounter
extends java.lang.Object
implements java.util.Observer
TransactionCounter is a singleton class that counts the
cryptographic operations performed by an application.
The class counts cryptographic operations in the following transaction types:
TransactionCounter also records two system properties:
The TransactionCounter class provides a variety of methods
for accessing information about transaction counting and system properties.
| Modifier and Type | Field and Description |
|---|---|
static int |
LOGIN
Constant for the login transaction
|
static int |
PKCS7_DECRYPTION
Constant for the PKCS#7 decryption transaction
|
static int |
PKCS7_ENCRYPTION
Constant for the PKCS#7 encryption transaction
|
static int |
PKCS7_SIGNING
Constant for the PKCS#7 signing transaction
|
static int |
PKCS7_VERIFICATION
Constant for the PKCS#7 verification transaction
|
static int |
SMIME_DECRYPTION
Constant for the S/MIME decryption transaction
|
static int |
SMIME_ENCRYPTION
Constant for the S/MIME encryption transaction
|
static int |
SMIME_SIGNING
Constant for the S/MIME signing transaction
|
static int |
SMIME_VERIFICATION
Constant for the S/MIME verification transaction
|
static int |
SSL_MUTUAL_AUTHENTICATION
Constant for the SSL client/mutual authentication transaction
|
static int |
SSL_SERVER_AUTHENTICATION
Constant for the SSL server authentication transaction
|
static java.lang.String[] |
TRANSACTION_TYPE
Array of
String constants for the types of transaction counted by the
TransactionCounter class |
static int |
UNKNOWN_TRANSACTION
Constant for any transaction other than those listed
|
static int |
XML_DECRYPTION
Constant for the XML decryption transaction
|
static int |
XML_ENCRYPTION
Constant for the XML encryption transaction
|
static int |
XML_SIGNING
Constant for the XML signing transaction
|
static int |
XML_VERIFICATION
Constant for the XML verification transaction
|
| Modifier | Constructor and Description |
|---|---|
protected |
TransactionCounter()
Creates a
TransactionCounter object. |
| Modifier and Type | Method and Description |
|---|---|
int |
getCount(int transaction_type)
Retrieves the count of the given transaction type.
|
static TransactionCounter |
getInstance()
Retrieves a single instance of the
TransactionCounter class. |
java.lang.String |
getJDKVersion()
Retrieves the Java Runtime Environment (JRE) version on which the
application is running.
|
java.lang.String |
getOSName()
Retrieves the operating system name on which the application is running.
|
boolean |
isOn()
Retrieves a
boolean specifying whether the counter is turned
on or turned off. |
void |
registerCounter(java.util.Observable counter)
Adds the given
Observable to this class. |
void |
reset()
Resets the counter.
|
void |
setCountingMode(boolean mode)
Sets the value of
m_is_on to turn the counter on or off. |
java.lang.String |
toString()
Retrieves the transaction counting and system properties information as a
single
String. |
void |
update(java.util.Observable observable,
java.lang.Object object)
Updates the counter.
|
public static final int LOGIN
public static final int PKCS7_SIGNING
public static final int PKCS7_VERIFICATION
public static final int PKCS7_ENCRYPTION
public static final int PKCS7_DECRYPTION
public static final int SSL_MUTUAL_AUTHENTICATION
public static final int SSL_SERVER_AUTHENTICATION
public static final int UNKNOWN_TRANSACTION
public static final int XML_SIGNING
public static final int XML_VERIFICATION
public static final int XML_ENCRYPTION
public static final int XML_DECRYPTION
public static final int SMIME_SIGNING
public static final int SMIME_VERIFICATION
public static final int SMIME_ENCRYPTION
public static final int SMIME_DECRYPTION
public static final java.lang.String[] TRANSACTION_TYPE
String constants for the types of transaction counted by the
TransactionCounter classprotected TransactionCounter()
TransactionCounter object.
The access specifier for this constructor is protected to prevent others from instantiating this class.
public static TransactionCounter getInstance()
TransactionCounter class.
TransactionCounter instance.public void setCountingMode(boolean mode)
m_is_on to turn the counter on or off.
mode - true to turn on the counter, or false
to turn off the counter.public void update(java.util.Observable observable,
java.lang.Object object)
update updates the counter corresponding to the given
transaction type if the counter is on. The method does nothing if
the counter is turned off.
update in interface java.util.Observerobservable - An object of class Observable for counting the
transaction activities performed by the classes in a specific
package.object - An Integer whose int value identifies
the transaction activity just performed.public int getCount(int transaction_type)
transaction_type - an integer between 0 and num_transaction_type - 1
specifying the type of the transaction.int representing the transaction count.public java.lang.String getJDKVersion()
String representing the JRE version.public java.lang.String getOSName()
String representing the operating system name.public boolean isOn()
boolean specifying whether the counter is turned
on or turned off.
boolean, true or false.public java.lang.String toString()
String.
toString in class java.lang.ObjectString listing transaction counting and system
properties information.public void registerCounter(java.util.Observable counter)
Observable to this class.
counter - An Observable instance to be added to the Observer
list.public void reset()