public ThreadGroupManager(AbstractRunnable[] runnables, ThreadWatcher threadWatcher, Jets3tProperties jets3tProperties, boolean isAdminTask) { this.runnables = runnables; this.threadWatcher = threadWatcher; if (isAdminTask) { this.maxThreadCount = jets3tProperties .getIntProperty("s3service.admin-max-thread-count", 20); } else { this.maxThreadCount = jets3tProperties .getIntProperty("s3service.max-thread-count", 2); } this.ignoreExceptions = jets3tProperties .getBoolProperty("s3service.ignore-exceptions-in-multi", false); this.threads = new Thread[runnables.length]; started = new boolean[runnables.length]; // All values initialized to false. alreadyFired = new boolean[runnables.length]; // All values initialized to false. }
public ThreadGroupManager(AbstractRunnable[] runnables, ThreadWatcher threadWatcher, Jets3tProperties jets3tProperties, boolean isAdminTask) { this.runnables = runnables; this.threadWatcher = threadWatcher; if (isAdminTask) { this.maxThreadCount = jets3tProperties .getIntProperty("threaded-service.admin-max-thread-count", 20); } else { this.maxThreadCount = jets3tProperties .getIntProperty("threaded-service.max-thread-count", 2); } this.ignoreExceptions = jets3tProperties .getBoolProperty("threaded-service.ignore-exceptions-in-multi", false); this.threads = new Thread[runnables.length]; started = new boolean[runnables.length]; // All values initialized to false. alreadyFired = new boolean[runnables.length]; // All values initialized to false. }
public ThreadGroupManager(AbstractRunnable[] runnables, ThreadWatcher threadWatcher, Jets3tProperties jets3tProperties, boolean isAdminTask) { this.runnables = runnables; this.threadWatcher = threadWatcher; if (isAdminTask) { this.maxThreadCount = jets3tProperties .getIntProperty("threaded-service.admin-max-thread-count", 20); } else { this.maxThreadCount = jets3tProperties .getIntProperty("threaded-service.max-thread-count", 2); } this.ignoreExceptions = jets3tProperties .getBoolProperty("threaded-service.ignore-exceptions-in-multi", false); this.threads = new Thread[runnables.length]; started = new boolean[runnables.length]; // All values initialized to false. alreadyFired = new boolean[runnables.length]; // All values initialized to false. }
public ThreadGroupManager(AbstractRunnable[] runnables, ThreadWatcher threadWatcher, Jets3tProperties jets3tProperties, boolean isAdminTask) { this.runnables = runnables; this.threadWatcher = threadWatcher; if (isAdminTask) { this.maxThreadCount = jets3tProperties .getIntProperty("s3service.admin-max-thread-count", 20); } else { this.maxThreadCount = jets3tProperties .getIntProperty("s3service.max-thread-count", 2); } this.ignoreExceptions = jets3tProperties .getBoolProperty("s3service.ignore-exceptions-in-multi", false); this.threads = new Thread[runnables.length]; started = new boolean[runnables.length]; // All values initialized to false. alreadyFired = new boolean[runnables.length]; // All values initialized to false. }
/** * @return * the port number to be used for insecure connections over HTTP. */ @Override protected int getHttpPort() { return getJetS3tProperties().getIntProperty("gsservice.gs-endpoint-http-port", 80); }
/** * @return * the port number to be used for secure connections over HTTPS. */ @Override protected int getHttpsPort() { return getJetS3tProperties().getIntProperty("gsservice.gs-endpoint-https-port", 443); }
/** * @return * the port number to be used for insecure connections over HTTP. */ @Override protected int getHttpPort() { return getJetS3tProperties().getIntProperty("s3service.s3-endpoint-http-port", 80); }
/** * @return * the port number to be used for secure connections over HTTPS. */ @Override protected int getHttpsPort() { return getJetS3tProperties().getIntProperty("s3service.s3-endpoint-https-port", 443); }
/** * @return * the port number to be used for secure connections over HTTPS. */ @Override protected int getHttpsPort() { return getJetS3tProperties().getIntProperty("s3service.s3-endpoint-https-port", 443); }
/** * @return * the port number to be used for insecure connections over HTTP. */ @Override protected int getHttpPort() { return getJetS3tProperties().getIntProperty("s3service.s3-endpoint-http-port", 80); }
/** * @return * the port number to be used for secure connections over HTTPS. */ @Override protected int getHttpsPort() { return getJetS3tProperties().getIntProperty("gsservice.gs-endpoint-https-port", 443); }
/** * @return * the port number to be used for insecure connections over HTTP. */ @Override protected int getHttpPort() { return getJetS3tProperties().getIntProperty("gsservice.gs-endpoint-http-port", 80); }
/** * Construct a <code>StorageService</code> identified by the given user credentials. * * @param credentials * the user credentials, may be null in which case the communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> * @param jets3tProperties * JetS3t properties that will be applied within this service. */ protected StorageService(ProviderCredentials credentials, String invokingApplicationDescription, Jets3tProperties jets3tProperties) { this.credentials = credentials; this.invokingApplicationDescription = invokingApplicationDescription; this.jets3tProperties = jets3tProperties; this.isHttpsOnly = this.getHttpsOnly(); this.internalErrorRetryMax = jets3tProperties.getIntProperty( "storage-service.internal-error-retry-max", 5); this.initializeDefaults(); }
/** * Construct a <code>StorageService</code> identified by the given user credentials. * * @param credentials * the user credentials, may be null in which case the communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> * @param jets3tProperties * JetS3t properties that will be applied within this service. */ protected StorageService(ProviderCredentials credentials, String invokingApplicationDescription, Jets3tProperties jets3tProperties) { this.credentials = credentials; this.invokingApplicationDescription = invokingApplicationDescription; this.jets3tProperties = jets3tProperties; this.isHttpsOnly = this.getHttpsOnly(); this.internalErrorRetryMax = jets3tProperties.getIntProperty( "storage-service.internal-error-retry-max", 5); this.initializeDefaults(); }
@Override protected AbstractConnPool createConnectionPool(final HttpParams params) { // Set the maximum connections per host for the HTTP connection manager, // *and* also set the maximum number of total connections (new in 0.7.1). // The max connections per host setting is made the same value as the max // global connections if there is no per-host property. Jets3tProperties props = (Jets3tProperties) params.getParameter( Jets3tProperties.JETS3T_PROPERTIES_ID); int maxConn = 20; int maxConnectionsPerHost = 0; if (props != null) { maxConn = props.getIntProperty("httpclient.max-connections", 20); maxConnectionsPerHost = props.getIntProperty( "httpclient.max-connections-per-host", 0); } if (maxConnectionsPerHost == 0) { maxConnectionsPerHost = maxConn; } connPerRoute.setDefaultMaxPerRoute(maxConnectionsPerHost); return new ConnPoolByRoute(connOperator, connPerRoute, maxConn,props.getLongProperty("httpclient.connection.ttl", -1L), TimeUnit.MILLISECONDS); } } //ThreadSafeConnManager
/** * Constructs the service and initialises its properties. * * @param credentials the Storage Provider user credentials to use when communicating with CloudFront * @param invokingApplicationDescription a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code>. * May be null. * @param credentialsProvider an implementation of the HttpClient CredentialsProvider interface, to provide a means for * prompting for credentials when necessary. May be null. * @param jets3tProperties JetS3t properties that will be applied within this service. May be null. */ public CloudFrontService(ProviderCredentials credentials, String invokingApplicationDescription, CredentialsProvider credentialsProvider, Jets3tProperties jets3tProperties) { this.credentials = credentials; this.invokingApplicationDescription = invokingApplicationDescription; this.credentialsProvider = credentialsProvider; if(jets3tProperties == null) { jets3tProperties = Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME); } this.jets3tProperties = jets3tProperties; this.internalErrorRetryMax = jets3tProperties.getIntProperty("cloudfront-service.internal-error-retry-max", 5); this.initializeDefaults(); }
protected void initializeProxy() { // Retrieve Proxy settings. if(this.jets3tProperties.getBoolProperty("httpclient.proxy-autodetect", true)) { RestUtils.initHttpProxy(this.httpClient, this.jets3tProperties); } else { String proxyHostAddress = this.jets3tProperties.getStringProperty("httpclient.proxy-host", null); int proxyPort = this.jets3tProperties.getIntProperty("httpclient.proxy-port", -1); String proxyUser = this.jets3tProperties.getStringProperty("httpclient.proxy-user", null); String proxyPassword = this.jets3tProperties.getStringProperty("httpclient.proxy-password", null); String proxyDomain = this.jets3tProperties.getStringProperty("httpclient.proxy-domain", null); RestUtils.initHttpProxy(this.httpClient, this.jets3tProperties, proxyHostAddress, proxyPort, proxyUser, proxyPassword, proxyDomain); } }
protected void initializeProxy() { // Retrieve Proxy settings. if(this.jets3tProperties.getBoolProperty("httpclient.proxy-autodetect", true)) { RestUtils.initHttpProxy(this.httpClient, this.jets3tProperties); } else { String proxyHostAddress = this.jets3tProperties.getStringProperty("httpclient.proxy-host", null); int proxyPort = this.jets3tProperties.getIntProperty("httpclient.proxy-port", -1); String proxyUser = this.jets3tProperties.getStringProperty("httpclient.proxy-user", null); String proxyPassword = this.jets3tProperties.getStringProperty("httpclient.proxy-password", null); String proxyDomain = this.jets3tProperties.getStringProperty("httpclient.proxy-domain", null); RestUtils.initHttpProxy(this.httpClient, this.jets3tProperties, proxyHostAddress, proxyPort, proxyUser, proxyPassword, proxyDomain); } }
protected void initializeProxy() { // Retrieve Proxy settings. if(getJetS3tProperties().getBoolProperty("httpclient.proxy-autodetect", true)) { RestUtils.initHttpProxy(httpClient, getJetS3tProperties(), this.getEndpoint()); } else { String proxyHostAddress = getJetS3tProperties().getStringProperty("httpclient.proxy-host", null); int proxyPort = getJetS3tProperties().getIntProperty("httpclient.proxy-port", -1); String proxyUser = getJetS3tProperties().getStringProperty("httpclient.proxy-user", null); String proxyPassword = getJetS3tProperties().getStringProperty("httpclient.proxy-password", null); String proxyDomain = getJetS3tProperties().getStringProperty("httpclient.proxy-domain", null); RestUtils.initHttpProxy(httpClient, getJetS3tProperties(), false, proxyHostAddress, proxyPort, proxyUser, proxyPassword, proxyDomain, this.getEndpoint()); } }
protected void initializeProxy() { // Retrieve Proxy settings. if(getJetS3tProperties().getBoolProperty("httpclient.proxy-autodetect", true)) { RestUtils.initHttpProxy(httpClient, getJetS3tProperties(), this.getEndpoint()); } else { String proxyHostAddress = getJetS3tProperties().getStringProperty("httpclient.proxy-host", null); int proxyPort = getJetS3tProperties().getIntProperty("httpclient.proxy-port", -1); String proxyUser = getJetS3tProperties().getStringProperty("httpclient.proxy-user", null); String proxyPassword = getJetS3tProperties().getStringProperty("httpclient.proxy-password", null); String proxyDomain = getJetS3tProperties().getStringProperty("httpclient.proxy-domain", null); RestUtils.initHttpProxy(httpClient, getJetS3tProperties(), false, proxyHostAddress, proxyPort, proxyUser, proxyPassword, proxyDomain, this.getEndpoint()); } }