Changeset 781


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

Legend:

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

    r676 r781  
    8181    } 
    8282 
     83    /** 
     84     * Gets the event time in milliseconds since EPOCH. Used for consistent hashing 
     85     * of the <code>eventTime<code> field. 
     86     * 
     87     * @return 
     88     */ 
     89    public long getEventTimeMillis(){ 
     90        return eventTime.getMillis(); 
     91    } 
     92 
     93    public void setEventTimeMillis(long millis){ 
     94        eventTime = new DateTime(millis); 
     95    } 
     96 
    8397    public void setPersistantId(Long persistantId) { 
    8498        this.persistantId = persistantId; 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/EzproxyAuthenticationEvent.java

    r711 r781  
    6868        int hash = HashCodeUtil.SEED; 
    6969 
    70         hash = HashCodeUtil.hash(hash,getEventTime()); 
     70        hash = HashCodeUtil.hash(hash,getEventTimeMillis()); 
    7171        hash = HashCodeUtil.hash(hash,getAuthenticationType()); 
    7272        hash = HashCodeUtil.hash(hash,getServiceHost()); 
     
    109109        EzproxyAuthenticationEvent that = (EzproxyAuthenticationEvent)obj; 
    110110        boolean areEqual = 
    111           EqualsUtil.areEqual(this.getEventTime(), that.getEventTime()) && 
     111          EqualsUtil.areEqual(this.getEventTimeMillis(), that.getEventTimeMillis()) && 
    112112          EqualsUtil.areEqual(this.getAuthenticationType(), that.getAuthenticationType()) && 
    113113          EqualsUtil.areEqual(this.getServiceHost(), that.getServiceHost()) && 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/ShibbolethIdpAuthenticationEvent.java

    r676 r781  
    102102            ShibbolethIdpAuthenticationEvent that = (ShibbolethIdpAuthenticationEvent)obj; 
    103103            boolean areEqual = 
    104               EqualsUtil.areEqual(this.getEventTime(), that.getEventTime()) && 
     104              EqualsUtil.areEqual(this.getEventTimeMillis(), that.getEventTimeMillis()) && 
    105105              EqualsUtil.areEqual(this.getAuthenticationType(), that.getAuthenticationType()) && 
    106106              EqualsUtil.areEqual(this.getServiceHost(), that.getServiceHost()) && 
     
    150150            int hash = HashCodeUtil.SEED; 
    151151 
    152             hash = HashCodeUtil.hash(hash,getEventTime()); 
     152            hash = HashCodeUtil.hash(hash,getEventTimeMillis()); 
    153153            hash = HashCodeUtil.hash(hash,getAuthenticationType()); 
    154154            hash = HashCodeUtil.hash(hash,getServiceHost()); 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/event.hbm.xml

    r776 r781  
    1717                </id> 
    1818 
    19                 <discriminator column="type_discriminator" type="string"/> 
    20  
    2119                <property name="eventTime" 
    2220                        type="org.joda.time.contrib.hibernate.PersistentDateTime" update="true" 
    23                         insert="true" column="eventtime" not-null="false" index="dt_index" /> 
    24                 <property name="serviceHost" type="string" update="true" 
     21                        insert="true" not-null="false" index="dt_index" > 
     22                      <column name="eventtime"></column> 
     23           </property> 
     24 
     25           <!--<property name="date" 
     26            type="timestamp" update="true" 
     27            insert="true" not-null="false" index="dt_index" > 
     28              <column name="eventtime"></column> 
     29       </property> 
     30 
     31 
     32                --><property name="serviceHost" type="string" update="true" 
    2533                        insert="true" column="serviceHost" not-null="false" index="requesthost_index" /> 
    2634                <property name="resourceHost" type="string" update="true" 
     
    4048        </class> 
    4149 
    42         <subclass name="uk.ac.cardiff.model.event.AuthenticationEvent" discriminator-value="authentication_event" extends="uk.ac.cardiff.model.event.Event"> 
     50        <union-subclass name="uk.ac.cardiff.model.event.AuthenticationEvent" extends="uk.ac.cardiff.model.event.Event"> 
    4351 
    4452                <property name="authenticationType" column="authenticationType" 
     
    4755                        index="principalname_index" /> 
    4856 
    49                 <!-- 
    50                         MUST use the cascade property, otherwise hibernate will think the 
    51                         referenced table is already persisted and will try to link to it, 
    52                         when it may not be there. So we need to make sure it saves or updates 
    53                         the object during save or update of this object 
    54                 --> 
    55                 <!--<many-to-one name="principalInformation" 
    56                         class="uk.ac.cardiff.model.event.auxiliary.PrincipalInformation" 
    57                         column="principalInformation_id" cascade="all" /> 
    58  
    59  
    60  
    61  
    62  
    63  
    64         --> 
    6557        <component name="principalInformation"> 
    6658            <property name="school" type="string" update="true" insert="true" 
     
    7062        </component> 
    7163 
    72         </subclass> 
     64        </union-subclass> 
    7365 
    74         <subclass extends="uk.ac.cardiff.model.event.AuthenticationEvent" discriminator-value="shibboleth_authentication_event" 
     66        <union-subclass extends="uk.ac.cardiff.model.event.AuthenticationEvent" 
    7567                name="uk.ac.cardiff.model.event.ShibbolethIdpAuthenticationEvent" > 
    7668 
     
    9183                <property name="hashCode" column="hashCode" type="integer" 
    9284                        index="hashcode_index" /> 
    93         </subclass> 
     85        </union-subclass> 
    9486 
    95         <subclass discriminator-value="ezproxy_authentication_event" extends="uk.ac.cardiff.model.event.AuthenticationEvent" 
     87        <union-subclass extends="uk.ac.cardiff.model.event.AuthenticationEvent" 
    9688        name="uk.ac.cardiff.model.event.EzproxyAuthenticationEvent"> 
    9789 
     
    10193                        index="hashcode_index" /> 
    10294 
    103         </subclass> 
    104  
    105         <!--<class name="uk.ac.cardiff.model.event.auxiliary.PrincipalInformation" 
    106                 table="principalInformation"> 
    107  
    108                 <id name="principleId" column="id" type="java.lang.Long"> 
    109                         <generator class="increment" /> 
    110                 </id> 
    111  
    112                 <property name="school" type="string" update="true" insert="true" 
    113                         column="school" index="school_index" /> 
    114                 <property name="affiliation" type="string" update="true" 
    115                         insert="true" column="affiliation" index="affiliation_index" /> 
    116  
    117         </class> 
     95        </union-subclass> 
    11896 
    11997 
    12098 
    12199 
    122 --></hibernate-mapping> 
     100</hibernate-mapping> 
Note: See TracChangeset for help on using the changeset viewer.