Changeset 710


Ignore:
Timestamp:
04/28/11 18:53:24 (8 years ago)
Author:
philsmart
Message:
 
Location:
raptor-mua/trunk/src/main
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • raptor-mua/trunk/src/main/config/attribute-association.xml

    r704 r710  
    1212        <!--  the attribute association engine --> 
    1313    <bean id="attributeAssociationEngine" class="uk.ac.cardiff.raptor.event.expansion.AttributeAssociationEngine"> 
    14         <property name="attributeAssociationDefinition"><ref bean="attributeAssociationDefinition"></ref></property> 
    15         <property name="dataConnector"><ref bean="ldapDataConnector"/></property> 
     14        <property name="attributeAssociationDefinitions"> 
     15            <list> 
     16                <ref bean="shibAttributeAssociationDefinition"/> 
     17                <ref bean="ezproxyAttributeAssociationDefinition"/> 
     18             </list> 
     19        </property> 
    1620    </bean> 
    1721 
    18     <!-- data connector --> 
    19     <bean id="ldapDataConnector" class="uk.ac.cardiff.raptor.event.expansion.connector.LdapDataConnector"> 
    20          <property name="poolMaxIdle"><value>10</value></property> 
    21          <property name="poolInitIdleCapacity"><value>10</value></property> 
    22          <property name="ldapUrl"><value>zidman12.cf.ac.uk</value></property> 
    23          <property name="ldapBaseDn"><value>o=people</value></property> 
    24          <property name="startTls"><value>false</value></property> 
    25          <property name="principal"><value>cn=srvreg1,o=users</value></property> 
    26          <property name="principalCredential"><value>1hk27be</value></property> 
    27          <property name="cacheResults"><value>false</value></property> 
    28         <!-- add the filter here, where [principal] is replaced by the principal extracted per event --> 
    29          <property name="searchFilterTemplate"><value>cn=[principal]</value></property> 
     22 
     23    <!-- Properties to set. PrincipalInformation only has the attributes [school, affiliation] --> 
     24    <bean id="shibAttributeAssociationDefinition" class="uk.ac.cardiff.raptor.event.expansion.AttributeAssociationDefinition"> 
     25        <property name="definiationName"><value>ShibAssociationDefinition</value></property> 
     26        <property name="subjectPrincipalField"><value>principalName</value></property> 
     27        <property name="dataConnector"><ref bean="ldapDataConnector"/></property> 
     28        <!-- add the filter here, where [principal] is replaced by the actual principal value extracted per event --> 
     29        <property name="searchFilterTemplate"><value>cn=[principal]</value></property> 
     30        <property name="enabled"><value>true</value></property> 
     31        <property name="classToAdd"><value type="java.lang.Class">uk.ac.cardiff.model.event.auxiliary.PrincipalInformation</value></property> 
     32        <property name="associateWithClass"><value>uk.ac.cardiff.model.event.ShibbolethIdpAuthenticationEvent</value></property> 
     33        <property name="lookupAttributes"> 
     34            <list> 
     35                <bean class="uk.ac.cardiff.raptor.event.expansion.AttributeLookup"> 
     36                    <property name="sourceAttributeName"><value>CardiffIDManAffiliation</value></property> 
     37                    <property name="internalAttributeName"><value>affiliation</value></property> 
     38                </bean> 
     39                 <bean class="uk.ac.cardiff.raptor.event.expansion.AttributeLookup"> 
     40                    <property name="sourceAttributeName"><value>CardiffIDManDept</value></property> 
     41                    <property name="internalAttributeName"><value>school</value></property> 
     42                </bean> 
     43            </list> 
     44        </property> 
    3045    </bean> 
    3146 
    32     <!-- Properties to set. PrincipalInformation only has the attributes [school, affiliation] --> 
    33     <bean id="attributeAssociationDefinition" class="uk.ac.cardiff.raptor.event.expansion.AttributeAssociationDefinition"> 
     47    <bean id="ezproxyAttributeAssociationDefinition" class="uk.ac.cardiff.raptor.event.expansion.AttributeAssociationDefinition"> 
     48        <property name="definiationName"><value>EzproxyAssociationDefinition</value></property> 
    3449        <property name="subjectPrincipalField"><value>principalName</value></property> 
    35         <property name="internalModelClass"><value type="java.lang.Class">uk.ac.cardiff.model.event.auxiliary.PrincipalInformation</value></property> 
     50        <property name="dataConnector"><ref bean="ldapDataConnector"/></property> 
     51        <!-- add the filter here, where [principal] is replaced by the actual principal value extracted per event --> 
     52        <property name="searchFilterTemplate"><value>CardiffIDManParentIdentityUid=[principal]</value></property> 
     53        <property name="enabled"><value>true</value></property> 
     54        <property name="classToAdd"><value type="java.lang.Class">uk.ac.cardiff.model.event.auxiliary.PrincipalInformation</value></property> 
     55        <property name="associateWithClass"><value>uk.ac.cardiff.model.event.EzproxyAuthenticationEvent</value></property> 
    3656        <property name="lookupAttributes"> 
    3757            <list> 
     
    4969 
    5070 
     71 
     72 
     73        <!-- data connectors. Currently only LDAP. Static Singleton Connector  --> 
     74    <bean id="ldapDataConnector" class="uk.ac.cardiff.raptor.event.expansion.connector.LdapDataConnector"> 
     75         <property name="poolMaxIdle"><value>10</value></property> 
     76         <property name="poolInitIdleCapacity"><value>10</value></property> 
     77         <property name="ldapUrl"><value>zidman12.cf.ac.uk</value></property> 
     78         <property name="ldapBaseDn"><value>o=people</value></property> 
     79         <property name="startTls"><value>false</value></property> 
     80         <property name="principal"><value>cn=srvreg1,o=users</value></property> 
     81         <property name="principalCredential"><value>1hk27be</value></property> 
     82         <property name="cacheResults"><value>true</value></property> 
     83         <property name="cacheTimeoutMs"><value>86400000</value></property> 
     84    </bean> 
     85 
     86 
    5187</beans> 
  • raptor-mua/trunk/src/main/config/mua-core.xml

    r702 r710  
    6666                                                <value>uk.ac.cardiff.model.event.AuthenticationEvent</value> 
    6767                                                <value>uk.ac.cardiff.model.event.ShibbolethIdpAuthenticationEvent</value> 
    68                                                 <!-- <value>org.sdmx.resources.sdmxml.schemas.v2_0.message.CompactDataType</value>--> 
     68                                                <value>uk.ac.cardiff.model.event.EzproxyAuthenticationEvent</value> 
     69                                                <value>uk.ac.cardiff.model.event.OpenathenslaAuthenticationEvent</value> 
    6970                                        </list> 
    7071                                </entry> 
  • raptor-mua/trunk/src/main/java/uk/ac/cardiff/raptormua/engine/MUAEngine.java

    r702 r710  
    4040import uk.ac.cardiff.raptor.store.EntryHandler; 
    4141import uk.ac.cardiff.raptor.store.StorageEngine; 
     42import uk.ac.cardiff.raptor.store.TransactionInProgressException; 
    4243import uk.ac.cardiff.raptormua.engine.statistics.Statistic; 
    4344import uk.ac.cardiff.raptormua.engine.statistics.StatisticsHandler; 
     
    165166        /** 
    166167         * @param pushed 
    167          */ 
    168         public void addAuthentications(EventPushMessage pushed) { 
     168         * @throws TransactionInProgressException 
     169         */ 
     170        public void addAuthentications(EventPushMessage pushed) throws TransactionInProgressException { 
    169171                int transactionId = (int)(Math.random()*1000000); 
    170                 log.info("Committing {} entries to the storage engine, with transaction id [{}]", pushed.getEvents().size(),transactionId); 
    171172                storageEngine.performAsynchronousEntryStoragePipeline(transactionId,pushed.getEvents()); 
    172173 
  • raptor-mua/trunk/src/main/java/uk/ac/cardiff/raptormua/service/MUAProcess.java

    r619 r710  
    3535 
    3636        /** 
    37          * 
    38          */ 
    39         public void poll(); 
    40  
    41         /** 
    4237         * @param statisticName 
    4338         */ 
  • raptor-mua/trunk/src/main/java/uk/ac/cardiff/raptormua/service/impl/MUAProcessImpl.java

    r619 r710  
    4949public class MUAProcessImpl implements MUAProcess { 
    5050 
    51         /* class logger */ 
    52         static Logger log = LoggerFactory.getLogger(MUAProcessImpl.class); 
     51        /** class logger */ 
     52        private final Logger log = LoggerFactory.getLogger(MUAProcessImpl.class); 
    5353 
    54         /* main engine of the MultiUnitAggregator */ 
     54        /** main engine of the MultiUnitAggregator */ 
    5555        private MUAEngine engine; 
    5656 
    57         /* 
     57        /** 
    5858         * ReentrantLock to prevent more than at the same time 
    5959         */ 
     
    6868        } 
    6969 
    70         /* 
    71          * The MUA no longer polls for data from the UA, but this is still here in 
    72          * case it is needed 
    73          * 
    74          * (non-Javadoc) 
    75          * 
    76          * @see uk.ac.cardiff.raptormua.service.MUAProcess#poll() 
    77          */ 
    78         public void poll() { 
    79                 if (lockR.tryLock()) { 
    80                         try { 
    81                                 // engine.poll(); 
    82                         } catch (Exception e) { 
    83                                 // TODO either throw as service output, or deal with here 
    84                                 log.error(e.getMessage()); 
    85                                 e.printStackTrace(); 
    86                         } finally { 
    87                                 lockR.unlock(); 
    88                         } 
    89                 } 
    9070 
    91         } 
    92  
    93         /* 
    94          * (non-Javadoc) 
    95          * 
    96          * @see 
    97          * uk.ac.cardiff.raptormua.service.MUAProcess#performStatistics(java.lang 
    98          * .String) 
    99          */ 
    10071        public AggregatorGraphModel performStatistic(String statisticName) throws SoapFault { 
    10172                if (lockR.tryLock()) { 
     
    11687        } 
    11788 
    118         /* 
    119          * Method does not need to be locked. (non-Javadoc) 
    120          * 
    121          * @see uk.ac.cardiff.raptormua.service.MUAProcess#getCapabilities() 
    122          */ 
     89 
    12390        public Capabilities getCapabilities() { 
    12491                log.info("WebSservice call for get capabilities"); 
     
    12693        } 
    12794 
    128         /* 
    129          * (non-Javadoc) 
    130          * 
    131          * @see 
    132          * uk.ac.cardiff.raptormua.service.MUAProcess#setStatisticalUnit(uk.ac.cardiff 
    133          * .model.wsmodel.StatisticalUnitInformation) 
    134          */ 
     95 
    13596        @Override 
    13697        public void updateStatisticalUnit(StatisticalUnitInformation statisticalUnitInformation) throws SoapFault { 
     
    155116        } 
    156117 
    157         /* 
    158          * (non-Javadoc) 
    159          * 
    160          * @see 
    161          * uk.ac.cardiff.raptormua.service.MUAProcess#performAdministrativeFunction 
    162          * (uk.ac.cardiff.model.AdministrativeFunction.AdministrativeFunctionType) 
    163          */ 
     118 
    164119        @Override 
    165120        public boolean performAdministrativeFunction(AdministrativeFunction function) throws SoapFault { 
     
    184139        } 
    185140 
    186         /* 
    187          * (non-Javadoc) 
    188          * 
    189          * @see 
    190          * uk.ac.cardiff.raptormua.service.MUAProcess#addAuthentications(uk.ac.cardiff 
    191          * .model.wsmodel.UAEntryPush) 
     141        /** 
     142         * Because this is perform async, the lock is not useful, its the exceptions that are. 
    192143         */ 
    193144        @Override 
     
    200151                                success = true; 
    201152                        } catch (Exception e) { 
    202                                 log.error("Error trying to add authentications to this MUA, {}",e.getMessage(),e); 
     153                                log.error("Error trying to add authentications to this MUA, {}",e.getMessage()); 
    203154 
    204155                        } finally { 
Note: See TracChangeset for help on using the changeset viewer.