/** * Tests the Object 'value': * if its null, return default. * if its a Boolean, return booleanValue() * if its an Integer, return 'false' if its '0' else 'true' * if its a String, return 'false' if its 'false', 'no', or '0' - else 'true' * All other types return 'true' */ public static boolean isTrue(Object value, boolean defaultVal) { return !isFalseExplicitly(value, !defaultVal); }
/** * Tests the Object 'value': * if its null, return default. * if its a Boolean, return booleanValue() * if its an Integer, return 'false' if its '0' else 'true' * if its a String, return 'false' if its 'false', 'no', or '0' - else 'true' * All other types return 'true' */ public static boolean isFalse(Object value, boolean defaultVal) { return isFalseExplicitly(value, defaultVal); }
/** * Tests the String 'value': * return 'true' if its 'false', '0', or 'no' - else 'false' * <p/> * Follow in 'C' tradition of boolean values: * false is specific (0), everything else is true; */ public static boolean isFalse(String value) { return isFalseExplicitly(value); }
/** * Tests the String 'value': * return 'false' if its 'false', '0', or 'no' - else 'true' * <p/> * Follow in 'C' tradition of boolean values: * false is specific (0), everything else is true; */ public static boolean isTrue(String value) { return !isFalseExplicitly(value); }
/** * Tests the String 'value': * return 'true' if its 'false', '0', or 'no' - else 'false' * <p/> * Follow in 'C' tradition of boolean values: * false is specific (0), everything else is true; */ public static boolean isFalse(String value) { return isFalseExplicitly(value); }
/** * Tests the Object 'value': * if its null, return default. * if its a Boolean, return booleanValue() * if its an Integer, return 'false' if its '0' else 'true' * if its a String, return 'false' if its 'false', 'no', or '0' - else 'true' * All other types return 'true' */ public static boolean isFalse(Object value, boolean defaultVal) { return isFalseExplicitly(value, defaultVal); }
/** * Tests the String 'value': * return 'false' if its 'false', '0', or 'no' - else 'true' * <p/> * Follow in 'C' tradition of boolean values: * false is specific (0), everything else is true; */ public static boolean isTrue(String value) { return !isFalseExplicitly(value); }
/** * Tests the Object 'value': * if its null, return default. * if its a Boolean, return booleanValue() * if its an Integer, return 'false' if its '0' else 'true' * if its a String, return 'false' if its 'false', 'no', or '0' - else 'true' * All other types return 'true' */ public static boolean isTrue(Object value, boolean defaultVal) { return !isFalseExplicitly(value, !defaultVal); }
public static boolean isFalseExplicitly(Object value) { return isFalseExplicitly(value, true); }
public static boolean isFalseExplicitly(Object value) { return isFalseExplicitly(value, true); }
/** * Tests the Object 'value': * if its null, return default. * if its a Boolean, return !booleanValue() * if its an Integer, return 'true' if its '0' else 'false' * if its a String, return isFalseExplicitly((String)value). * All other types return 'false' */ public static boolean isFalseExplicitly(Object value, boolean defaultVal) { if (value == null) { return defaultVal; } if (value instanceof Boolean) { return !((Boolean) value).booleanValue(); } if (value instanceof Integer) { return ((Integer) value).intValue() == 0; } if (value instanceof String) { return isFalseExplicitly((String) value); } return false; }
/** * Checks whether exposing the WSDL & WSDL elements such as schema & policy have been allowed * * @param service The AxisService which needs to be verified * @throws IOException If exposing WSDL & WSDL elements has been restricted. * @return true - if service metadata can be exposed, false - otherwise */ private boolean canExposeServiceMetadata(AxisService service) { Parameter exposeServiceMetadata = service.getParameter("exposeServiceMetadata"); if(exposeServiceMetadata != null && JavaUtils.isFalseExplicitly(exposeServiceMetadata.getValue())) { return false; } return true; }
/** * Checks whether exposing the WSDL & WSDL elements such as schema & policy have been allowed * * @param service The AxisService which needs to be verified * @throws IOException If exposing WSDL & WSDL elements has been restricted. * @return true - if service metadata can be exposed, false - otherwise */ private boolean canExposeServiceMetadata(AxisService service) { Parameter exposeServiceMetadata = service.getParameter("exposeServiceMetadata"); if(exposeServiceMetadata != null && JavaUtils.isFalseExplicitly(exposeServiceMetadata.getValue())) { return false; } return true; }
/** * Checks whether exposing the WSDL & WSDL elements such as schema & policy have been allowed * * @param service The AxisService which needs to be verified * @throws IOException If exposing WSDL & WSDL elements has been restricted. * @return true - if service metadata can be exposed, false - otherwise */ private boolean canExposeServiceMetadata(AxisService service) throws IOException { Parameter exposeServiceMetadata = service.getParameter("exposeServiceMetadata"); if (exposeServiceMetadata != null && JavaUtils.isFalseExplicitly(exposeServiceMetadata.getValue())) { return false; } return true; }
/** * Checks whether exposing the WSDL & WSDL elements such as schema & policy have been allowed * * @param service The AxisService which needs to be verified * @throws IOException If exposing WSDL & WSDL elements has been restricted. * @return true - if service metadata can be exposed, false - otherwise */ private boolean canExposeServiceMetadata(AxisService service) throws IOException { Parameter exposeServiceMetadata = service.getParameter("exposeServiceMetadata"); if (exposeServiceMetadata != null && JavaUtils.isFalseExplicitly(exposeServiceMetadata.getValue())) { return false; } return true; }
/** * This method is used to find whether an axis2service is declared as hidden using the * "hiddenService" param * * @param axisService - the service of interest * @return true if is declared as hidden, false if not */ public static boolean isHiddenService(AxisService axisService) { boolean hideService = false; Parameter hiddenServiceParam; hiddenServiceParam = axisService.getParameter(Constants.HIDDEN_SERVICE_PARAM_NAME); if (hiddenServiceParam != null) { hideService = !JavaUtils.isFalseExplicitly(hiddenServiceParam.getValue()); } return hideService; } }
/** * This method is used to find whether an axis2service is declared as hidden using the * "hiddenService" param * * @param axisService - the service of interest * @return true if is declared as hidden, false if not */ public static boolean isHiddenService(AxisService axisService) { boolean hideService = false; Parameter hiddenServiceParam; hiddenServiceParam = axisService.getParameter(Constants.HIDDEN_SERVICE_PARAM_NAME); if (hiddenServiceParam != null) { hideService = !JavaUtils.isFalseExplicitly(hiddenServiceParam.getValue()); } return hideService; } }
@Override public boolean authenticateClient(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception { OAuth2AccessTokenReqDTO oAuth2AccessTokenReqDTO = tokReqMsgCtx.getOauth2AccessTokenReqDTO(); //Skipping credential validation for saml2 bearer if not configured as needed if (StringUtils.isEmpty(oAuth2AccessTokenReqDTO.getClientSecret()) && org.wso2.carbon.identity.oauth.common .GrantType.SAML20_BEARER.toString().equals(oAuth2AccessTokenReqDTO.getGrantType()) && JavaUtils .isFalseExplicitly(authConfig)) { if (log.isDebugEnabled()) { log.debug("Grant type : " + oAuth2AccessTokenReqDTO.getGrantType() + " " + "Strict client validation set to : " + authConfig + " Authenticating without client secret"); } return true; } if (log.isDebugEnabled()) { log.debug("Grant type : " + oAuth2AccessTokenReqDTO.getGrantType() + " " + "Strict client validation set to : " + authConfig); } return false; } }
/** * Initializes the Axis2 parameters. */ protected void initParams() { Parameter parameter; // do we need to completely disable REST support parameter = axisConfiguration.getParameter(Constants.Configuration.DISABLE_REST); if (parameter != null) { disableREST = !JavaUtils.isFalseExplicitly(parameter.getValue()); } // Should we close the reader(s) parameter = axisConfiguration.getParameter("axis2.close.reader"); if (parameter != null) { closeReader = JavaUtils.isTrueExplicitly(parameter.getValue()); } }
/** * Initializes the Axis2 parameters. */ protected void initParams() { Parameter parameter; // do we need to completely disable REST support parameter = axisConfiguration.getParameter(Constants.Configuration.DISABLE_REST); if (parameter != null) { disableREST = !JavaUtils.isFalseExplicitly(parameter.getValue()); } // Should we close the reader(s) parameter = axisConfiguration.getParameter("axis2.close.reader"); if (parameter != null) { closeReader = JavaUtils.isTrueExplicitly(parameter.getValue()); } }