|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.techventus.server.voice.Voice
public class Voice
The Class Voice. This class is the basis of the entire API and contains all the components necessary to connect and authenticate with Google Voice, place calls and SMS, and pull in the raw data from the account.
Field Summary | |
---|---|
static java.lang.String |
GOOGLE
The Constant GOOGLE. |
static java.lang.String |
HOSTED
The Constant HOSTED. |
static java.lang.String |
HOSTED_OR_GOOGLE
The Constant HOSTED_OR_GOOGLE. |
boolean |
PRINT_TO_CONSOLE
The PRIN t_ t o_ console. |
Constructor Summary | |
---|---|
Voice(java.lang.String user,
java.lang.String pass)
Instantiates a new Voice Object. |
|
Voice(java.lang.String user,
java.lang.String pass,
java.lang.String source)
A constructor which which allows a custom source. |
|
Voice(java.lang.String user,
java.lang.String pass,
java.lang.String source,
boolean printDebugIntoToSystemOut)
Instantiates a new voice. |
|
Voice(java.lang.String user,
java.lang.String pass,
java.lang.String source,
boolean printDebugIntoToSystemOut,
java.lang.String accountType)
Instantiates a new voice. |
|
Voice(java.lang.String user,
java.lang.String pass,
java.lang.String source,
boolean printDebugIntoToSystemOut,
java.lang.String accountType,
java.lang.String captchaResponse,
java.lang.String captchaToken)
Instantiates a new voice. |
|
Voice(java.lang.String user,
java.lang.String pass,
java.lang.String source,
java.lang.String rnrSee)
Deprecated. |
Method Summary | |
---|---|
java.lang.String |
call(java.lang.String originNumber,
java.lang.String destinationNumber,
java.lang.String phoneType)
Place a call. |
java.lang.String |
cancelCall(java.lang.String originNumber,
java.lang.String destinationNumber,
java.lang.String phoneType)
Cancel a call that was just placed. |
java.lang.String |
deleteMessage(java.lang.String msgID)
Delete message. |
java.io.ByteArrayOutputStream |
downloadVoicemail(java.lang.String msgID)
Downloads a voicemail. |
java.lang.String |
getCaptchaToken()
Gets the captcha token. |
java.lang.String |
getCaptchaUrl()
Gets the captcha url. |
ERROR_CODE |
getError()
Deprecated. |
java.lang.String |
getGeneral()
Fetches the page Source Code for the Voice homepage. |
java.lang.String |
getGeneralPage(int page)
The main Google Voice section is paginated. |
java.util.List<java.lang.String> |
getGroupSettingsList(boolean forceUpdate)
Returns the Group list - Lazy. |
java.lang.String |
getInbox()
Fetches and returns the raw page source code for the Inbox. |
java.lang.String |
getInboxPage(int page)
Gets the inbox page. |
java.lang.String |
getMissed()
Gets the missed calls source code. |
java.lang.String |
getMissedPage(int page)
Gets the missed page. |
java.lang.String |
getPhoneNumber()
Gets the phone number. |
java.lang.String |
getPlaced()
Gets the raw source code for the placed calls page. |
java.lang.String |
getPlacedPage(int page)
Gets the placed page. |
java.lang.String |
getRawPhonesInfo()
Gets the raw phones info. |
java.lang.String |
getReceived()
Gets the received calls source code. |
java.lang.String |
getReceivedPage(int page)
Gets the received page. |
java.lang.String |
getRecent()
Gets the raw page source code for the recent items. |
java.lang.String |
getRecentPage(int page)
Gets the recent page. |
java.lang.String |
getRecorded()
Gets the page source for the recorded calls. |
java.lang.String |
getRecordedPage(int page)
Gets the recorded page. |
AllSettings |
getSettings(boolean forceUpdate)
returns all users settings - lazy. |
java.lang.String |
getSMS()
Gets the SMS page raw source code. |
java.lang.String |
getSMSPage(int page)
Gets the SMS page. |
java.util.Collection<SMSThread> |
getSMSThreads()
Gets a collection of SMS threads. |
java.util.Collection<SMSThread> |
getSMSThreads(java.lang.String response)
Gets the SMS threads from a given Response Page. |
java.lang.String |
getSpam()
Gets the page source for the spam. |
java.lang.String |
getSpamPage(int page)
Gets the spam page. |
java.lang.String |
getStarred()
Gets the raw page source code for the starred items. |
java.lang.String |
getStarredPage(int page)
Gets the starred page. |
java.lang.String |
getUnreadSMS()
Gets the unread sms. |
java.lang.String |
getUnreadSMSPage(int page)
Gets the unread sms page. |
java.lang.String |
getUsername()
Returns the username |
java.lang.String |
getVoicemail()
Gets the Voicemail page raw source code. |
java.util.List<Greeting> |
getVoicemailList(boolean forceUpdate)
Returns the Greeting list - Lazy |
java.lang.String |
getVoicemailPage(int page)
Gets the voicemail page. |
boolean |
isLoggedIn()
Fires a Get request for Recent Items. |
void |
login()
Login Method to refresh authentication with Google Voice. |
void |
login(java.lang.String pCaptchaAnswer,
java.lang.String pCaptchaToken)
Use this login method to login - use captchaAnswer to answer a captcha challenge |
java.lang.String |
markAsRead(java.lang.String msgID)
Mark a Conversation with a known Message ID as read. |
java.lang.String |
markUnRead(java.lang.String msgID)
Mark a Conversation with a known Message ID as unread. |
java.lang.String |
phoneDisable(int ID)
Disable one of the the phones attached to the account from ringing. |
java.lang.String |
phoneEnable(int ID)
Enables one of the the phones attached to the account from ringing. |
void |
phonesDisable(int[] IDs)
Disables multiple phones in one post TODO Test this with multiple phones in an account Make faster - spawn threads Best would be to be able to construct a url which can switch multiple phones at a time. |
void |
phonesEnable(int[] IDs)
Enables multiple phones in one post TODO Test this with multiple phones in an account Best would be to be able to construct a url which can switch multiple phones at a time. |
java.lang.String |
sendSMS(java.lang.String destinationNumber,
java.lang.String txt)
Send an SMS. |
java.lang.String |
sendSMS(java.lang.String destinationNumber,
java.lang.String txt,
SMSThread thread)
Send an SMS. |
java.lang.String |
sendSMS(java.lang.String destinationNumber,
java.lang.String txt,
java.lang.String id)
Send an SMS. |
java.lang.String |
setCallPresentation(boolean announceCaller)
Enables/disables the call Announcement setting (general for all phones). |
java.lang.String |
setDoNotDisturb(boolean dndEnabled)
Activated or deactivated the Do Not disturb function. Enable this to send to voicemail all calls made to your Google number. |
java.lang.String |
setNewGroupSettings(Group group)
Applies the settings for this group. |
java.lang.String |
setVoicemailGreetingId(java.lang.String greetingToSet)
This is the general voicemail greeting callers hear. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean PRINT_TO_CONSOLE
public static final java.lang.String GOOGLE
public static final java.lang.String HOSTED
public static final java.lang.String HOSTED_OR_GOOGLE
Constructor Detail |
---|
@Deprecated public Voice(java.lang.String user, java.lang.String pass, java.lang.String source, java.lang.String rnrSee) throws java.io.IOException
user
- the userpass
- the passsource
- the sourcernrSee
- the rnr see
java.io.IOException
- Signals that an I/O exception has occurred.public Voice(java.lang.String user, java.lang.String pass, java.lang.String source) throws java.io.IOException
user
- the username in the format of user@gmail.com or user@googlemail.compass
- the passwordsource
- Short string identifying your application, for logging purposes. This string should take the form:
"companyName-applicationName-versionID". See: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Request
java.io.IOException
- Signals that an I/O exception has occurred.public Voice(java.lang.String user, java.lang.String pass) throws java.io.IOException
user
- the username in the format of user@gmail.com or user@googlemail.compass
- the pass
java.io.IOException
- Signals that an I/O exception has occurred.public Voice(java.lang.String user, java.lang.String pass, java.lang.String source, boolean printDebugIntoToSystemOut) throws java.io.IOException
user
- the username in the format of user@gmail.com or user@googlemail.compass
- the passwordsource
- the arbitrary source identifier. Can be anything.printDebugIntoToSystemOut
- the print debug into to system out
java.io.IOException
- Signals that an I/O exception has occurred.public Voice(java.lang.String user, java.lang.String pass, java.lang.String source, boolean printDebugIntoToSystemOut, java.lang.String accountType) throws java.io.IOException
user
- the username in the format of user@gmail.com or user@googlemail.compass
- the passwordsource
- the arbitrary source identifier. Can be anything.printDebugIntoToSystemOut
- the print debug into to system outaccountType
- Type of account to request authorization for. Possible values are:
Voice.GOOGLE (get authorization for a Google account only)
Voice.HOSTED (get authorization for a hosted account only)
Voice.HOSTED_OR_GOOGLE (get authorization first for a hosted account; if attempt fails, get authorization for a Google account)
Use Voice.HOSTED_OR_GOOGLE if you're not sure which type of account you want authorization for. If the user information matches both a hosted and a Google account, only the hosted account is authorized.
java.io.IOException
- Signals that an I/O exception has occurred.public Voice(java.lang.String user, java.lang.String pass, java.lang.String source, boolean printDebugIntoToSystemOut, java.lang.String accountType, java.lang.String captchaResponse, java.lang.String captchaToken) throws java.io.IOException
user
- the username in the format of user@gmail.com or user@googlemail.compass
- the passwordsource
- the arbitrary source identifier. Can be anything.printDebugIntoToSystemOut
- the print debug into to system outaccountType
- Type of account to request authorization for. Possible values are:
Voice.GOOGLE (get authorization for a Google account only)
Voice.HOSTED (get authorization for a hosted account only)
Voice.HOSTED_OR_GOOGLE (get authorization first for a hosted account; if attempt fails, get authorization for a Google account)
Use Voice.HOSTED_OR_GOOGLE if you're not sure which type of account you want authorization for. If the user information matches both a hosted and a Google account, only the hosted account is authorized.captchaResponse
- response to a captcha challenge, set to null if normal logincaptchaToken
- (optional) token which matches the response/url from the captcha challenge
java.io.IOException
- Signals that an I/O exception has occurred.Method Detail |
---|
public java.lang.String getUsername()
public java.util.List<Greeting> getVoicemailList(boolean forceUpdate) throws java.io.IOException, gvjava.org.json.JSONException
forceUpdate
- set to true to force a List update from the server
java.io.IOException
- Signals that an I/O exception has occurred.
gvjava.org.json.JSONException
- the jSON exceptionpublic java.util.List<java.lang.String> getGroupSettingsList(boolean forceUpdate) throws java.io.IOException
forceUpdate
- the force update
java.io.IOException
- Signals that an I/O exception has occurred.public AllSettings getSettings(boolean forceUpdate) throws gvjava.org.json.JSONException, java.io.IOException
forceUpdate
- the force update
gvjava.org.json.JSONException
- the jSON exception
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getInbox() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getInboxPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getGeneral() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getGeneralPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getStarred() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getStarredPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getRecent() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getRecentPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getSpam() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getSpamPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getRecorded() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getRecordedPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getPlaced() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getPlacedPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getReceived() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getReceivedPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getMissed() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getMissedPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getUnreadSMS() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getUnreadSMSPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getVoicemail() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getVoicemailPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.io.ByteArrayOutputStream downloadVoicemail(java.lang.String msgID) throws java.io.IOException
msgID
- the msg id
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getSMS() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getSMSPage(int page) throws java.io.IOException
page
- the page
java.io.IOException
- Signals that an I/O exception has occurred.public java.util.Collection<SMSThread> getSMSThreads() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.util.Collection<SMSThread> getSMSThreads(java.lang.String response)
response
- the response
public java.lang.String getPhoneNumber()
public java.lang.String getRawPhonesInfo() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String call(java.lang.String originNumber, java.lang.String destinationNumber, java.lang.String phoneType) throws java.io.IOException
originNumber
- the origin numberdestinationNumber
- the destination numberphoneType
- the phone type, this is a number such as 1,2,7 formatted as a String
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String cancelCall(java.lang.String originNumber, java.lang.String destinationNumber, java.lang.String phoneType) throws java.io.IOException
originNumber
- the origin numberdestinationNumber
- the destination numberphoneType
- the phone type
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String markAsRead(java.lang.String msgID) throws java.io.IOException
msgID
- the msg id
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String markUnRead(java.lang.String msgID) throws java.io.IOException
msgID
- the msg id
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String deleteMessage(java.lang.String msgID) throws java.io.IOException
msgID
- the msg id
java.io.IOException
- Signals that an I/O exception has occurred.public void phonesEnable(int[] IDs) throws java.io.IOException
IDs
- Array of Phones to enable
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String phoneEnable(int ID) throws java.io.IOException
ID
- the iD
java.io.IOException
- Signals that an I/O exception has occurred.public void phonesDisable(int[] IDs) throws java.io.IOException
IDs
- Array of Phones to disable
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String phoneDisable(int ID) throws java.io.IOException
ID
- the iD
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String setCallPresentation(boolean announceCaller) throws java.io.IOException
announceCaller
- java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String setVoicemailGreetingId(java.lang.String greetingToSet) throws java.io.IOException
greetingToSet
- java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String setDoNotDisturb(boolean dndEnabled) throws java.io.IOException
dndEnabled
- true to enable dnd, false to disable it
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String setNewGroupSettings(Group group) throws java.io.IOException
group
- the group
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String sendSMS(java.lang.String destinationNumber, java.lang.String txt, java.lang.String id) throws java.io.IOException
destinationNumber
- the destination numbertxt
- the Text of the message. Messages longer than the allowed
character length will be split into multiple messages.id
- the Text of the message. Messages longer than the allowed
character length will be split into multiple messages.
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String sendSMS(java.lang.String destinationNumber, java.lang.String txt, SMSThread thread) throws java.io.IOException
destinationNumber
- the destination numbertxt
- the Text of the message. Messages longer than the allowed
character length will be split into multiple messages.
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String sendSMS(java.lang.String destinationNumber, java.lang.String txt) throws java.io.IOException
destinationNumber
- the destination numbertxt
- the Text of the message. Messages longer than the allowed
character length will be split into multiple messages.
java.io.IOException
- Signals that an I/O exception has occurred.public void login() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public void login(java.lang.String pCaptchaAnswer, java.lang.String pCaptchaToken) throws java.io.IOException
pCaptchaAnswer
- (optional) String entered by the user as an answer to a CAPTCHA challenge. - null to make a normal login attemptpCaptchaToken
- (optional) token which matches the response/url from the captcha challenge
java.io.IOException
- if login encounters a connection error@Deprecated public ERROR_CODE getError()
public java.lang.String getCaptchaUrl()
public java.lang.String getCaptchaToken()
public boolean isLoggedIn()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |