Refine search
/** * Loads the endpoint descriptor for a given endpoint. * * @param endpointId the endpoint id * * @return the descriptor */ public EndpointDescriptor getEndpoint(String endpointId) { return this.remoteConfig.getEndpointDescriptor(endpointId); }
/** * Removes all session-bound Connector Sessions for the current user * * @param context the context */ public void removeConnectorSessions(RequestContext context) { try { HttpSession httpSession = ServletUtil.getSession(); String[] endpointIds = this.remoteConfig.getEndpointIds(); for (int i = 0; i < endpointIds.length; i++) { connectorService.removeConnectorSession(httpSession, endpointIds[i]); } } catch (Exception ex) { logger.error("Unable to remove connector sessions", ex); } }
RemoteConfigElement combinedElement = new RemoteConfigElement();
EndpointDescriptor endpointDescriptor = getRemoteConfig().getEndpointDescriptor(endpointId); if (endpointDescriptor == null) String connectorId = (String)endpointDescriptor.getConnectorId(); if (connectorId == null) "The connector id property on the endpoint definition '" + endpointId + "' was empty"); ConnectorDescriptor connectorDescriptor = getRemoteConfig().getConnectorDescriptor(connectorId); if (connectorDescriptor == null) String url = endpointDescriptor.getEndpointUrl(); if (authId != null) AuthenticatorDescriptor authDescriptor = getRemoteConfig().getAuthenticatorDescriptor(authId); if (authDescriptor == null) IdentityType identity = endpointDescriptor.getIdentity(); switch (identity)
endpointId = this.remoteConfig.getDefaultEndpointId();
public ConfigElement parse(Element elem) { ConfigElement configElement = null; if(elem != null) { configElement = RemoteConfigElement.newInstance(elem); } return configElement; } }
/** * Returns the implementation of an Authenticator with a given id * * @param id the id * * @return the authenticator * * @throws ConnectorServiceException */ public Authenticator getAuthenticator(String id) throws ConnectorServiceException { if (id == null) { throw new IllegalArgumentException("Authenticator ID cannot be null."); } AuthenticatorDescriptor descriptor = getRemoteConfig().getAuthenticatorDescriptor(id); if (descriptor == null) { throw new ConnectorServiceException( "Unable to find authenticator for id: " + id); } return buildAuthenticator(descriptor.getImplementationClass()); }
vaultProviderId = this.getRemoteConfig().getDefaultCredentialVaultProviderId();
public void init() { RemoteConfigElement remoteConfig = (RemoteConfigElement) configService.getConfig("Remote").getConfigElement("remote"); SSLConfigDescriptor sslConfigDescriptor = null; if (remoteConfig != null) { sslConfigDescriptor = remoteConfig.getSSLConfigDescriptor(); } if (sslConfigDescriptor != null && sslConfigDescriptor.getSocketFactoryRegistry() != null) { connectionManager = new PoolingHttpClientConnectionManager(sslConfigDescriptor.getSocketFactoryRegistry()); } else { connectionManager = new PoolingHttpClientConnectionManager(); } connectionManager.setMaxTotal(poolSize); connectionManager.setDefaultMaxPerRoute(poolSize); }
EndpointDescriptor endpointDescriptor = getRemoteConfig().getEndpointDescriptor(endpointId); if (endpointDescriptor == null) String connectorId = (String)endpointDescriptor.getConnectorId(); if (connectorId == null) "The connector id property on the endpoint definition '" + endpointId + "' was empty"); ConnectorDescriptor connectorDescriptor = getRemoteConfig().getConnectorDescriptor(connectorId); if (connectorDescriptor == null) String url = endpointDescriptor.getEndpointUrl(); if (authId != null) AuthenticatorDescriptor authDescriptor = getRemoteConfig().getAuthenticatorDescriptor(authId); if (authDescriptor == null) IdentityType identity = endpointDescriptor.getIdentity(); switch (identity)
/** * Constructs a remote connector to a default endpoint (if configured). * If a default endpoint is not configured, null will be returned. * * @return the remote client */ @ScriptMethod ( help="Constructs a remote connector to a default endpoint (if configured).\nIf a default endpoint is not configured, null will be returned.", output="The remote client" ) public ScriptRemoteConnector connect() { ScriptRemoteConnector remoteConnector = null; // Check whether a remote configuration has been provided RemoteConfigElement remoteConfig = getRemoteConfig(); if (remoteConfig != null) { // See if we have a default endpoint id String defaultEndpointId = remoteConfig.getDefaultEndpointId(); if (defaultEndpointId != null) { // Construct for this endpoint id remoteConnector = connect(defaultEndpointId); } } return remoteConnector; }
public ConfigElement parse(Element elem) { ConfigElement configElement = null; if(elem != null) { configElement = RemoteConfigElement.newInstance(elem); } return configElement; } }
/** * Returns the implementation of an Authenticator with a given id * * @param id the id * * @return the authenticator * * @throws ConnectorServiceException */ public Authenticator getAuthenticator(String id) throws ConnectorServiceException { if (id == null) { throw new IllegalArgumentException("Authenticator ID cannot be null."); } AuthenticatorDescriptor descriptor = getRemoteConfig().getAuthenticatorDescriptor(id); if (descriptor == null) { throw new ConnectorServiceException( "Unable to find authenticator for id: " + id); } return buildAuthenticator(descriptor.getImplementationClass()); }
vaultProviderId = this.getRemoteConfig().getDefaultCredentialVaultProviderId();
public void init() { RemoteConfigElement remoteConfig = (RemoteConfigElement) configService.getConfig("Remote").getConfigElement("remote"); SSLConfigDescriptor sslConfigDescriptor = null; if (remoteConfig != null) { sslConfigDescriptor = remoteConfig.getSSLConfigDescriptor(); } if (sslConfigDescriptor != null && sslConfigDescriptor.getSocketFactoryRegistry() != null) { connectionManager = new PoolingHttpClientConnectionManager(sslConfigDescriptor.getSocketFactoryRegistry()); } else { connectionManager = new PoolingHttpClientConnectionManager(); } connectionManager.setMaxTotal(poolSize); connectionManager.setDefaultMaxPerRoute(poolSize); }
/** * Loads the endpoint descriptor for a given endpoint. * * @param endpointId the endpoint id * * @return the descriptor */ public EndpointDescriptor getEndpoint(String endpointId) { return this.remoteConfig.getEndpointDescriptor(endpointId); }
EndpointDescriptor endpointDescriptor = getRemoteConfig().getEndpointDescriptor(endpointId); if (endpointDescriptor == null) String connectorId = (String)endpointDescriptor.getConnectorId(); if (connectorId == null) "The connector id property on the endpoint definition '" + endpointId + "' was empty"); ConnectorDescriptor connectorDescriptor = getRemoteConfig().getConnectorDescriptor(connectorId); if (connectorDescriptor == null) String url = endpointDescriptor.getEndpointUrl(); if (authId != null) AuthenticatorDescriptor authDescriptor = getRemoteConfig().getAuthenticatorDescriptor(authId); if (authDescriptor == null) IdentityType identity = endpointDescriptor.getIdentity(); switch (identity)
/** * Removes all session-bound Connector Sessions for the current user * * @param context the context */ public void removeConnectorSessions(RequestContext context) { try { HttpSession httpSession = ServletUtil.getSession(); String[] endpointIds = this.remoteConfig.getEndpointIds(); for (int i = 0; i < endpointIds.length; i++) { connectorService.removeConnectorSession(httpSession, endpointIds[i]); } } catch (Exception ex) { logger.error("Unable to remove connector sessions", ex); } }
/** * Constructs a remote connector to a default endpoint (if configured). * If a default endpoint is not configured, null will be returned. * * @return the remote client */ @ScriptMethod ( help="Constructs a remote connector to a default endpoint (if configured).\nIf a default endpoint is not configured, null will be returned.", output="The remote client" ) public ScriptRemoteConnector connect() { ScriptRemoteConnector remoteConnector = null; // Check whether a remote configuration has been provided RemoteConfigElement remoteConfig = getRemoteConfig(); if (remoteConfig != null) { // See if we have a default endpoint id String defaultEndpointId = remoteConfig.getDefaultEndpointId(); if (defaultEndpointId != null) { // Construct for this endpoint id remoteConnector = connect(defaultEndpointId); } } return remoteConnector; }
public ConfigElement combine(ConfigElement element) { RemoteConfigElement configElement = (RemoteConfigElement) element; // new combined element RemoteConfigElement combinedElement = new RemoteConfigElement(); // copy in our things combinedElement.connectors.putAll(this.connectors); combinedElement.authenticators.putAll(this.authenticators); combinedElement.endpoints.putAll(this.endpoints); // override with things from the merging object combinedElement.connectors.putAll(configElement.connectors); combinedElement.authenticators.putAll(configElement.authenticators); combinedElement.endpoints.putAll(configElement.endpoints); // default endpoint id combinedElement.defaultEndpointId = this.defaultEndpointId; if(configElement.defaultEndpointId != null) { combinedElement.defaultEndpointId = configElement.defaultEndpointId; } // default credential vault provider id combinedElement.defaultCredentialVaultProviderId = this.defaultCredentialVaultProviderId; if(configElement.defaultCredentialVaultProviderId != null) { combinedElement.defaultCredentialVaultProviderId = configElement.defaultCredentialVaultProviderId; } // return the combined element return combinedElement; }