AttributeTypeRegistry atRegistry = modContext.getSession()
.getDirectoryService().getRegistries().getAttributeTypeRegistry();
// Add our modification items.
newModsList.add(
new ServerModification(
ModificationOperation.REPLACE_ATTRIBUTE,
new DefaultServerAttribute(
KerberosAttribute.KRB5_PRINCIPAL_NAME_AT,
atRegistry.lookup( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ),
principalName ) ) );
newModsList.add(
new ServerModification(
ModificationOperation.REPLACE_ATTRIBUTE,
new DefaultServerAttribute(
KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT,
atRegistry.lookup( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT ),
Integer.toString( kvno ) ) ) );
ServerAttribute attribute = getKeyAttribute( modContext.getSession()
.getDirectoryService().getRegistries(), keys );
newModsList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute ) );
modContext.setModItems( newModsList );
}