Search in sources :

Example 16 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxTrust by GluuFederation.

the class ViewLogFileAction method prepareLogFiles.

private Map<Integer, String> prepareLogFiles() {
    Map<Integer, String> logFiles = new HashMap<Integer, String>();
    int fileIndex = 0;
    for (SimpleCustomProperty logTemplate : this.logViewerConfiguration.getLogTemplates()) {
        String logTemplatePattern = logTemplate.getValue2();
        if (StringHelper.isEmpty(logTemplatePattern)) {
            continue;
        }
        String logTemplatePath = FilenameUtils.getFullPath(logTemplatePattern);
        String logTemplateFile = FilenameUtils.getName(logTemplatePattern);
        File logTemplateBaseDir = new File(logTemplatePath);
        FileFilter fileFilter = new AndFileFilter(FileFileFilter.FILE, new WildcardFileFilter(logTemplateFile));
        File[] files = logTemplateBaseDir.listFiles(fileFilter);
        if (files == null) {
            continue;
        }
        for (int i = 0; i < files.length; i++) {
            logFiles.put(fileIndex++, files[i].getPath());
        }
    }
    return logFiles;
}
Also used : AndFileFilter(org.apache.commons.io.filefilter.AndFileFilter) HashMap(java.util.HashMap) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty) AndFileFilter(org.apache.commons.io.filefilter.AndFileFilter) FileFileFilter(org.apache.commons.io.filefilter.FileFileFilter) FileFilter(java.io.FileFilter) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter) File(java.io.File) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter)

Example 17 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxTrust by GluuFederation.

the class ExternalIdGeneratorService method executeExternalGenerateIdMethod.

public String executeExternalGenerateIdMethod(CustomScriptConfiguration customScriptConfiguration, String appId, String idType, String idPrefix) {
    try {
        log.debug("Executing python 'generateId' method");
        IdGeneratorType externalType = (IdGeneratorType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        return externalType.generateId(appId, idType, idPrefix, configurationAttributes);
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
    }
    return null;
}
Also used : IdGeneratorType(org.xdi.model.custom.script.type.id.IdGeneratorType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Example 18 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxTrust by GluuFederation.

the class ExternalScimService method executeScimDeleteGroupMethod.

public boolean executeScimDeleteGroupMethod(GluuGroup group, CustomScriptConfiguration customScriptConfiguration) {
    try {
        log.debug("Executing python 'SCIM Delete Group' method");
        ScimType externalType = (ScimType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        boolean result = externalType.deleteGroup(group, configurationAttributes);
        log.debug("executeScimDeleteGroupMethod result = " + result);
        return result;
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return false;
}
Also used : ScimType(org.xdi.model.custom.script.type.scim.ScimType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Example 19 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxTrust by GluuFederation.

the class ExternalScimService method executeScimDeleteUserMethod.

public boolean executeScimDeleteUserMethod(GluuCustomPerson user, CustomScriptConfiguration customScriptConfiguration) {
    try {
        log.debug("Executing python 'SCIM Delete User' method");
        ScimType externalType = (ScimType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        boolean result = externalType.deleteUser(user, configurationAttributes);
        log.debug("executeScimDeleteUserMethod result = " + result);
        return result;
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return false;
}
Also used : ScimType(org.xdi.model.custom.script.type.scim.ScimType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Example 20 with SimpleCustomProperty

use of org.xdi.model.SimpleCustomProperty in project oxTrust by GluuFederation.

the class ExternalScimService method executeScimCreateUserMethod.

public boolean executeScimCreateUserMethod(GluuCustomPerson user, CustomScriptConfiguration customScriptConfiguration) {
    try {
        log.debug("Executing python 'SCIM Create User' method");
        ScimType externalType = (ScimType) customScriptConfiguration.getExternalType();
        Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
        boolean result = externalType.createUser(user, configurationAttributes);
        log.debug("executeScimCreateUserMethod result = " + result);
        return result;
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return false;
}
Also used : ScimType(org.xdi.model.custom.script.type.scim.ScimType) SimpleCustomProperty(org.xdi.model.SimpleCustomProperty)

Aggregations

SimpleCustomProperty (org.xdi.model.SimpleCustomProperty)41 PersonAuthenticationType (org.xdi.model.custom.script.type.auth.PersonAuthenticationType)10 InternalDefaultPersonAuthenticationType (org.xdi.oxauth.service.external.internal.InternalDefaultPersonAuthenticationType)10 ScimType (org.xdi.model.custom.script.type.scim.ScimType)6 CustomScript (org.xdi.model.custom.script.model.CustomScript)4 UpdateUserType (org.xdi.model.custom.script.type.user.UpdateUserType)4 UserRegistrationType (org.xdi.model.custom.script.type.user.UserRegistrationType)4 AuthenticationCustomScript (org.xdi.model.custom.script.model.auth.AuthenticationCustomScript)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 AuthenticationScriptUsageType (org.xdi.model.AuthenticationScriptUsageType)2 CustomScriptConfiguration (org.xdi.model.custom.script.conf.CustomScriptConfiguration)2 BaseExternalType (org.xdi.model.custom.script.type.BaseExternalType)2 IdGeneratorType (org.xdi.model.custom.script.type.id.IdGeneratorType)2 File (java.io.File)1 FileFilter (java.io.FileFilter)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 List (java.util.List)1 Entry (java.util.Map.Entry)1