Apache JMeter

org.apache.jmeter.protocol.smtp.sampler.gui
Class SmtpPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.apache.jmeter.protocol.smtp.sampler.gui.SmtpPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class SmtpPanel
extends JPanel

Class to build gui-components for SMTP-sampler. Getter-methods serve the input-data to the sampler-object, which provides them to the SendMailCommand-object.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SmtpPanel()
          Creates new form SmtpPanel, standard constructer.
 
Method Summary
 void clear()
          Reset all the Gui fields.
 String getAttachments()
          Returns path of file(s) to be attached in e-mail from textfield
 String getBody()
          Returns message body, i.e. main-mime-part of message (from textfield)
 String getEmlMessage()
          Returns path to eml message to be sent
 CollectionProperty getHeaderFields()
           
 String getMailFrom()
          Returns sender-address for e-mail from textfield
 String getPassword()
           
 String getPort()
          Returns port of mail-server (standard 25 for SMTP/SMTP with StartTLS, 465 for SSL) from textfield
 String getReceiverBCC()
          Returns receiver in field "bcc" from textfield
 String getReceiverCC()
          Returns receiver in field "cc" from textfield
 String getReceiverTo()
          Returns receiver in field "to" from textfield
 String getServer()
          Returns mail-server to be used to send message (from textfield)
 String getSubject()
          Returns subject of the e-mail from textfield
 String getTrustStoreToUse()
          Returns the path to the local (pre-installed) truststore to be used to avoid SSL-connection-exceptions
 String getUsername()
           
 boolean isEnableDebug()
           
 boolean isEnforceStartTLS()
          Returns if StartTLS is enforced (normally, SMTP uses plain SMTP-connection as fallback if "250-STARTTLS" isn't sent from the mailserver) (checkbox)
 boolean isIncludeTimestamp()
          Returns if current timestamp is included in the subject (checkbox)
 boolean isMessageSizeStatistics()
          Returns if message size statistics are processed.
 boolean isTrustAllCerts()
          Returns if all certificates are blindly trusted (using according SocketFactory) (checkbox)
 boolean isUseAuth()
          Returns if mail-server needs authentication (checkbox)
 boolean isUseEmlMessage()
          Returns if an .eml-message is sent instead of the content of message-text area
 boolean isUseLocalTrustStore()
          Returns if local (pre-installed) truststore is used to avoid SSL-connection-exceptions (checkbox)
 boolean isUseSSL()
          Returns if SSL is used to secure the SMTP-connection (checkbox)
 boolean isUseStartTLS()
          Returns if StartTLS is used to secure the connection (checkbox)
 void setAttachments(String attachments)
          Sets path of file to be attached in e-mail in textfield
 void setBody(String messageBodyText)
          Sets message body, i.e. main-mime-part of message in textfield
 void setEmlMessage(String emlMessage)
          Set path to eml message to be sent
 void setEnableDebug(boolean selected)
           
 void setEnforceStartTLS(boolean enforceStartTLS)
          Enforces StartTLS to secure the SMTP-connection (checkbox)
 void setHeaderFields(CollectionProperty fields)
           
 void setIncludeTimestamp(boolean includeTimestamp)
          Set timestamp to be included in the message-subject (checkbox)
 void setMailFrom(String mailFrom)
          Sets sender-address of e-mail in textfield
 void setMessageSizeStatistic(boolean val)
          Set message size to be calculated and included in sample result (checkbox)
 void setPassword(String authPassword)
           
 void setPort(String port)
          Sets port of mail-server
 void setReceiverBCC(String mailToBCC)
          Sets receiver in textfield "bcc"
 void setReceiverCC(String mailToCC)
          Sets receiver in textfield "cc"
 void setReceiverTo(String mailTo)
          Sets receiver in textfield "to"
 void setServer(String server)
          Sets mail-server to be used to send message in textfield
 void setSubject(String subject)
          Sets subject of the e-mail in textfield
 void setTrustAllCerts(boolean trustAllCerts)
          Enforces JMeter to trust all certificates, no matter what CA is issuer (checkbox)
 void setTrustStoreToUse(String trustStoreToUse)
          Set the path to local (pre-installed) truststore to be used to avoid SSL-connection-exceptions
 void setUseAuth(boolean selected)
          Set whether mail server needs auth.
 void setUseEmlMessage(boolean useEmlMessage)
          Set the use of an .eml-message instead of the content of message-text area
 void setUseLocalTrustStore(boolean useLocalTrustStore)
          Set the use of a local (pre-installed) truststore to avoid SSL-connection-exceptions (checkbox)
 void setUseNoSecurity(boolean selected)
           
 void setUsername(String username)
           
 void setUseSSL(boolean useSSL)
          Sets SSL to be used to secure the SMTP-connection (checkbox)
 void setUseStartTLS(boolean useStartTLS)
          Sets StartTLS to be used to secure the SMTP-connection (checkbox)
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SmtpPanel

public SmtpPanel()
Creates new form SmtpPanel, standard constructer. Calls initComponents();.

Method Detail

getMailFrom

public String getMailFrom()
Returns sender-address for e-mail from textfield

Returns:
Sender

getReceiverTo

public String getReceiverTo()
Returns receiver in field "to" from textfield

Returns:
Receiver "to"

getReceiverCC

public String getReceiverCC()
Returns receiver in field "cc" from textfield

Returns:
Receiver "cc"

getReceiverBCC

public String getReceiverBCC()
Returns receiver in field "bcc" from textfield

Returns:
Receiver "bcc"

getBody

public String getBody()
Returns message body, i.e. main-mime-part of message (from textfield)

Returns:
Message body

setBody

public void setBody(String messageBodyText)
Sets message body, i.e. main-mime-part of message in textfield

Parameters:
messageBodyText - Message body

setMailFrom

public void setMailFrom(String mailFrom)
Sets sender-address of e-mail in textfield

Parameters:
mailFrom - Sender

setReceiverTo

public void setReceiverTo(String mailTo)
Sets receiver in textfield "to"

Parameters:
mailTo - Receiver "to"

setReceiverCC

public void setReceiverCC(String mailToCC)
Sets receiver in textfield "cc"

Parameters:
mailToCC - Receiver "cc"

setReceiverBCC

public void setReceiverBCC(String mailToBCC)
Sets receiver in textfield "bcc"

Parameters:
mailToBCC - Receiver "bcc"

getAttachments

public String getAttachments()
Returns path of file(s) to be attached in e-mail from textfield

Returns:
File to attach

setAttachments

public void setAttachments(String attachments)
Sets path of file to be attached in e-mail in textfield

Parameters:
attachments - File to attach

getPort

public String getPort()
Returns port of mail-server (standard 25 for SMTP/SMTP with StartTLS, 465 for SSL) from textfield

Returns:
Mail-server port

setPort

public void setPort(String port)
Sets port of mail-server

Parameters:
port - Mail-server port

getServer

public String getServer()
Returns mail-server to be used to send message (from textfield)

Returns:
FQDN or IP of mail-server

setServer

public void setServer(String server)
Sets mail-server to be used to send message in textfield

Parameters:
server - FQDN or IP of mail-server

getSubject

public String getSubject()
Returns subject of the e-mail from textfield

Returns:
Subject of e-mail

setSubject

public void setSubject(String subject)
Sets subject of the e-mail in textfield

Parameters:
subject - Subject of e-mail

isUseAuth

public boolean isUseAuth()
Returns if mail-server needs authentication (checkbox)

Returns:
true if authentication is used

setUseAuth

public void setUseAuth(boolean selected)
Set whether mail server needs auth.

Parameters:
selected -

isUseSSL

public boolean isUseSSL()
Returns if SSL is used to secure the SMTP-connection (checkbox)

Returns:
true if SSL is used to secure the SMTP-connection

setUseSSL

public void setUseSSL(boolean useSSL)
Sets SSL to be used to secure the SMTP-connection (checkbox)

Parameters:
useSSL - Use SSL to secure the connection

isUseStartTLS

public boolean isUseStartTLS()
Returns if StartTLS is used to secure the connection (checkbox)

Returns:
true if StartTLS is used to secure the connection

setUseStartTLS

public void setUseStartTLS(boolean useStartTLS)
Sets StartTLS to be used to secure the SMTP-connection (checkbox)

Parameters:
useStartTLS - Use StartTLS to secure the connection

isEnforceStartTLS

public boolean isEnforceStartTLS()
Returns if StartTLS is enforced (normally, SMTP uses plain SMTP-connection as fallback if "250-STARTTLS" isn't sent from the mailserver) (checkbox)

Returns:
true if StartTLS is enforced

setEnforceStartTLS

public void setEnforceStartTLS(boolean enforceStartTLS)
Enforces StartTLS to secure the SMTP-connection (checkbox)

Parameters:
enforceStartTLS - Enforce the use of StartTLS to secure the connection
See Also:
isEnforceStartTLS()

isEnableDebug

public boolean isEnableDebug()

setEnableDebug

public void setEnableDebug(boolean selected)

isTrustAllCerts

public boolean isTrustAllCerts()
Returns if all certificates are blindly trusted (using according SocketFactory) (checkbox)

Returns:
true if all certificates are blindly trusted

setTrustAllCerts

public void setTrustAllCerts(boolean trustAllCerts)
Enforces JMeter to trust all certificates, no matter what CA is issuer (checkbox)

Parameters:
trustAllCerts - Trust all certificates
See Also:
isTrustAllCerts()

isUseLocalTrustStore

public boolean isUseLocalTrustStore()
Returns if local (pre-installed) truststore is used to avoid SSL-connection-exceptions (checkbox)

Returns:
true if a local truststore is used

setUseLocalTrustStore

public void setUseLocalTrustStore(boolean useLocalTrustStore)
Set the use of a local (pre-installed) truststore to avoid SSL-connection-exceptions (checkbox)

Parameters:
useLocalTrustStore - Use local keystore

getTrustStoreToUse

public String getTrustStoreToUse()
Returns the path to the local (pre-installed) truststore to be used to avoid SSL-connection-exceptions

Returns:
Path to local truststore

setTrustStoreToUse

public void setTrustStoreToUse(String trustStoreToUse)
Set the path to local (pre-installed) truststore to be used to avoid SSL-connection-exceptions

Parameters:
trustStoreToUse - Path to local truststore

isUseEmlMessage

public boolean isUseEmlMessage()
Returns if an .eml-message is sent instead of the content of message-text area

Returns:
true if .eml is sent, false if text area content is sent in e-mail

setUseEmlMessage

public void setUseEmlMessage(boolean useEmlMessage)
Set the use of an .eml-message instead of the content of message-text area

Parameters:
useEmlMessage - Use eml message

getEmlMessage

public String getEmlMessage()
Returns path to eml message to be sent

Returns:
path to eml message to be sent

setEmlMessage

public void setEmlMessage(String emlMessage)
Set path to eml message to be sent

Parameters:
emlMessage - path to eml message to be sent

isIncludeTimestamp

public boolean isIncludeTimestamp()
Returns if current timestamp is included in the subject (checkbox)

Returns:
true if current timestamp is included in subject

setIncludeTimestamp

public void setIncludeTimestamp(boolean includeTimestamp)
Set timestamp to be included in the message-subject (checkbox)

Parameters:
includeTimestamp - Should timestamp be included in subject?

isMessageSizeStatistics

public boolean isMessageSizeStatistics()
Returns if message size statistics are processed. Output of processing will be included in sample result. (checkbox)

Returns:
True if message size will be calculated

setMessageSizeStatistic

public void setMessageSizeStatistic(boolean val)
Set message size to be calculated and included in sample result (checkbox)

Parameters:
val - Schould message size be calculated?

setUseNoSecurity

public void setUseNoSecurity(boolean selected)

getPassword

public String getPassword()

setPassword

public void setPassword(String authPassword)

getUsername

public String getUsername()

setUsername

public void setUsername(String username)

getHeaderFields

public CollectionProperty getHeaderFields()

setHeaderFields

public void setHeaderFields(CollectionProperty fields)

clear

public void clear()
Reset all the Gui fields.


Apache JMeter

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.