Skip to content

Commit

Permalink
remove getters
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed committed Jan 20, 2018
1 parent a107839 commit 888e7b6
Show file tree
Hide file tree
Showing 20 changed files with 18 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,4 @@ public void addAddress(final String address) {
public String build() {
return this.addresses.stream().collect(Collectors.joining(","));
}

public double getLatitude() {
return latitude;
}

public double getLongitude() {
return longitude;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public class CasAuthenticationTransactionFailureEvent extends AbstractCasEvent {
* @param failures the failures
* @param credential the credential
*/
public CasAuthenticationTransactionFailureEvent(final Object source, final Map<String, Throwable> failures, final Collection<Credential> credential) {
public CasAuthenticationTransactionFailureEvent(final Object source, final Map<String, Throwable> failures,
final Collection<Credential> credential) {
super(source);
this.failures = failures;
this.credential = credential;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,4 @@ public CasSurrogateAuthenticationFailureEvent(final Object source, final Princip
this.principal = principal;
this.surrogate = surrogate;
}

public Principal getPrincipal() {
return principal;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,4 @@ public CasSurrogateAuthenticationSuccessfulEvent(final Object source, final Prin
this.principal = principal;
this.surrogate = surrogate;
}

public Principal getPrincipal() {
return principal;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public class SimplePrincipal implements Principal {
* @param attributes the attributes
*/
@JsonCreator
protected SimplePrincipal(@NonNull @JsonProperty("id") final String id, @JsonProperty("attributes") final Map<String, Object> attributes) {
protected SimplePrincipal(@NonNull @JsonProperty("id") final String id,
@NonNull @JsonProperty("attributes") final Map<String, Object> attributes) {
this.id = id;
if (attributes == null) {
this.attributes = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
Expand All @@ -23,9 +25,6 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
* Concrete implementation of a TicketGrantingTicket. A TicketGrantingTicket is
Expand Down Expand Up @@ -183,16 +182,6 @@ private static String normalizePath(final Service service) {
return path;
}

/**
* Gets an new map with the service ticket and services accessed by this ticket-granting ticket.
*
* @return a map of service ticket and services accessed by this ticket-granting ticket.
*/
@Override
public synchronized Map<String, Service> getServices() {
return new HashMap<>(this.services);
}

/**
* Remove all services of the TGT (at logout).
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ public MockServiceTicket(final String id, final Service service, final TicketGra
created = ZonedDateTime.now(ZoneOffset.UTC);
}

@Override
public Service getService() {
return service;
}

@Override
public boolean isFromNewLogin() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ public MockTicketGrantingTicket(final String principal) {
new HashMap());
}

@Override
public Authentication getAuthentication() {
return authentication;
}

@Override
public void update() {
usageCount++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,10 @@ public HttpMessage(final URL url, final String message) {
*/
public HttpMessage(final URL url, final String message, final boolean async) {
this.url = url;
this.message = message;
this.message = formatOutputMessageInternal(message);
this.asynchronous = async;
}

public String getMessage() {
return this.formatOutputMessageInternal(this.message);
}

/**
* Encodes the message in UTF-8 format in preparation to send.
*
Expand All @@ -83,7 +79,7 @@ protected String formatOutputMessageInternal(final String message) {
try {
return EncodingUtils.urlEncode(message);
} catch (final Exception e) {
LOGGER.warn("Unable to encode URL", e);
LOGGER.warn("Unable to encode URL " + message, e);
}
return message;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,9 @@ public class AuditTrailEntity {
private String applicationCode;

@Column(name = "AUD_DATE", nullable = false, columnDefinition = "TIMESTAMP")
private ZonedDateTime date;
private ZonedDateTime recordDate;

public AuditTrailEntity() {
this.id = System.currentTimeMillis();
}

public long getId() {
return this.id;
}

public ZonedDateTime getDate() {
return this.date;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,4 @@ public class ConsentDecision {
@Lob
@Column(name = "attributes", length = Integer.MAX_VALUE)
private String attributes;

public LocalDateTime getCreatedDate() {
return createdDate;
}

public ChronoUnit getReminderTimeUnit() {
return reminderTimeUnit;
}

public long getId() {
return id;
}

public ConsentOptions getOptions() {
return options;
}

public Long getReminder() {
return reminder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,4 @@ public enum AccountStatus {

private LocalDate expirationDate;

public AccountStatus getStatus() {
return status;
}

public LocalDate getExpirationDate() {
return expirationDate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,4 @@ public class SamlMetadataDocument {
public SamlMetadataDocument() {
setId(System.currentTimeMillis());
}

public long getId() {
return id;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,7 @@ public ProxyGrantingTicket grantProxyGrantingTicket(final String id, final Authe
public Authentication getAuthentication() {
return this.ticketGrantingTicket.getAuthentication();
}

@Override
public TicketGrantingTicket getTicketGrantingTicket() {
return this.ticketGrantingTicket;
}


@Override
public String getPrefix() {
return SamlAttributeQueryTicket.PREFIX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
@Slf4j
public abstract class AbstractInMemoryThrottledSubmissionHandlerInterceptorAdapter extends AbstractThrottledSubmissionHandlerInterceptorAdapter
implements InMemoryThrottledSubmissionHandlerInterceptor {



private static final double SUBMISSION_RATE_DIVIDEND = 1000.0;

private final ConcurrentMap<String, ZonedDateTime> ipMap = new ConcurrentHashMap<>();

public AbstractInMemoryThrottledSubmissionHandlerInterceptorAdapter(final int failureThreshold, final int failureRangeInSeconds,
public AbstractInMemoryThrottledSubmissionHandlerInterceptorAdapter(final int failureThreshold,
final int failureRangeInSeconds,
final String usernameParameter) {
super(failureThreshold, failureRangeInSeconds, usernameParameter);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package org.apereo.cas.web.support;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.http.HttpStatus;
import org.springframework.http.HttpMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.ToString;
import lombok.Getter;

/**
* Abstract implementation of the handler that has all of the logic. Encapsulates the logic in case we get it wrong!
Expand All @@ -21,6 +23,7 @@
@Slf4j
@ToString
@Getter
@RequiredArgsConstructor
public abstract class AbstractThrottledSubmissionHandlerInterceptorAdapter extends HandlerInterceptorAdapter implements ThrottledSubmissionHandlerInterceptor {

private final int failureThreshold;
Expand All @@ -31,11 +34,6 @@ public abstract class AbstractThrottledSubmissionHandlerInterceptorAdapter exten

private double thresholdRate;

public AbstractThrottledSubmissionHandlerInterceptorAdapter(final int failureThreshold, final int failureRangeInSeconds, final String usernameParameter) {
this.failureThreshold = failureThreshold;
this.failureRangeInSeconds = failureRangeInSeconds;
this.usernameParameter = usernameParameter;
}

/**
* Configure the threshold rate.
Expand Down Expand Up @@ -76,18 +74,6 @@ public void postHandle(final HttpServletRequest request, final HttpServletRespon
}
}

protected double getThresholdRate() {
return this.thresholdRate;
}

protected int getFailureThreshold() {
return this.failureThreshold;
}

protected int getFailureRangeInSeconds() {
return this.failureRangeInSeconds;
}

/**
* Record throttling event.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,4 @@ public class U2FDeviceRegistration {
public U2FDeviceRegistration() {
setId(System.currentTimeMillis());
}

public LocalDate getCreatedDate() {
return createdDate;
}

public long getId() {
return id;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,7 @@ public ExpiredCRLException(final String identifier, final Instant expirationDate
public ZonedDateTime getExpirationDate() {
return this.expirationDate == null ? null : ZonedDateTime.from(this.expirationDate);
}

/**
* @return Returns the leniency.
*/
public int getLeniency() {
return this.leniency;
}


@Override
public String getMessage() {
if (this.leniency > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ public Principal getIssuerDN() {
return this.issuer;
}

@Override
public Date getNextUpdate() {
return this.nextUpdate;
}

@Override
public Set<String> getNonCriticalExtensionOIDs() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,4 @@ public class YubiKeyAccount {
public YubiKeyAccount() {
this.id = System.currentTimeMillis();
}

public long getId() {
return id;
}
}

0 comments on commit 888e7b6

Please sign in to comment.