james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r531078 - in /james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core: DNSRequest.java DNSResponse.java
Date Sat, 21 Apr 2007 18:34:36 GMT
Author: bago
Date: Sat Apr 21 11:34:35 2007
New Revision: 531078

URL: http://svn.apache.org/viewvc?view=rev&rev=531078
Log:
Basic Request/Response objects for asynchronous DNS lookups

Added:
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSRequest.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSResponse.java

Added: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSRequest.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSRequest.java?view=auto&rev=531078
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSRequest.java
(added)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSRequest.java
Sat Apr 21 11:34:35 2007
@@ -0,0 +1,47 @@
+/****************************************************************
+ * 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.james.jspf.core;
+
+public class DNSRequest {
+
+    /**
+     * The hostname to be resolved
+     */
+    private String hostname;
+    
+    /**
+     * The record type to look for
+     */
+    private int recordType;
+
+    public DNSRequest(String hostname, int recordType) {
+        this.hostname = hostname;
+        this.recordType = recordType;
+    }
+    
+    public String getHostname() {
+        return hostname;
+    }
+
+    public int getRecordType() {
+        return recordType;
+    }
+
+}

Added: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSResponse.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSResponse.java?view=auto&rev=531078
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSResponse.java
(added)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/DNSResponse.java
Sat Apr 21 11:34:35 2007
@@ -0,0 +1,50 @@
+/****************************************************************
+ * 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.james.jspf.core;
+
+import org.apache.james.jspf.core.DNSService.TimeoutException;
+
+import java.util.List;
+
+public class DNSResponse {
+    
+    private List response;
+    
+    private TimeoutException exception;
+    
+    public DNSResponse(TimeoutException exception) {
+        this.exception = exception;
+        this.response = null;
+    }
+    
+    public DNSResponse(List response) {
+        this.exception = null;
+        this.response = response;
+    }
+    
+    public List getResponse() throws TimeoutException {
+        if (exception != null) {
+            throw exception;
+        } else {
+            return response;
+        }
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message