com.twilio.sdk.resource.instance
Class Member

java.lang.Object
  extended by com.twilio.sdk.resource.Resource
      extended by com.twilio.sdk.resource.InstanceResource
          extended by com.twilio.sdk.resource.instance.Member

public class Member
extends InstanceResource

The Member represents a single Queue member.

Author:
Christer Fahlgren

Field Summary
static String QUEUE_FRONT
          The front of the queue is identified with a special id, "Front".
 
Constructor Summary
Member(TwilioRestClient client, Map<String,Object> properties, String queueSid)
          Constructs a Member by passing in the properties to read from.
Member(TwilioRestClient client, String queueSid)
          Creates a Member representing the front of the queue.
Member(TwilioRestClient client, String queueSid, String callSid)
          Creates a Member.
 
Method Summary
 Member dequeue(String url, String method)
          Dequeue this Member and transfer control to the passed in url and method.
 String getCallSid()
          Retrieves the call sid.
 Date getDateEnqueued()
          Retrieves the Date the call was enqueued.
 String getPosition()
          Retrieves the position of the Member in the queue.
 String getQueueSid()
          Retrieves the queue sid.
 String getWaitTime()
          Retrieves the wait time in the queue for this Member.
 
Methods inherited from class com.twilio.sdk.resource.InstanceResource
getObject, getProperty, update, update
 
Methods inherited from class com.twilio.sdk.resource.Resource
setRequestAccountSid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUEUE_FRONT

public static final String QUEUE_FRONT
The front of the queue is identified with a special id, "Front".

See Also:
Constant Field Values
Constructor Detail

Member

public Member(TwilioRestClient client,
              String queueSid,
              String callSid)
Creates a Member.

Parameters:
client - the TwilioRestClient to use.
queueSid - the queue sid this Member represents.
callSid - the call sid this Member represents

Member

public Member(TwilioRestClient client,
              String queueSid)
Creates a Member representing the front of the queue.

Parameters:
client - the {
queueSid -

Member

public Member(TwilioRestClient client,
              Map<String,Object> properties,
              String queueSid)
Constructs a Member by passing in the properties to read from.

Parameters:
client - the TwilioRestClient to use
properties - the map of properties
Method Detail

getQueueSid

public String getQueueSid()
Retrieves the queue sid.

Returns:
the queue sid

getCallSid

public String getCallSid()
Retrieves the call sid.

Returns:
the call sid

getDateEnqueued

public Date getDateEnqueued()
Retrieves the Date the call was enqueued.

Returns:
the Date the call was enqueued.

getWaitTime

public String getWaitTime()
Retrieves the wait time in the queue for this Member.

Returns:
the wait time as a String

getPosition

public String getPosition()
Retrieves the position of the Member in the queue.

Returns:
the position as a String

dequeue

public Member dequeue(String url,
                      String method)
               throws TwilioRestException
Dequeue this Member and transfer control to the passed in url and method. Returns an updated Member object containing the actual wait time at the time of dequeue.

Parameters:
url - the url to redirect to
method - the method to use
Returns:
an updated Member object
Throws:
TwilioRestException - if communication fails


Copyright © 2011 Twilio, Inc. All Rights Reserved.