com.sap.security.core.server.destinations.api
Interface HTTPDestination

All Superinterfaces:
Destination, java.io.Serializable

public interface HTTPDestination
extends Destination


Method Summary
 java.lang.String getAuthenticationType()
          Return the authentication type Values are defined in HTTPDestinationConstantsInterface
 java.lang.String getClient()
          Return the Client configured for this destination Note: When using getHTTPConnectionTemplate, client and language are not set on the connection template and must be set directly on the IRequest object by using the setSAPHeaders method.
 com.tssap.dtr.client.lib.protocol.IConnectionTemplate getHTTPConnectionTemplate()
          Return an instance of com.tssap.dtr.client.lib.protocol.templates.ConnectionTemplate Note: When using getHTTPConnectionTemplate, client and language are not set on the connection template and must be set directly on the IRequest object by using the setSAPHeaders method.
 java.lang.String getLanguage()
          Return the language configured for this destination Note: When using getHTTPConnectionTemplate, client and language are not set on the connection template and must be set directly on the IRequest object by using the setSAPHeaders method.
 java.net.Socket getSocket()
          Return a socket to the server specified in the URL field of the destination.
 java.lang.String getUrl()
          Return the URL for this destination
 java.net.HttpURLConnection getURLConnection()
          Creates an HTTPURLConnection to the specified URL.
 java.net.HttpURLConnection getURLConnection(java.lang.String requestMethod)
          This has the same functionality as getURLConnection(), but it allows setting of the HTTP Request Method before setting the BASIC authentication data.
 boolean isIgnoreServerCertificates()
          Returns if SSL server certificates are ignored
 void setAcceptedServerCertificates(java.lang.String view)
          Set the accepted server certificates.
 void setAssertionTicketAuthentication()
          Set the authentication to SAP assertion tickets
 void setClient(java.lang.String client)
          Set the Client configured for this destination Note: When using getHTTPConnectionTemplate, client and language are not set on the connection template and must be set directly on the IRequest object by using the setSAPHeaders method.
 void setClientCertificateAuthentication(java.lang.String view, java.lang.String alias)
          Set the authentication to X.509 Client Certificates.
 void setIgnoreServerCertificates(boolean ignoreServerCertificates)
          Set if server certificates should be accepted
 void setSAPHeaders(com.tssap.dtr.client.lib.protocol.IRequest request)
          Set the SAP specific headers like language and client As they can not be set on the IConnectionTemplate, this method mus be called to set them before making an request
 void setSID(java.lang.String targetSID)
          Set the target SID
 void setSSO2Authentication()
          Set the authentication to SAP Logon Ticket
 void setUrl(java.lang.String url)
          Set the URL
 void setUsernamePassword(java.lang.String username, java.lang.String password)
          Sets the authentication method to HTTP basic, and sets the username and the password
 
Methods inherited from interface com.sap.security.core.server.destinations.api.Destination
getDestinationProperties, getName, init, isPublishedToLCR, publishToLCR, setDestinationProperties, setName
 

Method Detail

getSocket

public java.net.Socket getSocket()
                          throws ConfigurationException
Return a socket to the server specified in the URL field of the destination. Only X.509 client certificate authentication is supported, username/password is ignored.

Does not support HTTP/S proxies

Returns:
SSL-socket for https protocol, plain socket for http protocol

getURLConnection

public java.net.HttpURLConnection getURLConnection()
                                            throws ConfigurationException
Creates an HTTPURLConnection to the specified URL. If authentication type is HTTP-BASIC, a basic authentication header is set. If authentication type is X.509 client certificate, the client-certificates are set.

Supports HTTP/S proxies.


getURLConnection

public java.net.HttpURLConnection getURLConnection(java.lang.String requestMethod)
                                            throws ConfigurationException
This has the same functionality as getURLConnection(), but it allows setting of the HTTP Request Method before setting the BASIC authentication data. This is a workaround for a program error in the underlying IAIK HTTP implementation which in this case generates GET request even if another method is set.

Supports HTTP/S proxies.

Parameters:
requestMethod - The HTTP Request Method
Returns:
An instance of HttpURLConnection with preset request method.

getHTTPConnectionTemplate

public com.tssap.dtr.client.lib.protocol.IConnectionTemplate getHTTPConnectionTemplate()
                                                                                throws ConfigurationException
Return an instance of com.tssap.dtr.client.lib.protocol.templates.ConnectionTemplate

Note: When using getHTTPConnectionTemplate, client and language are not set on the connection template and must be set directly on the IRequest object by using the setSAPHeaders method.
Supports HTTP/S proxies.


setUsernamePassword

public void setUsernamePassword(java.lang.String username,
                                java.lang.String password)
Sets the authentication method to HTTP basic, and sets the username and the password

setClientCertificateAuthentication

public void setClientCertificateAuthentication(java.lang.String view,
                                               java.lang.String alias)
Set the authentication to X.509 Client Certificates. The certificate is taken from the keystore.

setAcceptedServerCertificates

public void setAcceptedServerCertificates(java.lang.String view)
Set the accepted server certificates. The certificate is taken from the keystore.

setIgnoreServerCertificates

public void setIgnoreServerCertificates(boolean ignoreServerCertificates)
Set if server certificates should be accepted

setUrl

public void setUrl(java.lang.String url)
Set the URL

getUrl

public java.lang.String getUrl()
Return the URL for this destination

getAuthenticationType

public java.lang.String getAuthenticationType()
Return the authentication type Values are defined in HTTPDestinationConstantsInterface
See Also:
com.sap.security.core.server.destinations.api.HTTPDestinationConstantsInterface

isIgnoreServerCertificates

public boolean isIgnoreServerCertificates()
Returns if SSL server certificates are ignored

setSSO2Authentication

public void setSSO2Authentication()
Set the authentication to SAP Logon Ticket

setAssertionTicketAuthentication

public void setAssertionTicketAuthentication()
Set the authentication to SAP assertion tickets

setSID

public void setSID(java.lang.String targetSID)
Set the target SID

setClient

public void setClient(java.lang.String client)
Set the Client configured for this destination Note: When using getHTTPConnectionTemplate, client and language are not set on the connection template and must be set directly on the IRequest object by using the setSAPHeaders method.
Returns:
 

getClient

public java.lang.String getClient()
Return the Client configured for this destination Note: When using getHTTPConnectionTemplate, client and language are not set on the connection template and must be set directly on the IRequest object by using the setSAPHeaders method.
Returns:
 

getLanguage

public java.lang.String getLanguage()
Return the language configured for this destination Note: When using getHTTPConnectionTemplate, client and language are not set on the connection template and must be set directly on the IRequest object by using the setSAPHeaders method.
Returns:
 

setSAPHeaders

public void setSAPHeaders(com.tssap.dtr.client.lib.protocol.IRequest request)
Set the SAP specific headers like language and client As they can not be set on the IConnectionTemplate, this method mus be called to set them before making an request
Parameters:
request -