com.openexchange.messaging
Interface MessagingResource

All Known Subinterfaces:
MessagingAccountAccess, MessagingAccountTransport
All Known Implementing Classes:
AbstractSMSAndMMSTransport

public interface MessagingResource

MessagingResource - A messaging resource which is connectable, closeable and pingable.

Since:
Open-Xchange v6.16
Author:
Thorben Betten

Method Summary
 boolean cacheable()
          Indicates if this resource may be cached (for a little amount of time) once opened.
 void close()
          Closes this resource.
 void connect()
          Opens this resource.
 boolean isConnected()
          Checks if this connection is currently connected.
 boolean ping()
          Pings this resource to check if it can be opened and and immediately closes connection.
 

Method Detail

connect

void connect()
             throws MessagingException
Opens this resource. May be invoked on an already opened resource.

Throws:
MessagingException - If the resource could not be opened for various reasons

isConnected

boolean isConnected()
Checks if this connection is currently connected.

Returns:
true if connected; otherwise false

close

void close()
Closes this resource. May be invoked on an already closed resource.


ping

boolean ping()
             throws MessagingException
Pings this resource to check if it can be opened and and immediately closes connection.

Returns:
true if a connection can be established; otherwise false
Throws:
MessagingException - If the ping fails

cacheable

boolean cacheable()
Indicates if this resource may be cached (for a little amount of time) once opened.

Returns:
true if this resource may be cached; otherwise false