de.avetana.bluetooth.sdp
Class ServiceDescriptor

java.lang.Object
  extended byde.avetana.bluetooth.sdp.ServiceDescriptor
All Implemented Interfaces:
java.io.Serializable

public class ServiceDescriptor
extends java.lang.Object
implements java.io.Serializable

An helper class for the ServiceFinder class.

COPYRIGHT:
(c) Copyright 2004 Avetana GmbH ALL RIGHTS RESERVED.

This file is part of the Avetana bluetooth API for Linux.

The Avetana bluetooth API for Linux is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The Avetana bluetooth API is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The development of the Avetana bluetooth API is based on the work of Christian Lorenz (see the Javabluetooth Stack at http://www.javabluetooth.org) for some classes, on the work of the jbluez team (see http://jbluez.sourceforge.net/) and on the work of the bluez team (see the BlueZ linux Stack at http://www.bluez.org) for the C code. Classes, part of classes, C functions or part of C functions programmed by these teams and/or persons are explicitly mentioned.



Description:
This is an helper class for the ServiceFinder class. This class has nothing to do with the JSR82 specification and just exists in order to provide a serializable Service description. The implementation as well as the the possibilities of this class are very basic.

See Also:
Serialized Form

Constructor Summary
ServiceDescriptor(BTAddress addr)
          Creates a new ServiceDescriptor object and sets the BTAddress of the remote device
ServiceDescriptor(RemoteDevice dev)
          Creates a new ServiceDescriptor object and sets the remote device
 
Method Summary
 BTAddress getBTAddress()
          Returns the BT address of the remote device this service belongs to.
 java.lang.String getRemoteName()
          Returns the name of the remote device this service belongs to
 java.lang.String getServiceName()
          Returns the name of the service
 java.lang.String getServiceURL()
          Returns the connection URL for this service
 void parseServiceRecord(ServiceRecord rec, int security, boolean master)
          Parses the Service record and fills the variables of this class.
 void setBTAddress(BTAddress newAdr)
          Sets the BT address of the remote device
 void setRemoteName(java.lang.String name)
          Sets the name of the remote device
 void setServiceName(java.lang.String name)
          Sets the name if the record
 void setServiceURL(java.lang.String URL)
          Sets the URL requested to connect to this record
 java.lang.String toString()
          Returns the String representation used in the JTree of the ServiceFinder class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceDescriptor

public ServiceDescriptor(BTAddress addr)
Creates a new ServiceDescriptor object and sets the BTAddress of the remote device

Parameters:
addr - The BTAddress of the remote device

ServiceDescriptor

public ServiceDescriptor(RemoteDevice dev)
                  throws java.lang.Exception
Creates a new ServiceDescriptor object and sets the remote device

Parameters:
dev - The remote device
Throws:
java.lang.Exception - If the BT address of this device could not be parsed.
Method Detail

setRemoteName

public void setRemoteName(java.lang.String name)
Sets the name of the remote device

Parameters:
name - The name of the remote device

setServiceName

public void setServiceName(java.lang.String name)
Sets the name if the record

Parameters:
name - The name of the record

setServiceURL

public void setServiceURL(java.lang.String URL)
Sets the URL requested to connect to this record

Parameters:
URL - The connection URL

setBTAddress

public void setBTAddress(BTAddress newAdr)
Sets the BT address of the remote device

Parameters:
newAdr - The BT address of the remote device

getRemoteName

public java.lang.String getRemoteName()
Returns the name of the remote device this service belongs to

Returns:
The name of the remote device this service belongs to

getBTAddress

public BTAddress getBTAddress()
Returns the BT address of the remote device this service belongs to.

Returns:
The BT address of the remote device this service belongs to.

getServiceURL

public java.lang.String getServiceURL()
Returns the connection URL for this service

Returns:
The connection URL for this service

getServiceName

public java.lang.String getServiceName()
Returns the name of the service

Returns:
The name of the service

parseServiceRecord

public void parseServiceRecord(ServiceRecord rec,
                               int security,
                               boolean master)
Parses the Service record and fills the variables of this class.

Parameters:
rec - The service record
security - The security flags
master - Is the local device master?

toString

public java.lang.String toString()
Returns the String representation used in the JTree of the ServiceFinder class.

Returns:
The String representation used in the JTree of the ServiceFinder class.