knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [19/25] knox git commit: Merge branch 'master' into KNOX-998-Package_Restructuring
Date Thu, 02 Nov 2017 18:48:23 GMT
http://git-wip-us.apache.org/repos/asf/knox/blob/c754cc06/gateway-server/src/main/java/org/apache/knox/gateway/GatewayMessages.java
----------------------------------------------------------------------
diff --cc gateway-server/src/main/java/org/apache/knox/gateway/GatewayMessages.java
index cd2c0eb,0000000..61c5303
mode 100644,000000..100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/GatewayMessages.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/GatewayMessages.java
@@@ -1,521 -1,0 +1,553 @@@
 +/**
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *     http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.knox.gateway;
 +
 +import org.apache.commons.cli.ParseException;
 +import org.apache.knox.gateway.i18n.messages.Message;
 +import org.apache.knox.gateway.i18n.messages.MessageLevel;
 +import org.apache.knox.gateway.i18n.messages.Messages;
 +import org.apache.knox.gateway.i18n.messages.StackTrace;
 +import org.apache.knox.gateway.services.security.KeystoreServiceException;
 +
 +import java.io.File;
 +import java.net.URI;
 +import java.util.Date;
 +import java.util.Map;
 +import java.util.Set;
 +
 +/**
 + *
 + */
 +@Messages(logger="org.apache.knox.gateway")
 +public interface GatewayMessages {
 +
 +  @Message( level = MessageLevel.FATAL, text = "Failed to parse command line: {0}" )
 +  void failedToParseCommandLine( @StackTrace( level = MessageLevel.DEBUG ) ParseException e );
 +
 +  @Message( level = MessageLevel.INFO, text = "Starting gateway..." )
 +  void startingGateway();
 +
 +  @Message( level = MessageLevel.FATAL, text = "Failed to start gateway: {0}" )
 +  void failedToStartGateway( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.INFO, text = "Started gateway on port {0}." )
 +  void startedGateway( int port );
 +
 +  @Message( level = MessageLevel.INFO, text = "Stopping gateway..." )
 +  void stoppingGateway();
 +
 +  @Message( level = MessageLevel.INFO, text = "Stopped gateway." )
 +  void stoppedGateway();
 +
 +  @Message( level = MessageLevel.INFO, text = "Loading configuration resource {0}" )
 +  void loadingConfigurationResource( String res );
 +
 +  @Message( level = MessageLevel.INFO, text = "Loading configuration file {0}" )
 +  void loadingConfigurationFile( String file );
 +
 +  @Message( level = MessageLevel.WARN, text = "Failed to load configuration file {0}: {1}" )
 +  void failedToLoadConfig( String path, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.INFO, text = "Using {1} as GATEWAY_HOME via {0}." )
 +  void settingGatewayHomeDir( String location, String home );
 +
 +  @Message( level = MessageLevel.INFO, text = "Loading topologies from directory: {0}" )
 +  void loadingTopologiesFromDirectory( String topologiesDir );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Loading topology file: {0}" )
 +  void loadingTopologyFile( String fileName );
 +
 +  @Message( level = MessageLevel.INFO, text = "Monitoring topologies in directory: {0}" )
 +  void monitoringTopologyChangesInDirectory( String topologiesDir );
 +
 +  @Message( level = MessageLevel.INFO, text = "Deploying topology {0} to {1}" )
 +  void deployingTopology( String clusterName, String warDirName );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Deployed topology {0}." )
 +  void deployedTopology( String clusterName );
 +
 +  @Message( level = MessageLevel.INFO, text = "Loading topology {0} from {1}" )
 +  void redeployingTopology( String clusterName, String warDirName );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Redeployed topology {0}." )
 +  void redeployedTopology( String clusterName );
 +
 +  @Message( level = MessageLevel.INFO, text = "Activating topology {0}" )
 +  void activatingTopology( String name );
 +
 +  @Message( level = MessageLevel.INFO, text = "Activating topology {0} archive {1}" )
 +  void activatingTopologyArchive( String topology, String archive );
 +
 +  @Message( level = MessageLevel.INFO, text = "Deactivating topology {0}" )
 +  void deactivatingTopology( String name );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to deploy topology {0}: {1}" )
 +  void failedToDeployTopology( String name, @StackTrace(level=MessageLevel.DEBUG) Throwable e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to redeploy topology {0}" )
 +  void failedToRedeployTopology( String name );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to redeploy topology {0}: {1}" )
 +  void failedToRedeployTopology( String name, @StackTrace(level=MessageLevel.DEBUG) Throwable e );
 +
 +  @Message(level = MessageLevel.ERROR, text = "Failed to load topology {0}: Topology configuration is invalid!")
 +  void failedToLoadTopology(String fileName);
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to redeploy topologies: {0}" )
 +  void failedToRedeployTopologies( @StackTrace(level=MessageLevel.DEBUG) Throwable e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to undeploy topology {0}: {1}" )
 +  void failedToUndeployTopology( String name, @StackTrace(level=MessageLevel.DEBUG) Exception e );
 +
 +  @Message( level = MessageLevel.INFO, text = "Deleting topology {0}" )
 +  void deletingTopology( String topologyName );
 +
 +  @Message( level = MessageLevel.INFO, text = "Deleting deployed topology {0}" )
 +  void deletingDeployment( String warDirName );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Purge backups of deployed topology {0}" )
 +  void cleanupDeployments( String topologyName );
 +
 +  @Message( level = MessageLevel.INFO, text = "Deleting backup deployed topology {0}" )
 +  void cleanupDeployment( String absolutePath );
 +
 +  @Message( level = MessageLevel.INFO, text = "Creating gateway home directory: {0}" )
 +  void creatingGatewayHomeDir( File homeDir );
 +
 +  @Message( level = MessageLevel.INFO, text = "Creating gateway deployment directory: {0}" )
 +  void creatingGatewayDeploymentDir( File topologiesDir );
 +
 +  @Message( level = MessageLevel.INFO, text = "Creating default gateway configuration file: {0}" )
 +  void creatingDefaultConfigFile( File defaultConfigFile );
 +
 +  @Message( level = MessageLevel.INFO, text = "Creating sample topology file: {0}" )
 +  void creatingDefaultTopologyFile( File defaultConfigFile );
 +
 +  @Message( level = MessageLevel.WARN, text = "Ignoring service deployment contributor with invalid null name: {0}" )
 +  void ignoringServiceContributorWithMissingName( String className );
 +
 +  @Message( level = MessageLevel.WARN, text = "Ignoring service deployment contributor with invalid null role: {0}" )
 +  void ignoringServiceContributorWithMissingRole( String className );
 +
 +  @Message( level = MessageLevel.WARN, text = "Ignoring service deployment contributor with invalid null version: {0}" )
 +  void ignoringServiceContributorWithMissingVersion( String className );
 +
 +  @Message( level = MessageLevel.WARN, text = "Ignoring provider deployment contributor with invalid null name: {0}" )
 +  void ignoringProviderContributorWithMissingName( String className );
 +
 +  @Message( level = MessageLevel.WARN, text = "Ignoring provider deployment contributor with invalid null role: {0}" )
 +  void ignoringProviderContributorWithMissingRole( String className );
 +
 +  @Message( level = MessageLevel.INFO, text = "Loaded logging configuration: {0}" )
 +  void loadedLoggingConfig( String fileName );
 +
 +  @Message( level = MessageLevel.WARN, text = "Failed to load logging configuration: {0}" )
 +  void failedToLoadLoggingConfig( String fileName );
 +
 +  @Message( level = MessageLevel.INFO, text = "Creating credential store for the gateway instance." )
 +  void creatingCredentialStoreForGateway();
 +
 +  @Message( level = MessageLevel.INFO, text = "Credential store for the gateway instance found - no need to create one." )
 +  void credentialStoreForGatewayFoundNotCreating();
 +
 +  @Message( level = MessageLevel.INFO, text = "Creating keystore for the gateway instance." )
 +  void creatingKeyStoreForGateway();
 +
 +  @Message( level = MessageLevel.INFO, text = "Keystore for the gateway instance found - no need to create one." )
 +  void keyStoreForGatewayFoundNotCreating();
 +
 +  @Message( level = MessageLevel.INFO, text = "Creating credential store for the cluster: {0}" )
 +  void creatingCredentialStoreForCluster(String clusterName);
 +
 +  @Message( level = MessageLevel.INFO, text = "Credential store found for the cluster: {0} - no need to create one." )
 +  void credentialStoreForClusterFoundNotCreating(String clusterName);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Received request: {0} {1}" )
 +  void receivedRequest( String method, String uri );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Dispatch request: {0} {1}" )
 +  void dispatchRequest( String method, URI uri );
 +  
 +  @Message( level = MessageLevel.WARN, text = "Connection exception dispatching request: {0} {1}" )
 +  void dispatchServiceConnectionException( URI uri, @StackTrace(level=MessageLevel.WARN) Exception e );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Signature verified: {0}" )
 +  void signatureVerified( boolean verified );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Apache Knox Gateway {0} ({1})" )
 +  void gatewayVersionMessage( String version, String hash );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to inject service {0}: {1}" )
 +  void failedToInjectService( String serviceName, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to finalize contribution: {0}" )
 +  void failedToFinalizeContribution( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to contribute service [role={1}, name={0}]: {2}" )
 +  void failedToContributeService( String name, String role, @StackTrace( level = MessageLevel.ERROR ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to contribute provider [role={1}, name={0}]: {2}" )
 +  void failedToContributeProvider( String name, String role, @StackTrace( level = MessageLevel.ERROR ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to initialize contribution: {0}" )
 +  void failedToInitializeContribution( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to initialize servlet instance: {0}" )
 +  void failedToInitializeServletInstace( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Gateway processing failed: {0}" )
 +  void failedToExecuteFilter( @StackTrace( level = MessageLevel.INFO ) Throwable t );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to load topology {0}: {1}")
 +  void failedToLoadTopology( String fileName, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to load topology {0}, retrying after {1}ms: {2}")
 +  void failedToLoadTopologyRetrying( String friendlyURI, String delay, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to handle topology events: {0}" )
 +  void failedToHandleTopologyEvents( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to reload topologies: {0}" )
 +  void failedToReloadTopologies( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.FATAL, text = "Unsupported encoding: {0}" )
 +  void unsupportedEncoding( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to persist master secret: {0}" )
 +  void failedToPersistMasterSecret( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to encrypt master secret: {0}" )
 +  void failedToEncryptMasterSecret( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to initialize master service from persistent master {0}: {1}" )
 +  void failedToInitializeFromPersistentMaster( String masterFileName, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to encode passphrase: {0}" )
 +  void failedToEncodePassphrase( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to verify signature: {0}")
 +  void failedToVerifySignature( @StackTrace(level=MessageLevel.DEBUG) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to sign the data: {0}")
 +  void failedToSignData( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to decrypt password for cluster {0}: {1}" )
 +  void failedToDecryptPasswordForCluster( String clusterName, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to encrypt password for cluster {0}: {1}")
 +  void failedToEncryptPasswordForCluster( String clusterName, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +  
 +  @Message( level = MessageLevel.ERROR, text = "Failed to create keystore [filename={0}, type={1}]: {2}" )
 +  void failedToCreateKeystore( String fileName, String keyStoreType, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to load keystore [filename={0}, type={1}]: {2}" )
 +  void failedToLoadKeystore( String fileName, String keyStoreType, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to add key for cluster {0}: {1}" )
 +  void failedToAddKeyForCluster( String clusterName, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to add credential for cluster {0}: {1}" )
 +  void failedToAddCredentialForCluster( String clusterName, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +  
 +  @Message( level = MessageLevel.ERROR, text = "Failed to get key for Gateway {0}: {1}" )
 +  void failedToGetKeyForGateway( String alias, @StackTrace( level=MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to get credential for cluster {0}: {1}" )
 +  void failedToGetCredentialForCluster( String clusterName, @StackTrace(level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to get key for cluster {0}: {1}" )
 +  void failedToGetKeyForCluster( String clusterName, @StackTrace(level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to add self signed certificate for Gateway {0}: {1}" )
 +  void failedToAddSeflSignedCertForGateway( String alias, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to generate secret key from password: {0}" )
 +  void failedToGenerateKeyFromPassword( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to establish connection to {0}: {1}" )
 +  void failedToEstablishConnectionToUrl( String url, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to interpret property \"{0}\": {1}")
 +  void failedToInterpretProperty( String property, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to instantiate the internal gateway services." )
 +  void failedToInstantiateGatewayServices();
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to serialize map to Json string {0}: {1}" )
 +  void failedToSerializeMapToJSON( Map<String, Object> map, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to get map from Json string {0}: {1}" )
 +  void failedToGetMapFromJsonString( String json, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +  
 +  @Message( level = MessageLevel.DEBUG, text = "Successful Knox->Hadoop SPNegotiation authentication for URL: {0}" )
 +  void successfulSPNegoAuthn(String uri);
 +  
 +  @Message( level = MessageLevel.ERROR, text = "Failed Knox->Hadoop SPNegotiation authentication for URL: {0}" )
 +  void failedSPNegoAuthn(String uri);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Dispatch response status: {0}" )
 +  void dispatchResponseStatusCode(int statusCode);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Dispatch response status: {0}, Location: {1}" )
 +  void dispatchResponseCreatedStatusCode( int statusCode, String location );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to decrypt cipher text for cluster {0}: due to inability to retrieve the password." )
 +  void failedToDecryptCipherForClusterNullPassword(String clusterName);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Gateway services have not been initialized." )
 +  void gatewayServicesNotInitialized();
 +
 +  @Message( level = MessageLevel.INFO, text = "The Gateway SSL certificate is issued to hostname: {0}." )
 +  void certificateHostNameForGateway(String cn);
 +
 +  @Message( level = MessageLevel.INFO, text = "The Gateway SSL certificate is valid between: {0} and {1}." )
 +  void certificateValidityPeriod(Date notBefore, Date notAfter);
 +
 +  @Message( level = MessageLevel.ERROR, text = "Unable to retrieve certificate for Gateway: {0}." )
 +  void unableToRetrieveCertificateForGateway(Exception e);
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to generate alias for cluster: {0} {1}." )
 +  void failedToGenerateAliasForCluster(String clusterName, KeystoreServiceException e);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Key passphrase not found in credential store - using master secret." )
 +  void assumingKeyPassphraseIsMaster();
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to remove alias for cluster: {0} {1}." )
 +  void failedToRemoveCredentialForCluster(String clusterName, Exception e);
 +
 +  @Message( level = MessageLevel.WARN, text = "Failed to match path {0}" )
 +  void failedToMatchPath( String path );
 +  
 +  @Message( level = MessageLevel.ERROR, text = "Failed to get system ldap connection: {0}" )
 +  void failedToGetSystemLdapConnection( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +  
 +  @Message( level = MessageLevel.WARN, text = "Value not found for cluster:{0}, alias: {1}" )
 +  void aliasValueNotFound( String cluster, String alias );
 +
 +  @Message( level = MessageLevel.INFO, text = "Computed userDn: {0} using dnTemplate for principal: {1}" )
 +  void computedUserDn(String userDn, String principal);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Searching from {0} where {1} scope {2}" )
 +  void searchBaseFilterScope( String searchBase, String searchFilter, String searchScope );
 +
 +  @Message( level = MessageLevel.INFO, text = "Computed userDn: {0} using ldapSearch for principal: {1}" )
 +  void searchedAndFoundUserDn(String userDn, String principal);
 +
 +  @Message( level = MessageLevel.INFO, text = "Computed roles/groups: {0} for principal: {1}" )
 +  void lookedUpUserRoles(Set<String> roleNames, String userName);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Initialize provider: {1}/{0}" )
 +  void initializeProvider( String name, String role );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Initialize service: {1}/{0}" )
 +  void initializeService( String name, String role );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Contribute provider: {1}/{0}" )
 +  void contributeProvider( String name, String role );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Contribute service: {1}/{0}" )
 +  void contributeService( String name, String role );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Finalize provider: {1}/{0}" )
 +  void finalizeProvider( String name, String role );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Finalize service: {1}/{0}" )
 +  void finalizeService( String name, String role );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Configured services directory is {0}" )
 +  void usingServicesDirectory(String path);
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to unmarshall service definition file {0} file : {1}" )
 +  void failedToLoadServiceDefinition(String fileName, @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to find service definition file {0} file : {1}" )
 +  void failedToFindServiceDefinitionFile(String fileName, @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to find rewrite file {0} file : {1}" )
 +  void failedToFindRewriteFile(String fileName, @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 +
 +  @Message( level = MessageLevel.ERROR, text = "Failed to unmarshall rewrite file {0} file : {1}" )
 +  void failedToLoadRewriteFile(String fileName, @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "No rewrite file found in service directory {0}" )
 +  void noRewriteFileFound(String path);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Added Service definition name: {0}, role : {1}, version : {2}" )
 +  void addedServiceDefinition(String serviceName, String serviceRole, String version);
 +
 +  @Message( level = MessageLevel.INFO, text = "System Property: {0}={1}" )
 +  void logSysProp( String name, String property );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Unable to get password: {0}" )
 +  void unableToGetPassword(@StackTrace( level = MessageLevel.DEBUG ) Exception e);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Initialize application: {0}" )
 +  void initializeApplication( String name );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Contribute application: {0}" )
 +  void contributeApplication( String name );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Finalize application: {0}" )
 +  void finalizeApplication( String name );
 +
 +  @Message( level = MessageLevel.INFO, text = "Default topology {0} at {1}" )
 +  void defaultTopologySetup( String defaultTopologyName, String redirectContext );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Default topology forward from {0} to {1}" )
 +  void defaultTopologyForward( String oldTarget, String newTarget );
 +
 +  @Message( level = MessageLevel.ERROR, text = "Unable to setup PagedResults" )
 +  void unableToSetupPagedResults();
 +
 +  @Message( level = MessageLevel.INFO, text = "Ignoring PartialResultException" )
 +  void ignoringPartialResultException();
 +
 +  @Message( level = MessageLevel.WARN, text = "Only retrieved first {0} groups due to SizeLimitExceededException." )
 +  void sizeLimitExceededOnlyRetrieved(int numResults);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Failed to parse path into Template: {0} : {1}" )
 +  void failedToParsePath( String path, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Failed to initialize metrics reporter {0}  : {1}" )
 +  void failedToInitializeReporter( String name,  @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Failed to start metrics reporter {0}  : {1}" )
 +  void failedToStartReporter( String name,  @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 +
 +  @Message( level = MessageLevel.DEBUG, text = "Failed to stop metrics reporter {0}  : {1}" )
 +  void failedToStopReporter( String name,  @StackTrace( level = MessageLevel.DEBUG ) Exception e);
 +
 +  @Message( level = MessageLevel.INFO, text = "Cookie scoping feature enabled: {0}" )
 +  void cookieScopingFeatureEnabled( boolean enabled );
 +
 +  /**
 +   * Log whether Topology port mapping feature is enabled/disabled.
 +   *
 +   * @param enabled
 +   */
 +  @Message(level = MessageLevel.INFO,
 +           text = "Topology port mapping feature enabled: {0}")
 +  void gatewayTopologyPortMappingEnabled(final boolean enabled);
 +
 +  /**
 +   * @param topology
 +   * @param port
 +   */
 +  @Message(level = MessageLevel.DEBUG,
 +           text = "Creating a connector for topology {0} listening on port {1}.")
 +  void createJettyConnector(final String topology, final int port);
 +
 +  /**
 +   * @param topology
 +   */
 +  @Message(level = MessageLevel.DEBUG,
 +           text = "Creating a handler for topology {0}.")
 +  void createJettyHandler(final String topology);
 +
 +  /**
 +   * @param oldTarget
 +   * @param newTarget
 +   */
 +  @Message(level = MessageLevel.INFO,
 +           text = "Updating request context from {0} to {1}")
 +  void topologyPortMappingAddContext(final String oldTarget,
 +      final String newTarget);
 +
 +  /**
 +   * @param oldTarget
 +   * @param newTarget
 +   */
 +  @Message(level = MessageLevel.DEBUG,
 +           text = "Updating request target from {0} to {1}")
 +  void topologyPortMappingUpdateRequest(final String oldTarget,
 +      final String newTarget);
 +
 +  /**
 +   * Messages for Topology Port Mapping
 +   *
 +   * @param port
 +   * @param topology
 +   */
 +  @Message(level = MessageLevel.ERROR,
 +           text = "Port {0} configured for Topology - {1} is already in use.")
 +  void portAlreadyInUse(final int port, final String topology);
 +
 +  /**
 +   * Messages for Topology Port Mapping
 +   *
 +   * @param port
 +   */
 +  @Message(level = MessageLevel.ERROR,
 +           text = "Port {0} is already in use.")
 +  void portAlreadyInUse(final int port);
 +
 +  /**
 +   * Log topology and port
 +   *
 +   * @param topology
 +   * @param port
 +   */
 +  @Message(level = MessageLevel.INFO,
 +           text = "Started gateway, topology \"{0}\" listening on port \"{1}\".")
 +  void startedGateway(final String topology, final int port);
 +
 +  @Message(level = MessageLevel.ERROR,
 +           text =
 +               " Could not find topology \"{0}\" mapped to port \"{1}\" configured in gateway-config.xml. "
 +                   + "This invalid topology mapping will be ignored by the gateway. "
 +                   + "Gateway restart will be required if in the future \"{0}\" topology is added.")
 +  void topologyPortMappingCannotFindTopology(final String topology, final int port);
 +
 +
++  @Message( level = MessageLevel.INFO, text = "Monitoring simple descriptors in directory: {0}" )
++  void monitoringDescriptorChangesInDirectory(String descriptorsDir);
++
++
++  @Message( level = MessageLevel.INFO, text = "Monitoring shared provider configurations in directory: {0}" )
++  void monitoringProviderConfigChangesInDirectory(String sharedProviderDir);
++
++  @Message( level = MessageLevel.INFO, text = "Prevented deletion of shared provider configuration because there are referencing descriptors: {0}" )
++  void preventedDeletionOfSharedProviderConfiguration(String providerConfigurationPath);
++
++  @Message( level = MessageLevel.INFO, text = "Generated topology {0} because the associated descriptor {1} changed." )
++  void generatedTopologyForDescriptorChange(String topologyName, String descriptorName);
++
 +  @Message( level = MessageLevel.ERROR, text = "An error occurred while processing {0} : {1}" )
 +  void simpleDescriptorHandlingError(final String simpleDesc,
-                                      @StackTrace( level = MessageLevel.DEBUG ) Exception e );
++                                     @StackTrace(level = MessageLevel.DEBUG) Exception e);
++
++  @Message(level = MessageLevel.DEBUG, text = "Successfully wrote configuration: {0}")
++  void wroteConfigurationFile(final String filePath);
++
++  @Message(level = MessageLevel.ERROR, text = "Failed to write configuration: {0}")
++  void failedToWriteConfigurationFile(final String filePath,
++                                      @StackTrace(level = MessageLevel.DEBUG) Exception e );
++
++  @Message( level = MessageLevel.INFO, text = "Deleting topology {0} because the associated descriptor {1} was deleted." )
++  void deletingTopologyForDescriptorDeletion(String topologyName, String descriptorName);
++
++  @Message( level = MessageLevel.INFO, text = "Deleting descriptor {0} because the associated topology {1} was deleted." )
++  void deletingDescriptorForTopologyDeletion(String descriptorName, String topologyName);
++
++  @Message( level = MessageLevel.DEBUG, text = "Added descriptor {0} reference to provider configuration {1}." )
++  void addedProviderConfigurationReference(String descriptorName, String providerConfigurationName);
++
++  @Message( level = MessageLevel.DEBUG, text = "Removed descriptor {0} reference to provider configuration {1}." )
++  void removedProviderConfigurationReference(String descriptorName, String providerConfigurationName);
 +
 +}

http://git-wip-us.apache.org/repos/asf/knox/blob/c754cc06/gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
----------------------------------------------------------------------
diff --cc gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
index dfe34d4,0000000..c7b8df5
mode 100644,000000..100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
@@@ -1,925 -1,0 +1,926 @@@
 +/**
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *     http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.knox.gateway.config.impl;
 +
++import org.apache.commons.io.FilenameUtils;
 +import org.apache.commons.lang3.StringUtils;
 +import org.apache.hadoop.conf.Configuration;
 +import org.apache.hadoop.fs.Path;
 +import org.apache.knox.gateway.GatewayMessages;
 +import org.apache.knox.gateway.config.GatewayConfig;
 +import org.apache.knox.gateway.i18n.messages.MessagesFactory;
 +import org.joda.time.Period;
 +import org.joda.time.format.PeriodFormatter;
 +import org.joda.time.format.PeriodFormatterBuilder;
 +
 +import java.io.File;
 +import java.net.InetSocketAddress;
 +import java.net.MalformedURLException;
 +import java.net.URL;
 +import java.net.UnknownHostException;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.Collections;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.concurrent.ConcurrentHashMap;
 +
 +/**
 + * The configuration for the Gateway.
 + *
 + * The Gateway configuration variables are described in gateway-default.xml
 + *
 + * The Gateway specific configuration is split into two layers:
 + *
 + * 1. gateway-default.xml - All the configuration variables that the
 + *    Gateway needs.  These are the defaults that ship with the app
 + *    and should only be changed by the app developers.
 + *
 + * 2. gateway-site.xml - The (possibly empty) configuration that the
 + *    system administrator can set variables for their Hadoop cluster.
 + *
 + * To find the gateway configuration files the following process is used.
 + * First, if the GATEWAY_HOME system property contains a valid directory name,
 + * an attempt will be made to read the configuration files from that directory.
 + * Second, if the GATEWAY_HOME environment variable contains a valid directory name,
 + * an attempt will be made to read the configuration files from that directory.
 + * Third, an attempt will be made to load the configuration files from the directory
 + * specified via the "user.dir" system property.
 + * Fourth, an attempt will be made to load the configuration files from the classpath.
 + * Last, defaults will be used for all values will be used.
 + *
 + * If GATEWAY_HOME isn't set via either the system property or environment variable then
 + * a value for this will be defaulted.  The default selected will be the directory that
 + * contained the last loaded configuration file that was not contained in a JAR.  If
 + * no such configuration file is loaded the value of the "user.dir" system property will be used
 + * as the value of GATEWAY_HOME.  This is important to consider for any relative file names as they
 + * will be resolved relative to the value of GATEWAY_HOME.  One such relative value is the
 + * name of the directory containing cluster topologies.  This value default to "clusters".
 + */
 +public class GatewayConfigImpl extends Configuration implements GatewayConfig {
 +
 +  private static final String GATEWAY_DEFAULT_TOPOLOGY_NAME_PARAM = "default.app.topology.name";
 +  private static final String GATEWAY_DEFAULT_TOPOLOGY_NAME = null;
 +
 +  private static final GatewayMessages log = MessagesFactory.get( GatewayMessages.class );
 +
 +  private static final String GATEWAY_CONFIG_DIR_PREFIX = "conf";
 +
 +  private static final String GATEWAY_CONFIG_FILE_PREFIX = "gateway";
 +
 +  private static final String DEFAULT_STACKS_SERVICES_DIR = "services";
 +
 +  private static final String DEFAULT_APPLICATIONS_DIR = "applications";
 +
 +  public static final String[] GATEWAY_CONFIG_FILENAMES = {
 +      GATEWAY_CONFIG_DIR_PREFIX + "/" + GATEWAY_CONFIG_FILE_PREFIX + "-default.xml",
 +      GATEWAY_CONFIG_DIR_PREFIX + "/" + GATEWAY_CONFIG_FILE_PREFIX + "-site.xml"
 +  };
 +
 +//  private static final String[] HADOOP_CONF_FILENAMES = {
 +//      "core-default.xml",
 +//      "core-site.xml"
 +////      "hdfs-default.xml",
 +////      "hdfs-site.xml",
 +////      "mapred-default.xml",
 +////      "mapred-site.xml"
 +//  };
 +
 +//  private static final String[] HADOOP_PREFIX_VARS = {
 +//      "HADOOP_PREFIX",
 +//      "HADOOP_HOME"
 +//  };
 +
 +  public static final String HTTP_HOST = GATEWAY_CONFIG_FILE_PREFIX + ".host";
 +  public static final String HTTP_PORT = GATEWAY_CONFIG_FILE_PREFIX + ".port";
 +  public static final String HTTP_PATH = GATEWAY_CONFIG_FILE_PREFIX + ".path";
 +  public static final String DEPLOYMENT_DIR = GATEWAY_CONFIG_FILE_PREFIX + ".deployment.dir";
 +  public static final String SECURITY_DIR = GATEWAY_CONFIG_FILE_PREFIX + ".security.dir";
 +  public static final String DATA_DIR = GATEWAY_CONFIG_FILE_PREFIX + ".data.dir";
 +  public static final String STACKS_SERVICES_DIR = GATEWAY_CONFIG_FILE_PREFIX + ".services.dir";
 +  public static final String GLOBAL_RULES_SERVICES = GATEWAY_CONFIG_FILE_PREFIX + ".global.rules.services";
 +  public static final String APPLICATIONS_DIR = GATEWAY_CONFIG_FILE_PREFIX + ".applications.dir";
 +  public static final String HADOOP_CONF_DIR = GATEWAY_CONFIG_FILE_PREFIX + ".hadoop.conf.dir";
 +  public static final String FRONTEND_URL = GATEWAY_CONFIG_FILE_PREFIX + ".frontend.url";
 +  private static final String TRUST_ALL_CERTS = GATEWAY_CONFIG_FILE_PREFIX + ".trust.all.certs";
 +  private static final String CLIENT_AUTH_NEEDED = GATEWAY_CONFIG_FILE_PREFIX + ".client.auth.needed";
 +  private static final String CLIENT_AUTH_WANTED = GATEWAY_CONFIG_FILE_PREFIX + ".client.auth.wanted";
 +  private static final String TRUSTSTORE_PATH = GATEWAY_CONFIG_FILE_PREFIX + ".truststore.path";
 +  private static final String TRUSTSTORE_TYPE = GATEWAY_CONFIG_FILE_PREFIX + ".truststore.type";
 +  private static final String KEYSTORE_TYPE = GATEWAY_CONFIG_FILE_PREFIX + ".keystore.type";
 +  private static final String XFORWARDED_ENABLED = GATEWAY_CONFIG_FILE_PREFIX + ".xforwarded.enabled";
 +  private static final String EPHEMERAL_DH_KEY_SIZE = GATEWAY_CONFIG_FILE_PREFIX + ".jdk.tls.ephemeralDHKeySize";
 +  private static final String HTTP_CLIENT_MAX_CONNECTION = GATEWAY_CONFIG_FILE_PREFIX + ".httpclient.maxConnections";
 +  private static final String HTTP_CLIENT_CONNECTION_TIMEOUT = GATEWAY_CONFIG_FILE_PREFIX + ".httpclient.connectionTimeout";
 +  private static final String HTTP_CLIENT_SOCKET_TIMEOUT = GATEWAY_CONFIG_FILE_PREFIX + ".httpclient.socketTimeout";
 +  private static final String THREAD_POOL_MAX = GATEWAY_CONFIG_FILE_PREFIX + ".threadpool.max";
 +  public static final String HTTP_SERVER_REQUEST_BUFFER = GATEWAY_CONFIG_FILE_PREFIX + ".httpserver.requestBuffer";
 +  public static final String HTTP_SERVER_REQUEST_HEADER_BUFFER = GATEWAY_CONFIG_FILE_PREFIX + ".httpserver.requestHeaderBuffer";
 +  public static final String HTTP_SERVER_RESPONSE_BUFFER = GATEWAY_CONFIG_FILE_PREFIX + ".httpserver.responseBuffer";
 +  public static final String HTTP_SERVER_RESPONSE_HEADER_BUFFER = GATEWAY_CONFIG_FILE_PREFIX + ".httpserver.responseHeaderBuffer";
 +  public static final String DEPLOYMENTS_BACKUP_VERSION_LIMIT = GATEWAY_CONFIG_FILE_PREFIX + ".deployment.backup.versionLimit";
 +  public static final String DEPLOYMENTS_BACKUP_AGE_LIMIT = GATEWAY_CONFIG_FILE_PREFIX + ".deployment.backup.ageLimit";
 +  public static final String METRICS_ENABLED = GATEWAY_CONFIG_FILE_PREFIX + ".metrics.enabled";
 +  public static final String JMX_METRICS_REPORTING_ENABLED = GATEWAY_CONFIG_FILE_PREFIX + ".jmx.metrics.reporting.enabled";
 +  public static final String GRAPHITE_METRICS_REPORTING_ENABLED = GATEWAY_CONFIG_FILE_PREFIX + ".graphite.metrics.reporting.enabled";
 +  public static final String GRAPHITE_METRICS_REPORTING_HOST = GATEWAY_CONFIG_FILE_PREFIX + ".graphite.metrics.reporting.host";
 +  public static final String GRAPHITE_METRICS_REPORTING_PORT = GATEWAY_CONFIG_FILE_PREFIX + ".graphite.metrics.reporting.port";
 +  public static final String GRAPHITE_METRICS_REPORTING_FREQUENCY = GATEWAY_CONFIG_FILE_PREFIX + ".graphite.metrics.reporting.frequency";
 +  public static final String GATEWAY_IDLE_TIMEOUT = GATEWAY_CONFIG_FILE_PREFIX + ".idle.timeout";
 +  public static final String REMOTE_IP_HEADER_NAME = GATEWAY_CONFIG_FILE_PREFIX + ".remote.ip.header.name";
 +
 +  /* @since 0.10 Websocket config variables */
 +  public static final String WEBSOCKET_FEATURE_ENABLED = GATEWAY_CONFIG_FILE_PREFIX + ".websocket.feature.enabled";
 +  public static final String WEBSOCKET_MAX_TEXT_MESSAGE_SIZE = GATEWAY_CONFIG_FILE_PREFIX + ".websocket.max.text.size";
 +  public static final String WEBSOCKET_MAX_BINARY_MESSAGE_SIZE = GATEWAY_CONFIG_FILE_PREFIX + ".websocket.max.binary.size";
 +  public static final String WEBSOCKET_MAX_TEXT_MESSAGE_BUFFER_SIZE = GATEWAY_CONFIG_FILE_PREFIX + ".websocket.max.text.buffer.size";
 +  public static final String WEBSOCKET_MAX_BINARY_MESSAGE_BUFFER_SIZE = GATEWAY_CONFIG_FILE_PREFIX + ".websocket.max.binary.buffer.size";
 +  public static final String WEBSOCKET_INPUT_BUFFER_SIZE = GATEWAY_CONFIG_FILE_PREFIX + ".websocket.input.buffer.size";
 +  public static final String WEBSOCKET_ASYNC_WRITE_TIMEOUT = GATEWAY_CONFIG_FILE_PREFIX + ".websocket.async.write.timeout";
 +  public static final String WEBSOCKET_IDLE_TIMEOUT = GATEWAY_CONFIG_FILE_PREFIX + ".websocket.idle.timeout";
 +
 +  /**
 +   * Properties for for gateway port mapping feature
 +   */
 +  public static final String GATEWAY_PORT_MAPPING_PREFIX = GATEWAY_CONFIG_FILE_PREFIX + ".port.mapping.";
 +  public static final String GATEWAY_PORT_MAPPING_REGEX = GATEWAY_CONFIG_FILE_PREFIX + "\\.port\\.mapping\\..*";
 +  public static final String GATEWAY_PORT_MAPPING_ENABLED = GATEWAY_PORT_MAPPING_PREFIX + "enabled";
 +
 +  /**
 +   * Comma seperated list of MIME Types to be compressed by Knox on the way out.
 +   *
 +   * @since 0.12
 +   */
 +  public static final String MIME_TYPES_TO_COMPRESS = GATEWAY_CONFIG_FILE_PREFIX
 +      + ".gzip.compress.mime.types";
 +
 +  // These config property names are not inline with the convention of using the
 +  // GATEWAY_CONFIG_FILE_PREFIX as is done by those above. These are left for
 +  // backward compatibility. 
 +  // LET'S NOT CONTINUE THIS PATTERN BUT LEAVE THEM FOR NOW.
 +  private static final String SSL_ENABLED = "ssl.enabled";
 +  private static final String SSL_EXCLUDE_PROTOCOLS = "ssl.exclude.protocols";
 +  private static final String SSL_INCLUDE_CIPHERS = "ssl.include.ciphers";
 +  private static final String SSL_EXCLUDE_CIPHERS = "ssl.exclude.ciphers";
 +  // END BACKWARD COMPATIBLE BLOCK
 +  
 +  public static final String DEFAULT_HTTP_PORT = "8888";
 +  public static final String DEFAULT_HTTP_PATH = "gateway";
 +  public static final String DEFAULT_DEPLOYMENT_DIR = "deployments";
 +  public static final String DEFAULT_SECURITY_DIR = "security";
 +  public static final String DEFAULT_DATA_DIR = "data";
 +
 +  /* Websocket defaults */
 +  public static final boolean DEFAULT_WEBSOCKET_FEATURE_ENABLED = false;
 +  public static final int DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE = Integer.MAX_VALUE;;
 +  public static final int DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_SIZE = Integer.MAX_VALUE;;
 +  public static final int DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_BUFFER_SIZE = 32768;
 +  public static final int DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_BUFFER_SIZE = 32768;
 +  public static final int DEFAULT_WEBSOCKET_INPUT_BUFFER_SIZE = 4096;
 +  public static final int DEFAULT_WEBSOCKET_ASYNC_WRITE_TIMEOUT = 60000;
 +  public static final int DEFAULT_WEBSOCKET_IDLE_TIMEOUT = 300000;
 +
 +  public static final boolean DEFAULT_GATEWAY_PORT_MAPPING_ENABLED = true;
 +
 +  /**
 +   * Default list of MIME Type to be compressed.
 +   * @since 0.12
 +   */
 +  public static final String DEFAULT_MIME_TYPES_TO_COMPRESS = "text/html, text/plain, text/xml, text/css, "
 +      + "application/javascript, application/x-javascript, text/javascript";
 +
 +  public static final String COOKIE_SCOPING_ENABLED = GATEWAY_CONFIG_FILE_PREFIX + ".scope.cookies.feature.enabled";
 +  public static final boolean DEFAULT_COOKIE_SCOPING_FEATURE_ENABLED = false;
 +  private static final String CRYPTO_ALGORITHM = GATEWAY_CONFIG_FILE_PREFIX + ".crypto.algorithm";
 +  private static final String CRYPTO_PBE_ALGORITHM = GATEWAY_CONFIG_FILE_PREFIX + ".crypto.pbe.algorithm";
 +  private static final String CRYPTO_TRANSFORMATION = GATEWAY_CONFIG_FILE_PREFIX + ".crypto.transformation";
 +  private static final String CRYPTO_SALTSIZE = GATEWAY_CONFIG_FILE_PREFIX + ".crypto.salt.size";
 +  private static final String CRYPTO_ITERATION_COUNT = GATEWAY_CONFIG_FILE_PREFIX + ".crypto.iteration.count";
 +  private static final String CRYPTO_KEY_LENGTH = GATEWAY_CONFIG_FILE_PREFIX + ".crypto.key.length";
 +  public static final String SERVER_HEADER_ENABLED = GATEWAY_CONFIG_FILE_PREFIX + ".server.header.enabled";
 +
 +  private static List<String> DEFAULT_GLOBAL_RULES_SERVICES;
 +
 +
 +  public GatewayConfigImpl() {
 +    init();
 +  }
 +
 +  private String getVar( String variableName, String defaultValue ) {
 +    String value = get( variableName );
 +    if( value == null ) {
 +      value = System.getProperty( variableName );
 +    }
 +    if( value == null ) {
 +      value = System.getenv( variableName );
 +    }
 +    if( value == null ) {
 +      value = defaultValue;
 +    }
 +    return value;
 +  }
 +
 +  private String getGatewayHomeDir() {
 +    String home = get(
 +        GATEWAY_HOME_VAR,
 +        System.getProperty(
 +            GATEWAY_HOME_VAR,
 +            System.getenv( GATEWAY_HOME_VAR ) ) );
 +    return home;
 +  }
 +
 +  private void setGatewayHomeDir( String dir ) {
 +    set( GATEWAY_HOME_VAR, dir );
 +  }
 +
 +  @Override
 +  public String getGatewayConfDir() {
 +    String value = getVar( GATEWAY_CONF_HOME_VAR, getGatewayHomeDir() + File.separator + "conf"  );
-     return value;
++    return FilenameUtils.normalize(value);
 +  }
 +
 +  @Override
 +  public String getGatewayDataDir() {
 +    String systemValue =
 +        System.getProperty(GATEWAY_DATA_HOME_VAR, System.getenv(GATEWAY_DATA_HOME_VAR));
 +    String dataDir = null;
 +    if (systemValue != null) {
 +      dataDir = systemValue;
 +    } else {
 +      dataDir = get(DATA_DIR, getGatewayHomeDir() + File.separator + DEFAULT_DATA_DIR);
 +    }
 +    return dataDir;
 +  }
 +
 +  @Override
 +  public String getGatewayServicesDir() {
 +    return get(STACKS_SERVICES_DIR, getGatewayDataDir() + File.separator + DEFAULT_STACKS_SERVICES_DIR);
 +  }
 +
 +  @Override
 +  public String getGatewayApplicationsDir() {
 +    return get(APPLICATIONS_DIR, getGatewayDataDir() + File.separator + DEFAULT_APPLICATIONS_DIR);
 +  }
 +
 +  @Override
 +  public String getHadoopConfDir() {
 +    return get( HADOOP_CONF_DIR );
 +  }
 +
 +  private void init() {
 +    // Load environment variables.
 +    for( Map.Entry<String, String> e : System.getenv().entrySet() ) {
 +      set( "env." + e.getKey(), e.getValue() );
 +    }
 +    // Load system properties.
 +    for( Map.Entry<Object, Object> p : System.getProperties().entrySet() ) {
 +      set( "sys." + p.getKey().toString(), p.getValue().toString() );
 +    }
 +
 +    URL lastFileUrl = null;
 +    for( String fileName : GATEWAY_CONFIG_FILENAMES ) {
 +      lastFileUrl = loadConfig( fileName, lastFileUrl );
 +    }
 +    //set default services list
 +    setDefaultGlobalRulesServices();
 +
 +    initGatewayHomeDir( lastFileUrl );
 +
 +    // log whether the scoping cookies to the gateway.path feature is enabled
 +    log.cookieScopingFeatureEnabled(isCookieScopingToPathEnabled());
 +  }
 +
 +  private void setDefaultGlobalRulesServices() {
 +    DEFAULT_GLOBAL_RULES_SERVICES = new ArrayList<>();
 +    DEFAULT_GLOBAL_RULES_SERVICES.add("NAMENODE");
 +    DEFAULT_GLOBAL_RULES_SERVICES.add("JOBTRACKER");
 +    DEFAULT_GLOBAL_RULES_SERVICES.add("WEBHDFS");
 +    DEFAULT_GLOBAL_RULES_SERVICES.add("WEBHCAT");
 +    DEFAULT_GLOBAL_RULES_SERVICES.add("OOZIE");
 +    DEFAULT_GLOBAL_RULES_SERVICES.add("WEBHBASE");
 +    DEFAULT_GLOBAL_RULES_SERVICES.add("HIVE");
 +    DEFAULT_GLOBAL_RULES_SERVICES.add("RESOURCEMANAGER");
 +  }
 +
 +  private void initGatewayHomeDir( URL lastFileUrl ) {
 +    String home = System.getProperty( GATEWAY_HOME_VAR );
 +    if( home != null ) {
 +      set( GATEWAY_HOME_VAR, home );
 +      log.settingGatewayHomeDir( "system property", home );
 +      return;
 +    }
 +    home = System.getenv( GATEWAY_HOME_VAR );
 +    if( home != null ) {
 +      set( GATEWAY_HOME_VAR, home );
 +      log.settingGatewayHomeDir( "environment variable", home );
 +      return;
 +    }
 +    if( lastFileUrl != null ) {
 +      File file = new File( lastFileUrl.getFile() ).getAbsoluteFile();
 +      File dir = file.getParentFile().getParentFile(); // Move up two levels to get to parent of conf.
 +      if( dir.exists() && dir.canRead() )
 +        home = dir.getAbsolutePath();
 +      set( GATEWAY_HOME_VAR, home );
 +      log.settingGatewayHomeDir( "configuration file location", home );
 +      return;
 +    }
 +    home = System.getProperty( "user.dir" );
 +    if( home != null ) {
 +      set( GATEWAY_HOME_VAR, home );
 +      log.settingGatewayHomeDir( "user.dir system property", home );
 +      return;
 +    }
 +  }
 +
 +  // 1. GATEWAY_HOME system property
 +  // 2. GATEWAY_HOME environment variable
 +  // 3. user.dir system property
 +  // 4. class path
 +  private URL loadConfig( String fileName, URL lastFileUrl ) {
 +    lastFileUrl = loadConfigFile( System.getProperty( GATEWAY_HOME_VAR ), fileName );
 +    if( lastFileUrl == null ) {
 +      lastFileUrl = loadConfigFile( System.getenv( GATEWAY_HOME_VAR ), fileName );
 +    }
 +    if( lastFileUrl == null ) {
 +      lastFileUrl = loadConfigFile( System.getProperty( "user.dir" ), fileName );
 +    }
 +    if( lastFileUrl == null ) {
 +      lastFileUrl = loadConfigResource( fileName );
 +    }
 +    if( lastFileUrl != null && !"file".equals( lastFileUrl.getProtocol() ) ) {
 +      lastFileUrl = null;
 +    }
 +    return lastFileUrl;
 +  }
 +
 +  private URL loadConfigFile( String dir, String file ) {
 +    URL url = null;
 +    if( dir != null ) {
 +      File f = new File( dir, file );
 +      if( f.exists() ) {
 +        String path = f.getAbsolutePath();
 +        try {
 +          url = f.toURI().toURL();
 +          addResource( new Path( path ) );
 +          log.loadingConfigurationFile( path );
 +        } catch ( MalformedURLException e ) {
 +          log.failedToLoadConfig( path, e );
 +        }
 +      }
 +    }
 +    return url;
 +  }
 +
 +  private URL loadConfigResource( String file ) {
 +    URL url = getResource( file );
 +    if( url != null ) {
 +      log.loadingConfigurationResource( url.toExternalForm() );
 +      addResource( url );
 +    }
 +    return url;
 +  }
 +
 +  @Override
 +  public String getGatewayHost() {
 +    String host = get( HTTP_HOST, "0.0.0.0" );
 +    return host;
 +  }
 +
 +  @Override
 +  public int getGatewayPort() {
 +    return Integer.parseInt( get( HTTP_PORT, DEFAULT_HTTP_PORT ) );
 +  }
 +
 +  @Override
 +  public String getGatewayPath() {
 +    return get( HTTP_PATH, DEFAULT_HTTP_PATH );
 +  }
 +
 +  @Override
 +  public String getGatewayTopologyDir() {
 +    return getGatewayConfDir() + File.separator + "topologies";
 +  }
 +
 +  @Override
 +  public String getGatewayDeploymentDir() {
 +    return get(DEPLOYMENT_DIR, getGatewayDataDir() + File.separator + DEFAULT_DEPLOYMENT_DIR);
 +  }
 +
 +  @Override
 +  public String getGatewaySecurityDir() {
 +    return get(SECURITY_DIR, getGatewayDataDir() + File.separator + DEFAULT_SECURITY_DIR);
 +  }
 +
 +  @Override
 +  public InetSocketAddress getGatewayAddress() throws UnknownHostException {
 +    String host = getGatewayHost();
 +    int port = getGatewayPort();
 +    InetSocketAddress address = new InetSocketAddress( host, port );
 +    return address;
 +  }
 +
 +  @Override
 +  public boolean isSSLEnabled() {
 +    String enabled = get( SSL_ENABLED, "true" );
 +    
 +    return "true".equals(enabled);
 +  }
 +
 +  @Override
 +  public boolean isHadoopKerberosSecured() {
 +    String hadoopKerberosSecured = get( HADOOP_KERBEROS_SECURED, "false" );
 +    return "true".equals(hadoopKerberosSecured);
 +  }
 +
 +  @Override
 +  public String getKerberosConfig() {
 +    return get( KRB5_CONFIG ) ;
 +  }
 +
 +  @Override
 +  public boolean isKerberosDebugEnabled() {
 +    String kerberosDebugEnabled = get( KRB5_DEBUG, "false" );
 +    return "true".equals(kerberosDebugEnabled);
 +  }
 +  
 +  @Override
 +  public String getKerberosLoginConfig() {
 +    return get( KRB5_LOGIN_CONFIG );
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getDefaultTopologyName()
 +   */
 +  @Override
 +  public String getDefaultTopologyName() {
 +    String name = get(GATEWAY_DEFAULT_TOPOLOGY_NAME_PARAM);
 +    return name != null ? name : GATEWAY_DEFAULT_TOPOLOGY_NAME;
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getDefaultAppRedirectPath()
 +   */
 +  @Override
 +  public String getDefaultAppRedirectPath() {
 +    String defTopo = getDefaultTopologyName();
 +    if( defTopo == null ) {
 +      return null;
 +    } else {
 +      return "/" + getGatewayPath() + "/" + defTopo;
 +    }
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getFrontendUrl()
 +   */
 +  @Override
 +  public String getFrontendUrl() {
 +    String url = get( FRONTEND_URL, null );
 +    return url;
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getExcludedSSLProtocols()
 +   */
 +  @Override
 +  public List<String> getExcludedSSLProtocols() {
 +    List<String> protocols = null;
 +    String value = get(SSL_EXCLUDE_PROTOCOLS);
 +    if (!"none".equals(value)) {
 +      protocols = Arrays.asList(value.split("\\s*,\\s*"));
 +    }
 +    return protocols;
 +  }
 +
 +  @Override
 +  public List<String> getIncludedSSLCiphers() {
 +    List<String> list = null;
 +    String value = get(SSL_INCLUDE_CIPHERS);
 +    if (value != null && !value.isEmpty() && !"none".equalsIgnoreCase(value.trim())) {
 +      list = Arrays.asList(value.trim().split("\\s*,\\s*"));
 +    }
 +    return list;
 +  }
 +
 +  @Override
 +  public List<String> getExcludedSSLCiphers() {
 +    List<String> list = null;
 +    String value = get(SSL_EXCLUDE_CIPHERS);
 +    if (value != null && !value.isEmpty() && !"none".equalsIgnoreCase(value.trim())) {
 +      list = Arrays.asList(value.trim().split("\\s*,\\s*"));
 +    }
 +    return list;
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#isClientAuthNeeded()
 +   */
 +  @Override
 +  public boolean isClientAuthNeeded() {
 +    String clientAuthNeeded = get( CLIENT_AUTH_NEEDED, "false" );
 +    return "true".equals(clientAuthNeeded);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see org.apache.knox.gateway.config.GatewayConfig#isClientAuthWanted()
 +   */
 +  @Override
 +  public boolean isClientAuthWanted() {
 +    String clientAuthWanted = get( CLIENT_AUTH_WANTED, "false" );
 +    return "true".equals(clientAuthWanted);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getTruststorePath()
 +   */
 +  @Override
 +  public String getTruststorePath() {
 +    return get( TRUSTSTORE_PATH, null);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getTrustAllCerts()
 +   */
 +  @Override
 +  public boolean getTrustAllCerts() {
 +    String trustAllCerts = get( TRUST_ALL_CERTS, "false" );
 +    return "true".equals(trustAllCerts);
 +  }
 +  
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getTruststorePath()
 +   */
 +  @Override
 +  public String getTruststoreType() {
 +    return get( TRUSTSTORE_TYPE, "JKS");
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getTruststorePath()
 +   */
 +  @Override
 +  public String getKeystoreType() {
 +    return get( KEYSTORE_TYPE, "JKS");
 +  }
 +
 +  @Override
 +  public boolean isXForwardedEnabled() {
 +    String xForwardedEnabled = get( XFORWARDED_ENABLED, "true" );
 +    return "true".equals(xForwardedEnabled);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getEphemeralDHKeySize()
 +   */
 +  @Override
 +  public String getEphemeralDHKeySize() {
 +    return get( EPHEMERAL_DH_KEY_SIZE, "2048");
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getHttpClientMaxConnections()
 +   */
 +  @Override
 +  public int getHttpClientMaxConnections() {
 +    return getInt( HTTP_CLIENT_MAX_CONNECTION, 32 );
 +  }
 +
 +  @Override
 +  public int getHttpClientConnectionTimeout() {
 +    int t = -1;
 +    String s = get( HTTP_CLIENT_CONNECTION_TIMEOUT, null );
 +    if ( s != null ) {
 +      try {
 +        t = (int)parseNetworkTimeout( s );
 +      } catch ( Exception e ) {
 +        // Ignore it and use the default.
 +      }
 +    }
 +    return t;
 +  }
 +
 +  @Override
 +  public int getHttpClientSocketTimeout() {
 +    int t = -1;
 +    String s = get( HTTP_CLIENT_SOCKET_TIMEOUT, null );
 +    if ( s != null ) {
 +      try {
 +        t = (int)parseNetworkTimeout( s );
 +      } catch ( Exception e ) {
 +        // Ignore it and use the default.
 +      }
 +    }
 +    return t;
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#getThreadPoolMax()
 +   */
 +  @Override
 +  public int getThreadPoolMax() {
 +    int i = getInt( THREAD_POOL_MAX, 254 );
 +    // Testing has shown that a value lower than 5 prevents Jetty from servicing request.
 +    if( i < 5 ) {
 +      i = 5;
 +    }
 +    return i;
 +  }
 +
 +  @Override
 +  public int getHttpServerRequestBuffer() {
 +    int i = getInt( HTTP_SERVER_REQUEST_BUFFER, 16 * 1024 );
 +    return i;
 +  }
 +
 +  @Override
 +  public int getHttpServerRequestHeaderBuffer() {
 +    int i = getInt( HTTP_SERVER_REQUEST_HEADER_BUFFER, 8 * 1024 );
 +    return i;
 +  }
 +
 +  @Override
 +  public int getHttpServerResponseBuffer() {
 +    int i = getInt( HTTP_SERVER_RESPONSE_BUFFER, 32 * 1024 );
 +    return i;
 +  }
 +
 +  @Override
 +  public int getHttpServerResponseHeaderBuffer() {
 +    int i = getInt( HTTP_SERVER_RESPONSE_HEADER_BUFFER, 8 * 1024 );
 +    return i;
 +  }
 +
 +  @Override
 +  public int getGatewayDeploymentsBackupVersionLimit() {
 +    int i = getInt( DEPLOYMENTS_BACKUP_VERSION_LIMIT, 5 );
 +    if( i < 0 ) {
 +      i = -1;
 +    }
 +    return i;
 +  }
 +
 +  @Override
 +  public long getGatewayIdleTimeout() {
 +    return getLong(GATEWAY_IDLE_TIMEOUT, 300000l);
 +  }
 +
 +  @Override
 +  public long getGatewayDeploymentsBackupAgeLimit() {
 +    PeriodFormatter f = new PeriodFormatterBuilder().appendDays().toFormatter();
 +    String s = get( DEPLOYMENTS_BACKUP_AGE_LIMIT, "-1" );
 +    long d;
 +    try {
 +      Period p = Period.parse( s, f );
 +      d = p.toStandardDuration().getMillis();
 +      if( d < 0 ) {
 +        d = -1;
 +      }
 +    } catch( Exception e ) {
 +      d = -1;
 +    }
 +    return d;
 +  }
 +
 +  @Override
 +  public String getSigningKeystoreName() {
 +    return get(SIGNING_KEYSTORE_NAME);
 +  }
 +
 +  @Override
 +  public String getSigningKeyAlias() {
 +    return get(SIGNING_KEY_ALIAS);
 +  }
 +
 +  @Override
 +  public List<String> getGlobalRulesServices() {
 +    String value = get( GLOBAL_RULES_SERVICES );
 +    if ( value != null && !value.isEmpty() && !"none".equalsIgnoreCase(value.trim()) ) {
 +      return Arrays.asList( value.trim().split("\\s*,\\s*") );
 +    }
 +    return DEFAULT_GLOBAL_RULES_SERVICES;
 +  }
 +
 +  @Override
 +  public boolean isMetricsEnabled() {
 +    String metricsEnabled = get( METRICS_ENABLED, "false" );
 +    return "true".equals(metricsEnabled);
 +  }
 +
 +  @Override
 +  public boolean isJmxMetricsReportingEnabled() {
 +    String enabled = get( JMX_METRICS_REPORTING_ENABLED, "false" );
 +    return "true".equals(enabled);
 +  }
 +
 +  @Override
 +  public boolean isGraphiteMetricsReportingEnabled() {
 +    String enabled = get( GRAPHITE_METRICS_REPORTING_ENABLED, "false" );
 +    return "true".equals(enabled);
 +  }
 +
 +  @Override
 +  public String getGraphiteHost() {
 +    String host = get( GRAPHITE_METRICS_REPORTING_HOST, "localhost" );
 +    return host;
 +  }
 +
 +  @Override
 +  public int getGraphitePort() {
 +    int i = getInt( GRAPHITE_METRICS_REPORTING_PORT, 32772 );
 +    return i;
 +  }
 +
 +  @Override
 +  public int getGraphiteReportingFrequency() {
 +    int i = getInt( GRAPHITE_METRICS_REPORTING_FREQUENCY, 1 );
 +    return i;
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#isWebsocketEnabled()
 +   */
 +  @Override
 +  public boolean isWebsocketEnabled() {
 +    final String result = get( WEBSOCKET_FEATURE_ENABLED, Boolean.toString(DEFAULT_WEBSOCKET_FEATURE_ENABLED));
 +    return Boolean.parseBoolean(result);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#websocketMaxTextMessageSize()
 +   */
 +  @Override
 +  public int getWebsocketMaxTextMessageSize() {
 +    return getInt( WEBSOCKET_MAX_TEXT_MESSAGE_SIZE, DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#websocketMaxBinaryMessageSize()
 +   */
 +  @Override
 +  public int getWebsocketMaxBinaryMessageSize() {
 +    return getInt( WEBSOCKET_MAX_BINARY_MESSAGE_SIZE, DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_SIZE);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#websocketMaxTextMessageBufferSize()
 +   */
 +  @Override
 +  public int getWebsocketMaxTextMessageBufferSize() {
 +    return getInt( WEBSOCKET_MAX_TEXT_MESSAGE_BUFFER_SIZE, DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_BUFFER_SIZE);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#websocketMaxBinaryMessageBufferSize()
 +   */
 +  @Override
 +  public int getWebsocketMaxBinaryMessageBufferSize() {
 +    return getInt( WEBSOCKET_MAX_BINARY_MESSAGE_BUFFER_SIZE, DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_BUFFER_SIZE);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#websocketInputBufferSize()
 +   */
 +  @Override
 +  public int getWebsocketInputBufferSize() {
 +    return getInt( WEBSOCKET_INPUT_BUFFER_SIZE, DEFAULT_WEBSOCKET_INPUT_BUFFER_SIZE);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#websocketAsyncWriteTimeout()
 +   */
 +  @Override
 +  public int getWebsocketAsyncWriteTimeout() {
 +    return getInt( WEBSOCKET_ASYNC_WRITE_TIMEOUT, DEFAULT_WEBSOCKET_ASYNC_WRITE_TIMEOUT);
 +  }
 +
 +  /* (non-Javadoc)
 +   * @see GatewayConfig#websocketIdleTimeout()
 +   */
 +  @Override
 +  public int getWebsocketIdleTimeout() {
 +    return getInt( WEBSOCKET_IDLE_TIMEOUT, DEFAULT_WEBSOCKET_IDLE_TIMEOUT);
 +  }
 +
 +  /*
 +   * (non-Javadoc)
 +   *
 +   * @see
 +   * GatewayConfig#getMimeTypesToCompress()
 +   */
 +  @Override
 +  public List<String> getMimeTypesToCompress() {
 +    List<String> mimeTypes = null;
 +    String value = get(MIME_TYPES_TO_COMPRESS, DEFAULT_MIME_TYPES_TO_COMPRESS);
 +    if (value != null && !value.isEmpty()) {
 +      mimeTypes = Arrays.asList(value.trim().split("\\s*,\\s*"));
 +    }
 +    return mimeTypes;
 +  }
 +
 +  /**
 +   * Map of Topology names and their ports.
 +   *
 +   * @return
 +   */
 +  @Override
 +  public Map<String, Integer> getGatewayPortMappings() {
 +
 +    final Map<String, Integer> result = new ConcurrentHashMap<String, Integer>();
 +    final Map<String, String> properties = getValByRegex(GATEWAY_PORT_MAPPING_REGEX);
 +
 +    // Convert port no. from string to int
 +    for(final Map.Entry<String, String> e : properties.entrySet()) {
 +      // ignore the GATEWAY_PORT_MAPPING_ENABLED property
 +      if(!e.getKey().equalsIgnoreCase(GATEWAY_PORT_MAPPING_ENABLED)) {
 +        // extract the topology name and use it as a key
 +        result.put(StringUtils.substringAfter(e.getKey(), GATEWAY_PORT_MAPPING_PREFIX), Integer.parseInt(e.getValue()) );
 +      }
 +
 +    }
 +
 +    return Collections.unmodifiableMap(result);
 +  }
 +
 +  /**
 +   * Is the Port Mapping feature on ?
 +   *
 +   * @return
 +   */
 +  @Override
 +  public boolean isGatewayPortMappingEnabled() {
 +    final String result = get( GATEWAY_PORT_MAPPING_ENABLED, Boolean.toString(DEFAULT_GATEWAY_PORT_MAPPING_ENABLED));
 +    return Boolean.parseBoolean(result);
 +  }
 +
 +  private static long parseNetworkTimeout(String s ) {
 +    PeriodFormatter f = new PeriodFormatterBuilder()
 +        .appendMinutes().appendSuffix("m"," min")
 +        .appendSeconds().appendSuffix("s"," sec")
 +        .appendMillis().toFormatter();
 +    Period p = Period.parse( s, f );
 +    return p.toStandardDuration().getMillis();
 +  }
 +
 +  @Override
 +  public boolean isCookieScopingToPathEnabled() {
 +    final boolean result = Boolean.parseBoolean(get(COOKIE_SCOPING_ENABLED,
 +            Boolean.toString(DEFAULT_COOKIE_SCOPING_FEATURE_ENABLED)));
 +    return result;
 +  }
 +
 +  @Override
 +  public String getHeaderNameForRemoteAddress() {
 +    String value = getVar(REMOTE_IP_HEADER_NAME, "X-Forwarded-For");
 +    return value;
 +  }
 +
 +  @Override
 +  public String getAlgorithm() {
 +	return getVar(CRYPTO_ALGORITHM, null);
 +  }
 +
 +  @Override
 +  public String getPBEAlgorithm() {
 +	return getVar(CRYPTO_PBE_ALGORITHM, null);
 +  }
 +
 +  @Override
 +  public String getTransformation() {
 +	return getVar(CRYPTO_TRANSFORMATION, null);
 +  }
 +
 +  @Override
 +  public String getSaltSize() {
 +	return getVar(CRYPTO_SALTSIZE, null);
 +  }
 +
 +  @Override
 +  public String getIterationCount() {
 +	return getVar(CRYPTO_ITERATION_COUNT, null);
 +  }
 +
 +  @Override
 +  public String getKeyLength() {
 +	return getVar(CRYPTO_KEY_LENGTH, null);
 +  }
 +
 +  @Override
 +  public boolean isGatewayServerHeaderEnabled() {
 +    return Boolean.parseBoolean(getVar(SERVER_HEADER_ENABLED, "true"));
 +  }
 +}


Mime
View raw message