org.opennms.sms.phonebook
Class PropertyPhonebook

java.lang.Object
  extended by org.opennms.sms.phonebook.PropertyPhonebook
All Implemented Interfaces:
Phonebook

public class PropertyPhonebook
extends Object
implements Phonebook

PropertyPhonebook class.

Version:
$Id: $
Author:
ranger

Constructor Summary
PropertyPhonebook()
          Initialize the phone book.
PropertyPhonebook(String filename)
          Initialize the phone book with the given property filename.
 
Method Summary
 String getPropertyFile()
          getPropertyFile
 String getTargetForAddress(String address)
          Get an SMS message target given an IP address.
 void setPropertyFile(String filename)
          setPropertyFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyPhonebook

public PropertyPhonebook()
Initialize the phone book. Defaults to assuming "smsPhonebook.properties" will exist in the classpath, and contain address -> phone number mappings.

Throws:
PhonebookException - if any.

PropertyPhonebook

public PropertyPhonebook(String filename)
Initialize the phone book with the given property filename. The filename must exist either as a path (a @{link File} object) or a resource in the class path.

Parameters:
filename - the name of the phone book file
Throws:
PhonebookException - if any.
Method Detail

getPropertyFile

public String getPropertyFile()

getPropertyFile

Returns:
a String object.

setPropertyFile

public void setPropertyFile(String filename)

setPropertyFile

Parameters:
filename - a String object.

getTargetForAddress

public String getTargetForAddress(String address)
                           throws PhonebookException
Get an SMS message target given an IP address.

Specified by:
getTargetForAddress in interface Phonebook
Parameters:
address - the IP address
Returns:
a string representing the SMS "to" (usually a phone number or SMS email address)
Throws:
PhonebookException - if any.


Copyright © 2011. All Rights Reserved.