Skip to content

Commit

Permalink
o Using MINA 2.0.18
Browse files Browse the repository at this point in the history
o Fixed an error message
o Extending IoHandlerAdapter instead of implementing IoHandler
  • Loading branch information
elecharny committed Jun 5, 2018
1 parent af4c072 commit e49a170
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private void fastParseVersion() throws LdapLdifException

if ( lines.size() == 0 )
{
LOG.warn( "The ldif file is empty" );
LOG.warn( I18n.msg( I18n.MSG_13414_LDIF_FILE_EMPTY ) );
return;
}

Expand Down Expand Up @@ -151,7 +151,7 @@ public LdifEntry next()
{
try
{
LOG.debug( "next(): -- called" );
LOG.debug( I18n.msg( I18n.MSG_13411_NEXT_CALLED ) );

nextTuple = firstFetchedTuple;

Expand Down Expand Up @@ -180,7 +180,7 @@ public LdifEntry next()
catch ( LdapLdifException ne )
{
ne.printStackTrace();
LOG.error( I18n.err( I18n.ERR_12071 ) );
LOG.error( I18n.err( I18n.ERR_13430_PREMATURE_LDIF_ITERATOR_TERMINATION ) );
error = ne;
return null;
}
Expand All @@ -194,7 +194,8 @@ private DnTuple parseDnAlone() throws LdapException
{
if ( ( lines == null ) || ( lines.size() == 0 ) )
{
LOG.debug( "The entry is empty : end of ldif file" );
LOG.debug( I18n.msg( I18n.MSG_13408_END_OF_LDIF ) );

return null;
}

Expand Down Expand Up @@ -275,8 +276,8 @@ private void fastReadLines() throws LdapLdifException
}
else if ( sb.length() == 0 )
{
LOG.error( I18n.err( I18n.ERR_12062_EMPTY_CONTINUATION_LINE ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12061_LDIF_PARSING_ERROR ) );
LOG.error( I18n.err( I18n.ERR_13424_EMPTY_CONTINUATION_LINE ) );
throw new LdapLdifException( I18n.err( I18n.ERR_13462_LDIF_PARSING_ERROR ) );
}
else
{
Expand Down Expand Up @@ -306,7 +307,7 @@ else if ( sb.length() == 0 )
}
catch ( IOException ioe )
{
throw new LdapLdifException( I18n.err( I18n.ERR_12063_ERROR_WHILE_READING_LDIF_LINE ), ioe );
throw new LdapLdifException( I18n.err( I18n.ERR_13463_ERROR_WHILE_READING_LDIF_LINE ), ioe );
}

// Stores the current line if necessary.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<maven.artifact.version>3.3.9</maven.artifact.version>
<maven.plugin.api.version>3.3.9</maven.plugin.api.version>
<maven.project.version>3.0-alpha-2</maven.project.version>
<mina.core.version>2.0.17</mina.core.version>
<mina.core.version>2.0.18</mina.core.version>
<org.apache.felix.version>5.6.10</org.apache.felix.version>
<pax-exam.version>4.11.0</pax-exam.version>
<pax-url.version>2.5.4</pax-url.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.apache.directory.shared.kerberos.exceptions.ErrorType;
import org.apache.directory.shared.kerberos.exceptions.KerberosException;
import org.apache.directory.shared.kerberos.messages.KrbError;
import org.apache.mina.core.service.IoHandler;
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IdleStatus;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
Expand All @@ -53,7 +53,7 @@
/**
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class ChangePasswordProtocolHandler implements IoHandler
public class ChangePasswordProtocolHandler extends IoHandlerAdapter
{
private static final Logger LOG = LoggerFactory.getLogger( ChangePasswordProtocolHandler.class );

Expand Down Expand Up @@ -108,7 +108,7 @@ public void sessionIdle( IoSession session, IdleStatus status )
public void exceptionCaught( IoSession session, Throwable cause )
{
LOG.debug( session.getRemoteAddress() + " EXCEPTION", cause );
session.close( true );
session.closeNow();
}


Expand Down

0 comments on commit e49a170

Please sign in to comment.