You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/10/08 00:49:12 UTC
svn commit: r1005659 - in
/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config:
ConfigPartitionReader.java beans/DirectoryBackedServiceBean.java
beans/KdcServerBean.java beans/ProtocolServiceBean.java
Author: elecharny
Date: Thu Oct 7 22:49:12 2010
New Revision: 1005659
URL: http://svn.apache.org/viewvc?rev=1005659&view=rev
Log:
Added the KdcServerbean class.
Added:
directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryBackedServiceBean.java
directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java
directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ProtocolServiceBean.java
Modified:
directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=1005659&r1=1005658&r2=1005659&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Thu Oct 7 22:49:12 2010
@@ -59,6 +59,7 @@ import javax.naming.directory.SearchCont
import org.apache.directory.server.changepw.ChangePasswordServer;
import org.apache.directory.server.config.beans.ChangeLogBean;
import org.apache.directory.server.config.beans.JournalBean;
+import org.apache.directory.server.config.beans.KdcServerBean;
import org.apache.directory.server.config.beans.TcpTransportBean;
import org.apache.directory.server.config.beans.TransportBean;
import org.apache.directory.server.config.beans.UdpTransportBean;
@@ -330,7 +331,7 @@ public class ConfigPartitionReader
}
- public KdcServer createKdcServer() throws Exception
+ public KdcServerBean readKdcServer() throws Exception
{
EqualityNode<String> filter = new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
ConfigSchemaConstants.ADS_KERBEROS_SERVER_OC ) );
@@ -350,7 +351,7 @@ public class ConfigPartitionReader
.get();
cursor.close();
- ClonedServerEntry kdcEntry = configPartition.lookup( forwardEntry.getId() );
+ Entry kdcEntry = configPartition.lookup( forwardEntry.getId() );
LOG.debug( "kerberos server entry {}", kdcEntry );
if ( !isEnabled( kdcEntry ) )
@@ -358,19 +359,20 @@ public class ConfigPartitionReader
return null;
}
- KdcServer kdcServer = new KdcServer();
+ KdcServerBean kdcServerBean = new KdcServerBean();
- kdcServer.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, kdcEntry ) );
+ // The serviceID
+ kdcServerBean.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, kdcEntry ) );
- Transport[] transports = createTransports( kdcEntry.getDn() );
- kdcServer.setTransports( transports );
+ TransportBean[] transports = readTransports( kdcEntry.getDn() );
+ kdcServerBean.setTransports( transports );
// MAY attributes
EntryAttribute clockSkewAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_ALLOWABLE_CLOCKSKEW );
if ( clockSkewAttr != null )
{
- kdcServer.setAllowableClockSkew( Long.parseLong( clockSkewAttr.getString() ) );
+ kdcServerBean.setAllowableClockSkew( Long.parseLong( clockSkewAttr.getString() ) );
}
EntryAttribute encryptionTypeAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_ENCRYPTION_TYPES );
@@ -378,101 +380,139 @@ public class ConfigPartitionReader
if ( encryptionTypeAttr != null )
{
EncryptionType[] encryptionTypes = new EncryptionType[encryptionTypeAttr.size()];
- Iterator<Value<?>> itr = encryptionTypeAttr.getAll();
int count = 0;
- while ( itr.hasNext() )
+ for ( Value<?> value : encryptionTypeAttr )
{
- Value<?> val = itr.next();
- encryptionTypes[count++] = EncryptionType.getByName( val.getString() );
+ encryptionTypes[count++] = EncryptionType.getByName( value.getString() );
}
- kdcServer.setEncryptionTypes( encryptionTypes );
+ kdcServerBean.setEncryptionTypes( encryptionTypes );
}
EntryAttribute emptyAddrAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_EMPTY_ADDRESSES_ALLOWED );
if ( emptyAddrAttr != null )
{
- kdcServer.setEmptyAddressesAllowed( Boolean.parseBoolean( emptyAddrAttr.getString() ) );
+ kdcServerBean.setEmptyAddressesAllowed( Boolean.parseBoolean( emptyAddrAttr.getString() ) );
}
EntryAttribute fwdAllowedAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_FORWARDABLE_ALLOWED );
if ( fwdAllowedAttr != null )
{
- kdcServer.setForwardableAllowed( Boolean.parseBoolean( fwdAllowedAttr.getString() ) );
+ kdcServerBean.setForwardableAllowed( Boolean.parseBoolean( fwdAllowedAttr.getString() ) );
}
EntryAttribute paEncTmstpAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_PAENC_TIMESTAMP_REQUIRED );
if ( paEncTmstpAttr != null )
{
- kdcServer.setPaEncTimestampRequired( Boolean.parseBoolean( paEncTmstpAttr.getString() ) );
+ kdcServerBean.setPaEncTimestampRequired( Boolean.parseBoolean( paEncTmstpAttr.getString() ) );
}
EntryAttribute posdtAllowedAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_POSTDATED_ALLOWED );
if ( posdtAllowedAttr != null )
{
- kdcServer.setPostdatedAllowed( Boolean.parseBoolean( posdtAllowedAttr.getString() ) );
+ kdcServerBean.setPostdatedAllowed( Boolean.parseBoolean( posdtAllowedAttr.getString() ) );
}
EntryAttribute prxyAllowedAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_PROXIABLE_ALLOWED );
if ( prxyAllowedAttr != null )
{
- kdcServer.setProxiableAllowed( Boolean.parseBoolean( prxyAllowedAttr.getString() ) );
+ kdcServerBean.setProxiableAllowed( Boolean.parseBoolean( prxyAllowedAttr.getString() ) );
}
EntryAttribute rnwAllowedAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_RENEWABLE_ALLOWED );
if ( rnwAllowedAttr != null )
{
- kdcServer.setRenewableAllowed( Boolean.parseBoolean( rnwAllowedAttr.getString() ) );
+ kdcServerBean.setRenewableAllowed( Boolean.parseBoolean( rnwAllowedAttr.getString() ) );
}
EntryAttribute kdcPrncplAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_KDC_PRINCIPAL );
if ( kdcPrncplAttr != null )
{
- kdcServer.setKdcPrincipal( kdcPrncplAttr.getString() );
+ kdcServerBean.setKdcPrincipal( kdcPrncplAttr.getString() );
}
EntryAttribute maxRnwLfTimeAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_MAXIMUM_RENEWABLE_LIFETIME );
if ( maxRnwLfTimeAttr != null )
{
- kdcServer.setMaximumRenewableLifetime( Long.parseLong( maxRnwLfTimeAttr.getString() ) );
+ kdcServerBean.setMaximumRenewableLifetime( Long.parseLong( maxRnwLfTimeAttr.getString() ) );
}
EntryAttribute maxTcktLfTimeAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_MAXIMUM_TICKET_LIFETIME );
if ( maxTcktLfTimeAttr != null )
{
- kdcServer.setMaximumTicketLifetime( Long.parseLong( maxTcktLfTimeAttr.getString() ) );
+ kdcServerBean.setMaximumTicketLifetime( Long.parseLong( maxTcktLfTimeAttr.getString() ) );
}
EntryAttribute prmRealmAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_PRIMARY_REALM );
if ( prmRealmAttr != null )
{
- kdcServer.setPrimaryRealm( prmRealmAttr.getString() );
+ kdcServerBean.setPrimaryRealm( prmRealmAttr.getString() );
}
EntryAttribute bdyCkhsmVerifyAttr = kdcEntry.get( ConfigSchemaConstants.ADS_KRB_BODY_CHECKSUM_VERIFIED );
if ( bdyCkhsmVerifyAttr != null )
{
- kdcServer.setBodyChecksumVerified( Boolean.parseBoolean( bdyCkhsmVerifyAttr.getString() ) );
+ kdcServerBean.setBodyChecksumVerified( Boolean.parseBoolean( bdyCkhsmVerifyAttr.getString() ) );
}
EntryAttribute searchBaseAttr = kdcEntry.get( ConfigSchemaConstants.ADS_SEARCH_BASE );
+
if( searchBaseAttr != null )
{
- kdcServer.setSearchBaseDn( searchBaseAttr.getString() );
+ kdcServerBean.setSearchBaseDn( searchBaseAttr.getString() );
}
+ return kdcServerBean;
+ }
+
+
+ /**
+ * Create an instance of KdcServer reading its configuration in the DIT
+ *
+ * @return An instance of a KdcServer
+ * @throws Exception If the instance cannot be created
+ */
+ public KdcServer createKdcServer() throws Exception
+ {
+ KdcServerBean kdcServerBean = readKdcServer();
+
+ KdcServer kdcServer = new KdcServer();
+
+ for ( TransportBean transportBean : kdcServerBean.getTransports() )
+ {
+ Transport transport = createTransport( transportBean );
+
+ kdcServer.addTransports( transport );
+ }
+
+ kdcServer.setServiceId( kdcServerBean.getServiceId() );
+ kdcServer.setAllowableClockSkew( kdcServerBean.getAllowableClockSkew() );
+ kdcServer.setEncryptionTypes( kdcServerBean.getEncryptionTypes() );
+ kdcServer.setEmptyAddressesAllowed( kdcServerBean.isEmptyAddressesAllowed() );
+ kdcServer.setForwardableAllowed( kdcServerBean.isForwardableAllowed() );
+ kdcServer.setPaEncTimestampRequired( kdcServerBean.isPaEncTimestampRequired() );
+ kdcServer.setPostdatedAllowed( kdcServerBean.isPostdatedAllowed() );
+ kdcServer.setProxiableAllowed( kdcServerBean.isProxiableAllowed() );
+ kdcServer.setRenewableAllowed( kdcServerBean.isRenewableAllowed() );
+ kdcServer.setKdcPrincipal( kdcServerBean.getServicePrincipal().getName() );
+ kdcServer.setMaximumRenewableLifetime( kdcServerBean.getMaximumRenewableLifetime() );
+ kdcServer.setMaximumTicketLifetime( kdcServerBean.getMaximumTicketLifetime() );
+ kdcServer.setPrimaryRealm( kdcServerBean.getPrimaryRealm() );
+ kdcServer.setBodyChecksumVerified( kdcServerBean.isBodyChecksumVerified() );
+ kdcServer.setSearchBaseDn( kdcServerBean.getSearchBaseDn() );
+
return kdcServer;
}
@@ -1831,4 +1871,4 @@ public class ConfigPartitionReader
return true;
}
}
-}
+}
\ No newline at end of file
Added: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryBackedServiceBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryBackedServiceBean.java?rev=1005659&view=auto
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryBackedServiceBean.java (added)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryBackedServiceBean.java Thu Oct 7 22:49:12 2010
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.config.beans;
+
+import org.apache.directory.server.constants.ServerDNConstants;
+
+/**
+ * A class used to store the KdcServer configuration.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class DirectoryBackedServiceBean extends ProtocolServiceBean
+{
+ /**
+ * The single location where entries are stored. If this service
+ * is catalog based the store will search the system partition
+ * configuration for catalog entries. Otherwise it will use this
+ * search base as a single point of searching the DIT.
+ */
+ private String searchBaseDn = ServerDNConstants.USER_EXAMPLE_COM_DN;
+
+ /**
+ * Create a new JournalBean instance
+ */
+ public DirectoryBackedServiceBean()
+ {
+ }
+
+
+
+ /**
+ * Returns the search base DN.
+ *
+ * @return The search base DN.
+ */
+ public String getSearchBaseDn()
+ {
+ return searchBaseDn;
+ }
+
+
+ /**
+ * @param searchBaseDn The searchBaseDn to set.
+ */
+ public void setSearchBaseDn( String searchBaseDn )
+ {
+ this.searchBaseDn = searchBaseDn;
+ }
+}
Added: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java?rev=1005659&view=auto
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java (added)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/KdcServerBean.java Thu Oct 7 22:49:12 2010
@@ -0,0 +1,393 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.config.beans;
+
+import java.util.Set;
+
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
+
+/**
+ * A class used to store the KdcServer configuration.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class KdcServerBean extends DirectoryBackedServiceBean
+{
+ /** The default allowable clockskew */
+ private static final long DEFAULT_ALLOWABLE_CLOCKSKEW = 5 * 60000;
+
+ /** The default for allowing empty addresses */
+ private static final boolean DEFAULT_EMPTY_ADDRESSES_ALLOWED = true;
+
+ /** The allowable clock skew. */
+ private long allowableClockSkew = DEFAULT_ALLOWABLE_CLOCKSKEW;
+
+ /** The default for allowing forwardable tickets */
+ private static final boolean DEFAULT_TGS_FORWARDABLE_ALLOWED = true;
+
+ /** The default for requiring encrypted timestamps */
+ private static final boolean DEFAULT_PA_ENC_TIMESTAMP_REQUIRED = true;
+
+ /** The default for allowing postdated tickets */
+ private static final boolean DEFAULT_TGS_POSTDATED_ALLOWED = true;
+
+ /** The default for allowing proxiable tickets */
+ private static final boolean DEFAULT_TGS_PROXIABLE_ALLOWED = true;
+
+ /** The default for allowing renewable tickets */
+ private static final boolean DEFAULT_TGS_RENEWABLE_ALLOWED = true;
+
+ /** The default for the maximum renewable lifetime */
+ private static final int DEFAULT_TGS_MAXIMUM_RENEWABLE_LIFETIME = 60000 * 10080;
+
+ /** The default for the maximum ticket lifetime */
+ private static final int DEFAULT_TGS_MAXIMUM_TICKET_LIFETIME = 60000 * 1440;
+
+ /** The default kdc realm */
+ private static final String DEFAULT_REALM = "EXAMPLE.COM";
+
+ /** The default for verifying the body checksum */
+ private static final boolean DEFAULT_VERIFY_BODY_CHECKSUM = true;
+
+ /** The default kdc service principal */
+ private static final String DEFAULT_PRINCIPAL = "krbtgt/EXAMPLE.COM@EXAMPLE.COM";
+
+ /** Tells if the KdcServer is enabled */
+ private boolean enabled;
+
+ /** Whether empty addresses are allowed. */
+ private boolean isEmptyAddressesAllowed = DEFAULT_EMPTY_ADDRESSES_ALLOWED;
+
+ /** Whether forwardable addresses are allowed. */
+ private boolean isForwardableAllowed = DEFAULT_TGS_FORWARDABLE_ALLOWED;
+
+ /** Whether pre-authentication by encrypted timestamp is required. */
+ private boolean isPaEncTimestampRequired = DEFAULT_PA_ENC_TIMESTAMP_REQUIRED;
+
+ /** Whether postdated tickets are allowed. */
+ private boolean isPostdatedAllowed = DEFAULT_TGS_POSTDATED_ALLOWED;
+
+ /** Whether proxiable addresses are allowed. */
+ private boolean isProxiableAllowed = DEFAULT_TGS_PROXIABLE_ALLOWED;
+
+ /** Whether renewable tickets are allowed. */
+ private boolean isRenewableAllowed = DEFAULT_TGS_RENEWABLE_ALLOWED;
+
+ /** The maximum renewable lifetime. */
+ private long maximumRenewableLifetime = DEFAULT_TGS_MAXIMUM_RENEWABLE_LIFETIME;
+
+ /** The maximum ticket lifetime. */
+ private long maximumTicketLifetime = DEFAULT_TGS_MAXIMUM_TICKET_LIFETIME;
+
+ /** The primary realm */
+ private String primaryRealm = DEFAULT_REALM;
+
+ /** Whether to verify the body checksum. */
+ private boolean isBodyChecksumVerified = DEFAULT_VERIFY_BODY_CHECKSUM;
+
+ /** The encryption types. */
+ private Set<EncryptionType> encryptionTypes;
+
+ /** The service principal name. */
+ private String servicePrincipal = DEFAULT_PRINCIPAL;
+
+ /**
+ * Create a new KdcServerBean instance
+ */
+ public KdcServerBean()
+ {
+ // Enabled by default
+ enabled = true;
+ }
+
+
+ /**
+ * @return <code>true</code> if the Journal is enabled
+ */
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+
+
+ /**
+ * @param enabled Set the enabled flag
+ */
+ public void setEnabled( boolean enabled )
+ {
+ this.enabled = enabled;
+ }
+
+
+ /**
+ * Returns the allowable clock skew.
+ *
+ * @return The allowable clock skew.
+ */
+ public long getAllowableClockSkew()
+ {
+ return allowableClockSkew;
+ }
+
+
+ /**
+ * @param allowableClockSkew the allowableClockSkew to set
+ */
+ public void setAllowableClockSkew( long allowableClockSkew )
+ {
+ this.allowableClockSkew = allowableClockSkew;
+ }
+
+
+ /**
+ * Returns the encryption types.
+ *
+ * @return The encryption types.
+ */
+ public Set<EncryptionType> getEncryptionTypes()
+ {
+ return encryptionTypes;
+ }
+
+
+ /**
+ * Initialize the encryptionTypes set
+ *
+ * @param encryptionTypes the encryptionTypes to set
+ */
+ public void setEncryptionTypes( EncryptionType... encryptionTypes )
+ {
+ if ( encryptionTypes != null )
+ {
+ this.encryptionTypes.clear();
+
+ for ( EncryptionType encryptionType:encryptionTypes )
+ {
+ this.encryptionTypes.add( encryptionType );
+ }
+ }
+ }
+
+
+ /**
+ * @return the isEmptyAddressesAllowed
+ */
+ public boolean isEmptyAddressesAllowed()
+ {
+ return isEmptyAddressesAllowed;
+ }
+
+
+ /**
+ * @param isEmptyAddressesAllowed the isEmptyAddressesAllowed to set
+ */
+ public void setEmptyAddressesAllowed( boolean isEmptyAddressesAllowed )
+ {
+ this.isEmptyAddressesAllowed = isEmptyAddressesAllowed;
+ }
+
+
+ /**
+ * @return the isForwardableAllowed
+ */
+ public boolean isForwardableAllowed()
+ {
+ return isForwardableAllowed;
+ }
+
+
+ /**
+ * @param isForwardableAllowed the isForwardableAllowed to set
+ */
+ public void setForwardableAllowed( boolean isForwardableAllowed )
+ {
+ this.isForwardableAllowed = isForwardableAllowed;
+ }
+
+
+ /**
+ * Returns whether pre-authentication by encrypted timestamp is required.
+ *
+ * @return Whether pre-authentication by encrypted timestamp is required.
+ */
+ public boolean isPaEncTimestampRequired()
+ {
+ return isPaEncTimestampRequired;
+ }
+
+
+ /**
+ * @param isPaEncTimestampRequired the isPaEncTimestampRequired to set
+ */
+ public void setPaEncTimestampRequired( boolean isPaEncTimestampRequired )
+ {
+ this.isPaEncTimestampRequired = isPaEncTimestampRequired;
+ }
+
+
+ /**
+ * @return the isPostdatedAllowed
+ */
+ public boolean isPostdatedAllowed()
+ {
+ return isPostdatedAllowed;
+ }
+
+
+ /**
+ * @param isPostdatedAllowed the isPostdatedAllowed to set
+ */
+ public void setPostdatedAllowed( boolean isPostdatedAllowed )
+ {
+ this.isPostdatedAllowed = isPostdatedAllowed;
+ }
+
+
+ /**
+ * @return the isProxiableAllowed
+ */
+ public boolean isProxiableAllowed()
+ {
+ return isProxiableAllowed;
+ }
+
+
+ /**
+ * @param isProxiableAllowed the isProxiableAllowed to set
+ */
+ public void setProxiableAllowed( boolean isProxiableAllowed )
+ {
+ this.isProxiableAllowed = isProxiableAllowed;
+ }
+
+
+ /**
+ * @return the isRenewableAllowed
+ */
+ public boolean isRenewableAllowed()
+ {
+ return isRenewableAllowed;
+ }
+
+
+ /**
+ * @param isRenewableAllowed the isRenewableAllowed to set
+ */
+ public void setRenewableAllowed( boolean isRenewableAllowed )
+ {
+ this.isRenewableAllowed = isRenewableAllowed;
+ }
+
+
+ /**
+ * @return the maximumRenewableLifetime
+ */
+ public long getMaximumRenewableLifetime()
+ {
+ return maximumRenewableLifetime;
+ }
+
+
+ /**
+ * @param maximumRenewableLifetime the maximumRenewableLifetime to set
+ */
+ public void setMaximumRenewableLifetime( long maximumRenewableLifetime )
+ {
+ this.maximumRenewableLifetime = maximumRenewableLifetime;
+ }
+
+
+ /**
+ * @return the maximumTicketLifetime
+ */
+ public long getMaximumTicketLifetime()
+ {
+ return maximumTicketLifetime;
+ }
+
+
+ /**
+ * @param maximumTicketLifetime the maximumTicketLifetime to set
+ */
+ public void setMaximumTicketLifetime( long maximumTicketLifetime )
+ {
+ this.maximumTicketLifetime = maximumTicketLifetime;
+ }
+
+
+ /**
+ * Returns the primary realm.
+ *
+ * @return The primary realm.
+ */
+ public String getPrimaryRealm()
+ {
+ return primaryRealm;
+ }
+
+
+ /**
+ * @param primaryRealm the primaryRealm to set
+ */
+ public void setPrimaryRealm( String primaryRealm )
+ {
+ this.primaryRealm = primaryRealm;
+ }
+
+
+ /**
+ * @return the isBodyChecksumVerified
+ */
+ public boolean isBodyChecksumVerified()
+ {
+ return isBodyChecksumVerified;
+ }
+
+
+ /**
+ * @param isBodyChecksumVerified the isBodyChecksumVerified to set
+ */
+ public void setBodyChecksumVerified( boolean isBodyChecksumVerified )
+ {
+ this.isBodyChecksumVerified = isBodyChecksumVerified;
+ }
+
+
+ /**
+ * Returns the service principal for this KDC service.
+ *
+ * @return The service principal for this KDC service.
+ */
+ public KerberosPrincipal getServicePrincipal()
+ {
+ return new KerberosPrincipal( servicePrincipal );
+ }
+
+
+ /**
+ * @param kdcPrincipal the kdcPrincipal to set
+ */
+ public void setKdcPrincipal( String kdcPrincipal )
+ {
+ this.servicePrincipal = kdcPrincipal;
+ }
+}
Added: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ProtocolServiceBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ProtocolServiceBean.java?rev=1005659&view=auto
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ProtocolServiceBean.java (added)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ProtocolServiceBean.java Thu Oct 7 22:49:12 2010
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.config.beans;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * A class used to store the ProtocolService configuration.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ProtocolServiceBean
+{
+ /** A flag set to tell if the server is enabled or not */
+ private boolean enabled;
+
+ /** The server ID */
+ private String serviceId;
+
+ /** The service name */
+ private String serviceName;
+
+ /** The service transports. We may have more than one */
+ protected Set<TransportBean> transports = new HashSet<TransportBean>();
+
+ /**
+ * Create a new JournalBean instance
+ */
+ public ProtocolServiceBean()
+ {
+ // Not enabled by default
+ enabled = false;
+ }
+
+
+ /**
+ * Services can be enabled or disabled. If enabled they will be started, if
+ * not they will not.
+ *
+ * @return true if this service is to be started, false otherwise
+ */
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+
+
+ /**
+ * Sets whether or not this ProtocolService is enabled.
+ *
+ * @param enabled true to enable, false to disable
+ */
+ public void setEnabled( boolean enabled )
+ {
+ this.enabled = enabled;
+ }
+
+
+ /**
+ * Gets the instance identifier for this ProtocolService.
+ *
+ * @return the identifier for the service instance
+ */
+ public String getServiceId()
+ {
+ return serviceId;
+ }
+
+
+ /**
+ * Sets the instance identifier for this ProtocolService.
+ *
+ * @param serviceId an identifier for the service instance
+ */
+ public void setServiceId( String serviceId )
+ {
+ this.serviceId = serviceId;
+ }
+
+
+ /**
+ * @return the transport
+ */
+ public TransportBean[] getTransports()
+ {
+ return transports.toArray( new TransportBean[]{} );
+ }
+
+
+ /**
+ * Set the underlying transports
+ * @param transports The transports
+ */
+ public void setTransports( TransportBean... transports )
+ {
+ for ( TransportBean transport : transports )
+ {
+ this.transports.add( transport );
+ }
+ }
+
+
+ /**
+ * Add underlying transports
+ * @param transports The transports
+ */
+ public void addTransports( TransportBean... transports )
+ {
+ for ( TransportBean transport : transports )
+ {
+ this.transports.add( transport );
+ }
+ }
+}