/*
* Copyright (c) 2009 Lockheed Martin Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.eurekastreams.server.domain;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import org.eurekastreams.commons.model.DomainEntity;
/**
* Represents the OAuth protocol details for shindig acting as an OAuth service provider.
*/
@SuppressWarnings("serial")
@Entity
public class OAuthDomainEntry extends DomainEntity implements Serializable
{
/**
* The consumer that is being issued the token.
*/
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "consumerId")
private OAuthConsumer consumer;
/**
* Flag to see if the callback is signed (if using OAuth 1.0 A).
*/
@Column(nullable = false)
private boolean callbackUrlSigned;
/**
* Flag to see if the access token has been authorized.
*/
@Column(nullable = false)
private boolean authorized;
/**
* The date the token was first issued.
*/
@Column(nullable = false)
private Date issueTime;
/**
* Number of attempts made using the callback token.
*/
@Column(nullable = false)
private int callbackTokenAttempts;
/**
* The application ID.
*/
@Column(nullable = true)
private String appId;
/**
* The callback URL (if using OAuth 1.0 A).
*/
@Column(nullable = true)
private String callbackUrl;
/**
* The user identifier.
*/
@Column(nullable = true)
private String userId;
/**
* The token itself.
*/
@Column(nullable = false)
private String token;
/**
* The token secret generated by the provider.
*/
@Column(nullable = false)
private String tokenSecret;
/**
* Type of token being issued.
*/
@Column(nullable = false)
private String type;
/**
* Name of the domain.
*/
@Column(nullable = false)
private String domain;
/**
* Name of the container.
*/
@Column(nullable = false)
private String container;
/**
* The version of the OAuth protocol being used.
*/
@Column(nullable = false)
private String oauthVersion;
/**
* The callback token issued by the provider.
*/
@Column(nullable = true)
private String callbackToken;
/**
* @return the consumer
*/
public OAuthConsumer getConsumer()
{
return consumer;
}
/**
* @param inConsumer
* the consumer to set
*/
public void setConsumer(final OAuthConsumer inConsumer)
{
consumer = inConsumer;
}
/**
* @return the callbackUrlSigned
*/
public boolean isCallbackUrlSigned()
{
return callbackUrlSigned;
}
/**
* @param inCallbackUrlSigned
* the callbackUrlSigned to set
*/
public void setCallbackUrlSigned(final boolean inCallbackUrlSigned)
{
callbackUrlSigned = inCallbackUrlSigned;
}
/**
* @return the authorized
*/
public boolean isAuthorized()
{
return authorized;
}
/**
* @param inAuthorized
* the authorized to set
*/
public void setAuthorized(final boolean inAuthorized)
{
authorized = inAuthorized;
}
/**
* @return the issueTime
*/
public Date getIssueTime()
{
return issueTime;
}
/**
* @param inIssueTime
* the issueTime to set
*/
public void setIssueTime(final Date inIssueTime)
{
issueTime = inIssueTime;
}
/**
* @return the callbackTokenAttempts
*/
public int getCallbackTokenAttempts()
{
return callbackTokenAttempts;
}
/**
* @param inCallbackTokenAttempts
* the callbackTokenAttempts to set
*/
public void setCallbackTokenAttempts(final int inCallbackTokenAttempts)
{
callbackTokenAttempts = inCallbackTokenAttempts;
}
/**
* @return the appId
*/
public String getAppId()
{
return appId;
}
/**
* @param inAppId
* the appId to set
*/
public void setAppId(final String inAppId)
{
appId = inAppId;
}
/**
* @return the callbackUrl
*/
public String getCallbackUrl()
{
return callbackUrl;
}
/**
* @param inCallbackUrl
* the callbackUrl to set
*/
public void setCallbackUrl(final String inCallbackUrl)
{
callbackUrl = inCallbackUrl;
}
/**
* @return the userId
*/
public String getUserId()
{
return userId;
}
/**
* @param inUserId
* the userId to set
*/
public void setUserId(final String inUserId)
{
userId = inUserId;
}
/**
* @return the token
*/
public String getToken()
{
return token;
}
/**
* @param inToken
* the token to set
*/
public void setToken(final String inToken)
{
token = inToken;
}
/**
* @return the tokenSecret
*/
public String getTokenSecret()
{
return tokenSecret;
}
/**
* @param inTokenSecret
* the tokenSecret to set
*/
public void setTokenSecret(final String inTokenSecret)
{
tokenSecret = inTokenSecret;
}
/**
* @return the type
*/
public String getType()
{
return type;
}
/**
* @param inType
* the type to set
*/
public void setType(final String inType)
{
type = inType;
}
/**
* @return the domain
*/
public String getDomain()
{
return domain;
}
/**
* @param inDomain
* the domain to set
*/
public void setDomain(final String inDomain)
{
domain = inDomain;
}
/**
* @return the container
*/
public String getContainer()
{
return container;
}
/**
* @param inContainer
* the container to set
*/
public void setContainer(final String inContainer)
{
container = inContainer;
}
/**
* @return the oauthVersion
*/
public String getOauthVersion()
{
return oauthVersion;
}
/**
* @param inOauthVersion
* the oauthVersion to set
*/
public void setOauthVersion(final String inOauthVersion)
{
oauthVersion = inOauthVersion;
}
/**
* @return the callbackToken
*/
public String getCallbackToken()
{
return callbackToken;
}
/**
* @param inCallbackToken
* the callbackToken to set
*/
public void setCallbackToken(final String inCallbackToken)
{
callbackToken = inCallbackToken;
}
}