Package org.apache.maven.wagon.events
Class SessionEventSupport
- java.lang.Object
-
- org.apache.maven.wagon.events.SessionEventSupport
-
public final class SessionEventSupport extends java.lang.Object
The class allows registration and deregistration of session listeners- Author:
- Michal Maczka
-
-
Constructor Summary
Constructors Constructor Description SessionEventSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSessionListener(SessionListener listener)
Adds the listener to the collection of listeners who will be notified when any session event occurs in thisWagon
object.void
fireDebug(java.lang.String message)
Dispatches the given debug message to all registered listeners (calls methodSessionListener.debug(String)
on all of them}.void
fireSessionConnectionRefused(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionConnectionRefused(SessionEvent)
on all of them}.void
fireSessionDisconnected(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionDisconnected(SessionEvent)
on all of them}.void
fireSessionDisconnecting(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionDisconnecting(SessionEvent)
} on all of them}.void
fireSessionError(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionConnectionRefused(SessionEvent)
on all of them}.void
fireSessionLoggedIn(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionLoggedIn(SessionEvent)
on all of them}.void
fireSessionLoggedOff(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionLoggedOff(SessionEvent)
on all of them}.void
fireSessionOpened(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionOpened(SessionEvent)
on all of them}.void
fireSessionOpening(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionOpening(SessionEvent)
on all of them}.boolean
hasSessionListener(SessionListener listener)
Returns whether the specified instance of session listener was added to the collection of listeners who will be notified when an session event occursvoid
removeSessionListener(SessionListener listener)
Removes the session listener from the collection of listeners so it no longer receives session events.
-
-
-
Method Detail
-
addSessionListener
public void addSessionListener(SessionListener listener)
Adds the listener to the collection of listeners who will be notified when any session event occurs in thisWagon
object.
If listener isnull
, no exception is thrown and no action is performed- Parameters:
listener
- the transfer listener- See Also:
removeSessionListener(SessionListener)
,TransferListener
-
removeSessionListener
public void removeSessionListener(SessionListener listener)
Removes the session listener from the collection of listeners so it no longer receives session events.
If listener isnull
or specified listener was not added to thisSessionEventSupport
object no exception is thrown and no action is performed- Parameters:
listener
- the session listener- See Also:
addSessionListener(org.apache.maven.wagon.events.SessionListener)
-
hasSessionListener
public boolean hasSessionListener(SessionListener listener)
Returns whether the specified instance of session listener was added to the collection of listeners who will be notified when an session event occurs- Parameters:
listener
- the session listener- Returns:
true
if given listener was added to the collection of listeners
false
otherwise- See Also:
SessionListener
,addSessionListener(org.apache.maven.wagon.events.SessionListener)
-
fireSessionDisconnected
public void fireSessionDisconnected(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionDisconnected(SessionEvent)
on all of them}. The Event should be of typeSessionEvent.SESSION_DISCONNECTED
- Parameters:
sessionEvent
- the SessionEvent which will be dispatched to listeners
-
fireSessionDisconnecting
public void fireSessionDisconnecting(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionDisconnecting(SessionEvent)
} on all of them}. The Event should be of typeSessionEvent.SESSION_DISCONNECTING
- Parameters:
sessionEvent
- the SessionEvent which will be dispatched to listeners
-
fireSessionLoggedIn
public void fireSessionLoggedIn(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionLoggedIn(SessionEvent)
on all of them}. The Event should be of typeSessionEvent.SESSION_LOGGED_IN
- Parameters:
sessionEvent
- the SessionEvent which will be dispatched to listeners
-
fireSessionLoggedOff
public void fireSessionLoggedOff(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionLoggedOff(SessionEvent)
on all of them}. The Event should be of typeSessionEvent.SESSION_LOGGED_OFF
- Parameters:
sessionEvent
- the SessionEvent which will be dispatched to listeners
-
fireSessionOpened
public void fireSessionOpened(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionOpened(SessionEvent)
on all of them}. The Event should be of typeSessionEvent.SESSION_OPENED
- Parameters:
sessionEvent
- the SessionEvent which will be dispatched to listeners
-
fireSessionOpening
public void fireSessionOpening(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionOpening(SessionEvent)
on all of them}. The Event should be of typeSessionEvent.SESSION_OPENING
- Parameters:
sessionEvent
- the SessionEvent which will be dispatched to listeners
-
fireSessionConnectionRefused
public void fireSessionConnectionRefused(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionConnectionRefused(SessionEvent)
on all of them}. The Event should be of typeSessionEvent.SESSION_CONNECTION_REFUSED
- Parameters:
sessionEvent
- the SessionEvent which will be dispatched to listeners
-
fireDebug
public void fireDebug(java.lang.String message)
Dispatches the given debug message to all registered listeners (calls methodSessionListener.debug(String)
on all of them}.- Parameters:
message
- the debug message which will be dispatched to listeners
-
fireSessionError
public void fireSessionError(SessionEvent sessionEvent)
Dispatches the givenSessionEvent
to all registered listeners (calls methodSessionListener.sessionConnectionRefused(SessionEvent)
on all of them}. The Event should be of typeSessionEvent.SESSION_ERROR_OCCURRED
and it is expected thatSessionEvent.getException()
method will return not null value- Parameters:
sessionEvent
- the SessionEvent which will be dispatched to listeners
-
-