Search in sources :

Example 1 with LdapEncoder

use of org.apache.directory.api.ldap.codec.api.LdapEncoder in project directory-ldap-api by apache.

the class AbstractCodecServiceTest method setupLdapCodecService.

/**
 * Initialize the codec service
 */
@BeforeClass
public static void setupLdapCodecService() {
    codec = new DefaultLdapCodecService();
    codec.registerProtocolCodecFactory(new ProtocolCodecFactory() {

        public ProtocolEncoder getEncoder(IoSession session) throws Exception {
            return null;
        }

        public ProtocolDecoder getDecoder(IoSession session) throws Exception {
            return null;
        }
    });
    if (LdapApiServiceFactory.isInitialized() == false) {
        LdapApiServiceFactory.initialize(codec);
    }
    encoder = new LdapEncoder(codec);
}
Also used : LdapEncoder(org.apache.directory.api.ldap.codec.api.LdapEncoder) DefaultLdapCodecService(org.apache.directory.api.ldap.codec.osgi.DefaultLdapCodecService) ProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory) ProtocolDecoder(org.apache.mina.filter.codec.ProtocolDecoder) ProtocolEncoder(org.apache.mina.filter.codec.ProtocolEncoder) IoSession(org.apache.mina.core.session.IoSession) BeforeClass(org.junit.BeforeClass)

Example 2 with LdapEncoder

use of org.apache.directory.api.ldap.codec.api.LdapEncoder in project directory-ldap-api by apache.

the class AbstractCodecServiceTest method setupLdapCodecService.

/**
 * Initialize the codec service
 */
@BeforeClass
public static void setupLdapCodecService() {
    codec = new DefaultLdapCodecService();
    encoder = new LdapEncoder(codec);
}
Also used : LdapEncoder(org.apache.directory.api.ldap.codec.api.LdapEncoder) DefaultLdapCodecService(org.apache.directory.api.ldap.codec.osgi.DefaultLdapCodecService) BeforeClass(org.junit.BeforeClass)

Aggregations

LdapEncoder (org.apache.directory.api.ldap.codec.api.LdapEncoder)2 DefaultLdapCodecService (org.apache.directory.api.ldap.codec.osgi.DefaultLdapCodecService)2 BeforeClass (org.junit.BeforeClass)2 IoSession (org.apache.mina.core.session.IoSession)1 ProtocolCodecFactory (org.apache.mina.filter.codec.ProtocolCodecFactory)1 ProtocolDecoder (org.apache.mina.filter.codec.ProtocolDecoder)1 ProtocolEncoder (org.apache.mina.filter.codec.ProtocolEncoder)1