use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.
the class AtlasADAuthenticationProvider method setADProperties.
private void setADProperties() {
try {
Configuration configuration = ApplicationProperties.get();
Properties properties = ConfigurationConverter.getProperties(configuration.subset("atlas.authentication.method.ldap.ad"));
this.adDomain = properties.getProperty("domain");
this.adURL = properties.getProperty("url");
this.adBindDN = properties.getProperty("bind.dn");
this.adBindPassword = properties.getProperty("bind.password");
this.adUserSearchFilter = properties.getProperty("user.searchfilter");
this.adBase = properties.getProperty("base.dn");
this.adReferral = properties.getProperty("referral");
this.adDefaultRole = properties.getProperty("default.role");
this.groupsFromUGI = configuration.getBoolean("atlas.authentication.method.ldap.ugi-groups", true);
if (LOG.isDebugEnabled()) {
LOG.debug("AtlasADAuthenticationProvider{" + "adURL='" + adURL + '\'' + ", adDomain='" + adDomain + '\'' + ", adBindDN='" + adBindDN + '\'' + ", adUserSearchFilter='" + adUserSearchFilter + '\'' + ", adBase='" + adBase + '\'' + ", adReferral='" + adReferral + '\'' + ", adDefaultRole='" + adDefaultRole + '\'' + ", groupsFromUGI=" + groupsFromUGI + '}');
}
} catch (Exception e) {
LOG.error("Exception while setADProperties", e);
}
}
use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.
the class AtlasAuthenticationProvider method setAuthenticationMethod.
@PostConstruct
void setAuthenticationMethod() {
try {
Configuration configuration = ApplicationProperties.get();
this.fileAuthenticationMethodEnabled = configuration.getBoolean(FILE_AUTH_METHOD, true);
boolean ldapAuthenticationEnabled = configuration.getBoolean(LDAP_AUTH_METHOD, false);
if (ldapAuthenticationEnabled) {
this.ldapType = configuration.getString(LDAP_TYPE, "NONE");
} else {
this.ldapType = "NONE";
}
} catch (Exception e) {
LOG.error("Error while getting atlas.login.method application properties", e);
}
}
use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.
the class AtlasLdapAuthenticationProvider method setLdapProperties.
private void setLdapProperties() {
try {
Configuration configuration = ApplicationProperties.get();
Properties properties = ConfigurationConverter.getProperties(configuration.subset("atlas.authentication.method.ldap"));
ldapURL = properties.getProperty("url");
ldapUserDNPattern = properties.getProperty("userDNpattern");
ldapGroupSearchBase = properties.getProperty("groupSearchBase");
ldapGroupSearchFilter = properties.getProperty("groupSearchFilter");
ldapGroupRoleAttribute = properties.getProperty("groupRoleAttribute");
ldapBindDN = properties.getProperty("bind.dn");
ldapBindPassword = properties.getProperty("bind.password");
ldapDefaultRole = properties.getProperty("default.role");
ldapUserSearchFilter = properties.getProperty("user.searchfilter");
ldapReferral = properties.getProperty("referral");
ldapBase = properties.getProperty("base.dn");
groupsFromUGI = configuration.getBoolean("atlas.authentication.method.ldap.ugi-groups", true);
if (LOG.isDebugEnabled()) {
LOG.debug("AtlasLdapAuthenticationProvider{" + "ldapURL='" + ldapURL + '\'' + ", ldapUserDNPattern='" + ldapUserDNPattern + '\'' + ", ldapGroupSearchBase='" + ldapGroupSearchBase + '\'' + ", ldapGroupSearchFilter='" + ldapGroupSearchFilter + '\'' + ", ldapGroupRoleAttribute='" + ldapGroupRoleAttribute + '\'' + ", ldapBindDN='" + ldapBindDN + '\'' + ", ldapDefaultRole='" + ldapDefaultRole + '\'' + ", ldapUserSearchFilter='" + ldapUserSearchFilter + '\'' + ", ldapReferral='" + ldapReferral + '\'' + ", ldapBase='" + ldapBase + '\'' + ", groupsFromUGI=" + groupsFromUGI + '}');
}
} catch (Exception e) {
LOG.error("Exception while setLdapProperties", e);
}
}
use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.
the class Titan1GraphDatabase method getConfiguration.
public static Configuration getConfiguration() throws AtlasException {
Configuration configProperties = ApplicationProperties.get();
Configuration titanConfig = ApplicationProperties.getSubsetConfiguration(configProperties, GRAPH_PREFIX);
//add serializers for non-standard property value types that Atlas uses
titanConfig.addProperty("attributes.custom.attribute1.attribute-class", TypeCategory.class.getName());
titanConfig.addProperty("attributes.custom.attribute1.serializer-class", TypeCategorySerializer.class.getName());
//not ideal, but avoids making large changes to Atlas
titanConfig.addProperty("attributes.custom.attribute2.attribute-class", ArrayList.class.getName());
titanConfig.addProperty("attributes.custom.attribute2.serializer-class", StringListSerializer.class.getName());
titanConfig.addProperty("attributes.custom.attribute3.attribute-class", BigInteger.class.getName());
titanConfig.addProperty("attributes.custom.attribute3.serializer-class", BigIntegerSerializer.class.getName());
titanConfig.addProperty("attributes.custom.attribute4.attribute-class", BigDecimal.class.getName());
titanConfig.addProperty("attributes.custom.attribute4.serializer-class", BigDecimalSerializer.class.getName());
return titanConfig;
}
use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.
the class SqoopHook method publish.
@Override
public void publish(SqoopJobDataPublisher.Data data) throws AtlasHookException {
try {
Configuration atlasProperties = ApplicationProperties.get();
String clusterName = atlasProperties.getString(ATLAS_CLUSTER_NAME, DEFAULT_CLUSTER_NAME);
Referenceable dbStoreRef = createDBStoreInstance(data);
Referenceable dbRef = createHiveDatabaseInstance(clusterName, data.getHiveDB());
Referenceable hiveTableRef = createHiveTableInstance(clusterName, dbRef, data.getHiveTable(), data.getHiveDB());
Referenceable procRef = createSqoopProcessInstance(dbStoreRef, hiveTableRef, data, clusterName);
int maxRetries = atlasProperties.getInt(HOOK_NUM_RETRIES, 3);
HookNotification.HookNotificationMessage message = new HookNotification.EntityCreateRequest(AtlasHook.getUser(), dbStoreRef, dbRef, hiveTableRef, procRef);
AtlasHook.notifyEntities(Arrays.asList(message), maxRetries);
} catch (Exception e) {
throw new AtlasHookException("SqoopHook.publish() failed.", e);
}
}
Aggregations