com.dyuproject.oauth
Class Endpoint

java.lang.Object
  extended by com.dyuproject.oauth.Endpoint
All Implemented Interfaces:
Serializable

public final class Endpoint
extends Object
implements Serializable

Endpoint which contains all the information for the target webservice.

Author:
David Yu
See Also:
Serialized Form
Date created:
Jun 2, 2009

Constructor Summary
Endpoint(String consumerKey, String consumerSecret, boolean secure, String domain, String requestTokenUrl, String authorizeUrl, String accessTokenUrl, Signature signature, Transport transport)
           
Endpoint(String consumerKey, String consumerSecret, boolean secure, String domain, String requestTokenUrl, String authorizationUrl, String accessTokenUrl, String sigMethod, String transportName)
           
 
Method Summary
 String getAccessTokenUrl()
          Gets the url for exchanging the request token with an access token.
 String getAuthorizationUrl()
          Gets the url for authorizing the request token.
 String getConsumerKey()
          Gets the consumer key.
 String getConsumerSecret()
          Gets the consumer secret.
 String getDomain()
          Gets the domain.
 String getRequestTokenUrl()
          Gets the url for obtaining the request token.
 String getRoot()
          Gets the root ("http://" or "https://")
 Signature getSignature()
          Gets the signature used for this endpoint.
 Transport getTransport()
          Gets the transport used for this endpoint; This could either be HttpAuthTransport, HttpGetTransport or HttpPostTransport.
 boolean isSecure()
          Checks whether this endpoint is secure.
static Endpoint load(InputStream in)
          Loads an endpoint from the given InputStream in.
static Endpoint load(Properties props)
          Loads an endpoint from the given Properties props.
static Endpoint load(Properties props, String domain)
          Loads an endpoint from the given Properties props configured for the given domain.
static Endpoint load(String resource)
          Loads an endpoint from the given resource from the classpath.
static Endpoint load(URL resource)
          Loads an endpoint from the given URL resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Endpoint

public Endpoint(String consumerKey,
                String consumerSecret,
                boolean secure,
                String domain,
                String requestTokenUrl,
                String authorizationUrl,
                String accessTokenUrl,
                String sigMethod,
                String transportName)

Endpoint

public Endpoint(String consumerKey,
                String consumerSecret,
                boolean secure,
                String domain,
                String requestTokenUrl,
                String authorizeUrl,
                String accessTokenUrl,
                Signature signature,
                Transport transport)
Method Detail

load

public static Endpoint load(String resource)
                     throws IOException
Loads an endpoint from the given resource from the classpath.

Throws:
IOException

load

public static Endpoint load(URL resource)
                     throws IOException
Loads an endpoint from the given URL resource.

Throws:
IOException

load

public static Endpoint load(InputStream in)
                     throws IOException
Loads an endpoint from the given InputStream in.

Throws:
IOException

load

public static Endpoint load(Properties props)
Loads an endpoint from the given Properties props.


load

public static Endpoint load(Properties props,
                            String domain)
Loads an endpoint from the given Properties props configured for the given domain.


getConsumerKey

public String getConsumerKey()
Gets the consumer key.


getConsumerSecret

public String getConsumerSecret()
Gets the consumer secret.


getDomain

public String getDomain()
Gets the domain.


getRoot

public String getRoot()
Gets the root ("http://" or "https://")


isSecure

public boolean isSecure()
Checks whether this endpoint is secure. ("https")


getRequestTokenUrl

public String getRequestTokenUrl()
Gets the url for obtaining the request token.


getAuthorizationUrl

public String getAuthorizationUrl()
Gets the url for authorizing the request token.


getAccessTokenUrl

public String getAccessTokenUrl()
Gets the url for exchanging the request token with an access token.


getSignature

public Signature getSignature()
Gets the signature used for this endpoint.


getTransport

public Transport getTransport()
Gets the transport used for this endpoint; This could either be HttpAuthTransport, HttpGetTransport or HttpPostTransport.



Copyright © 2008-2013. All Rights Reserved.