Author: erodriguez Date: Wed Jan 12 18:48:16 2005 New Revision: 125020 URL: http://svn.apache.org/viewcvs?view=rev&rev=125020 Log: DNS MINA handler logic moved to DNS service impl. Added: incubator/directory/dns/trunk/core/src/java/org/apache/dns/service/DomainNameServiceImpl.java Modified: incubator/directory/dns/trunk/protocol/src/java/org/apache/dns/protocol/DnsProtocolHandler.java
Added: incubator/directory/dns/trunk/core/src/java/org/apache/dns/service/DomainNameServiceImpl.java Url: http://svn.apache.org/viewcvs/incubator/directory/dns/trunk/core/src/java/org/apache/dns/service/DomainNameServiceImpl.java?view=auto&rev=125020 ============================================================================== --- (empty file) +++ incubator/directory/dns/trunk/core/src/java/org/apache/dns/service/DomainNameServiceImpl.java Wed Jan 12 18:48:16 2005 @@ -0,0 +1,31 @@ +/* + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.dns.service; + +import org.apache.dns.DomainNameService; +import org.apache.dns.messages.DnsMessage; + + +public class DomainNameServiceImpl implements DomainNameService +{ + public DnsMessage getReplyFor( DnsMessage request ) + { + return request; + } +} + Modified: incubator/directory/dns/trunk/protocol/src/java/org/apache/dns/protocol/DnsProtocolHandler.java Url: http://svn.apache.org/viewcvs/incubator/directory/dns/trunk/protocol/src/java/org/apache/dns/protocol/DnsProtocolHandler.java?view=diff&rev=125020&p1=incubator/directory/dns/trunk/protocol/src/java/org/apache/dns/protocol/DnsProtocolHandler.java&r1=125019&p2=incubator/directory/dns/trunk/protocol/src/java/org/apache/dns/protocol/DnsProtocolHandler.java&r2=125020 ============================================================================== --- incubator/directory/dns/trunk/protocol/src/java/org/apache/dns/protocol/DnsProtocolHandler.java (original) +++ incubator/directory/dns/trunk/protocol/src/java/org/apache/dns/protocol/DnsProtocolHandler.java Wed Jan 12 18:48:16 2005 @@ -17,6 +17,9 @@ package org.apache.dns.protocol; +import org.apache.dns.DomainNameService; +import org.apache.dns.messages.DnsMessage; +import org.apache.dns.service.DomainNameServiceImpl; import org.apache.mina.common.IdleStatus; import org.apache.mina.protocol.ProtocolHandler; import org.apache.mina.protocol.ProtocolSession; @@ -52,7 +55,10 @@ { System.out.println( session.getRemoteAddress() + " RCVD: " + message ); - session.write( message ); + DomainNameService dnsService = new DomainNameServiceImpl(); + DnsMessage reply = dnsService.getReplyFor( (DnsMessage)message ); + + session.write( reply ); } public void messageSent( ProtocolSession session, Object message )
