]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSShared/Java/DNSSDRegistration.java
mDNSResponder-66.3.tar.gz
[apple/mdnsresponder.git] / mDNSShared / Java / DNSSDRegistration.java
1 /*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24
25 Change History (most recent first):
26
27 $Log: DNSSDRegistration.java,v $
28 Revision 1.1 2004/04/30 16:32:34 rpantos
29 First checked in.
30
31
32 This file declares the public interface to DNSSDRegistration, a DNSSDService
33 subclass that allows a client to control a service registration.
34 */
35
36
37 package com.apple.dnssd;
38
39
40 /** A tracking object for a registration created by {@link DNSSD#register}. */
41
42 public interface DNSSDRegistration extends DNSSDService
43 {
44 /** Add a record to a registered service.<P>
45 The name of the record will be the same as the registered service's name.<P>
46 The record can later be updated or deregistered by passing the DNSRecord returned
47 by this function to updateRecord() or removeRecord().<P>
48
49 @param flags
50 Currently unused, reserved for future use.
51 <P>
52 @param rrType
53 The type of the record (e.g. TXT, SRV, etc), as defined in nameser.h.
54 <P>
55 @param rData
56 The raw rdata to be contained in the added resource record.
57 <P>
58 @param ttl
59 The time to live of the resource record, in seconds.
60 <P>
61 @return A {@link DNSRecord} that may be passed to updateRecord() or removeRecord().
62 If {@link DNSSDRegistration#stop} is called, the DNSRecord is also
63 invalidated and may not be used further.
64 */
65 DNSRecord addRecord( int flags, int rrType, byte[] rData, int ttl)
66 throws DNSSDException;
67
68 /** Update a registered resource record.<P>
69 The record must either be the primary txt record of a service registered via DNSSD.register(),
70 or a record added to a registered service via addRecord().<P>
71
72 @param record
73 A DNSRecord initialized by addRecord(), or null to update the
74 service's primary txt record.
75 <P>
76 @param flags
77 Currently unused, reserved for future use.
78 <P>
79 @param rData
80 The new rdata to be contained in the updated resource record.
81 <P>
82 @param ttl
83 The time to live of the updated resource record, in seconds.
84 */
85 void updateRecord( DNSRecord record, int flags, byte[] rData, int ttl)
86 throws DNSSDException;
87
88 /** Remove a registered resource record.<P>
89 The record must have been previously added to a service record set via via addRecord().<P>
90
91 @param record
92 A DNSRecord initialized by addRecord().
93 <P>
94 @param flags
95 Currently unused, reserved for future use.
96 */
97 void removeRecord( DNSRecord record, int flags)
98 throws DNSSDException;
99 }
100