|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.m2technologies.open_arm.transport.transaction.AbstractTransactionMediatorImpl
net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator
Copyright 2005 Mark Masterson
Licensed under the Apache License, Version 2.0 (the "License");
you may
not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Description: This class outputs the information for a given transaction as SNMP v.2c traps.
You should
provide a properties file for this class within its classpath/classloader scope. The name of the properties file
must be the value of the PROPERTIES_FILE_NAME constant defined in this class. Within this properties file, you
should define 7 properties; the managment host that traps should be sent to, the port that the managment host listens
for traps on, the enterprise OID that define your company's/application's traps, the application trap OID that
defines traps sent by your application, the time interval that you want as a threshold that must be exceeded before a
trap is sent, the same sort of threshold for updates, and a boolean flag that determines whether or not blocking
events should be forwarded as traps.
These properties must take the following form: "[standard
prefix].[attribute name]=[value]", where the [standard prefix] element must be "net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator"
, and the 7 attribute names are:
"managementHost", "managementHostTrapListenPort", "enterpriseOID",
"applicationTrapOIDValue", "transactionLengthInterval", "updateLengthInterval", "isBlockedEventTrap".
A
sample properties file might therefore look like the following:
net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator.managementHost=127.0.0.1
net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator.managementHostTrapListenPort=162
net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator.enterpriseOID=1.3.6.1.2.1.2.0
net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator.applicationTrapOIDValue=1.3.6.1.2.1.2.0.0.0.0
net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator.transactionLengthInterval=5000
net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator.updateLengthInterval=5000
net.m2technologies.open_arm.transport.transaction.snmp.SnmpMediator.isBlockedEventTrap=false
The sample above also shows the default values that this class will use for each of these attributes, if you do not provide a properties file, or if you omit one or more of the attributes.
Field Summary | |
static java.lang.String |
PROPERTIES_FILE_NAME
Value = "open_arm_snmp_trap.properties" |
Constructor Summary | |
SnmpMediator(java.lang.Object transactionDelegate)
|
Method Summary | |
protected void |
doBlocked(long tmpHandle)
Sends a trap with the standard 'blocked' message text. |
protected void |
doStop(long elapsedTime,
long totalElapsedTime,
int status,
java.lang.String diagnosticDetail)
Sends a trap with the standard 'stop' message text. |
protected void |
doUnblocked(long blockHandle)
Sends a trap with the standard 'unblocked' message text. |
protected void |
doUpdate(long runningTime,
long totalRunningTime)
Sends a trap with the standard 'update' message text. |
void |
setConfiguration(java.lang.Object configuration)
|
Methods inherited from class net.m2technologies.open_arm.transport.transaction.AbstractTransactionMediatorImpl |
bindThread, blocked, getApplication, getBlockedMessage, getContextURIValue, getContextValue, getCorrelator, getCreatingFactory, getDefinition, getDelegate, getErrorCode, getErrorMessage, getMetricGroup, getParentCorrelator, getStatus, getStopMessage, getTransactionWithMetricsDefinition, getUnblockedMessage, getUpdateMessage, getUser, isTraceRequested, reset, setArrivalTime, setContextURIValue, setContextValue, setErrorCode, setTraceRequested, setTransactionalDelegate, setUser, start, start, start, start, stop, stop, unbindThread, unblocked, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PROPERTIES_FILE_NAME
Constructor Detail |
public SnmpMediator(java.lang.Object transactionDelegate)
Method Detail |
public void setConfiguration(java.lang.Object configuration)
protected void doBlocked(long tmpHandle)
doBlocked
in class AbstractTransactionMediatorImpl
tmpHandle
- protected void doStop(long elapsedTime, long totalElapsedTime, int status, java.lang.String diagnosticDetail)
doStop
in class AbstractTransactionMediatorImpl
elapsedTime
- totalElapsedTime
- status
- diagnosticDetail
- protected void doUnblocked(long blockHandle)
doUnblocked
in class AbstractTransactionMediatorImpl
blockHandle
- protected void doUpdate(long runningTime, long totalRunningTime)
doUpdate
in class AbstractTransactionMediatorImpl
runningTime
- totalRunningTime
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |