1/* -*- Mode: Java; tab-width: 4 -*- 2 * 3 * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 19package com.apple.dnssd; 20 21 22/** An object for registering records, created by {@link DNSSD#createRecordRegistrar}. */ 23 24public interface DNSSDRecordRegistrar extends DNSSDService 25{ 26 /** Register an independent {@link DNSRecord}.<P> 27 @param flags 28 Possible values are SHARED or UNIQUE (see flag type definitions for details). 29 <P> 30 @param ifIndex 31 If non-zero, specifies the interface on which to register the record 32 (the index for a given interface is determined via the if_nametoindex() 33 family of calls.) Passing 0 causes the record to be registered on all interfaces. 34 <P> 35 @param fullname 36 The full domain name of the resource record. 37 <P> 38 @param rrtype 39 The numerical type of the resource record to be queried for (e.g. PTR, SRV, etc) 40 as defined in nameser.h. 41 <P> 42 @param rrclass 43 The class of the resource record, as defined in nameser.h 44 (usually 1 for the Internet class). 45 <P> 46 @param rData 47 The new rdata as it is to appear in the DNS record. 48 <P> 49 @param ttl 50 The time to live of the resource record, in seconds. Pass 0 to use a default value. 51 <P> 52 @param listener 53 This object will get called when the service is registered. 54 <P> 55 @return A {@link DNSSDService} that can be used to abort the record registration. 56 57 @throws SecurityException If a security manager is present and denies <tt>RuntimePermission("getDNSSDInstance")</tt>. 58 @see RuntimePermission 59 */ 60 public DNSRecord registerRecord( int flags, int ifIndex, String fullname, int rrtype, 61 int rrclass, byte[] rdata, int ttl) 62 throws DNSSDException; 63} 64 65