Skip to content

Commit

Permalink
Merge pull request #859 from Unicon/hibernate-upgrade
Browse files Browse the repository at this point in the history
Hibernate dependency upgrades
  • Loading branch information
SavvasMisaghMoayyed committed Feb 2, 2015
2 parents eb7ed6f + 389f334 commit 6a6dbc8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.jasig.cas.ticket.TicketGrantingTicket;
import org.jasig.cas.validation.Assertion;

import javax.validation.constraints.NotNull;
import java.util.Collection;
import java.util.List;

Expand Down Expand Up @@ -67,7 +68,7 @@ public interface CentralAuthenticationService {
* @throws AuthenticationException on errors authenticating the credentials
* @throws org.jasig.cas.ticket.TicketException if ticket cannot be created
*/
TicketGrantingTicket createTicketGrantingTicket(Credential... credentials)
TicketGrantingTicket createTicketGrantingTicket(@NotNull Credential... credentials)
throws AuthenticationException, TicketException;


Expand All @@ -85,7 +86,7 @@ TicketGrantingTicket createTicketGrantingTicket(Credential... credentials)
* @throws org.jasig.cas.ticket.InvalidTicketException if ticket is not found or has expired.
* @since 4.1.0
*/
<T extends Ticket> T getTicket(String ticketId, Class<? extends Ticket> clazz)
<T extends Ticket> T getTicket(@NotNull String ticketId, @NotNull Class<? extends Ticket> clazz)
throws InvalidTicketException;

/**
Expand All @@ -100,7 +101,7 @@ <T extends Ticket> T getTicket(String ticketId, Class<? extends Ticket> clazz)
* @return the tickets
* @since 4.1.0
*/
Collection<Ticket> getTickets(Predicate predicate);
Collection<Ticket> getTickets(@NotNull Predicate predicate);

/**
* Grants a {@link org.jasig.cas.ticket.ServiceTicket} that may be used to access the given service.
Expand All @@ -112,7 +113,7 @@ <T extends Ticket> T getTicket(String ticketId, Class<? extends Ticket> clazz)
*
* @throws org.jasig.cas.ticket.TicketException if the ticket could not be created.
*/
ServiceTicket grantServiceTicket(String ticketGrantingTicketId, Service service) throws TicketException;
ServiceTicket grantServiceTicket(@NotNull String ticketGrantingTicketId, @NotNull Service service) throws TicketException;

/**
* Grant a {@link org.jasig.cas.ticket.ServiceTicket} that may be used to access the given service
Expand All @@ -135,7 +136,7 @@ <T extends Ticket> T getTicket(String ticketId, Class<? extends Ticket> clazz)
* @throws org.jasig.cas.ticket.TicketException if the ticket could not be created.
*/
ServiceTicket grantServiceTicket(
final String ticketGrantingTicketId, final Service service, final Credential... credentials)
@NotNull final String ticketGrantingTicketId, @NotNull final Service service, final Credential... credentials)
throws AuthenticationException, TicketException;

/**
Expand All @@ -148,7 +149,7 @@ ServiceTicket grantServiceTicket(
*
* @throws org.jasig.cas.ticket.TicketException if there was an error validating the ticket.
*/
Assertion validateServiceTicket(final String serviceTicketId, final Service service) throws TicketException;
Assertion validateServiceTicket(@NotNull final String serviceTicketId, @NotNull final Service service) throws TicketException;

/**
* Destroy a TicketGrantingTicket and perform back channel logout. This has the effect of invalidating any
Expand All @@ -158,7 +159,7 @@ ServiceTicket grantServiceTicket(
* @param ticketGrantingTicketId the id of the ticket we want to destroy
* @return the logout requests.
*/
List<LogoutRequest> destroyTicketGrantingTicket(final String ticketGrantingTicketId);
List<LogoutRequest> destroyTicketGrantingTicket(@NotNull final String ticketGrantingTicketId);

/**
* Delegate a TicketGrantingTicket to a Service for proxying authentication
Expand All @@ -174,6 +175,6 @@ ServiceTicket grantServiceTicket(
* @throws AuthenticationException on errors authenticating the credentials
* @throws org.jasig.cas.ticket.TicketException if there was an error creating the ticket
*/
TicketGrantingTicket delegateTicketGrantingTicket(final String serviceTicketId, final Credential... credentials)
TicketGrantingTicket delegateTicketGrantingTicket(@NotNull final String serviceTicketId, @NotNull final Credential... credentials)
throws AuthenticationException, TicketException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public CentralAuthenticationServiceImpl(final TicketRegistry ticketRegistry,
@Profiled(tag = "DESTROY_TICKET_GRANTING_TICKET", logFailuresSeparately = false)
@Transactional(readOnly = false)
@Override
public List<LogoutRequest> destroyTicketGrantingTicket(final String ticketGrantingTicketId) {
public List<LogoutRequest> destroyTicketGrantingTicket(@NotNull final String ticketGrantingTicketId) {
try {
logger.debug("Removing ticket [{}] from registry...", ticketGrantingTicketId);
final TicketGrantingTicket ticket = getTicket(ticketGrantingTicketId, TicketGrantingTicket.class);
Expand All @@ -240,8 +240,8 @@ public List<LogoutRequest> destroyTicketGrantingTicket(final String ticketGranti
@Transactional(readOnly = false)
@Override
public ServiceTicket grantServiceTicket(
@NotNull final String ticketGrantingTicketId,
@NotNull final Service service, final Credential... credentials)
final String ticketGrantingTicketId,
final Service service, final Credential... credentials)
throws AuthenticationException, TicketException {

final TicketGrantingTicket ticketGrantingTicket = getTicket(ticketGrantingTicketId, TicketGrantingTicket.class);
Expand Down Expand Up @@ -357,9 +357,6 @@ public ServiceTicket grantServiceTicket(final String ticketGrantingTicketId,
public TicketGrantingTicket delegateTicketGrantingTicket(final String serviceTicketId, final Credential... credentials)
throws AuthenticationException, TicketException {

Assert.notNull(serviceTicketId, "serviceTicketId cannot be null");
Assert.notNull(credentials, "credentials cannot be null");

final ServiceTicket serviceTicket = this.serviceTicketRegistry.getTicket(serviceTicketId, ServiceTicket.class);

if (serviceTicket == null || serviceTicket.isExpired()) {
Expand Down Expand Up @@ -397,7 +394,7 @@ public TicketGrantingTicket delegateTicketGrantingTicket(final String serviceTic
@Profiled(tag="VALIDATE_SERVICE_TICKET", logFailuresSeparately = false)
@Transactional(readOnly = false)
@Override
public Assertion validateServiceTicket(@NotNull final String serviceTicketId, @NotNull final Service service) throws TicketException {
public Assertion validateServiceTicket(final String serviceTicketId, final Service service) throws TicketException {
final RegisteredService registeredService = this.servicesManager.findServiceBy(service);
verifyRegisteredServiceProperties(registeredService, service);

Expand Down Expand Up @@ -461,8 +458,6 @@ public Assertion validateServiceTicket(@NotNull final String serviceTicketId, @N
public TicketGrantingTicket createTicketGrantingTicket(final Credential... credentials)
throws AuthenticationException, TicketException {

Assert.notNull(credentials, "credentials cannot be null");

final Authentication authentication = this.authenticationManager.authenticate(credentials);

final TicketGrantingTicket ticketGrantingTicket = new TicketGrantingTicketImpl(
Expand All @@ -479,7 +474,7 @@ public TicketGrantingTicket createTicketGrantingTicket(final Credential... crede
*/
@Transactional(readOnly = true)
@Override
public <T extends Ticket> T getTicket(@NotNull final String ticketId, @NotNull final Class<? extends Ticket> clazz)
public <T extends Ticket> T getTicket(final String ticketId, final Class<? extends Ticket> clazz)
throws InvalidTicketException {
Assert.notNull(ticketId, "ticketId cannot be null");
final Ticket ticket = this.ticketRegistry.getTicket(ticketId, clazz);
Expand All @@ -505,7 +500,7 @@ public <T extends Ticket> T getTicket(@NotNull final String ticketId, @NotNull f
*/
@Transactional(readOnly = true)
@Override
public Collection<Ticket> getTickets(@NotNull final Predicate predicate) {
public Collection<Ticket> getTickets(final Predicate predicate) {
final Collection<Ticket> c = new HashSet<>(this.ticketRegistry.getTickets());
final Iterator<Ticket> it = c.iterator();
while (it.hasNext()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.jasig.cas.util.http;

import javax.validation.constraints.NotNull;
import java.net.URL;

/**
Expand All @@ -39,21 +40,21 @@ public interface HttpClient {
* @return boolean if the message was sent, or async was used. false if the message failed.
* @since 4.1.0
*/
boolean sendMessageToEndPoint(HttpMessage message);
boolean sendMessageToEndPoint(@NotNull HttpMessage message);

/**
* Make a synchronous HTTP(S) call to ensure that the url is reachable.
*
* @param url the url to call
* @return whether the url is valid
*/
boolean isValidEndPoint(String url);
boolean isValidEndPoint(@NotNull String url);

/**
* Make a synchronous HTTP(S) call to ensure that the url is reachable.
*
* @param url the url to call
* @return whether the url is valid
*/
boolean isValidEndPoint(URL url);
boolean isValidEndPoint(@NotNull URL url);
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public SimpleHttpClient(final List<Integer> acceptableCodes, final CloseableHttp
}

@Override
public boolean sendMessageToEndPoint(@NotNull final HttpMessage message) {
public boolean sendMessageToEndPoint(final HttpMessage message) {
Assert.notNull(this.httpClient);

try {
Expand Down
22 changes: 19 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,20 @@
<scope>compile</scope>
</dependency>

<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>${javax.el-api.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.el</artifactId>
<version>${javax.el-impl.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down Expand Up @@ -1227,11 +1241,11 @@
<spring.security.version>3.2.5.RELEASE</spring.security.version>
<clover.version>2.6.3</clover.version>
<aspectj.version>1.8.2</aspectj.version>
<javax.validation.version>1.0.0.GA</javax.validation.version>
<javax.validation.version>1.1.0.Final</javax.validation.version>
<perf4j.version>0.9.16</perf4j.version>
<commons.jexl.version>1.1</commons.jexl.version>
<hibernate.validator.version>4.3.2.Final</hibernate.validator.version>
<hibernate.core.version>4.3.6.Final</hibernate.core.version>
<hibernate.validator.version>5.1.3.Final</hibernate.validator.version>
<hibernate.core.version>4.3.8.Final</hibernate.core.version>
<slf4j.version>1.7.9</slf4j.version>
<person.directory.version>1.6.1</person.directory.version>
<servlet.api.version>3.0.1</servlet.api.version>
Expand Down Expand Up @@ -1262,6 +1276,8 @@
<google.guava.version>18.0</google.guava.version>
<jcache.version>1.0.0</jcache.version>
<jcache.ri.version>1.0.0</jcache.ri.version>
<javax.el-api.version>2.2.5</javax.el-api.version>
<javax.el-impl.version>2.2.6</javax.el-impl.version>

<!-- Plugin Versions -->
<coveralls-maven-plugin.version>3.0.1</coveralls-maven-plugin.version>
Expand Down

0 comments on commit 6a6dbc8

Please sign in to comment.