Changeset 794


Ignore:
Timestamp:
05/12/11 23:10:19 (8 years ago)
Author:
philsmart
Message:
 
Location:
raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/Event.java

    r788 r794  
    2424 
    2525/** 
     26 * For any class that extends this class, equality must be computed for the 
     27 * same fields as the hash. Otherwise a discrepancy will occur when checking 
     28 * containment through object equality (e.g. set containment), and through hashcodes. 
     29 *  
    2630 * @author philsmart 
    2731 * 
     
    2933public class Event { 
    3034 
    31     /** used if a persistant db primary key is required */ 
     35    /** used if a persistant db primary key is required. Not to  
     36     * be used in the computation of the hash or equals methods */ 
    3237    private Long persistantId; 
    3338 
    3439    /** attributes generic to all entries */ 
    3540    private DateTime eventTime; 
    36     private long eventId; 
     41     
     42    /** Event id, as generated and added by the hashcode of this method. 
     43     * Not to be used in computation of the hash or equals methods. 
     44     */ 
     45    private int eventId; 
    3746    private String serviceId; 
    3847    private String eventType; 
     
    172181    } 
    173182 
    174     public void setEventId(long eventId) { 
     183    public void setEventId(int eventId) { 
    175184        this.eventId = eventId; 
    176185    } 
    177186 
    178     public long getEventId() { 
     187    public int getEventId() { 
    179188        return eventId; 
    180189    } 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/EzproxyAuthenticationEvent.java

    r788 r794  
    9292        hash = HashCodeUtil.hash(hash,getResourceHost()); 
    9393        hash = HashCodeUtil.hash(hash,getPrincipalName()); 
    94         hash = HashCodeUtil.hash(hash,getEventId()); 
    9594        hash = HashCodeUtil.hash(hash,getEventType()); 
    9695        hash = HashCodeUtil.hash(hash,getServiceId()); 
     
    134133          EqualsUtil.areEqual(this.getServiceId(), that.getServiceId()) && 
    135134          EqualsUtil.areEqual(this.getEventType(), that.getEventType()) && 
    136           EqualsUtil.areEqual(this.getEventId(), that.getEventId()) && 
    137135          EqualsUtil.areEqual(this.getResourceId(), that.getResourceId()) && 
    138136          EqualsUtil.areEqual(this.getPrincipalName(), that.getPrincipalName()); 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/ShibbolethIdpAuthenticationEvent.java

    r788 r794  
    1010import java.util.List; 
    1111 
     12import org.slf4j.Logger; 
     13import org.slf4j.LoggerFactory; 
     14 
    1215import uk.ac.cardiff.utility.EqualsUtil; 
    1316import uk.ac.cardiff.utility.HashCodeUtil; 
     
    1821 */ 
    1922public class ShibbolethIdpAuthenticationEvent extends AuthenticationEvent{ 
     23 
    2024 
    2125        private String requestId; 
     
    144148              EqualsUtil.areEqual(this.getServiceId(), that.getServiceId()) && 
    145149              EqualsUtil.areEqual(this.getEventType(), that.getEventType()) && 
    146               EqualsUtil.areEqual(this.getEventId(), that.getEventId()) && 
    147150              EqualsUtil.areEqual(this.getResourceId(), that.getResourceId()) && 
    148151              Arrays.equals(this.getAssertionId(), that.getAssertionId()) && 
     
    191194            hash = HashCodeUtil.hash(hash,getResponseId()); 
    192195            hash = HashCodeUtil.hash(hash,getAssertionId()); 
    193             hash = HashCodeUtil.hash(hash,getEventId()); 
    194196            hash = HashCodeUtil.hash(hash,getEventType()); 
    195197            hash = HashCodeUtil.hash(hash,getServiceId()); 
    196198            hash = HashCodeUtil.hash(hash,getResourceId()); 
    197  
    198199            return hash; 
    199200 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/event.hbm.xml

    r788 r794  
    3838                <property name="resourceId" type="string" update="true" 
    3939                        insert="true" column="resourceId" not-null="false" /> 
    40                 <property name="eventId" type="long" update="true" insert="true" 
     40                <property name="eventId" type="integer" update="true" insert="true" 
    4141                        column="eventId" not-null="false" /> 
    4242                <property name="eventType" type="string" update="true" 
     
    8080                <property name="nameIdentifier" column="nameIdentifier" type="string" /> 
    8181                <property name="responseId" column="responseId" type="string" /> 
    82                 <property name="hashCode" column="hashCode" type="integer" 
     82                <property name="hashCode" column=" current_hashCode" type="integer" 
    8383                        index="hashcode_index" /> 
    8484        </union-subclass> 
     
    8989                <property name="requesterIp" column="requesterIp" type="string" /> 
    9090                <property name="sessionId" column="sessionId" type="string" /> 
    91                 <property name="hashCode" column="hashCode" type="integer" 
     91                <property name="hashCode" column="current_hashCode" type="integer" 
    9292                        index="hashcode_index" /> 
    9393 
Note: See TracChangeset for help on using the changeset viewer.