| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.ksb.messaging.serviceconnectors; |
| 17 | |
|
| 18 | |
import org.kuali.rice.core.security.credentials.CredentialsSource; |
| 19 | |
import org.kuali.rice.ksb.messaging.BusClientFailureProxy; |
| 20 | |
import org.kuali.rice.ksb.messaging.ServiceInfo; |
| 21 | |
import org.kuali.rice.ksb.messaging.bam.BAMClientProxy; |
| 22 | |
import org.springframework.util.Assert; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
public abstract class AbstractServiceConnector implements ServiceConnector { |
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
private ServiceInfo serviceInfo; |
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
private CredentialsSource credentialsSource; |
| 44 | |
|
| 45 | 0 | public AbstractServiceConnector(final ServiceInfo serviceInfo) { |
| 46 | 0 | Assert.notNull(serviceInfo, "serviceInfo cannot be null"); |
| 47 | 0 | this.serviceInfo = serviceInfo; |
| 48 | 0 | } |
| 49 | |
|
| 50 | |
public ServiceInfo getServiceInfo() { |
| 51 | 0 | return this.serviceInfo; |
| 52 | |
} |
| 53 | |
|
| 54 | |
public void setServiceInfo(final ServiceInfo serviceInfo) { |
| 55 | 0 | this.serviceInfo = serviceInfo; |
| 56 | 0 | } |
| 57 | |
|
| 58 | |
public void setCredentialsSource(final CredentialsSource credentialsSource) { |
| 59 | 0 | this.credentialsSource = credentialsSource; |
| 60 | 0 | } |
| 61 | |
|
| 62 | |
protected CredentialsSource getCredentialsSource() { |
| 63 | 0 | return this.credentialsSource; |
| 64 | |
} |
| 65 | |
|
| 66 | |
protected Object getServiceProxyWithFailureMode(final Object service, |
| 67 | |
final ServiceInfo serviceInfo) { |
| 68 | 0 | Object bamWrappedClientProxy = BAMClientProxy |
| 69 | |
.wrap(service, serviceInfo); |
| 70 | 0 | return BusClientFailureProxy.wrap(bamWrappedClientProxy, serviceInfo); |
| 71 | |
} |
| 72 | |
} |