代码优化
This commit is contained in:
@@ -55,6 +55,7 @@ public abstract class AbstractWebApplicationService {
|
||||
this.artifactId = artifactId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String toString() {
|
||||
return this.id;
|
||||
}
|
||||
@@ -102,6 +103,7 @@ public abstract class AbstractWebApplicationService {
|
||||
return this.originalUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object object) {
|
||||
if (object == null) {
|
||||
return false;
|
||||
@@ -116,6 +118,7 @@ public abstract class AbstractWebApplicationService {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 41;
|
||||
int result = 1;
|
||||
|
||||
@@ -27,6 +27,7 @@ public abstract class RandomServiceTicketServices implements TicketServices {
|
||||
|
||||
private DefaultUniqueTicketIdGenerator generator=new DefaultUniqueTicketIdGenerator();
|
||||
|
||||
@Override
|
||||
public String createTicket(Ticket ticket) {
|
||||
//String code = generator.generate();
|
||||
/*
|
||||
@@ -83,6 +84,7 @@ public abstract class RandomServiceTicketServices implements TicketServices {
|
||||
return ticketId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ticket consumeTicket(String ticketId) throws Exception{
|
||||
Ticket ticket = this.remove(ticketId);
|
||||
if (ticket == null) {
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ServiceTicketImpl extends AbstractTicket implements ServiceTicket{
|
||||
* policy in that, depending on the policy configuration, the ticket
|
||||
* may be considered expired.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean isValidFor(final Service serviceToValidate) {
|
||||
update();
|
||||
return serviceToValidate.matches(this.service);
|
||||
|
||||
@@ -41,6 +41,7 @@ public class DefaultExpiringOAuth2RefreshToken extends DefaultOAuth2RefreshToken
|
||||
*
|
||||
* @return The instant the token expires.
|
||||
*/
|
||||
@Override
|
||||
public Date getExpiration() {
|
||||
return expiration;
|
||||
}
|
||||
|
||||
@@ -95,10 +95,12 @@ public class DefaultOAuth2AccessToken implements Serializable, OAuth2AccessToken
|
||||
*
|
||||
* @return The token value.
|
||||
*/
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpiresIn() {
|
||||
return expiration != null ? Long.valueOf((expiration.getTime() - System.currentTimeMillis()) / 1000L).intValue()
|
||||
: 0;
|
||||
@@ -113,6 +115,7 @@ public class DefaultOAuth2AccessToken implements Serializable, OAuth2AccessToken
|
||||
*
|
||||
* @return The instant the token expires.
|
||||
*/
|
||||
@Override
|
||||
public Date getExpiration() {
|
||||
return expiration;
|
||||
}
|
||||
@@ -131,6 +134,7 @@ public class DefaultOAuth2AccessToken implements Serializable, OAuth2AccessToken
|
||||
*
|
||||
* @return true if the expiration is befor ethe current time
|
||||
*/
|
||||
@Override
|
||||
public boolean isExpired() {
|
||||
return expiration != null && expiration.before(new Date());
|
||||
}
|
||||
@@ -142,6 +146,7 @@ public class DefaultOAuth2AccessToken implements Serializable, OAuth2AccessToken
|
||||
*
|
||||
* @return The token type, as introduced in draft 11 of the OAuth 2 spec.
|
||||
*/
|
||||
@Override
|
||||
public String getTokenType() {
|
||||
return tokenType;
|
||||
}
|
||||
@@ -161,6 +166,7 @@ public class DefaultOAuth2AccessToken implements Serializable, OAuth2AccessToken
|
||||
*
|
||||
* @return The refresh token associated with the access token, if any.
|
||||
*/
|
||||
@Override
|
||||
public OAuth2RefreshToken getRefreshToken() {
|
||||
return refreshToken;
|
||||
}
|
||||
@@ -180,6 +186,7 @@ public class DefaultOAuth2AccessToken implements Serializable, OAuth2AccessToken
|
||||
*
|
||||
* @return The scope of the token.
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getScope() {
|
||||
return scope;
|
||||
}
|
||||
@@ -249,6 +256,7 @@ public class DefaultOAuth2AccessToken implements Serializable, OAuth2AccessToken
|
||||
*
|
||||
* @return the additional information (default empty)
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getAdditionalInformation() {
|
||||
return additionalInformation;
|
||||
}
|
||||
|
||||
@@ -108,14 +108,15 @@ public class ExtractPostBindingAdapter implements ExtractBindingAdapter, Initial
|
||||
@Override
|
||||
public String extractSAMLMessage(HttpServletRequest request) {
|
||||
|
||||
if(StringUtils.isNotBlank(request.getParameter(SAML_REQUEST_POST_PARAM_NAME)))
|
||||
if(StringUtils.isNotBlank(request.getParameter(SAML_REQUEST_POST_PARAM_NAME))) {
|
||||
return request.getParameter(SAML_REQUEST_POST_PARAM_NAME);
|
||||
else
|
||||
}else {
|
||||
return request.getParameter(SAML_RESPONSE_POST_PARAM_NAME);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void buildSecurityPolicyResolver(KeyStore trustKeyStore) {
|
||||
_logger.debug("EntityName {}, KeystorePassword {}",
|
||||
keyStoreLoader.getEntityName(),keyStoreLoader.getKeystorePassword());
|
||||
@@ -133,6 +134,7 @@ public class ExtractPostBindingAdapter implements ExtractBindingAdapter, Initial
|
||||
/**
|
||||
* @param securityPolicyResolver the securityPolicyResolver to set
|
||||
*/
|
||||
@Override
|
||||
public void setSecurityPolicyResolver(
|
||||
SecurityPolicyResolver securityPolicyResolver) {
|
||||
this.securityPolicyResolver = securityPolicyResolver;
|
||||
@@ -148,10 +150,12 @@ public class ExtractPostBindingAdapter implements ExtractBindingAdapter, Initial
|
||||
this.saml20Detail=saml20Detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppsSAML20Details getSaml20Detail() {
|
||||
return saml20Detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public KeyStoreLoader getKeyStoreLoader() {
|
||||
return keyStoreLoader;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public class ExtractRedirectBindingAdapter extends ExtractPostBindingAdapter{
|
||||
this.securityPolicyResolver = securityPolicyResolver;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSecurityPolicyResolver(KeyStore trustKeyStore) {
|
||||
|
||||
TrustResolver trustResolver = new TrustResolver(trustKeyStore,
|
||||
|
||||
@@ -171,6 +171,7 @@ public class PostBindingAdapter implements BindingAdapter, InitializingBean{
|
||||
/**
|
||||
* @param securityPolicyResolver the securityPolicyResolver to set
|
||||
*/
|
||||
@Override
|
||||
public void setSecurityPolicyResolver(
|
||||
SecurityPolicyResolver securityPolicyResolver) {
|
||||
this.securityPolicyResolver = securityPolicyResolver;
|
||||
@@ -186,6 +187,7 @@ public class PostBindingAdapter implements BindingAdapter, InitializingBean{
|
||||
return extractBindingAdapter.getKeyStoreLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Credential getSigningCredential() {
|
||||
return signingCredential;
|
||||
}
|
||||
@@ -194,6 +196,7 @@ public class PostBindingAdapter implements BindingAdapter, InitializingBean{
|
||||
this.signingCredential = signingCredential;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Credential getSpSigningCredential() {
|
||||
return spSigningCredential;
|
||||
}
|
||||
@@ -202,14 +205,17 @@ public class PostBindingAdapter implements BindingAdapter, InitializingBean{
|
||||
this.spSigningCredential = spSigningCredential;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuthnRequestInfo getAuthnRequestInfo() {
|
||||
return authnRequestInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAuthnRequestInfo(AuthnRequestInfo authnRequestInfo) {
|
||||
this.authnRequestInfo = authnRequestInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRelayState(String relayState) {
|
||||
this.relayState = relayState;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user