tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static boolean areSDBInputsValid(Safe safe) {
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
				put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER).toString()).
				put(LogMessage.ACTION, "areSDBInputsValid").
				put(LogMessage.MESSAGE, "Start validating input parameters for SDB creation").
				put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL).toString()).
				build()));
		if (safe == null) {
			return false;
		}
		SafeBasicDetails safeBasicDetails = safe.getSafeBasicDetails();
		if (safeBasicDetails == null) {
			return false;
		}
		String sdbName = safeBasicDetails.getName();
		String sdbOwner = safeBasicDetails.getOwner();
		String sdbDescription = safeBasicDetails.getDescription();
		String appName=safeBasicDetails.getAppName();
		String path = safe.getPath();
		if (StringUtils.isEmpty(sdbName) 
				|| StringUtils.isEmpty(sdbOwner) 
				|| StringUtils.isEmpty(sdbDescription) 
				|| StringUtils.isEmpty(path) 
				|| StringUtils.isEmpty(appName) 
				) {
			return false;
		}
		if(appName != null ) {
			String applicationName=appName.trim();
			if(StringUtils.isEmpty(applicationName)) {
				return false;
			}
		}
		if (!isSdbNameValid(sdbName) || sdbName.length() > 40 || !sdbName.equals(sdbName.toLowerCase())) {
			return false;
		}
		String safeName = getSafeName(path);
		if (!sdbName.equals(safeName)) {
			return false;
		}
		
		if (!EmailValidator.getInstance().isValid(sdbOwner)) {
			return false;
		}
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
				put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER).toString()).
				put(LogMessage.ACTION, "areSDBInputsValid").
				put(LogMessage.MESSAGE, "Input parameter validation completed").
				put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL).toString()).
				build()));
		return true;
	}
/**
	 * Validates inputs values required for SDB creation
	 * @param safe
	 * @return
	 */
Validates inputs values required for SDB creation
@param safe
@return
Validates inputs values required for SDB creation @param safe @return
public static boolean areSDBInputsValid(Safe safe) {
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
				put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER).toString()).
				put(LogMessage.ACTION, "areSDBInputsValid").
				put(LogMessage.MESSAGE, "Start validating input parameters for SDB creation").
				put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL).toString()).
				build()));
		if (safe == null) {
			return false;
		}
		SafeBasicDetails safeBasicDetails = safe.getSafeBasicDetails();
		if (safeBasicDetails == null) {
			return false;
		}
		String sdbName = safeBasicDetails.getName();
		String sdbOwner = safeBasicDetails.getOwner();
		String sdbDescription = safeBasicDetails.getDescription();
		String appName=safeBasicDetails.getAppName();
		String path = safe.getPath();
		if (StringUtils.isEmpty(sdbName) 
				|| StringUtils.isEmpty(sdbOwner) 
				|| StringUtils.isEmpty(sdbDescription) 
				|| StringUtils.isEmpty(path) 
				|| StringUtils.isEmpty(appName) 
				) {
			return false;
		}
		if(appName != null ) {
			String applicationName=appName.trim();
			if(StringUtils.isEmpty(applicationName)) {
				return false;
			}
		}
		if (!isSdbNameValid(sdbName) || sdbName.length() > 40 || !sdbName.equals(sdbName.toLowerCase())) {
			return false;
		}
		String safeName = getSafeName(path);
		if (!sdbName.equals(safeName)) {
			return false;
		}
		if (!EmailValidator.getInstance().isValid(sdbOwner)) {
			return false;
		}
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
				put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER).toString()).
				put(LogMessage.ACTION, "areSDBInputsValid").
				put(LogMessage.MESSAGE, "Input parameter validation completed").
				put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL).toString()).
				build()));
		return true;
	}
public static boolean areSDBInputsValid ( Safe safe ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) . toString ( ) ) . put ( LogMessage . ACTION , "areSDBInputsValid" ) . put ( LogMessage . MESSAGE , "Start validating input parameters for SDB creation" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) . toString ( ) ) . build ( ) ) ) ; if ( safe == null ) { return false ; } SafeBasicDetails safeBasicDetails = safe . getSafeBasicDetails ( ) ; if ( safeBasicDetails == null ) { return false ; } String sdbName = safeBasicDetails . getName ( ) ; String sdbOwner = safeBasicDetails . getOwner ( ) ; String sdbDescription = safeBasicDetails . getDescription ( ) ; String appName = safeBasicDetails . getAppName ( ) ; String path = safe . getPath ( ) ; if ( StringUtils . isEmpty ( sdbName ) || StringUtils . isEmpty ( sdbOwner ) || StringUtils . isEmpty ( sdbDescription ) || StringUtils . isEmpty ( path ) || StringUtils . isEmpty ( appName ) ) { return false ; } if ( appName != null ) { String applicationName = appName . trim ( ) ; if ( StringUtils . isEmpty ( applicationName ) ) { return false ; } } if ( ! isSdbNameValid ( sdbName ) || sdbName . length ( ) > 40 || ! sdbName . equals ( sdbName . toLowerCase ( ) ) ) { return false ; } String safeName = getSafeName ( path ) ; if ( ! sdbName . equals ( safeName ) ) { return false ; } if ( ! EmailValidator . getInstance ( ) . isValid ( sdbOwner ) ) { return false ; } log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) . toString ( ) ) . put ( LogMessage . ACTION , "areSDBInputsValid" ) . put ( LogMessage . MESSAGE , "Input parameter validation completed" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) . toString ( ) ) . build ( ) ) ) ; return true ; }
Validates inputs values required for SDB creation
 @param safe
 @return
Validates inputs values required for SDB creation @param safe @return