Class WebConnector
java.lang.Object
i5.las2peer.api.Configurable
i5.las2peer.connectors.Connector
i5.las2peer.connectors.webConnector.WebConnector
public class WebConnector
extends i5.las2peer.connectors.Connector
Starter class for registering the Web Connector at the las2peer server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected Stringprotected intstatic final Stringstatic final intstatic final Stringstatic final booleanstatic final intstatic final intstatic final intstatic final intstatic final intstatic final booleanstatic final intstatic final booleanstatic final booleanprotected booleanprotected intprotected intprotected intprotected intprotected intprotected Stringprotected Stringprotected booleanstatic final Stringstatic final Stringprotected Stringprotected Stringprotected booleanprotected booleanstatic final String -
Constructor Summary
ConstructorsConstructorDescriptioncreate a new web connector instance.WebConnector(boolean http, int httpPort, boolean https, int httpsPort) create a new web connector instance.WebConnector(Integer httpPort) -
Method Summary
Modifier and TypeMethodDescriptioni5.las2peer.security.AgentImplauthenticateAgent(javax.ws.rs.core.MultivaluedMap<String, String> requestHeaders, String accessTokenQueryParam) voiddestroySession(String sessionId) voidenableHttpHttps(boolean http, boolean https) enables/disables HTTP/HTTPsGets the currently used CA certificate.intintinti5.las2peer.p2p.Nodeget the node, this connector is running at / forgetOrCreateSession(i5.las2peer.security.PassphraseAgentImpl agent) getSessionById(String sessionid) booleanvoidLogs an error.voidLogs an error with throwable.voidlogMessage(String message) Logs a message.voidset the cross origin resource domainvoidsetCrossOriginResourceMaxAge(int maxAge) voidsetCrossOriginResourceSharing(boolean enable) allow cross origin resource sharingvoidsetHttpPort(Integer port) set the port for the HTTP connector to listen tovoidsetHttpsPort(Integer port) set the port for the web connector to listen to for the secure linevoidsetLogFile(String filename) set the log file for this connectorvoidsetLogStream(OutputStream stream) set a stream to log all messages tovoidsetPreferLocalServices(boolean enable) prefer local servicesvoidsetSocketTimeout(int timeoutInMs) Deprecated.This method is no longer supported and will be removed in the future.voidsetSslKeyPassword(String password) set the SSL key passwordvoidsetSslKeystore(String keystore) set the location of the SSL keystorevoidstart(i5.las2peer.p2p.Node node) voidstop()Methods inherited from class i5.las2peer.api.Configurable
getProperties, setFieldValues
-
Field Details
-
DEFAULT_HTTP_PORT
public static final int DEFAULT_HTTP_PORT- See Also:
-
WEB_CONNECTOR
- See Also:
-
httpPort
protected int httpPort -
DEFAULT_HTTPS_PORT
public static final int DEFAULT_HTTPS_PORT- See Also:
-
httpsPort
protected int httpsPort -
DEFAULT_START_HTTP
public static final boolean DEFAULT_START_HTTP- See Also:
-
startHttp
protected boolean startHttp -
DEFAULT_START_HTTPS
public static final boolean DEFAULT_START_HTTPS- See Also:
-
startHttps
protected boolean startHttps -
sslKeystore
-
sslKeyPassword
-
DEFAULT_CROSS_ORIGIN_RESOURCE_DOMAIN
- See Also:
-
crossOriginResourceDomain
-
DEFAULT_CROSS_ORIGIN_RESOURCE_MAX_AGE
public static final int DEFAULT_CROSS_ORIGIN_RESOURCE_MAX_AGE- See Also:
-
crossOriginResourceMaxAge
protected int crossOriginResourceMaxAge -
DEFAULT_ENABLE_CROSS_ORIGIN_RESOURCE_SHARING
public static final boolean DEFAULT_ENABLE_CROSS_ORIGIN_RESOURCE_SHARING- See Also:
-
enableCrossOriginResourceSharing
protected boolean enableCrossOriginResourceSharing -
DEFAULT_ONLY_LOCAL_SERVICES
public static final boolean DEFAULT_ONLY_LOCAL_SERVICES- See Also:
-
onlyLocalServices
protected boolean onlyLocalServices -
SESSION_COOKIE
- See Also:
-
DEFAULT_DEFAULT_OIDC_PROVIDER
- See Also:
-
defaultOIDCProvider
-
oidcProviders
-
oidcClientId
-
oidcClientSecret
-
DEFAULT_MAX_CONNECTIONS
public static final int DEFAULT_MAX_CONNECTIONS- See Also:
-
maxConnections
protected int maxConnections -
COOKIE_SESSIONID_KEY
- See Also:
-
DEFAULT_SESSION_TIMEOUT
public static final int DEFAULT_SESSION_TIMEOUT- See Also:
-
DEFAULT_MAX_THREADS
public static final int DEFAULT_MAX_THREADS- See Also:
-
maxThreads
protected int maxThreads -
DEFAULT_MAX_REQUEST_BODY_SIZE
public static final int DEFAULT_MAX_REQUEST_BODY_SIZE- See Also:
-
maxRequestBodySize
protected int maxRequestBodySize -
SSL_INSTANCE_NAME
- See Also:
-
oidcProviderInfos
-
-
Constructor Details
-
WebConnector
public WebConnector()create a new web connector instance. -
WebConnector
public WebConnector(boolean http, int httpPort, boolean https, int httpsPort) create a new web connector instance.- Parameters:
http-httpPort-https-httpsPort-
-
WebConnector
-
-
Method Details
-
setLogFile
set the log file for this connector- Parameters:
filename-- Throws:
IOException
-
setHttpPort
set the port for the HTTP connector to listen to- Parameters:
port-
-
setHttpsPort
set the port for the web connector to listen to for the secure line- Parameters:
port-
-
enableHttpHttps
public void enableHttpHttps(boolean http, boolean https) enables/disables HTTP/HTTPs- Parameters:
http- enable HTTPhttps- enable HTTPS
-
setSocketTimeout
Deprecated.This method is no longer supported and will be removed in the future.- Parameters:
timeoutInMs-
-
setLogStream
set a stream to log all messages to- Parameters:
stream-
-
setSslKeyPassword
set the SSL key password- Parameters:
password-
-
setSslKeystore
set the location of the SSL keystore- Parameters:
keystore-
-
setCrossOriginResourceDomain
set the cross origin resource domain- Parameters:
cord-
-
getCrossOriginResourceDomain
-
setCrossOriginResourceMaxAge
public void setCrossOriginResourceMaxAge(int maxAge) -
getCrossOriginResourceMaxAge
public int getCrossOriginResourceMaxAge() -
setCrossOriginResourceSharing
public void setCrossOriginResourceSharing(boolean enable) allow cross origin resource sharing- Parameters:
enable-
-
isCrossOriginResourceSharing
public boolean isCrossOriginResourceSharing() -
setPreferLocalServices
public void setPreferLocalServices(boolean enable) prefer local services- Parameters:
enable-
-
start
public void start(i5.las2peer.p2p.Node node) throws i5.las2peer.connectors.ConnectorException - Specified by:
startin classi5.las2peer.connectors.Connector- Throws:
i5.las2peer.connectors.ConnectorException
-
getRootCAFilename
-
getMyHostname
-
getHttpsEndpoint
-
getHttpEndpoint
-
stop
public void stop() throws i5.las2peer.connectors.ConnectorException- Specified by:
stopin classi5.las2peer.connectors.Connector- Throws:
i5.las2peer.connectors.ConnectorException
-
getL2pNode
public i5.las2peer.p2p.Node getL2pNode()get the node, this connector is running at / for- Returns:
- the Las2Peer node of this connector
-
logMessage
Logs a message.- Parameters:
message-
-
logError
Logs an error with throwable.- Parameters:
message-throwable-
-
logError
Logs an error.- Parameters:
message-
-
getLockOidc
-
getOidcClientId
-
getOidcClientSecret
-
getHttpPort
public int getHttpPort() -
getHttpsPort
public int getHttpsPort() -
getCACertificate
Gets the currently used CA certificate.- Returns:
- Returns the CA certificate or
null, if the connector is not started. - Throws:
FileNotFoundException- If the certificate is not stored in the local keystore.
-
authenticateAgent
-
getOrCreateSession
-
getSessionById
-
destroySession
-
generateToken
-