ForwardIndexEntry<Long, ServerEntry, Long> forwardEntry = ( ForwardIndexEntry<Long, ServerEntry, Long> ) cursor
.get();
cursor.close();
ClonedServerEntry kdcEntry = configPartition.lookup( forwardEntry.getId() );
LOG.debug( "kerberos server entry {}", kdcEntry );
if ( !isEnabled( kdcEntry ) )
{
return null;
}
KdcServer kdcServer = new KdcServer();
kdcServer.setServiceId( getString( "ads-serverId", kdcEntry ) );
DN transportsDN = new DN( getString( "ads-transports", kdcEntry ) );
transportsDN.normalize( schemaManager.getNormalizerMapping() );
Transport[] transports = getTransports( transportsDN );
kdcServer.setTransports( transports );
// MAY attributes
EntryAttribute clockSkewAttr = kdcEntry.get( "ads-krbAllowableClockSkew" );
if ( clockSkewAttr != null )
{
kdcServer.setAllowableClockSkew( Long.parseLong( clockSkewAttr.getString() ) );
}
EntryAttribute encryptionTypeAttr = kdcEntry.get( "ads-krbEncryptionTypes" );
if ( encryptionTypeAttr != null )
{
EncryptionType[] encryptionTypes = new EncryptionType[encryptionTypeAttr.size()];
Iterator<Value<?>> itr = encryptionTypeAttr.getAll();
int count = 0;
while ( itr.hasNext() )
{
Value<?> val = itr.next();
encryptionTypes[count++] = EncryptionType.getByName( val.getString() );
}
kdcServer.setEncryptionTypes( encryptionTypes );
}
EntryAttribute emptyAddrAttr = kdcEntry.get( "ads-krbEmptyAddressesAllowed" );
if ( emptyAddrAttr != null )
{
kdcServer.setEmptyAddressesAllowed( Boolean.parseBoolean( emptyAddrAttr.getString() ) );
}
EntryAttribute fwdAllowedAttr = kdcEntry.get( "ads-krbForwardableAllowed" );
if ( fwdAllowedAttr != null )
{
kdcServer.setForwardableAllowed( Boolean.parseBoolean( fwdAllowedAttr.getString() ) );
}
EntryAttribute paEncTmstpAttr = kdcEntry.get( "ads-krbPaEncTimestampRequired" );
if ( paEncTmstpAttr != null )
{
kdcServer.setPaEncTimestampRequired( Boolean.parseBoolean( paEncTmstpAttr.getString() ) );
}
EntryAttribute posdtAllowedAttr = kdcEntry.get( "ads-krbPostdatedAllowed" );
if ( posdtAllowedAttr != null )
{
kdcServer.setPostdatedAllowed( Boolean.parseBoolean( posdtAllowedAttr.getString() ) );
}
EntryAttribute prxyAllowedAttr = kdcEntry.get( "ads-krbProxiableAllowed" );
if ( prxyAllowedAttr != null )
{
kdcServer.setProxiableAllowed( Boolean.parseBoolean( prxyAllowedAttr.getString() ) );
}
EntryAttribute rnwAllowedAttr = kdcEntry.get( "ads-krbRenewableAllowed" );
if ( rnwAllowedAttr != null )
{
kdcServer.setRenewableAllowed( Boolean.parseBoolean( rnwAllowedAttr.getString() ) );
}
EntryAttribute kdcPrncplAttr = kdcEntry.get( "ads-krbKdcPrincipal" );
if ( kdcPrncplAttr != null )
{
kdcServer.setKdcPrincipal( kdcPrncplAttr.getString() );
}
EntryAttribute maxRnwLfTimeAttr = kdcEntry.get( "ads-krbMaximumRenewableLifetime" );
if ( maxRnwLfTimeAttr != null )
{
kdcServer.setMaximumRenewableLifetime( Long.parseLong( maxRnwLfTimeAttr.getString() ) );
}
EntryAttribute maxTcktLfTimeAttr = kdcEntry.get( "ads-krbMaximumTicketLifetime" );
if ( maxTcktLfTimeAttr != null )
{
kdcServer.setMaximumTicketLifetime( Long.parseLong( maxTcktLfTimeAttr.getString() ) );
}
EntryAttribute prmRealmAttr = kdcEntry.get( "ads-krbPrimaryRealm" );
if ( prmRealmAttr != null )
{
kdcServer.setPrimaryRealm( prmRealmAttr.getString() );
}
EntryAttribute bdyCkhsmVerifyAttr = kdcEntry.get( "ads-krbBodyChecksumVerified" );
if ( bdyCkhsmVerifyAttr != null )
{
kdcServer.setBodyChecksumVerified( Boolean.parseBoolean( bdyCkhsmVerifyAttr.getString() ) );
}