org.rococoa.cocoa.foundation
Class NSNetService

java.lang.Object
  extended by org.rococoa.cocoa.foundation.NSObject
      extended by org.rococoa.cocoa.foundation.NSNetService
All Implemented Interfaces:
NSObject, ObjCObject

public abstract class NSNetService
extends NSObject
implements ObjCObject

This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java, Rococoa, or JNA.


Nested Class Summary
static class NSNetService._class_
           
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.foundation.protocols.NSObject
NSObject._static_
 
Constructor Summary
NSNetService()
           
 
Method Summary
abstract  NSArray addresses()
          The addresses of the service.
static NSNetService alloc()
           
static NSNetService createWithDomain_type_name_port(NSString domain, NSString type, NSString name, int port)
          Factory method
static NSNetService createWithDomain_type_name(NSString domain, NSString type, NSString name)
          Factory method
static NSData dataFromTXTRecordDictionary(NSDictionary txtDictionary)
          Returns an NSData created from the provided dictionary.
abstract  NSNetServiceDelegate delegate()
          Original signature : -(id)delegate
native declaration : NSNetServices.h:88
static NSDictionary dictionaryFromTXTRecordData(NSData txtData)
          Returns an NSDictionary created from the provided NSData.
abstract  NSString domain()
          Returns the domain of the discovered or published service.
abstract  boolean getInputStream_outputStream(PointerByReference inputStream, PointerByReference outputStream)
          Retrieves streams from the NSNetService instance.
static NSNetService._class_ getNSClass()
           
abstract  NSString hostName()
          Returns the DNS host name of the computer hosting the discovered or published service.
abstract  NSNetService initWithDomain_type_name_port(NSString domain, NSString type, NSString name, int port)
          This is the initializer for publishing.
abstract  NSNetService initWithDomain_type_name(NSString domain, NSString type, NSString name)
          This is the initializer for resolution.
abstract  NSString name()
          Returns the name of the discovered or published service.
static NSNetService new_()
           
abstract  NSInteger port()
          The port of a resolved service.
abstract  void publish()
          Advertises a given service on the network.
abstract  void publishWithOptions(int options)
          Advertises a given service on the network.
abstract  void removeFromRunLoop_forMode(NSRunLoop aRunLoop, NSString mode)
          Original signature : -(void)removeFromRunLoop:(NSRunLoop*) forMode:(NSString*)
native declaration : NSNetServices.h:94
abstract  void resolve()
          Attempts to determine at least one address for the NSNetService instance.
abstract  void scheduleInRunLoop_forMode(NSRunLoop aRunLoop, NSString mode)
          NSNetService instances may be scheduled on NSRunLoops to operate in different modes, or in other threads.
abstract  void setDelegate(NSNetServiceDelegate delegate)
          Original signature : -(void)setDelegate:(id)
native declaration : NSNetServices.h:89
abstract  boolean setTXTRecordData(NSData recordData)
          Sets the TXT record of the NSNetService instance that has been or will be published.
abstract  void startMonitoring()
          Starts monitoring the NSNetService instance for events.
abstract  void stop()
          Halts a service which is either publishing or resolving.
abstract  void stopMonitoring()
          Stops monitoring the NSNetService instance for events.
abstract  NSData TXTRecordData()
          Returns the raw TXT record of the NSNetService instance.
abstract  NSString type()
          Returns the type of the discovered or published service.
 
Methods inherited from class org.rococoa.cocoa.foundation.NSObject
as_NSObject_NSAccessibility, as_NSObject_NSAccessibilityAdditions, as_NSObject_NSApplicationScriptingDelegation, as_NSObject_NSArchiverCallback, as_NSObject_NSClassDescriptionPrimitives, as_NSObject_NSCoderMethods, as_NSObject_NSColorPanelResponderMethod, as_NSObject_NSComparisonMethods, as_NSObject_NSControlSubclassNotifications, as_NSObject_NSCopyLinkMoveHandler, as_NSObject_NSDelayedPerforming, as_NSObject_NSDeprecatedKeyValueCoding, as_NSObject_NSDeprecatedKeyValueObservingCustomization, as_NSObject_NSDeprecatedMethods, as_NSObject_NSDictionaryControllerKeyValuePair, as_NSObject_NSDistributedObjects, as_NSObject_NSDraggingDestination, as_NSObject_NSDraggingSource, as_NSObject_NSDraggingSourceDeprecated, as_NSObject_NSEditor, as_NSObject_NSEditorRegistration, as_NSObject_NSErrorRecoveryAttempting, as_NSObject_NSFileManagerFileOperationAdditions, as_NSObject_NSFontManagerDelegate, as_NSObject_NSFontManagerResponderMethod, as_NSObject_NSFontPanelValidationAdditions, as_NSObject_NSKeyValueBindingCreation, as_NSObject_NSKeyValueCoding, as_NSObject_NSKeyValueObserverNotification, as_NSObject_NSKeyValueObserverRegistration, as_NSObject_NSKeyValueObserving, as_NSObject_NSKeyValueObservingCustomization, as_NSObject_NSMenuValidation, as_NSObject_NSNibAwaking, as_NSObject_NSPasteboardOwner, as_NSObject_NSPlaceholders, as_NSObject_NSScriptClassDescription, as_NSObject_NSScripting, as_NSObject_NSScriptingComparisonMethods, as_NSObject_NSScriptKeyValueCoding, as_NSObject_NSScriptObjectSpecifiers, as_NSObject_NSThreadPerformAdditions, as_NSObject_NSURLClient, as_NSObject_NSURLConnectionDelegate, as_NSObject_NSURLDownloadDelegate, copy, create, dealloc, description, doesNotRecognizeSelector, finalize, forwardingTargetForSelector, forwardInvocation, init, isKindOfClass, isKindOfClass, methodForSelector, methodSignatureForSelector, mutableCopy, release, retain, retainCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rococoa.ObjCObject
id
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSObject
autorelease, class_, conformsToProtocol, hash, isEqual, isMemberOfClass, isProxy, performSelector_withObject_withObject, performSelector_withObject, performSelector, respondsToSelector, self, superclass, zone
 

Constructor Detail

NSNetService

public NSNetService()
Method Detail

initWithDomain_type_name_port

public abstract NSNetService initWithDomain_type_name_port(NSString domain,
                                                           NSString type,
                                                           NSString name,
                                                           int port)
This is the initializer for publishing. You should use this initializer if you are going to announce the availability of a service on the network. To publish a service in all available domains, pass the empty string as the domain.
Original signature : -(id)initWithDomain:(NSString*) type:(NSString*) name:(NSString*) port:(int)
native declaration : NSNetServices.h:80


createWithDomain_type_name_port

public static NSNetService createWithDomain_type_name_port(NSString domain,
                                                           NSString type,
                                                           NSString name,
                                                           int port)
Factory method

See Also:
initWithDomain_type_name_port(org.rococoa.cocoa.foundation.NSString, org.rococoa.cocoa.foundation.NSString, org.rococoa.cocoa.foundation.NSString, int)

initWithDomain_type_name

public abstract NSNetService initWithDomain_type_name(NSString domain,
                                                      NSString type,
                                                      NSString name)
This is the initializer for resolution. If you know the domain, type and name of the service for which you wish to discover addresses, you should initialize an NSNetService instance using this method and call resolve: on the result. If you wish to connect to this service immediately, you should call getInputStream:getOutputStream: on the result and forego the resolution step entirely.
If publish: is called on an NSNetService instance initialized with this method, an NSNetServicesBadArgumentError will be sent in the error dictionary to the delegate's netService:didNotPublish: method.
Original signature : -(id)initWithDomain:(NSString*) type:(NSString*) name:(NSString*)
native declaration : NSNetServices.h:86


createWithDomain_type_name

public static NSNetService createWithDomain_type_name(NSString domain,
                                                      NSString type,
                                                      NSString name)
Factory method

See Also:
initWithDomain_type_name(org.rococoa.cocoa.foundation.NSString, org.rococoa.cocoa.foundation.NSString, org.rococoa.cocoa.foundation.NSString)

delegate

public abstract NSNetServiceDelegate delegate()
Original signature : -(id)delegate
native declaration : NSNetServices.h:88


setDelegate

public abstract void setDelegate(NSNetServiceDelegate delegate)
Original signature : -(void)setDelegate:(id)
native declaration : NSNetServices.h:89


scheduleInRunLoop_forMode

public abstract void scheduleInRunLoop_forMode(NSRunLoop aRunLoop,
                                               NSString mode)
NSNetService instances may be scheduled on NSRunLoops to operate in different modes, or in other threads. It is generally not necessary to schedule NSNetServices in other threads. NSNetServices are scheduled in the current thread's NSRunLoop in the NSDefaultRunLoopMode when they are created.
Original signature : -(void)scheduleInRunLoop:(NSRunLoop*) forMode:(NSString*)
native declaration : NSNetServices.h:93


removeFromRunLoop_forMode

public abstract void removeFromRunLoop_forMode(NSRunLoop aRunLoop,
                                               NSString mode)
Original signature : -(void)removeFromRunLoop:(NSRunLoop*) forMode:(NSString*)
native declaration : NSNetServices.h:94


domain

public abstract NSString domain()
Returns the domain of the discovered or published service.
Original signature : -(NSString*)domain
native declaration : NSNetServices.h:98


type

public abstract NSString type()
Returns the type of the discovered or published service.
Original signature : -(NSString*)type
native declaration : NSNetServices.h:102


name

public abstract NSString name()
Returns the name of the discovered or published service.
Original signature : -(NSString*)name
native declaration : NSNetServices.h:106


addresses

public abstract NSArray addresses()
The addresses of the service. This is an NSArray of NSData instances, each of which contains a single struct sockaddr suitable for use with connect(2). In the event that no addresses are resolved for the service or the service has not yet been resolved, an empty NSArray is returned.
Original signature : -(NSArray*)addresses
native declaration : NSNetServices.h:110


port

public abstract NSInteger port()
The port of a resolved service. This returns -1 if the service has not been resolved.
Original signature : -(NSInteger)port
native declaration : NSNetServices.h:115


publish

public abstract void publish()
Advertises a given service on the network. This method returns immediately. Success or failure is indicated by callbacks to the NSNetService instance's delegate.
If the name of the service is the default name (@""), then the service will be renamed automatically. If the name of the service has been specified, then the service will not be renamed automatically. If more control over renaming is required, then -[NSNetService publishWithOptions:] is available.
Original signature : -(void)publish
native declaration : NSNetServices.h:123


publishWithOptions

public abstract void publishWithOptions(int options)
Advertises a given service on the network. This method returns immediately. Success or failure is indicated by callbacks to the NSNetService instance's delegate.
See the notes above for NSNetServiceNoAutoRename for information about controlling the auto-renaming behavior using this method.
Original signature : -(void)publishWithOptions:(NSNetServiceOptions)
native declaration : NSNetServices.h:131

Parameters:
options - @see org.rococoa.cocoa.foundation.FoundationLibrary#NSNetServiceOptions

resolve

public abstract void resolve()
Attempts to determine at least one address for the NSNetService instance. For applications linked on or after Mac OS X 10.4 "Tiger", this method calls -resolveWithTimeout: with a value of 5.0. Applications linked prior to Mac OS X 10.4 "Tiger" must call -stop on the instance after an appropriate (short) amount of time to avoid causing unnecessary network traffic.
Original signature : -(void)resolve
native declaration : NSNetServices.h:137


stop

public abstract void stop()
Halts a service which is either publishing or resolving.
Original signature : -(void)stop
native declaration : NSNetServices.h:141


dictionaryFromTXTRecordData

public static NSDictionary dictionaryFromTXTRecordData(NSData txtData)
Returns an NSDictionary created from the provided NSData. The keys will be UTF8-encoded NSStrings. The values are NSDatas. The caller is responsible for interpreting these as types appropriate to the keys. If the NSData cannot be converted into an appropriate NSDictionary, this method will return nil. For applications linked on or after Mac OS X 10.5, this method will throw an NSInvalidException if it is passed nil as the argument.
Original signature : +(NSDictionary*)dictionaryFromTXTRecordData:(NSData*)
native declaration : NSNetServices.h:147


dataFromTXTRecordDictionary

public static NSData dataFromTXTRecordDictionary(NSDictionary txtDictionary)
Returns an NSData created from the provided dictionary. The keys in the provided dictionary must be NSStrings, and the values must be NSDatas. If the dictionary cannot be converted into an NSData suitable for a TXT record, this method will return nil. For applications linked on or after Mac OS X 10.5, this method will throw an NSInvalidArgumentException if it is passed nil as the argument.
Original signature : +(NSData*)dataFromTXTRecordDictionary:(NSDictionary*)
native declaration : NSNetServices.h:151


hostName

public abstract NSString hostName()
Returns the DNS host name of the computer hosting the discovered or published service. If a successful resolve has not yet occurred, this method will return nil.
Original signature : -(NSString*)hostName
native declaration : NSNetServices.h:155


getInputStream_outputStream

public abstract boolean getInputStream_outputStream(PointerByReference inputStream,
                                                    PointerByReference outputStream)
Retrieves streams from the NSNetService instance. The instance's delegate methods are not called. Returns YES if the streams requested are created successfully. Returns NO if or any reason the stream could not be created. If only one stream is desired, pass NULL for the address of the other stream. The streams that are created are not open, and are not scheduled in any run loop for any mode.
Original signature : -(BOOL)getInputStream:(NSInputStream**) outputStream:(NSOutputStream**)
native declaration : NSNetServices.h:163


setTXTRecordData

public abstract boolean setTXTRecordData(NSData recordData)
Sets the TXT record of the NSNetService instance that has been or will be published. Pass nil to remove the TXT record from the instance.
Original signature : -(BOOL)setTXTRecordData:(NSData*)
native declaration : NSNetServices.h:167


TXTRecordData

public abstract NSData TXTRecordData()
Returns the raw TXT record of the NSNetService instance. If the instance has not been resolved, or the delegate's -netService:didUpdateTXTRecordData: has not been called, this will return nil. It is permitted to have a zero-length TXT record.
Original signature : -(NSData*)TXTRecordData
native declaration : NSNetServices.h:171


startMonitoring

public abstract void startMonitoring()
Starts monitoring the NSNetService instance for events. In Mac OS X 10.4 Tiger, monitored NSNetService instances inform their delegates of changes to the instance's TXT record by calling the delegate's -netService:didUpdateTXTRecordData: method.
Original signature : -(void)startMonitoring
native declaration : NSNetServices.h:175


stopMonitoring

public abstract void stopMonitoring()
Stops monitoring the NSNetService instance for events.
Original signature : -(void)stopMonitoring
native declaration : NSNetServices.h:179


alloc

public static NSNetService alloc()

new_

public static NSNetService new_()

getNSClass

public static NSNetService._class_ getNSClass()


Copyright © 2009. All Rights Reserved.