org.opennms.serviceregistration.strategies
Class AppleStrategy

java.lang.Object
  extended by org.opennms.serviceregistration.strategies.AppleStrategy
All Implemented Interfaces:
com.apple.dnssd.BaseListener, com.apple.dnssd.RegisterListener, ServiceRegistrationStrategy

public class AppleStrategy
extends java.lang.Object
implements ServiceRegistrationStrategy, com.apple.dnssd.RegisterListener


Constructor Summary
AppleStrategy()
           
 
Method Summary
 void initialize(java.lang.String serviceType, java.lang.String serviceName, int port)
          Initialize the service registration strategy.
 void initialize(java.lang.String serviceType, java.lang.String serviceName, int port, java.util.Hashtable<java.lang.String,java.lang.String> properties)
          Initialize the service registration strategy.
 void operationFailed(com.apple.dnssd.DNSSDService service, int errorCode)
           
 void register()
          Register the service.
 void serviceRegistered(com.apple.dnssd.DNSSDRegistration registration, int flags, java.lang.String serviceName, java.lang.String regType, java.lang.String domain)
           
 void unregister()
          Unregister the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppleStrategy

public AppleStrategy()
              throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

initialize

public void initialize(java.lang.String serviceType,
                       java.lang.String serviceName,
                       int port)
                throws java.lang.Exception
Description copied from interface: ServiceRegistrationStrategy
Initialize the service registration strategy.

Specified by:
initialize in interface ServiceRegistrationStrategy
Parameters:
serviceType - the service type string (eg, "http")
serviceName - the name of the service (eg, "My Service")
port - the port the service is listening on
Throws:
java.lang.Exception

initialize

public void initialize(java.lang.String serviceType,
                       java.lang.String serviceName,
                       int port,
                       java.util.Hashtable<java.lang.String,java.lang.String> properties)
                throws java.lang.Exception
Description copied from interface: ServiceRegistrationStrategy
Initialize the service registration strategy.

Specified by:
initialize in interface ServiceRegistrationStrategy
Parameters:
serviceType - the service type string (eg, "http")
serviceName - the name of the service (eg, "My Service")
port - the port the service is listening on
properties - other properties (eg, path = "/opennms")
Throws:
java.lang.Exception

register

public void register()
              throws java.lang.Exception
Description copied from interface: ServiceRegistrationStrategy
Register the service.

Specified by:
register in interface ServiceRegistrationStrategy
Throws:
java.lang.Exception

unregister

public void unregister()
                throws java.lang.Exception
Description copied from interface: ServiceRegistrationStrategy
Unregister the service.

Specified by:
unregister in interface ServiceRegistrationStrategy
Throws:
java.lang.Exception

serviceRegistered

public void serviceRegistered(com.apple.dnssd.DNSSDRegistration registration,
                              int flags,
                              java.lang.String serviceName,
                              java.lang.String regType,
                              java.lang.String domain)
Specified by:
serviceRegistered in interface com.apple.dnssd.RegisterListener

operationFailed

public void operationFailed(com.apple.dnssd.DNSSDService service,
                            int errorCode)
Specified by:
operationFailed in interface com.apple.dnssd.BaseListener


Copyright © 2007. All Rights Reserved.