Class P3BindSession
- Direct Known Subclasses:
P7BindSession
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Semaphoreprotected booleanBoolean value that represents if the session is bound or notprotected StringThe password for the P3 userprotected booleanDisable configuration requests in MS bind operationsprotected StringPresentation Address of the P3 channelprotected booleanBoolean value that represents if the security environment has been initialized or notprotected StringP3 user DNprotected StringP3 user O/R address -
Constructor Summary
ConstructorsConstructorDescriptionP3BindSession(String presentation_address, String or_addr, String passwd) Create a P3BindSessionP3BindSession(String presentation_address, String or_addr, String passwd, boolean submit_only) Create a P3BindSession, specifying whether the session should be used for Submission only or not. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidbind()Bind to the P3 channelRetrieve the Session objectbooleanisBound()Check if this session is bound or not.Receive the "next available message" from the Message Storeprotected voidvoidsetDisableConfigRequest(boolean b) Enables or disables the request of configuration from the MTA or Message Store.voidsetSecurityEnv(String id, String id_dn, String pass) Set the session's security environment data.voidsetSecurityEnvPKCS12(String pkcs12FileName, String password, String sec_trusted_ca_cert_dir) Set the session's security environment data.voidSet the P3 channel user's DNvoidunbind()Unbind from the P3 channel or P7 Message Store.voidunbind(boolean force) Unbind from the P3 channel or P7 Message Store.intwaitForNewMessages(int seconds) Wait for a new message the specified number of seconds.Methods inherited from class com.isode.x400api.Session
cancelWait, enableWait, GetNumMsgs, GetSummarizeOnBind, SetSummarizeOnBind
-
Field Details
-
pa
Presentation Address of the P3 channel -
user_oraddr
P3 user O/R address -
user_dn
P3 user DN -
credentials
The password for the P3 user -
disable_config_requests
protected boolean disable_config_requestsDisable configuration requests in MS bind operations -
bound
protected boolean boundBoolean value that represents if the session is bound or not -
sec_init
protected boolean sec_initBoolean value that represents if the security environment has been initialized or not -
available
-
-
Constructor Details
-
P3BindSession
Create a P3BindSession- Parameters:
presentation_address- the P3 channel's Presentation Address Typical values are "593"/Internet=myserver.mycompany.comor_addr- the string encoded O/R address of the P3 channel user. For example /"cn=John Smith, o=Address Book, o=Isode, c=GB"passwd- the P3 channel's password that correspond to the user
-
P3BindSession
public P3BindSession(String presentation_address, String or_addr, String passwd, boolean submit_only) Create a P3BindSession, specifying whether the session should be used for Submission only or not.- Parameters:
presentation_address- the P3 channel's Presentation Address Typical values are "593"/Internet=myserver.mycompany.comor_addr- the string encoded O/R address of the P3 channel user. For example /"cn=John Smith, o=Address Book, o=Isode, c=GB"passwd- the P3 channel's password that correspond to the usersubmit_only- Set to true if this session is only to be used for submission
-
-
Method Details
-
setUserDN
Set the P3 channel user's DNThis is the string encoded O/R address of the user. For example /"cn=John Smith, o=Address Book, o=Isode, c=GB"
- Throws:
BadDNException
-
setDisableConfigRequest
public void setDisableConfigRequest(boolean b) Enables or disables the request of configuration from the MTA or Message Store. This will be needed by some non-Isode Message Stores or MTAs, like the Deutsche Telekom service.- Parameters:
b-
-
acquireSemaphore
- Throws:
InterruptedException
-
releaseSemaphore
protected void releaseSemaphore() -
bind
Bind to the P3 channel- Throws:
X400APIException
-
getSession
Retrieve the Session object- Returns:
- A Session object. This is the object that is need to, for example, read or create a message
-
isBound
public boolean isBound()Check if this session is bound or not.This means that the application think it is still bound to the server, but bear in mind that the connection may have been dropped by the server for any number of reasons, and this application won't be informed.
- Returns:
- Returns true if the session bind() was successful and unbind() was not called.
-
unbind
Unbind from the P3 channel or P7 Message Store.Closes the connection to the the P3 channel or P7 Message Store. No more messages can be sent or received until a new connection is open.
- Throws:
X400APIException
-
unbind
Unbind from the P3 channel or P7 Message Store.Closes the connection to the the P3 channel or P7 Message Store. No more messages can be sent or received until a new connection is open.
- Parameters:
force- ignore InterruptedException when acquiring semaphore- Throws:
X400APIException
-
setSecurityEnv
Set the session's security environment data.The information is passed on to the underlying API, but is not checked at this stage. This means that the information may be invalid, but won't be noticed until later on.
- Parameters:
pkcs12file- - The absolute path of the PKCS#12 file with the user certificatepkcs12password- - The password for the PKCS#12 user certificatesec_trusted_ca_cert_dir- - The directory where the trusted certificates for the CAs are kept- Throws:
X400APIException
-
setSecurityEnvPKCS12
public void setSecurityEnvPKCS12(String pkcs12FileName, String password, String sec_trusted_ca_cert_dir) throws X400APIException Set the session's security environment data.The information is passed on to the underlying API, but is not checked at this stage. This means that the information may be invalid, but won't be noticed until later on.
- Parameters:
pkcs12FileName- String : The PKCS#12 file that corresponds to this user, containing it's O/R addresspassword- String : Passphrase to open the PKCS#12 filesec_trusted_ca_cert_dir- : the directory where the CA's trusted certificates are kept (optional)- Throws:
X400APIException- Since:
- 15.0
-
receiveNextAvailableMessage
Receive the "next available message" from the Message Store- Throws:
X400APIException
-
waitForNewMessages
Wait for a new message the specified number of seconds. If seconds is 0, then there's no wait. If seconds is negative, then the delay is indefinite.- Parameters:
seconds-- Returns:
X400_att.X400_E_NOERROR if there were no errors and a message is ready to be read
X400_att.X400_E_TIMED_OUT: if no messages arrived in the specified number of seconds
X400_att.X400_E_NO_MESSAGE: if there are no more messages to read
- Throws:
X400APIException
-