Java Code Examples for org.apache.directory.api.ldap.model.constants.SchemaConstants#CN_AT
The following examples show how to use
org.apache.directory.api.ldap.model.constants.SchemaConstants#CN_AT .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TriggerUtils.java From directory-ldap-api with Apache License 2.0 | 6 votes |
/** * Create the Trigger execution subentry * * @param apCtx The administration point context * @param subentryCN The CN used by the suentry * @param subtreeSpec The subtree specification * @param prescriptiveTriggerSpec The prescriptive trigger specification * @throws NamingException If the operation failed */ public static void createTriggerExecutionSubentry( LdapContext apCtx, String subentryCN, String subtreeSpec, String prescriptiveTriggerSpec ) throws NamingException { Attributes subentry = new BasicAttributes( SchemaConstants.CN_AT, subentryCN, true ); Attribute objectClass = new BasicAttribute( SchemaConstants.OBJECT_CLASS_AT ); subentry.put( objectClass ); objectClass.add( SchemaConstants.TOP_OC ); objectClass.add( SchemaConstants.SUBENTRY_OC ); objectClass.add( SchemaConstants.TRIGGER_EXECUTION_SUBENTRY_OC ); subentry.put( SchemaConstants.SUBTREE_SPECIFICATION_AT, subtreeSpec ); subentry.put( SchemaConstants.PRESCRIPTIVE_TRIGGER_SPECIFICATION_AT, prescriptiveTriggerSpec ); apCtx.createSubcontext( "cn=" + subentryCN, subentry ); }
Example 2
Source File: GroupDAO.java From directory-fortress-core with Apache License 2.0 | 6 votes |
/** * Package private default constructor. */ GroupDAO() { super(); GROUP_OBJECT_CLASS_IMPL = Config.getInstance().getProperty( GROUP_OBJECT_CLASS ); GROUP_PROTOCOL_ATTR_IMPL = Config.getInstance().getProperty( GROUP_PROTOCOL_ATTR ); GROUP_PROPERTY_ATTR_IMPL = Config.getInstance().getProperty( GROUP_PROPERTY_ATTR ); GROUP_OBJ_CLASS = new String[]{SchemaConstants.TOP_OC, GROUP_OBJECT_CLASS_IMPL }; GROUP_ATRS = new String[] { SchemaConstants.CN_AT, SchemaConstants.DESCRIPTION_AT, GlobalIds.TYPE, GROUP_PROTOCOL_ATTR_IMPL, GROUP_PROPERTY_ATTR_IMPL, SchemaConstants.MEMBER_AT }; }
Example 3
Source File: ExampleDAO.java From directory-fortress-core with Apache License 2.0 | 6 votes |
/** * @param name * @throws org.apache.directory.fortress.core.RemoveException * */ public void remove(String name) throws RemoveException { LdapConnection ld = null; String dn = SchemaConstants.CN_AT + "=" + name + "," + Config.getInstance().getProperty(EIds.EXAMPLE_ROOT); if (LOG.isDebugEnabled()) { LOG.debug("remove dn [" + dn + "]"); } try { ld = getAdminConnection(); delete(ld, dn); } catch (LdapException e) { String error = "remove [" + name + "] caught LDAPException=" + e; LOG.error(error); throw new RemoveException(EErrIds.EXAMPLE_DELETE_FAILED, error); } finally { closeAdminConnection(ld); } }
Example 4
Source File: RoleDAO.java From directory-fortress-core with Apache License 2.0 | 4 votes |
private String getDn( String name, String contextId ) { return SchemaConstants.CN_AT + "=" + name + "," + getRootDn( contextId, GlobalIds.ROLE_ROOT ); }
Example 5
Source File: AdminRoleDAO.java From directory-fortress-core with Apache License 2.0 | 4 votes |
@Override public String getDn( AdminRole adminRole ) { return SchemaConstants.CN_AT + "=" + adminRole.getName() + "," + getRootDn( adminRole.getContextId(), GlobalIds.ADMIN_ROLE_ROOT ); }
Example 6
Source File: GroupDAO.java From directory-fortress-core with Apache License 2.0 | 4 votes |
private String getDn( String name, String contextId ) { return SchemaConstants.CN_AT + "=" + name + "," + getRootDn( contextId, GlobalIds.GROUP_ROOT ); }
Example 7
Source File: SdDAO.java From directory-fortress-core with Apache License 2.0 | 4 votes |
private String getDn( String name, String contextId ) { return SchemaConstants.CN_AT + "=" + name + "," + getSdRoot( contextId ); }
Example 8
Source File: ExampleDAO.java From directory-fortress-core with Apache License 2.0 | 4 votes |
/** * @param entity * @return * @throws org.apache.directory.fortress.core.CreateException * */ public Example create(Example entity) throws CreateException { LdapConnection ld = null; String dn = SchemaConstants.CN_AT + "=" + entity.getName() + "," + Config.getInstance().getProperty(EIds.EXAMPLE_ROOT); if (LOG.isDebugEnabled()) { LOG.debug("create dn [" + dn + "]"); } try { /* public class Example implements Constraint, java.io.Serializable { private String id; // this maps to oamId private String name; // this is oamRoleName private String description; // this is description private String dn; // this attribute is automatically saved to each ldap record. private String beginTime; // this attribute is oamBeginTime private String endTime; // this attribute is oamEndTime private String beginDate; // this attribute is oamBeginDate private String endDate; // this attribute is oamEndDate private String beginLockDate;// this attribute is oamBeginLockDate private String endLockDate; // this attribute is oamEndLockDate private String dayMask; // this attribute is oamDayMask private int timeout; // this attribute is oamTimeOut */ ld = getAdminConnection(); Entry entry = new DefaultEntry( dn ); entry.add( createAttributes( SchemaConstants.OBJECT_CLASS_AT, EIds.EXAMPLE_OBJ_CLASS ) ); entity.setId(); entry.add( GlobalIds.FT_IID, entity.getId() ); entry.add( EIds.EXAMPLE_NM, entity.getName() ); if (entity.getDescription() != null && entity.getDescription().length() > 0) entry.add( SchemaConstants.DESCRIPTION_AT, entity.getDescription() ); // organizational name requires CN attribute: entry.add( SchemaConstants.CN_AT, entity.getName() ); //AttrHelper.loadTemporalAttrs(entity, attrs); entity.setName("EXAMPLE"); entry.add( GlobalIds.CONSTRAINT, ConstraintUtil.setConstraint( entity ) ); add(ld, entry); } catch (LdapException e) { String error = "create [" + entity.getName() + "] caught LDAPException=" + e; LOG.error(error); throw new CreateException(EErrIds.EXAMPLE_ADD_FAILED, error); } finally { closeAdminConnection(ld); } return entity; }
Example 9
Source File: ExampleDAO.java From directory-fortress-core with Apache License 2.0 | 4 votes |
/** * @param entity * @return * @throws org.apache.directory.fortress.core.UpdateException * */ public Example update(Example entity) throws UpdateException { LdapConnection ld = null; String dn = SchemaConstants.CN_AT + "=" + entity.getName() + "," + Config.getInstance().getProperty( EIds.EXAMPLE_ROOT ); if (LOG.isDebugEnabled()) { LOG.debug("update dn [" + dn + "]"); } try { ld = getAdminConnection(); List<Modification> mods = new ArrayList<Modification>(); if (entity.getDescription() != null && entity.getDescription().length() > 0) { mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, SchemaConstants.DESCRIPTION_AT, entity.getDescription() ) ); } String szRawData = ConstraintUtil.setConstraint( entity ); if (szRawData != null && szRawData.length() > 0) { mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, GlobalIds.CONSTRAINT, szRawData ) ); } if (mods.size() > 0) { modify(ld, dn, mods); } } catch (LdapException e) { String error = "update [" + entity.getName() + "] caught LDAPException=" + e; LOG.error(error); throw new UpdateException(EErrIds.EXAMPLE_UPDATE_FAILED, error); } finally { closeAdminConnection(ld); } return entity; }
Example 10
Source File: ConfigDAO.java From directory-fortress-core with Apache License 2.0 | 2 votes |
/** * * @param name * @return */ private String getDn( String name ) { return SchemaConstants.CN_AT + "=" + name + "," + Config.getInstance().getProperty( GlobalIds.CONFIG_ROOT_PARAM ); }