|
Spring Social | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.social.connect.support.AbstractConnection<A>
A
- the service provider's API typepublic abstract class AbstractConnection<A>
Base support class for Connection
implementations.
Defines the state and behavior that is common across connection implementations and independent of any specific authorization protocol.
Constructor Summary | |
---|---|
AbstractConnection(ApiAdapter<A> apiAdapter)
Creates a new connection. |
|
AbstractConnection(ConnectionData data,
ApiAdapter<A> apiAdapter)
Creates a connection from the data provider. |
Method Summary | |
---|---|
abstract ConnectionData |
createData()
Creates a data transfer object that can be used to persist the state of this connection. |
boolean |
equals(java.lang.Object o)
|
UserProfile |
fetchUserProfile()
Fetch a normalized model of the user's profile on the provider system. |
abstract A |
getApi()
A Java binding to the service provider's native API. |
java.lang.String |
getDisplayName()
A display name or label for this connection. |
java.lang.String |
getImageUrl()
A link to a image that visualizes this connection. |
ConnectionKey |
getKey()
The key identifying this connection. |
protected java.lang.Object |
getMonitor()
Provides subclasses with access to a monitor that can be used to synchronize access to this connection. |
java.lang.String |
getProfileUrl()
The public URL of the connected user's profile at the provider's site. |
boolean |
hasExpired()
Returns true if this connection has expired. |
int |
hashCode()
|
protected void |
initKey(java.lang.String providerId,
java.lang.String providerUserId)
Hook that should be called by subclasses to initialize the key property when establishing a new connection. |
void |
refresh()
Refresh this connection. |
void |
sync()
Sync's this connection object with the current state of the external user's profile. |
boolean |
test()
Test this connection. |
void |
updateStatus(java.lang.String message)
Update the user's status on the provider's system. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractConnection(ApiAdapter<A> apiAdapter)
apiAdapter
- the Service API adapterpublic AbstractConnection(ConnectionData data, ApiAdapter<A> apiAdapter)
data
- the connection dataapiAdapter
- the Service API adapterMethod Detail |
---|
public ConnectionKey getKey()
Connection
getKey
in interface Connection<A>
public java.lang.String getDisplayName()
Connection
getDisplayName
in interface Connection<A>
Connection.sync()
public java.lang.String getProfileUrl()
Connection
getProfileUrl
in interface Connection<A>
Connection.sync()
public java.lang.String getImageUrl()
Connection
getImageUrl
in interface Connection<A>
Connection.sync()
public boolean test()
Connection
api
will fail.
Used to proactively test authorization credentials such as an API access token before invoking the service API.
test
in interface Connection<A>
public boolean hasExpired()
Connection
Connection.test()
return false, and any service API invocations fail.
If expired, you may call Connection.refresh()
to renew the connection.
Not supported by all Connection implementations; always returns false if not supported.
hasExpired
in interface Connection<A>
public void refresh()
Connection
Connection.hasExpired()
returns false.
Not supported by all connection implementations; if not supported, this method is a no-op.
refresh
in interface Connection<A>
public UserProfile fetchUserProfile()
Connection
fetchUserProfile
in interface Connection<A>
public void updateStatus(java.lang.String message)
Connection
updateStatus
in interface Connection<A>
message
- the status messagepublic void sync()
Connection
sync
in interface Connection<A>
public abstract A getApi()
Connection
getApi
in interface Connection<A>
public abstract ConnectionData createData()
Connection
createData
in interface Connection<A>
protected void initKey(java.lang.String providerId, java.lang.String providerUserId)
providerId
- the providerIdproviderUserId
- the providerUserIdprotected java.lang.Object getMonitor()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
Spring Social | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |