Changeset 1172


Ignore:
Timestamp:
10/24/11 17:41:17 (20 months ago)
Author:
philsmart
Message:

added more javadoc

Location:
raptor-information-model/trunk/src/main/java/uk/ac/cardiff
Files:
1 added
14 edited

Legend:

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

    r614 r1172  
    44package uk.ac.cardiff.model.event; 
    55 
     6import uk.ac.cardiff.utility.StringUtils; 
     7 
    68/** 
    79 * @author philsmart 
    8  * 
     10 *  
    911 */ 
    1012public class AuthenticationFailureEvent { 
     
    1416    private String errorDescription; 
    1517 
     18    public void setErrorCode(String errorCode) { 
     19        this.errorCode = errorCode; 
     20    } 
    1621 
    17     public void setErrorCode(String errorCode) { 
    18         this.errorCode = errorCode; 
     22    public String getErrorCode() { 
     23        return errorCode; 
    1924    } 
    20     public String getErrorCode() { 
    21         return errorCode; 
     25 
     26    public void setErrorType(String errorType) { 
     27        this.errorType = errorType; 
    2228    } 
    23     public void setErrorType(String errorType) { 
    24         this.errorType = errorType; 
     29 
     30    public String getErrorType() { 
     31        return errorType; 
    2532    } 
    26     public String getErrorType() { 
    27         return errorType; 
     33 
     34    public void setErrorDescription(String errorDescription) { 
     35        this.errorDescription = errorDescription; 
    2836    } 
    29     public void setErrorDescription(String errorDescription) { 
    30         this.errorDescription = errorDescription; 
     37 
     38    public String getErrorDescription() { 
     39        return errorDescription; 
    3140    } 
    32     public String getErrorDescription() { 
    33         return errorDescription; 
     41 
     42    public String toString() { 
     43        return StringUtils.buildToString(this); 
    3444    } 
    3545 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/Event.java

    r800 r1172  
    2424 
    2525import uk.ac.cardiff.model.event.auxiliary.EventMetadata; 
     26import uk.ac.cardiff.utility.StringUtils; 
    2627 
    2728/** 
    28  * For any class that extends this class, equality must be computed for the 
    29  * same fields as the hash. Otherwise a discrepancy will occur when checking 
     29 * For any class that extends this class, equality must be computed for the same fields as the hash. Otherwise a discrepancy will occur when checking 
    3030 * containment through object equality (e.g. set containment), and through hashcodes. 
    31  * 
     31 *  
    3232 * @author philsmart 
    33  * 
     33 *  
    3434 */ 
    3535public class Event { 
    3636 
    37     /** used if a persistant db primary key is required. Not to 
    38      * be used in the computation of the hash or equals methods */ 
     37    /** 
     38     * used if a persistant db primary key is required. Not to be used in the computation of the hash or equals methods 
     39     */ 
    3940    private Long persistantId; 
    4041 
    41     /** attributes generic to all entries */ 
     42    /** attributes generic to all entries. */ 
    4243    private DateTime eventTime; 
    4344 
    44     /** Event id, as generated and added by the hashcode of this method. 
    45      * Not to be used in computation of the hash or equals methods. 
     45    /** 
     46     * Event id, as generated and added by the hashcode of this method. Not to be used in computation of the hash or equals methods. 
    4647     */ 
    4748    private int eventId; 
     49 
     50    /** The service id. */ 
    4851    private String serviceId; 
     52 
     53    /** The event type. */ 
    4954    private String eventType; 
     55 
     56    /** The service host. */ 
    5057    private String serviceHost; 
     58 
     59    /** The resource host. */ 
    5160    private String resourceHost; 
     61 
     62    /** The resource id. */ 
    5263    private String resourceId; 
    5364 
    54     /** User defined category for this event for this resourceId, e.g. internal resource or external resource. 
    55      * 1 - Internal 
    56      * 2 - External*/ 
     65    /** 
     66     * User defined category for this event for this resourceId, e.g. internal resource or external resource. 1 - Internal 2 - External 
     67     */ 
    5768    private int resourceIdCategory; 
    5869 
    59     /** Metadata about the service this event was generated from. Not used in 
    60      * Hash or Equality methods. */ 
     70    /** 
     71     * Metadata about the service this event was generated from. Not used in Hash or Equality methods. 
     72     */ 
    6173    private EventMetadata eventMetadata; 
    6274 
    63  
    64     public Event(){ 
    65  
    66     } 
    67  
    68     /** A Copy constructor */ 
    69     public Event(Event event){ 
    70         //this has a defensive getter, so a direct assignment is possible 
     75    /** 
     76     * Instantiates a new event. 
     77     */ 
     78    public Event() { 
     79 
     80    } 
     81 
     82    /** 
     83     * A Copy constructor. 
     84     *  
     85     * @param event 
     86     *            the event 
     87     */ 
     88    public Event(Event event) { 
     89        // this has a defensive getter, so a direct assignment is possible 
    7190        this.eventTime = event.getEventTime(); 
    7291        this.eventId = event.getEventId(); 
     
    7998    } 
    8099 
    81     public Event copy(){ 
     100    /** 
     101     * Copy. 
     102     *  
     103     * @return the event 
     104     */ 
     105    public Event copy() { 
    82106        return new Event(this); 
    83107    } 
    84108 
     109    /** 
     110     * New instance. 
     111     *  
     112     * @return the event 
     113     */ 
    85114    public static Event newInstance() { 
    86115        return new Event(); 
    87       } 
    88  
    89  
     116    } 
     117 
     118    /** 
     119     * Sets the event time. 
     120     *  
     121     * @param eventTime 
     122     *            the new event time 
     123     */ 
    90124    public void setEventTime(DateTime eventTime) { 
    91         this.eventTime = eventTime; 
    92     } 
    93  
    94     /** 
    95      * Returns the eventTime using a defensive copy 
    96      * @return 
     125        this.eventTime = eventTime; 
     126    } 
     127 
     128    /** 
     129     * Returns the eventTime using a defensive copy. 
     130     *  
     131     * @return the event time 
    97132     */ 
    98133    public DateTime getEventTime() { 
    99         return new DateTime(eventTime); 
     134        return new DateTime(eventTime); 
    100135    } 
    101136 
     
    104139     * convert from DateTime to Date 
    105140     * <p> 
    106      * 
     141     *  
    107142     * @return a Date representation of the eventTime DateTime format 
    108143     */ 
    109144    public Date getDate() { 
    110         Date now = new Date(eventTime.getMillis()); 
    111         return now; 
     145        Date now = new Date(eventTime.getMillis()); 
     146        return now; 
    112147 
    113148    } 
     
    117152     * convert from the XML Date to the DateTime used by eventTime 
    118153     * <p> 
    119      * 
     154     *  
     155     * @param date 
     156     *            the new date 
    120157     * @return a Date representation of the eventTime DateTime format 
    121158     */ 
    122159    public void setDate(Date date) { 
    123         eventTime = new DateTime(date.getTime()); 
    124  
    125     } 
    126  
    127     /** 
    128      * Gets the event time in milliseconds since EPOCH. Used for consistent hashing 
    129      * of the <code>eventTime<code> field. 
    130      * 
    131      * @return 
    132      */ 
    133     public long getEventTimeMillis(){ 
     160        eventTime = new DateTime(date.getTime()); 
     161 
     162    } 
     163 
     164    /** 
     165     * Gets the event time in milliseconds since EPOCH. Used for consistent hashing of the <code>eventTime<code> field. 
     166     *  
     167     * @return the event time millis 
     168     */ 
     169    public long getEventTimeMillis() { 
    134170        return eventTime.getMillis(); 
    135171    } 
    136172 
     173    /** 
     174     * Sets the persistant id. 
     175     *  
     176     * @param persistantId 
     177     *            the new persistant id 
     178     */ 
    137179    public void setPersistantId(Long persistantId) { 
    138         this.persistantId = persistantId; 
    139     } 
    140  
     180        this.persistantId = persistantId; 
     181    } 
     182 
     183    /** 
     184     * Gets the persistant id. 
     185     *  
     186     * @return the persistant id 
     187     */ 
    141188    public Long getPersistantId() { 
    142         return persistantId; 
    143     } 
    144  
     189        return persistantId; 
     190    } 
     191 
     192    /** 
     193     * Sets the event type. 
     194     *  
     195     * @param eventType 
     196     *            the new event type 
     197     */ 
    145198    public void setEventType(String eventType) { 
    146         this.eventType = eventType; 
    147     } 
    148  
     199        this.eventType = eventType; 
     200    } 
     201 
     202    /** 
     203     * Gets the event type. 
     204     *  
     205     * @return the event type 
     206     */ 
    149207    public String getEventType() { 
    150         return eventType; 
    151     } 
    152  
     208        return eventType; 
     209    } 
     210 
     211    /** 
     212     * Sets the service host. 
     213     *  
     214     * @param serviceHost 
     215     *            the new service host 
     216     */ 
    153217    public void setServiceHost(String serviceHost) { 
    154         this.serviceHost = serviceHost; 
    155     } 
    156  
     218        this.serviceHost = serviceHost; 
     219    } 
     220 
     221    /** 
     222     * Gets the service host. 
     223     *  
     224     * @return the service host 
     225     */ 
    157226    public String getServiceHost() { 
    158         return serviceHost; 
    159     } 
    160  
     227        return serviceHost; 
     228    } 
     229 
     230    /** 
     231     * Sets the resource host. 
     232     *  
     233     * @param resourceHost 
     234     *            the new resource host 
     235     */ 
    161236    public void setResourceHost(String resourceHost) { 
    162         this.resourceHost = resourceHost; 
    163     } 
    164  
     237        this.resourceHost = resourceHost; 
     238    } 
     239 
     240    /** 
     241     * Gets the resource host. 
     242     *  
     243     * @return the resource host 
     244     */ 
    165245    public String getResourceHost() { 
    166         return resourceHost; 
    167     } 
    168  
     246        return resourceHost; 
     247    } 
     248 
     249    /** 
     250     * Sets the resource id. 
     251     *  
     252     * @param resourceId 
     253     *            the new resource id 
     254     */ 
    169255    public void setResourceId(String resourceId) { 
    170         this.resourceId = resourceId; 
    171     } 
    172  
     256        this.resourceId = resourceId; 
     257    } 
     258 
     259    /** 
     260     * Gets the resource id. 
     261     *  
     262     * @return the resource id 
     263     */ 
    173264    public String getResourceId() { 
    174         return resourceId; 
    175     } 
    176  
    177     /** 
    178      * @param resourceIdCategory the resourceIdCategory to set 
     265        return resourceId; 
     266    } 
     267 
     268    /** 
     269     * Sets the resource id category. 
     270     *  
     271     * @param resourceIdCategory 
     272     *            the resourceIdCategory to set 
    179273     */ 
    180274    public void setResourceIdCategory(int resourceIdCategory) { 
    181         this.resourceIdCategory = resourceIdCategory; 
    182     } 
    183  
    184     /** 
     275        this.resourceIdCategory = resourceIdCategory; 
     276    } 
     277 
     278    /** 
     279     * Gets the resource id category. 
     280     *  
    185281     * @return the resourceIdCategory 
    186282     */ 
    187283    public int getResourceIdCategory() { 
    188         return resourceIdCategory; 
    189     } 
    190  
     284        return resourceIdCategory; 
     285    } 
     286 
     287    /** 
     288     * Sets the event id. 
     289     *  
     290     * @param eventId 
     291     *            the new event id 
     292     */ 
    191293    public void setEventId(int eventId) { 
    192294        this.eventId = eventId; 
    193295    } 
    194296 
     297    /** 
     298     * Gets the event id. 
     299     *  
     300     * @return the event id 
     301     */ 
    195302    public int getEventId() { 
    196303        return eventId; 
    197304    } 
    198305 
     306    /** 
     307     * Sets the service id. 
     308     *  
     309     * @param serviceId 
     310     *            the new service id 
     311     */ 
    199312    public void setServiceId(String serviceId) { 
    200313        this.serviceId = serviceId; 
    201314    } 
    202315 
     316    /** 
     317     * Gets the service id. 
     318     *  
     319     * @return the service id 
     320     */ 
    203321    public String getServiceId() { 
    204322        return serviceId; 
    205323    } 
    206324 
    207  
     325    /* 
     326     * (non-Javadoc) 
     327     *  
     328     * @see java.lang.Object#toString() 
     329     */ 
    208330    public String toString() { 
    209         return getClass().getName()+"@[" + this.getEventTime() + "," + this.getServiceHost() + "," + this.getResourceHost() + "]"; 
    210     } 
    211  
    212     /** 
    213      * @param eventMetadata the eventMetadata to set 
     331        return StringUtils.buildToString(this); 
     332    } 
     333 
     334    /** 
     335     * Sets the event metadata. 
     336     *  
     337     * @param eventMetadata 
     338     *            the eventMetadata to set 
    214339     */ 
    215340    public void setEventMetadata(EventMetadata eventMetadata) { 
     
    218343 
    219344    /** 
     345     * Gets the event metadata. 
     346     *  
    220347     * @return the eventMetadata 
    221348     */ 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/EzproxyAuthenticationEvent.java

    r815 r1172  
    44package uk.ac.cardiff.model.event; 
    55 
    6 import java.lang.reflect.Method; 
    7  
    86import uk.ac.cardiff.utility.EqualsUtil; 
    97import uk.ac.cardiff.utility.HashCodeUtil; 
     8import uk.ac.cardiff.utility.StringUtils; 
    109 
    1110/** 
     11 * The Class EzproxyAuthenticationEvent. 
     12 *  
    1213 * @author philsmart 
    13  * 
    1414 */ 
    15 public class EzproxyAuthenticationEvent extends AuthenticationEvent{ 
     15public class EzproxyAuthenticationEvent extends AuthenticationEvent { 
    1616 
     17    /** The requester ip. */ 
    1718    private String requesterIp; 
     19 
     20    /** The session id. */ 
    1821    private String sessionId; 
    1922 
    20     public EzproxyAuthenticationEvent(){ 
     23    /** 
     24     * Instantiates a new ezproxy authentication event. 
     25     */ 
     26    public EzproxyAuthenticationEvent() { 
    2127        super(); 
    2228    } 
    2329 
    24     protected EzproxyAuthenticationEvent(EzproxyAuthenticationEvent event){ 
     30    /** 
     31     * Instantiates a new ezproxy authentication event. 
     32     *  
     33     * @param event 
     34     *            the event 
     35     */ 
     36    protected EzproxyAuthenticationEvent(EzproxyAuthenticationEvent event) { 
    2537        super(event); 
    2638        this.requesterIp = event.getRequesterIp(); 
     
    3042    /** 
    3143     * Copy method. Alternative to clone. 
     44     *  
     45     * @return the ezproxy authentication event 
    3246     */ 
    33     public EzproxyAuthenticationEvent copy(){ 
     47    public EzproxyAuthenticationEvent copy() { 
    3448        return new EzproxyAuthenticationEvent(this); 
    3549    } 
    3650 
     51    /** 
     52     * Sets the requester ip. 
     53     *  
     54     * @param requesterIp 
     55     *            the new requester ip 
     56     */ 
    3757    public void setRequesterIp(String requesterIp) { 
    38         this.requesterIp = requesterIp; 
    39     } 
    40  
    41     public String getRequesterIp() { 
    42         return requesterIp; 
     58        this.requesterIp = requesterIp; 
    4359    } 
    4460 
    4561    /** 
    46      * @param sessionId the sessionId to set 
     62     * Gets the requester ip. 
     63     *  
     64     * @return the requester ip 
    4765     */ 
    48     public void setSessionId(String sessionId) { 
    49         this.sessionId = sessionId; 
     66    public String getRequesterIp() { 
     67        return requesterIp; 
    5068    } 
    5169 
    5270    /** 
     71     * Sets the session id. 
     72     *  
     73     * @param sessionId 
     74     *            the sessionId to set 
     75     */ 
     76    public void setSessionId(String sessionId) { 
     77        this.sessionId = sessionId; 
     78    } 
     79 
     80    /** 
     81     * Gets the session id. 
     82     *  
    5383     * @return the sessionId 
    5484     */ 
    5585    public String getSessionId() { 
    56         return sessionId; 
     86        return sessionId; 
    5787    } 
    5888 
     89    /* 
     90     * (non-Javadoc) 
     91     *  
     92     * @see uk.ac.cardiff.model.event.Event#toString() 
     93     */ 
    5994    public String toString() { 
    60         Method[] methods = this.getClass().getMethods(); 
    61         StringBuilder builder = new StringBuilder(); 
    62         builder.append(this.getClass() + "@["); 
    63         for (Method method : methods) { 
    64             try { 
    65                 if (method.getName().startsWith("get") && !method.getName().equals("getClass")) { 
    66                     this.getClass().getMethod(method.getName(), (Class[]) null); 
    67                     Object object = method.invoke(this, (Object[]) null); 
    68                     builder.append(method.getName() + " [" + object + "],"); 
    69  
    70                 } 
    71             } catch (Exception e){ 
    72                 //do nothing 
    73             } 
    74         } 
    75         builder.append("]"); 
    76         return builder.toString(); 
     95        return StringUtils.buildToString(this); 
    7796    } 
    7897 
    79  
    8098    /** 
    81      * create a unique hash, with as uniform a distribution as possible 
     99     * create a unique hash, with as uniform a distribution as possible. 
     100     *  
     101     * @return the int 
    82102     */ 
    83     public int hashCode(){ 
     103    public int hashCode() { 
    84104        int hash = HashCodeUtil.SEED; 
    85105 
    86         hash = HashCodeUtil.hash(hash,getEventTimeMillis()); 
    87         hash = HashCodeUtil.hash(hash,getEventId()); 
    88         hash = HashCodeUtil.hash(hash,getAuthenticationType()); 
    89         hash = HashCodeUtil.hash(hash,getServiceHost()); 
    90         hash = HashCodeUtil.hash(hash,getRequesterIp()); 
    91         hash = HashCodeUtil.hash(hash,getSessionId()); 
    92         hash = HashCodeUtil.hash(hash,getResourceHost()); 
    93         hash = HashCodeUtil.hash(hash,getPrincipalName()); 
    94         hash = HashCodeUtil.hash(hash,getEventType()); 
    95         hash = HashCodeUtil.hash(hash,getServiceId()); 
    96         hash = HashCodeUtil.hash(hash,getResourceId()); 
    97  
     106        hash = HashCodeUtil.hash(hash, getEventTimeMillis()); 
     107        hash = HashCodeUtil.hash(hash, getEventId()); 
     108        hash = HashCodeUtil.hash(hash, getAuthenticationType()); 
     109        hash = HashCodeUtil.hash(hash, getServiceHost()); 
     110        hash = HashCodeUtil.hash(hash, getRequesterIp()); 
     111        hash = HashCodeUtil.hash(hash, getSessionId()); 
     112        hash = HashCodeUtil.hash(hash, getResourceHost()); 
     113        hash = HashCodeUtil.hash(hash, getPrincipalName()); 
     114        hash = HashCodeUtil.hash(hash, getEventType()); 
     115        hash = HashCodeUtil.hash(hash, getServiceId()); 
     116        hash = HashCodeUtil.hash(hash, getResourceId()); 
    98117 
    99118        return hash; 
     
    102121 
    103122    /** 
    104      * For hibernate, so the hashcode can be persisted 
    105      * @return 
     123     * For hibernate, so the hashcode can be persisted. 
     124     *  
     125     * @return the hash code 
    106126     */ 
    107     public int getHashCode(){ 
     127    public int getHashCode() { 
    108128        return hashCode(); 
    109129    } 
    110130 
    111131    /** 
    112      * For hibernate, does nothing as the hascode is computed on the fly 
    113      * from the <code>hashCode</code> method 
    114      * 
     132     * For hibernate, does nothing as the hascode is computed on the fly from the <code>hashCode</code> method. 
     133     *  
    115134     * @param hashCode 
     135     *            the new hash code 
    116136     */ 
    117     public void setHashCode(int hashCode){ 
     137    public void setHashCode(int hashCode) { 
    118138 
    119139    } 
    120140 
    121     public boolean equals(Object obj){ 
    122         if ( this == obj ) return true; 
    123         if((obj == null) || (obj.getClass() != this.getClass())) 
     141    /* 
     142     * (non-Javadoc) 
     143     *  
     144     * @see java.lang.Object#equals(java.lang.Object) 
     145     */ 
     146    public boolean equals(Object obj) { 
     147        if (this == obj) 
     148            return true; 
     149        if ((obj == null) || (obj.getClass() != this.getClass())) 
    124150            return false; 
    125         EzproxyAuthenticationEvent that = (EzproxyAuthenticationEvent)obj; 
    126         boolean areEqual = 
    127           EqualsUtil.areEqual(this.getEventTimeMillis(), that.getEventTimeMillis()) && 
    128           EqualsUtil.areEqual(this.getEventId(), that.getEventId()) && 
    129           EqualsUtil.areEqual(this.getAuthenticationType(), that.getAuthenticationType()) && 
    130           EqualsUtil.areEqual(this.getServiceHost(), that.getServiceHost()) && 
    131           EqualsUtil.areEqual(this.getRequesterIp(), that.getRequesterIp()) && 
    132           EqualsUtil.areEqual(this.getSessionId(), that.getSessionId()) && 
    133           EqualsUtil.areEqual(this.getResourceHost(), that.getResourceHost()) && 
    134           EqualsUtil.areEqual(this.getServiceId(), that.getServiceId()) && 
    135           EqualsUtil.areEqual(this.getEventType(), that.getEventType()) && 
    136           EqualsUtil.areEqual(this.getResourceId(), that.getResourceId()) && 
    137           EqualsUtil.areEqual(this.getPrincipalName(), that.getPrincipalName()); 
     151        EzproxyAuthenticationEvent that = (EzproxyAuthenticationEvent) obj; 
     152        boolean areEqual = EqualsUtil.areEqual(this.getEventTimeMillis(), that.getEventTimeMillis()) && EqualsUtil.areEqual(this.getEventId(), that.getEventId()) 
     153                && EqualsUtil.areEqual(this.getAuthenticationType(), that.getAuthenticationType()) && EqualsUtil.areEqual(this.getServiceHost(), that.getServiceHost()) 
     154                && EqualsUtil.areEqual(this.getRequesterIp(), that.getRequesterIp()) && EqualsUtil.areEqual(this.getSessionId(), that.getSessionId()) 
     155                && EqualsUtil.areEqual(this.getResourceHost(), that.getResourceHost()) && EqualsUtil.areEqual(this.getServiceId(), that.getServiceId()) 
     156                && EqualsUtil.areEqual(this.getEventType(), that.getEventType()) && EqualsUtil.areEqual(this.getResourceId(), that.getResourceId()) 
     157                && EqualsUtil.areEqual(this.getPrincipalName(), that.getPrincipalName()); 
    138158 
    139159        return areEqual; 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/EzproxyProxyEvent.java

    r788 r1172  
    44package uk.ac.cardiff.model.event; 
    55 
    6 import java.lang.reflect.InvocationTargetException; 
    7 import java.lang.reflect.Method; 
     6import uk.ac.cardiff.utility.StringUtils; 
    87 
    98/** 
     9 * The Class EzproxyProxyEvent. 
     10 *  
    1011 * @author philsmart 
    11  * 
    1212 */ 
    13 public class EzproxyProxyEvent extends ProxyEvent{ 
     13public class EzproxyProxyEvent extends ProxyEvent { 
    1414 
     15    /** The session id. */ 
    1516    private String sessionId; 
    1617 
    17     public EzproxyProxyEvent(){ 
     18    /** 
     19     * Instantiates a new ezproxy proxy event. 
     20     */ 
     21    public EzproxyProxyEvent() { 
    1822        super(); 
    1923    } 
    2024 
    2125    /** 
    22      * Copy constructor 
    23      * 
     26     * Copy constructor. 
     27     *  
    2428     * @param event 
     29     *            the event 
    2530     */ 
    26     protected EzproxyProxyEvent(EzproxyProxyEvent event){ 
     31    protected EzproxyProxyEvent(EzproxyProxyEvent event) { 
    2732        super(event); 
    2833        this.sessionId = event.getSessionId(); 
     
    3136    /** 
    3237     * Copy method. Alternative to clone. 
     38     *  
     39     * @return the ezproxy proxy event 
    3340     */ 
    34     public EzproxyProxyEvent copy(){ 
     41    public EzproxyProxyEvent copy() { 
    3542        return new EzproxyProxyEvent(this); 
    3643    } 
    3744 
    3845    /** 
     46     * Sets the session id. 
     47     *  
    3948     * @param sessionId 
    4049     *            the sessionId to set 
    4150     */ 
    4251    public void setSessionId(String sessionId) { 
    43         this.sessionId = sessionId; 
     52        this.sessionId = sessionId; 
    4453    } 
    4554 
    4655    /** 
     56     * Gets the session id. 
     57     *  
    4758     * @return the sessionId 
    4859     */ 
    4960    public String getSessionId() { 
    50         return sessionId; 
     61        return sessionId; 
    5162    } 
    5263 
     64    /* 
     65     * (non-Javadoc) 
     66     *  
     67     * @see uk.ac.cardiff.model.event.ProxyEvent#toString() 
     68     */ 
    5369    public String toString() { 
    54         Method[] methods = this.getClass().getMethods(); 
    55         StringBuilder builder = new StringBuilder(); 
    56         builder.append(this.getClass() + "@["); 
    57         for (Method method : methods) { 
    58             try { 
    59                 if (method.getName().startsWith("get") && !method.getName().equals("getClass")) { 
    60                     this.getClass().getMethod(method.getName(), (Class[]) null); 
    61                     Object object = method.invoke(this, (Object[]) null); 
    62                     builder.append(method.getName() + " [" + object + "],"); 
    63  
    64                 } 
    65             } catch (IllegalArgumentException e) { 
    66                 e.printStackTrace(); 
    67             } catch (SecurityException e) { 
    68                 e.printStackTrace(); 
    69             } catch (NoSuchMethodException e) { 
    70                 e.printStackTrace(); 
    71             } catch (IllegalAccessException e) { 
    72                 e.printStackTrace(); 
    73             } catch (InvocationTargetException e) { 
    74                 e.printStackTrace(); 
    75             } 
    76         } 
    77         builder.append("]"); 
    78         return builder.toString(); 
     70        return StringUtils.buildToString(this); 
    7971    } 
    8072 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/OpenathenslaAuthenticationEvent.java

    r788 r1172  
    44package uk.ac.cardiff.model.event; 
    55 
     6import uk.ac.cardiff.utility.StringUtils; 
     7 
    68/** 
     9 * The Class OpenathenslaAuthenticationEvent. 
     10 *  
    711 * @author philsmart 
    8  * 
    912 */ 
    10 public class OpenathenslaAuthenticationEvent extends Event{ 
     13public class OpenathenslaAuthenticationEvent extends Event { 
    1114 
     15    /** The requester ip. */ 
    1216    private String requesterIP; 
    1317 
    14     public OpenathenslaAuthenticationEvent(){ 
     18    /** 
     19     * Instantiates a new openathensla authentication event. 
     20     */ 
     21    public OpenathenslaAuthenticationEvent() { 
    1522        super(); 
    1623    } 
     
    1825    /** 
    1926     * Copy constructor. 
    20      * 
     27     *  
    2128     * @param event 
     29     *            the event 
    2230     */ 
    23     public OpenathenslaAuthenticationEvent(OpenathenslaAuthenticationEvent event){ 
     31    public OpenathenslaAuthenticationEvent(OpenathenslaAuthenticationEvent event) { 
    2432        super(event); 
    2533        this.requesterIP = event.getRequesterIP(); 
     
    2836    /** 
    2937     * Copy method. Alternative to clone. 
     38     *  
     39     * @return the openathensla authentication event 
    3040     */ 
    31     public OpenathenslaAuthenticationEvent copy(){ 
     41    public OpenathenslaAuthenticationEvent copy() { 
    3242        return new OpenathenslaAuthenticationEvent(this); 
    3343    } 
    3444 
    35  
     45    /** 
     46     * Sets the requester ip. 
     47     *  
     48     * @param requesterIP 
     49     *            the new requester ip 
     50     */ 
    3651    public void setRequesterIP(String requesterIP) { 
    37         this.requesterIP = requesterIP; 
     52        this.requesterIP = requesterIP; 
    3853    } 
    3954 
     55    /** 
     56     * Gets the requester ip. 
     57     *  
     58     * @return the requester ip 
     59     */ 
    4060    public String getRequesterIP() { 
    41         return requesterIP; 
     61        return requesterIP; 
     62    } 
     63 
     64    /* 
     65     * (non-Javadoc) 
     66     *  
     67     * @see uk.ac.cardiff.model.event.Event#toString() 
     68     */ 
     69    public String toString() { 
     70        return StringUtils.buildToString(this); 
    4271    } 
    4372 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/ProxyEvent.java

    r788 r1172  
    66import org.joda.time.DateTime; 
    77 
     8import uk.ac.cardiff.utility.StringUtils; 
    89 
    910/** 
     11 * The Class ProxyEvent. 
     12 *  
    1013 * @author philsmart 
    11  * 
    1214 */ 
    13 public class ProxyEvent extends Event{ 
     15public class ProxyEvent extends Event { 
    1416 
     17    /** The request url. */ 
    1518    private String requestURL; 
     19 
     20    /** The http response code. */ 
    1621    private int httpResponseCode; 
     22 
     23    /** The response size. */ 
    1724    private long responseSize; 
     25 
     26    /** The response time. */ 
    1827    private DateTime responseTime; 
     28 
     29    /** The requester ip. */ 
    1930    private String requesterIp; 
    2031 
    21     public ProxyEvent(){ 
     32    /** 
     33     * Instantiates a new proxy event. 
     34     */ 
     35    public ProxyEvent() { 
    2236        super(); 
    2337    } 
    2438 
    2539    /** 
    26      * Copy constructor 
     40     * Copy constructor. 
     41     *  
    2742     * @param event 
     43     *            the event 
    2844     */ 
    29     public ProxyEvent(ProxyEvent event){ 
     45    public ProxyEvent(ProxyEvent event) { 
    3046        super(event); 
    3147        this.requestURL = event.getRequestURL(); 
     
    3854    /** 
    3955     * Copy method. Alternative to clone. 
     56     *  
     57     * @return the proxy event 
    4058     */ 
    41     public ProxyEvent cop(){ 
     59    public ProxyEvent cop() { 
    4260        return new ProxyEvent(this); 
    4361    } 
    4462 
    45  
     63    /** 
     64     * Sets the request url. 
     65     *  
     66     * @param requestURL 
     67     *            the new request url 
     68     */ 
    4669    public void setRequestURL(String requestURL) { 
    47         this.requestURL = requestURL; 
    48     } 
    49     public String getRequestURL() { 
    50         return requestURL; 
    51     } 
    52     public void setHttpResponseCode(int httpResponseCode) { 
    53         this.httpResponseCode = httpResponseCode; 
    54     } 
    55     public int getHttpResponseCode() { 
    56         return httpResponseCode; 
    57     } 
    58     public void setResponseSize(long responseSize) { 
    59         this.responseSize = responseSize; 
    60     } 
    61     public long getResponseSize() { 
    62         return responseSize; 
    63     } 
    64     public void setResponseTime(DateTime responseTime) { 
    65         this.responseTime = responseTime; 
     70        this.requestURL = requestURL; 
    6671    } 
    6772 
    6873    /** 
    69      * Get response time, using a defensive copy 
    70      * 
    71      * @return 
     74     * Gets the request url. 
     75     *  
     76     * @return the request url 
     77     */ 
     78    public String getRequestURL() { 
     79        return requestURL; 
     80    } 
     81 
     82    /** 
     83     * Sets the http response code. 
     84     *  
     85     * @param httpResponseCode 
     86     *            the new http response code 
     87     */ 
     88    public void setHttpResponseCode(int httpResponseCode) { 
     89        this.httpResponseCode = httpResponseCode; 
     90    } 
     91 
     92    /** 
     93     * Gets the http response code. 
     94     *  
     95     * @return the http response code 
     96     */ 
     97    public int getHttpResponseCode() { 
     98        return httpResponseCode; 
     99    } 
     100 
     101    /** 
     102     * Sets the response size. 
     103     *  
     104     * @param responseSize 
     105     *            the new response size 
     106     */ 
     107    public void setResponseSize(long responseSize) { 
     108        this.responseSize = responseSize; 
     109    } 
     110 
     111    /** 
     112     * Gets the response size. 
     113     *  
     114     * @return the response size 
     115     */ 
     116    public long getResponseSize() { 
     117        return responseSize; 
     118    } 
     119 
     120    /** 
     121     * Sets the response time. 
     122     *  
     123     * @param responseTime 
     124     *            the new response time 
     125     */ 
     126    public void setResponseTime(DateTime responseTime) { 
     127        this.responseTime = responseTime; 
     128    } 
     129 
     130    /** 
     131     * Get response time, using a defensive copy. 
     132     *  
     133     * @return the response time 
    72134     */ 
    73135    public DateTime getResponseTime() { 
    74         return new DateTime(responseTime); 
     136        return new DateTime(responseTime); 
    75137    } 
     138 
    76139    /** 
    77      * @param requesterIp the requesterIp to set 
     140     * Sets the requester ip. 
     141     *  
     142     * @param requesterIp 
     143     *            the requesterIp to set 
    78144     */ 
    79145    public void setRequesterIp(String requesterIp) { 
    80         this.requesterIp = requesterIp; 
     146        this.requesterIp = requesterIp; 
    81147    } 
     148 
    82149    /** 
     150     * Gets the requester ip. 
     151     *  
    83152     * @return the requesterIp 
    84153     */ 
    85154    public String getRequesterIp() { 
    86         return requesterIp; 
     155        return requesterIp; 
     156    } 
     157 
     158    /* 
     159     * (non-Javadoc) 
     160     *  
     161     * @see uk.ac.cardiff.model.event.Event#toString() 
     162     */ 
     163    public String toString() { 
     164        return StringUtils.buildToString(this); 
    87165    } 
    88166 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/ShibbolethIdpAuthenticationEvent.java

    r815 r1172  
    44package uk.ac.cardiff.model.event; 
    55 
    6 import java.lang.reflect.Method; 
    76import java.util.Arrays; 
    8 import java.util.Collection; 
    9  
    107 
    118import uk.ac.cardiff.utility.EqualsUtil; 
    129import uk.ac.cardiff.utility.HashCodeUtil; 
     10import uk.ac.cardiff.utility.StringUtils; 
    1311 
    1412/** 
     13 * The Class ShibbolethIdpAuthenticationEvent. 
     14 *  
    1515 * @author philsmart 
    16  * 
    1716 */ 
    18 public class ShibbolethIdpAuthenticationEvent extends AuthenticationEvent{ 
    19  
    20  
    21         private String requestId; 
    22         private String messageProfileId; 
    23         private String responseBinding; 
    24         private String responseId; 
    25         private String requestBinding; 
    26         private String nameIdentifier; 
    27         private String[] assertionId; 
    28         private String[] releasedAttributes; 
    29  
    30  
    31         public ShibbolethIdpAuthenticationEvent(){ 
    32             super(); 
    33         } 
    34  
    35         public static ShibbolethIdpAuthenticationEvent newInstance() { 
    36             return new ShibbolethIdpAuthenticationEvent(); 
    37           } 
    38  
    39         /** 
    40          * Copy constructor 
    41          * 
    42          * @param event 
    43          */ 
    44         protected ShibbolethIdpAuthenticationEvent(ShibbolethIdpAuthenticationEvent event){ 
    45             super (event); 
    46             this.requestId = event.getRequestId(); 
    47             this.messageProfileId = event.getMessageProfileId(); 
    48             this.responseBinding = event.getResponseBinding(); 
    49             this.responseId = event.getResponseId(); 
    50             this.requestBinding = event.getRequestBinding(); 
    51             this.nameIdentifier = event.getNameIdentifier(); 
    52  
    53             //shallow copy is OK here, as a new array is created with immutable objects (String). 
    54             this.assertionId = event.getAssertionId().clone(); 
    55             this.releasedAttributes = event.getReleasedAttributes().clone(); 
    56         } 
    57  
    58             /** 
    59              * Copy method. Alternative to clone. 
    60              */ 
    61          public ShibbolethIdpAuthenticationEvent copy(){ 
    62               return new ShibbolethIdpAuthenticationEvent(this); 
    63          } 
    64  
    65         public void setResponseBinding(String responseBinding) { 
    66                 this.responseBinding = responseBinding; 
    67         } 
    68         public String getResponseBinding() { 
    69                 return responseBinding; 
    70         } 
    71  
    72         public void setRequestBinding(String requestBinding) { 
    73                 this.requestBinding = requestBinding; 
    74         } 
    75         public String getRequestBinding() { 
    76                 return requestBinding; 
    77         } 
    78         public void setMessageProfileId(String messageProfileId) { 
    79                 this.messageProfileId = messageProfileId; 
    80         } 
    81         public String getMessageProfileId() { 
    82                 return messageProfileId; 
    83         } 
    84         /** 
    85          * @param releasedAttributes the releasedAttributes to set 
    86          */ 
    87         public void setReleasedAttributes(String[] releasedAttributes) { 
    88             this.releasedAttributes = releasedAttributes; 
    89         } 
    90         /** 
    91          * @return the releasedAttributes 
    92          */ 
    93         public String[] getReleasedAttributes() { 
    94             return releasedAttributes; 
    95         } 
    96  
    97         public String toString() { 
    98                 Method[] methods = this.getClass().getMethods(); 
    99                 StringBuilder builder = new StringBuilder(); 
    100                 builder.append(this.getClass() + "@["); 
    101                 for (Method method : methods) { 
    102                     try { 
    103                         if (method.getName().startsWith("get") && !method.getName().equals("getClass")) { 
    104                             this.getClass().getMethod(method.getName(), (Class[]) null); 
    105                             Object object = method.invoke(this, (Object[]) null); 
    106                             if (object instanceof Collection){ 
    107                                  builder.append(method.getName() + " [" + Arrays.asList(object) + "],"); 
    108                             } 
    109                             else if (object.getClass().isArray()){ 
    110                                 Object[] array = (Object[])object; 
    111                                 builder.append(method.getName() + " [" + Arrays.asList(array) + "],"); 
    112                             } 
    113                             else{ 
    114                                 builder.append(method.getName() + " [" + object + "],"); 
    115                             } 
    116                       } 
    117                     } catch (Exception e){ 
    118                         //do nothing 
    119                     } 
    120                 } 
    121                 builder.append("]"); 
    122                 return builder.toString(); 
    123          } 
    124  
    125         @Override 
    126         public boolean equals(Object obj){ 
    127             if ( this == obj ) return true; 
    128             if((obj == null) || (obj.getClass() != this.getClass())) 
    129                 return false; 
    130             ShibbolethIdpAuthenticationEvent that = (ShibbolethIdpAuthenticationEvent)obj; 
    131             boolean areEqual = 
    132               EqualsUtil.areEqual(this.getEventTimeMillis(), that.getEventTimeMillis()) && 
    133               EqualsUtil.areEqual(this.getEventId(), that.getEventId()) && 
    134               EqualsUtil.areEqual(this.getAuthenticationType(), that.getAuthenticationType()) && 
    135               EqualsUtil.areEqual(this.getServiceHost(), that.getServiceHost()) && 
    136               EqualsUtil.areEqual(this.getRequestId(), that.getRequestId()) && 
    137               EqualsUtil.areEqual(this.getResponseBinding(), that.getResponseBinding()) && 
    138               EqualsUtil.areEqual(this.getResourceHost(), that.getResourceHost()) && 
    139               EqualsUtil.areEqual(this.getMessageProfileId(), that.getMessageProfileId()) && 
    140               EqualsUtil.areEqual(this.getRequestBinding(), that.getRequestBinding()) && 
    141               EqualsUtil.areEqual(this.getPrincipalName(), that.getPrincipalName()) && 
    142               EqualsUtil.areEqual(this.getNameIdentifier(), that.getNameIdentifier()) && 
    143               EqualsUtil.areEqual(this.getResponseId(), that.getResponseId()) && 
    144               EqualsUtil.areEqual(this.getServiceId(), that.getServiceId()) && 
    145               EqualsUtil.areEqual(this.getEventType(), that.getEventType()) && 
    146               EqualsUtil.areEqual(this.getResourceId(), that.getResourceId()) && 
    147               Arrays.equals(this.getAssertionId(), that.getAssertionId()) && 
    148               Arrays.equals(this.getReleasedAttributes(), that.getReleasedAttributes()); 
    149  
    150             return areEqual; 
    151         } 
    152  
    153         /** 
    154          * For hibernate, so the hashcode can be persisted 
    155          * @return 
    156          */ 
    157         public int getHashCode(){ 
    158             return hashCode(); 
    159         } 
    160  
    161         /** 
    162          * For hibernate, does nothing as the hascode is computed on the fly 
    163          * from the <code>hashCode</code> method 
    164          * 
    165          * @param hashCode 
    166          */ 
    167         public void setHashCode(int hashCode){ 
    168  
    169         } 
    170  
    171  
    172         /** 
    173          * create a unique hash, with as uniform a distribution as possible 
    174          */ 
    175         @Override 
    176         public int hashCode(){ 
    177             int hash = HashCodeUtil.SEED; 
    178  
    179             hash = HashCodeUtil.hash(hash,getEventTimeMillis()); 
    180             hash = HashCodeUtil.hash(hash,getAuthenticationType()); 
    181             hash = HashCodeUtil.hash(hash,getEventId()); 
    182             hash = HashCodeUtil.hash(hash,getServiceHost()); 
    183             hash = HashCodeUtil.hash(hash,getRequestId()); 
    184             hash = HashCodeUtil.hash(hash,getResponseBinding()); 
    185             hash = HashCodeUtil.hash(hash,getResourceHost()); 
    186             hash = HashCodeUtil.hash(hash,getReleasedAttributes()); 
    187             hash = HashCodeUtil.hash(hash,getMessageProfileId()); 
    188             hash = HashCodeUtil.hash(hash,getRequestBinding()); 
    189             hash = HashCodeUtil.hash(hash,getPrincipalName()); 
    190             hash = HashCodeUtil.hash(hash,getNameIdentifier()); 
    191             hash = HashCodeUtil.hash(hash,getResponseId()); 
    192             hash = HashCodeUtil.hash(hash,getAssertionId()); 
    193             hash = HashCodeUtil.hash(hash,getEventType()); 
    194             hash = HashCodeUtil.hash(hash,getServiceId()); 
    195             hash = HashCodeUtil.hash(hash,getResourceId()); 
    196             return hash; 
    197  
    198         } 
    199         public void setNameIdentifier(String nameIdentifier) { 
    200             this.nameIdentifier = nameIdentifier; 
    201         } 
    202         public String getNameIdentifier() { 
    203             return nameIdentifier; 
    204         } 
    205         public void setAssertionId(String[] assertionId) { 
    206             this.assertionId = assertionId; 
    207         } 
    208         public String[] getAssertionId() { 
    209             return assertionId; 
    210         } 
    211         public void setResponseId(String responseId) { 
    212             this.responseId = responseId; 
    213         } 
    214         public String getResponseId() { 
    215             return responseId; 
    216         } 
    217         public void setRequestId(String requestId) { 
    218             this.requestId = requestId; 
    219         } 
    220         public String getRequestId() { 
    221             return requestId; 
    222         } 
    223  
    224  
    225  
    226  
    227  
     17public class ShibbolethIdpAuthenticationEvent extends AuthenticationEvent { 
     18 
     19    /** The request id. */ 
     20    private String requestId; 
     21 
     22    /** The message profile id. */ 
     23    private String messageProfileId; 
     24 
     25    /** The response binding. */ 
     26    private String responseBinding; 
     27 
     28    /** The response id. */ 
     29    private String responseId; 
     30 
     31    /** The request binding. */ 
     32    private String requestBinding; 
     33 
     34    /** The name identifier. */ 
     35    private String nameIdentifier; 
     36 
     37    /** The assertion id. */ 
     38    private String[] assertionId; 
     39 
     40    /** The released attributes. */ 
     41    private String[] releasedAttributes; 
     42 
     43    /** 
     44     * Instantiates a new shibboleth idp authentication event. 
     45     */ 
     46    public ShibbolethIdpAuthenticationEvent() { 
     47        super(); 
     48    } 
     49 
     50    /** 
     51     * New instance. 
     52     *  
     53     * @return the shibboleth idp authentication event 
     54     */ 
     55    public static ShibbolethIdpAuthenticationEvent newInstance() { 
     56        return new ShibbolethIdpAuthenticationEvent(); 
     57    } 
     58 
     59    /** 
     60     * Copy constructor. 
     61     *  
     62     * @param event 
     63     *            the event to copy 
     64     */ 
     65    protected ShibbolethIdpAuthenticationEvent(ShibbolethIdpAuthenticationEvent event) { 
     66        super(event); 
     67        this.requestId = event.getRequestId(); 
     68        this.messageProfileId = event.getMessageProfileId(); 
     69        this.responseBinding = event.getResponseBinding(); 
     70        this.responseId = event.getResponseId(); 
     71        this.requestBinding = event.getRequestBinding(); 
     72        this.nameIdentifier = event.getNameIdentifier(); 
     73 
     74        // shallow copy is OK here, as a new array is created with immutable objects (String). 
     75        this.assertionId = event.getAssertionId().clone(); 
     76        this.releasedAttributes = event.getReleasedAttributes().clone(); 
     77    } 
     78 
     79    /** 
     80     * Copy method. Alternative to clone. Returns a copied version of this event. 
     81     *  
     82     * @return the shibboleth idp authentication event 
     83     */ 
     84    public ShibbolethIdpAuthenticationEvent copy() { 
     85        return new ShibbolethIdpAuthenticationEvent(this); 
     86    } 
     87 
     88    /** 
     89     * Sets the response binding. 
     90     *  
     91     * @param responseBinding 
     92     *            the new response binding 
     93     */ 
     94    public void setResponseBinding(String responseBinding) { 
     95        this.responseBinding = responseBinding; 
     96    } 
     97 
     98    /** 
     99     * Gets the response binding. 
     100     *  
     101     * @return the response binding 
     102     */ 
     103    public String getResponseBinding() { 
     104        return responseBinding; 
     105    } 
     106 
     107    /** 
     108     * Sets the request binding. 
     109     *  
     110     * @param requestBinding 
     111     *            the new request binding 
     112     */ 
     113    public void setRequestBinding(String requestBinding) { 
     114        this.requestBinding = requestBinding; 
     115    } 
     116 
     117    /** 
     118     * Gets the request binding. 
     119     *  
     120     * @return the request binding 
     121     */ 
     122    public String getRequestBinding() { 
     123        return requestBinding; 
     124    } 
     125 
     126    /** 
     127     * Sets the message profile id. 
     128     *  
     129     * @param messageProfileId 
     130     *            the new message profile id 
     131     */ 
     132    public void setMessageProfileId(String messageProfileId) { 
     133        this.messageProfileId = messageProfileId; 
     134    } 
     135 
     136    /** 
     137     * Gets the message profile id. 
     138     *  
     139     * @return the message profile id 
     140     */ 
     141    public String getMessageProfileId() { 
     142        return messageProfileId; 
     143    } 
     144 
     145    /** 
     146     * Sets the released attributes. 
     147     *  
     148     * @param releasedAttributes 
     149     *            the releasedAttributes to set 
     150     */ 
     151    public void setReleasedAttributes(String[] releasedAttributes) { 
     152        this.releasedAttributes = releasedAttributes; 
     153    } 
     154 
     155    /** 
     156     * Gets the released attributes. 
     157     *  
     158     * @return the releasedAttributes 
     159     */ 
     160    public String[] getReleasedAttributes() { 
     161        return releasedAttributes; 
     162    } 
     163 
     164    /* 
     165     * (non-Javadoc) 
     166     *  
     167     * @see uk.ac.cardiff.model.event.Event#toString() 
     168     */ 
     169    public String toString() { 
     170        return StringUtils.buildToString(this); 
     171    } 
     172 
     173    /* 
     174     * (non-Javadoc) 
     175     *  
     176     * @see java.lang.Object#equals(java.lang.Object) 
     177     */ 
     178    @Override 
     179    public boolean equals(Object obj) { 
     180        if (this == obj) 
     181            return true; 
     182        if ((obj == null) || (obj.getClass() != this.getClass())) 
     183            return false; 
     184        ShibbolethIdpAuthenticationEvent that = (ShibbolethIdpAuthenticationEvent) obj; 
     185        boolean areEqual = EqualsUtil.areEqual(this.getEventTimeMillis(), that.getEventTimeMillis()) && EqualsUtil.areEqual(this.getEventId(), that.getEventId()) 
     186                && EqualsUtil.areEqual(this.getAuthenticationType(), that.getAuthenticationType()) && EqualsUtil.areEqual(this.getServiceHost(), that.getServiceHost()) 
     187                && EqualsUtil.areEqual(this.getRequestId(), that.getRequestId()) && EqualsUtil.areEqual(this.getResponseBinding(), that.getResponseBinding()) 
     188                && EqualsUtil.areEqual(this.getResourceHost(), that.getResourceHost()) && EqualsUtil.areEqual(this.getMessageProfileId(), that.getMessageProfileId()) 
     189                && EqualsUtil.areEqual(this.getRequestBinding(), that.getRequestBinding()) && EqualsUtil.areEqual(this.getPrincipalName(), that.getPrincipalName()) 
     190                && EqualsUtil.areEqual(this.getNameIdentifier(), that.getNameIdentifier()) && EqualsUtil.areEqual(this.getResponseId(), that.getResponseId()) 
     191                && EqualsUtil.areEqual(this.getServiceId(), that.getServiceId()) && EqualsUtil.areEqual(this.getEventType(), that.getEventType()) 
     192                && EqualsUtil.areEqual(this.getResourceId(), that.getResourceId()) && Arrays.equals(this.getAssertionId(), that.getAssertionId()) 
     193                && Arrays.equals(this.getReleasedAttributes(), that.getReleasedAttributes()); 
     194 
     195        return areEqual; 
     196    } 
     197 
     198    /** 
     199     * For hibernate, so the hashcode can be persisted. 
     200     *  
     201     * @return the hash code 
     202     */ 
     203    public int getHashCode() { 
     204        return hashCode(); 
     205    } 
     206 
     207    /** 
     208     * For hibernate, does nothing as the hascode is computed on the fly from the <code>hashCode</code> method. 
     209     *  
     210     * @param hashCode 
     211     *            the new hash code 
     212     */ 
     213    public void setHashCode(int hashCode) { 
     214 
     215    } 
     216 
     217    /** 
     218     * create a unique hash, with as uniform a distribution as possible. 
     219     *  
     220     * @return the int 
     221     */ 
     222    @Override 
     223    public int hashCode() { 
     224        int hash = HashCodeUtil.SEED; 
     225 
     226        hash = HashCodeUtil.hash(hash, getEventTimeMillis()); 
     227        hash = HashCodeUtil.hash(hash, getAuthenticationType()); 
     228        hash = HashCodeUtil.hash(hash, getEventId()); 
     229        hash = HashCodeUtil.hash(hash, getServiceHost()); 
     230        hash = HashCodeUtil.hash(hash, getRequestId()); 
     231        hash = HashCodeUtil.hash(hash, getResponseBinding()); 
     232        hash = HashCodeUtil.hash(hash, getResourceHost()); 
     233        hash = HashCodeUtil.hash(hash, getReleasedAttributes()); 
     234        hash = HashCodeUtil.hash(hash, getMessageProfileId()); 
     235        hash = HashCodeUtil.hash(hash, getRequestBinding()); 
     236        hash = HashCodeUtil.hash(hash, getPrincipalName()); 
     237        hash = HashCodeUtil.hash(hash, getNameIdentifier()); 
     238        hash = HashCodeUtil.hash(hash, getResponseId()); 
     239        hash = HashCodeUtil.hash(hash, getAssertionId()); 
     240        hash = HashCodeUtil.hash(hash, getEventType()); 
     241        hash = HashCodeUtil.hash(hash, getServiceId()); 
     242        hash = HashCodeUtil.hash(hash, getResourceId()); 
     243        return hash; 
     244 
     245    } 
     246 
     247    /** 
     248     * Sets the name identifier. 
     249     *  
     250     * @param nameIdentifier 
     251     *            the new name identifier 
     252     */ 
     253    public void setNameIdentifier(String nameIdentifier) { 
     254        this.nameIdentifier = nameIdentifier; 
     255    } 
     256 
     257    /** 
     258     * Gets the name identifier. 
     259     *  
     260     * @return the name identifier 
     261     */ 
     262    public String getNameIdentifier() { 
     263        return nameIdentifier; 
     264    } 
     265 
     266    /** 
     267     * Sets the assertion id. 
     268     *  
     269     * @param assertionId 
     270     *            the new assertion id 
     271     */ 
     272    public void setAssertionId(String[] assertionId) { 
     273        this.assertionId = assertionId; 
     274    } 
     275 
     276    /** 
     277     * Gets the assertion id. 
     278     *  
     279     * @return the assertion id 
     280     */ 
     281    public String[] getAssertionId() { 
     282        return assertionId; 
     283    } 
     284 
     285    /** 
     286     * Sets the response id. 
     287     *  
     288     * @param responseId 
     289     *            the new response id 
     290     */ 
     291    public void setResponseId(String responseId) { 
     292        this.responseId = responseId; 
     293    } 
     294 
     295    /** 
     296     * Gets the response id. 
     297     *  
     298     * @return the response id 
     299     */ 
     300    public String getResponseId() { 
     301        return responseId; 
     302    } 
     303 
     304    /** 
     305     * Sets the request id. 
     306     *  
     307     * @param requestId 
     308     *            the new request id 
     309     */ 
     310    public void setRequestId(String requestId) { 
     311        this.requestId = requestId; 
     312    } 
     313 
     314    /** 
     315     * Gets the request id. 
     316     *  
     317     * @return the request id 
     318     */ 
     319    public String getRequestId() { 
     320        return requestId; 
     321    } 
    228322 
    229323} 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/auxiliary/PrincipalInformation.java

    r815 r1172  
    11package uk.ac.cardiff.model.event.auxiliary; 
    22 
    3 import java.lang.reflect.Method; 
    4 import java.util.Arrays; 
    5 import java.util.Collection; 
     3import uk.ac.cardiff.utility.StringUtils; 
    64 
    75public class PrincipalInformation { 
     
    1614    private String affiliation; 
    1715 
    18  
    1916    /** 
    2017     * Default constructor 
    21      * 
     18     *  
    2219     */ 
    23     public PrincipalInformation(){ 
     20    public PrincipalInformation() { 
    2421 
    2522    } 
     
    2724    /** 
    2825     * Copy constructor 
    29      * 
     26     *  
    3027     * @param principalInformation 
    3128     */ 
    32     public PrincipalInformation(PrincipalInformation principalInformation){ 
     29    public PrincipalInformation(PrincipalInformation principalInformation) { 
    3330        this.school = principalInformation.getSchool(); 
    3431        this.affiliation = principalInformation.getAffiliation(); 
     
    6562    } 
    6663 
    67     /** 
    68      * Reflection based toString method that outputs all the field value pairs of this class 
    69      */ 
    7064    public String toString() { 
    71         Method[] methods = this.getClass().getMethods(); 
    72         StringBuilder builder = new StringBuilder(); 
    73         builder.append(this.getClass() + "@["); 
    74         for (Method method : methods) { 
    75             try { 
    76                 if (method.getName().startsWith("get") && !method.getName().equals("getClass")) { 
    77                     this.getClass().getMethod(method.getName(), (Class[]) null); 
    78                     Object object = method.invoke(this, (Object[]) null); 
    79                     if (object instanceof Collection) { 
    80                         builder.append(method.getName() + " [" + Arrays.asList(object) + "],"); 
    81                     } else { 
    82                         builder.append(method.getName() + " [" + object + "],"); 
    83                     } 
    84                 } 
    85             } catch (Exception e) { 
    86                 // do nothing 
    87             } 
    88         } 
    89         builder.append("]"); 
    90         return builder.toString(); 
     65        return StringUtils.buildToString(this); 
    9166    } 
    9267 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/report/AggregatorGraphModel.java

    r815 r1172  
    66import java.util.List; 
    77 
    8 /* 
    9  * based on the Apache Trinidad ChartModel, for compatibility. However, does not extend the Apache Trinidad Model 
    10  * so as to remain view agnostic. 
     8/** 
     9 * based on the Apache Trinidad ChartModel, for compatibility. However, does not extend the Apache Trinidad Model so as to remain view agnostic. 
    1110 */ 
    1211 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/wsmodel/Capabilities.java

    r830 r1172  
    1010import uk.ac.cardiff.model.resource.ResourceMetadata; 
    1111 
    12  
    1312/** 
     13 * The Class Capabilities. 
     14 *  
    1415 * @author philsmart 
    15  * 
    1616 */ 
    1717public class Capabilities implements Serializable { 
    1818 
    19     /* Generated Serial UID */ 
     19    /** Generated Serial UID. */ 
    2020    private static final long serialVersionUID = -4008642148652388534L; 
    2121 
     22    /** The list of attached MUAs. */ 
    2223    private List<String> attached; 
     24 
     25    /** The list of statistical services the attached MUA has configured. */ 
    2326    private List<StatisticalUnitInformation> statisticalServices; 
     27 
     28    /** Any error message that occurs during processing. */ 
    2429    private String errorMessage; 
     30 
     31    /** If an error occured during processing. */ 
    2532    private boolean error; 
     33 
     34    /** The metadata of the attached Service e.g. the attached MUA. */ 
    2635    private ServiceMetadata metadata; 
     36 
     37    /** The suggestion values used by the UI to display in suggestion boxes. */ 
    2738    private SuggestionValues suggestionValues; 
     39 
     40    /** The resource metadata. */ 
    2841    private List<ResourceMetadata> resourceMetadata; 
    2942 
     43    /** The number of events store in the attached MUA. */ 
    3044    private long numberOfEntries; 
    3145 
     46    /** 
     47     * Sets the statistical services. 
     48     *  
     49     * @param statisticalServices 
     50     *            the new statistical services 
     51     */ 
    3252    public void setStatisticalServices(List<StatisticalUnitInformation> statisticalServices) { 
    3353        this.statisticalServices = statisticalServices; 
     
    3555 
    3656    /** 
    37      * Returns all configured statistical units 
    38      * 
    39      * @return 
     57     * Returns all configured statistical units. 
     58     *  
     59     * @return the statistical services 
    4060     */ 
    4161    public List<StatisticalUnitInformation> getStatisticalServices() { 
     
    4363    } 
    4464 
     65    /** 
     66     * Sets the attached. 
     67     *  
     68     * @param attached 
     69     *            the new attached 
     70     */ 
    4571    public void setAttached(List<String> attached) { 
    4672        this.attached = attached; 
    4773    } 
    4874 
     75    /** 
     76     * Gets the attached. 
     77     *  
     78     * @return the attached 
     79     */ 
    4980    public List<String> getAttached() { 
    5081        return attached; 
     
    5283 
    5384    /** 
     85     * Sets the error message. 
     86     *  
    5487     * @param errorMessage 
    5588     *            the errorMessage to set 
     
    6093 
    6194    /** 
     95     * Gets the error message. 
     96     *  
    6297     * @return the errorMessage 
    6398     */ 
     
    67102 
    68103    /** 
     104     * Sets the error. 
     105     *  
    69106     * @param error 
    70107     *            the error to set 
     
    75112 
    76113    /** 
     114     * Checks if is error. 
     115     *  
    77116     * @return the error 
    78117     */ 
     
    81120    } 
    82121 
     122    /** 
     123     * Sets the suggestion values. 
     124     *  
     125     * @param suggestionValues 
     126     *            the new suggestion values 
     127     */ 
    83128    public void setSuggestionValues(SuggestionValues suggestionValues) { 
    84129        this.suggestionValues = suggestionValues; 
    85130    } 
    86131 
     132    /** 
     133     * Gets the suggestion values. 
     134     *  
     135     * @return the suggestion values 
     136     */ 
    87137    public SuggestionValues getSuggestionValues() { 
    88138        return suggestionValues; 
    89139    } 
    90140 
     141    /** 
     142     * Sets the metadata. 
     143     *  
     144     * @param metadata 
     145     *            the new metadata 
     146     */ 
    91147    public void setMetadata(ServiceMetadata metadata) { 
    92148        this.metadata = metadata; 
    93149    } 
    94150 
     151    /** 
     152     * Gets the metadata. 
     153     *  
     154     * @return the metadata 
     155     */ 
    95156    public ServiceMetadata getMetadata() { 
    96157        return metadata; 
    97158    } 
    98159 
     160    /** 
     161     * Sets the number of authentications stored. 
     162     *  
     163     * @param numberOfEntries 
     164     *            the new number of authentications stored 
     165     */ 
    99166    public void setNumberOfAuthenticationsStored(long numberOfEntries) { 
    100167        this.numberOfEntries = numberOfEntries; 
     
    102169    } 
    103170 
    104     public long getNumberOfAuthenticationsStored(){ 
     171    /** 
     172     * Gets the number of authentications stored. 
     173     *  
     174     * @return the number of authentications stored 
     175     */ 
     176    public long getNumberOfAuthenticationsStored() { 
    105177        return numberOfEntries; 
    106178    } 
    107179 
    108180    /** 
    109      * @param resourceMetadata the resourceMetadata to set 
     181     * Sets the resource metadata. 
     182     *  
     183     * @param resourceMetadata 
     184     *            the resourceMetadata to set 
    110185     */ 
    111186    public void setResourceMetadata(List<ResourceMetadata> resourceMetadata) { 
     
    114189 
    115190    /** 
     191     * Gets the resource metadata. 
     192     *  
    116193     * @return the resourceMetadata 
    117194     */ 
     
    120197    } 
    121198 
    122  
    123  
    124  
    125199} 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/wsmodel/EventPushMessage.java

    r747 r1172  
    1111 
    1212/** 
     13 * The Class EventPushMessage. 
     14 *  
    1315 * @author philsmart 
    14  * 
    1516 */ 
    1617public class EventPushMessage { 
    17     //TODO to be replaced by SAML messages 
     18    // TODO to be replaced by SAML messages 
    1819 
     20    /** The list of events that are being sent. */ 
    1921    private List<Event> events; 
     22 
     23    /** The metadata of the client sending the events. */ 
    2024    private ServiceMetadata clientMetadata; 
     25 
     26    /** The time instant the message was created push. */ 
    2127    private Date timeOfPush; 
    2228 
     29    /** 
     30     * Sets the events. 
     31     *  
     32     * @param events 
     33     *            the new events 
     34     */ 
    2335    public void setEvents(List<Event> events) { 
    24         this.events = events; 
     36        this.events = events; 
    2537    } 
     38 
     39    /** 
     40     * Gets the events. 
     41     *  
     42     * @return the events 
     43     */ 
    2644    public List<Event> getEvents() { 
    27         return events; 
     45        return events; 
    2846    } 
     47 
     48    /** 
     49     * Sets the time of push. 
     50     *  
     51     * @param timeOfPush 
     52     *            the new time of push 
     53     */ 
    2954    public void setTimeOfPush(Date timeOfPush) { 
    30         this.timeOfPush = timeOfPush; 
     55        this.timeOfPush = timeOfPush; 
    3156    } 
     57 
     58    /** 
     59     * Gets the time of push. 
     60     *  
     61     * @return the time of push 
     62     */ 
    3263    public Date getTimeOfPush() { 
    33         return timeOfPush; 
     64        return timeOfPush; 
    3465    } 
     66 
     67    /** 
     68     * Sets the client metadata. 
     69     *  
     70     * @param clientMetadata 
     71     *            the new client metadata 
     72     */ 
    3573    public void setClientMetadata(ServiceMetadata clientMetadata) { 
    36         this.clientMetadata = clientMetadata; 
     74        this.clientMetadata = clientMetadata; 
    3775    } 
     76 
     77    /** 
     78     * Gets the client metadata. 
     79     *  
     80     * @return the client metadata 
     81     */ 
    3882    public ServiceMetadata getClientMetadata() { 
    39         return clientMetadata; 
     83        return clientMetadata; 
    4084    } 
    4185 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/wsmodel/LogFileUpload.java

    r734 r1172  
    33import java.io.Serializable; 
    44 
    5  
    6 public class LogFileUpload implements Serializable{ 
    7  
    8     /** Generated Serial UID */ 
     5/** 
     6 * The Class LogFileUpload. 
     7 */ 
     8public class LogFileUpload implements Serializable { 
     9 
     10    /** Generated Serial UID. */ 
    911    private static final long serialVersionUID = -6283086431616419079L; 
    1012 
     13    /** The Name. */ 
    1114    private String Name; 
     15 
     16    /** The mime. */ 
    1217    private String mime; 
     18 
     19    /** The length. */ 
    1320    private long length; 
    1421 
    15     /** Random ID that we can use for tracking */ 
     22    /** Random ID that we can use for tracking. */ 
    1623    private long id; 
    1724 
    18     /** The contents of the file in <code>bytes</code>*/ 
     25    /** The contents of the file in <code>bytes</code>. */ 
    1926    private byte[] data; 
    2027 
    21     public enum ParsingEventType{ 
     28    /** 
     29     * The Enum ParsingEventType. 
     30     */ 
     31    public enum ParsingEventType { 
     32 
     33        /** The NA. */ 
    2234        NA("Not Selected. Please Select"), 
     35 
     36        /** The SHIBBOLET h13. */ 
    2337        SHIBBOLETH13("Shibboleth 1.3"), 
     38 
     39        /** The SHIBBOLET h2. */ 
    2440        SHIBBOLETH2("Shibboleth 2"), 
     41 
     42        /** The EZPROXY. */ 
    2543        EZPROXY("Ezproxy"); 
    2644 
     45        /** The friendly name. */ 
    2746        public String friendlyName; 
    2847 
    29         ParsingEventType(String friendlyName){ 
     48        /** 
     49         * Instantiates a new parsing event type. 
     50         *  
     51         * @param friendlyName 
     52         *            the friendly name 
     53         */ 
     54        ParsingEventType(String friendlyName) { 
    3055            this.friendlyName = friendlyName; 
    3156        } 
    3257    } 
    3358 
    34     /** The type of event that this file upload represents*/ 
     59    /** The type of event that this file upload represents. */ 
    3560    private ParsingEventType eventType; 
    3661 
    37     /** Store <code>String</code> messages reflecting, in human readable form, 
    38      * the current processing status of this batch file. 
     62    /** 
     63     * Store <code>String</code> messages reflecting, in human readable form, the current processing status of this batch file. 
    3964     */ 
    4065    private String processingStatus; 
    4166 
     67    /** The processed. */ 
    4268    private boolean processed; 
    4369 
    44     public LogFileUpload(){ 
     70    /** 
     71     * Instantiates a new log file upload. 
     72     */ 
     73    public LogFileUpload() { 
    4574        eventType = ParsingEventType.NA; 
    4675    } 
    4776 
     77    /** 
     78     * Gets the data. 
     79     *  
     80     * @return the data 
     81     */ 
    4882    public byte[] getData() { 
    4983        return data; 
    5084    } 
    5185 
     86    /** 
     87     * Sets the data. 
     88     *  
     89     * @param data 
     90     *            the new data 
     91     */ 
    5292    public void setData(byte[] data) { 
    5393        this.data = data; 
    5494    } 
    5595 
     96    /** 
     97     * Gets the name. 
     98     *  
     99     * @return the name 
     100     */ 
    56101    public String getName() { 
    57102        return Name; 
    58103    } 
    59104 
     105    /** 
     106     * Sets the name. 
     107     *  
     108     * @param name 
     109     *            the new name 
     110     */ 
    60111    public void setName(String name) { 
    61112        Name = name; 
     
    73124    } 
    74125 
     126    /** 
     127     * Gets the length. 
     128     *  
     129     * @return the length 
     130     */ 
    75131    public long getLength() { 
    76132        return length; 
    77133    } 
    78134 
     135    /** 
     136     * Sets the length. 
     137     *  
     138     * @param length 
     139     *            the new length 
     140     */ 
    79141    public void setLength(long length) { 
    80142        this.length = length; 
    81143    } 
    82144 
     145    /** 
     146     * Gets the mime. 
     147     *  
     148     * @return the mime 
     149     */ 
    83150    public String getMime() { 
    84151        return mime; 
    85152    } 
    86153 
    87     public void setMime(String mime){ 
     154    /** 
     155     * Sets the mime. 
     156     *  
     157     * @param mime 
     158     *            the new mime 
     159     */ 
     160    public void setMime(String mime) { 
    88161        this.mime = mime; 
    89162    } 
    90163 
    91  
    92     /** 
     164    /** 
     165     * Sets the processing status. 
     166     *  
    93167     * @param processingStatus 
     168     *            the new processing status 
    94169     */ 
    95170    public void setProcessingStatus(String processingStatus) { 
     
    98173    } 
    99174 
    100     public String getProcessingStatus(){ 
     175    /** 
     176     * Gets the processing status. 
     177     *  
     178     * @return the processing status 
     179     */ 
     180    public String getProcessingStatus() { 
    101181        return processingStatus; 
    102182    } 
    103183 
    104184    /** 
    105      * @param processed the processed to set 
     185     * Sets the processed. 
     186     *  
     187     * @param processed 
     188     *            the processed to set 
    106189     */ 
    107190    public void setProcessed(boolean processed) { 
     
    110193 
    111194    /** 
     195     * Checks if is processed. 
     196     *  
    112197     * @return the processed 
    113198     */ 
     
    117202 
    118203    /** 
    119      * @param eventType the eventType to set 
     204     * Sets the event type. 
     205     *  
     206     * @param eventType 
     207     *            the eventType to set 
    120208     */ 
    121209    public void setEventType(ParsingEventType eventType) { 
     
    123211    } 
    124212 
     213    /** 
     214     * Sets the event type string. 
     215     *  
     216     * @param eventType 
     217     *            the new event type string 
     218     */ 
    125219    public void setEventTypeString(String eventType) { 
    126         for (ParsingEventType pet : ParsingEventType.values()){ 
    127             if (pet.friendlyName.equals(eventType)){ 
     220        for (ParsingEventType pet : ParsingEventType.values()) { 
     221            if (pet.friendlyName.equals(eventType)) { 
    128222                this.eventType = pet; 
    129223            } 
     
    131225    } 
    132226 
    133  
    134     /** 
     227    /** 
     228     * Gets the event type. 
     229     *  
    135230     * @return the eventType 
    136231     */ 
     
    139234    } 
    140235 
     236    /** 
     237     * Gets the event type string. 
     238     *  
     239     * @return the event type string 
     240     */ 
    141241    public String getEventTypeString() { 
    142242        return eventType.friendlyName; 
     
    144244 
    145245    /** 
    146      * @param id the id to set 
     246     * Sets the id. 
     247     *  
     248     * @param id 
     249     *            the id to set 
    147250     */ 
    148251    public void setId(long id) { 
     
    151254 
    152255    /** 
     256     * Gets the id. 
     257     *  
    153258     * @return the id 
    154259     */ 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/wsmodel/LogFileUploadResult.java

    r734 r1172  
    55 
    66/** 
     7 * The Class LogFileUploadResult. 
     8 *  
    79 * @author philsmart 
    8  * 
    910 */ 
    1011public class LogFileUploadResult { 
    1112 
     13    /** The id of this <code>LogFileUploadResult</code> instance. */ 
    1214    private long id; 
    1315 
     16    /** The status. */ 
    1417    private String status; 
    1518 
     19    /** Has the upload successfully been processed. */ 
    1620    private boolean processed; 
    1721 
    1822    /** 
    19      * @param id the id to set 
     23     * Sets the id. 
     24     *  
     25     * @param id 
     26     *            the id to set 
    2027     */ 
    2128    public void setId(long id) { 
     
    2431 
    2532    /** 
     33     * Gets the id. 
     34     *  
    2635     * @return the id 
    2736     */ 
     
    3140 
    3241    /** 
    33      * @param status the status to set 
     42     * Sets the status. 
     43     *  
     44     * @param status 
     45     *            the status to set 
    3446     */ 
    3547    public void setStatus(String status) { 
     
    3850 
    3951    /** 
     52     * Gets the status. 
     53     *  
    4054     * @return the status 
    4155     */ 
     
    4559 
    4660    /** 
    47      * @param processed the processed to set 
     61     * Sets the processed. 
     62     *  
     63     * @param processed 
     64     *            the processed to set 
    4865     */ 
    4966    public void setProcessed(boolean processed) { 
     
    5269 
    5370    /** 
     71     * Checks if is processed. 
     72     *  
    5473     * @return the processed 
    5574     */ 
  • raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/wsmodel/MethodParameter.java

    r815 r1172  
    55 
    66import java.io.Serializable; 
    7 import java.util.List; 
    87 
    98import org.slf4j.Logger; 
    109import org.slf4j.LoggerFactory; 
    1110 
     11/** 
     12 * The Class MethodParameter. 
     13 *  
     14 * @author philsmart 
     15 */ 
     16public class MethodParameter implements Serializable { 
    1217 
    13 /** 
    14  * @author philsmart 
    15  * 
    16  */ 
    17 public class MethodParameter implements Serializable{ 
    18  
    19  
    20     /** Generated SerialUID*/ 
     18    /** Generated SerialUID. */ 
    2119    private static final long serialVersionUID = -290473614440091625L; 
    2220 
    23     /** Class logger */ 
     21    /** Class logger. */ 
    2422    private final Logger log = LoggerFactory.getLogger(MethodParameter.class); 
    2523 
    26     /** enum, which holds information about the parameter 
    27      * FIELD - name of a field in the model 
    28      * VALUE - a primitive data type value*/ 
    29     public enum ParameterType{FIELD, VALUE}; 
     24    /** 
     25     * enum, which holds information about the parameter FIELD - name of a field in the model VALUE - a primitive data type value. 
     26     */ 
     27    public enum ParameterType { 
     28        /** The FIELD. */ 
     29        FIELD, 
     30        /** The VALUE. */ 
     31        VALUE 
     32    }; 
    3033 
     34    /** The parameter type. */ 
    3135    private ParameterType parameterType; 
    3236 
    33     /** friendly name of the parameter, for the benefit of the view*/ 
     37    /** friendly name of the parameter, for the benefit of the view. */ 
    3438    private String parameterName; 
    3539 
    36     /** value of the parameter */ 
     40    /** value of the parameter. */ 
    3741    private String value; 
    3842 
    39  
    40  
     43    /** 
     44     * Sets the value. 
     45     *  
     46     * @param value 
     47     *            the new value 
     48     */ 
    4149    public void setValue(String value) { 
    42         this.value = value; 
     50        this.value = value; 
    4351    } 
    4452 
     53    /** 
     54     * Gets the value. 
     55     *  
     56     * @return the value 
     57     */ 
    4558    public String getValue() { 
    46         return value; 
     59        return value; 
    4760    } 
    4861 
     62    /** 
     63     * Sets the parameter name. 
     64     *  
     65     * @param parameterName 
     66     *            the new parameter name 
     67     */ 
    4968    public void setParameterName(String parameterName) { 
    50         this.parameterName = parameterName; 
     69        this.parameterName = parameterName; 
    5170    } 
    5271 
     72    /** 
     73     * Gets the parameter name. 
     74     *  
     75     * @return the parameter name 
     76     */ 
    5377    public String getParameterName() { 
    54         return parameterName; 
     78        return parameterName; 
    5579    } 
    5680 
     81    /** 
     82     * Sets the parameter type. 
     83     *  
     84     * @param parameterType 
     85     *            the new parameter type 
     86     */ 
    5787    public void setParameterType(ParameterType parameterType) { 
    58         this.parameterType = parameterType; 
     88        this.parameterType = parameterType; 
    5989    } 
    6090 
     91    /** 
     92     * Gets the parameter type. 
     93     *  
     94     * @return the parameter type 
     95     */ 
    6196    public ParameterType getParameterType() { 
    62         return parameterType; 
     97        return parameterType; 
    6398    } 
    6499 
    65  
    66  
    67  
    68  
    69100} 
Note: See TracChangeset for help on using the changeset viewer.