private boolean validateAddTenant()

in custos-services/custos-core-services/tenant-profile-core-service/src/main/java/org/apache/custos/tenant/profile/validator/TenantProfileInputValidator.java [72:122]


    private boolean validateAddTenant(Object obj) {
        if (obj instanceof Tenant) {
            Tenant tenant = (Tenant) obj;

            if (tenant.getClientName() == null || tenant.getClientName().trim() == "") {
                throw new MissingParameterException("Client name should not be null", null);
            }

            if (tenant.getDomain() == null || tenant.getDomain().trim() == "") {
                throw new MissingParameterException(" Domain should not be null", null);
            }


            if (tenant.getAdminFirstName() == null || tenant.getAdminFirstName().trim() == "") {
                throw new MissingParameterException(" Admin first name should not be null", null);
            }

            if (tenant.getAdminLastName() == null || tenant.getAdminLastName().trim() == "") {
                throw new MissingParameterException(" Admin last name should not be null", null);
            }

            if (tenant.getAdminEmail() == null || tenant.getAdminEmail().trim() == "") {
                throw new MissingParameterException(" Admin email should not be null", null);
            }

            if (tenant.getAdminUsername() == null || tenant.getAdminUsername().trim() == "") {
                throw new MissingParameterException(" Admin username should not be null", null);
            }

            if (tenant.getAdminPassword() == null || tenant.getAdminPassword().trim() == "") {
                throw new MissingParameterException(" Admin password should not be null", null);
            }

            if (tenant.getRequesterEmail() == null || tenant.getRequesterEmail().trim() == "") {
                throw new MissingParameterException("Admin requester email  should not be null", null);
            }

            if (tenant.getRedirectUrisCount() == 0) {
                throw new MissingParameterException("Redirect uris cannot be  should not be null", null);
            }

//            if (tenant.getJwksCount() > 0 && (tenant.getJwksUri() != null && !tenant.getJwksUri().trim().equals(""))) {
//                throw new RuntimeException("jwks and jwks both should not be present in a single request", null);
//            }


        } else {
            throw new RuntimeException("Unexpected input type for method addTenant");
        }
        return true;
    }