]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
243e9ccd9661e5a343d56865ea61ff7f9739df54
[tmp/jakarta-migration.git] /
1 /**
2  *  This document is a part of the source code and related artifacts
3  *  for CollectionSpace, an open source collections management system
4  *  for museums and related institutions:
5
6  *  http://www.collectionspace.org
7  *  http://wiki.collectionspace.org
8
9  *  Copyright 2009 University of California at Berkeley
10
11  *  Licensed under the Educational Community License (ECL), Version 2.0.
12  *  You may not use this file except in compliance with this License.
13
14  *  You may obtain a copy of the ECL 2.0 License at
15
16  *  https://source.collectionspace.org/collection-space/LICENSE.txt
17
18  *  Unless required by applicable law or agreed to in writing, software
19  *  distributed under the License is distributed on an "AS IS" BASIS,
20  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  *  See the License for the specific language governing permissions and
22  *  limitations under the License.
23  */
24 package org.collectionspace.services.common.context;
25
26 import java.util.ArrayList;
27 import java.util.HashMap;
28 import java.util.List;
29 import java.util.Map;
30 import javax.ws.rs.core.MultivaluedMap;
31 import javax.ws.rs.core.UriInfo;
32
33 import org.collectionspace.services.client.IQueryManager;
34 import org.collectionspace.services.client.workflow.WorkflowClient;
35 import org.collectionspace.services.common.ServiceMain;
36 import org.collectionspace.services.common.authorization_mgt.AuthorizationCommon;
37 import org.collectionspace.services.common.config.PropertyItemUtils;
38 import org.collectionspace.services.common.config.ServiceConfigUtils;
39 import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
40 import org.collectionspace.services.common.document.DocumentHandler;
41 import org.collectionspace.services.common.document.DocumentFilter;
42 import org.collectionspace.services.common.document.ValidatorHandler;
43 import org.collectionspace.services.common.security.SecurityContext;
44 import org.collectionspace.services.common.security.SecurityContextImpl;
45 import org.collectionspace.services.common.security.UnauthorizedException;
46 import org.collectionspace.services.config.ClientType;
47 import org.collectionspace.services.config.service.ObjectPartType;
48 import org.collectionspace.services.config.service.ServiceBindingType;
49 import org.collectionspace.services.config.tenant.RepositoryDomainType;
50 import org.collectionspace.services.config.tenant.TenantBindingType;
51 import org.collectionspace.services.config.types.PropertyItemType;
52 import org.collectionspace.services.config.types.PropertyType;
53 import org.slf4j.Logger;
54 import org.slf4j.LoggerFactory;
55
56 /**
57  * AbstractServiceContext
58  *
59  * $LastChangedRevision: $
60  * $LastChangedDate: $
61  */
62 /**
63  * @author pschmitz
64  *
65  * @param <IT>
66  * @param <OT>
67  */
68 /**
69  * @author pschmitz
70  *
71  * @param <IT>
72  * @param <OT>
73  */
74 public abstract class AbstractServiceContextImpl<IT, OT>
75         implements ServiceContext<IT, OT> {
76
77     /** The logger. */
78     final Logger logger = LoggerFactory.getLogger(AbstractServiceContextImpl.class);
79     /** The properties. */
80     Map<String, Object> properties = new HashMap<String, Object>();
81     /** The object part map. */
82     Map<String, ObjectPartType> objectPartMap = new HashMap<String, ObjectPartType>();
83     /** The service binding. */
84     protected ServiceBindingType serviceBinding;
85     /** The tenant binding. */
86     private TenantBindingType tenantBinding;
87     /** repository domain used by the service */
88     private RepositoryDomainType repositoryDomain;
89         /** The override document type. */
90     private String overrideDocumentType = null;
91     /** The val handlers. */
92     private List<ValidatorHandler<IT, OT>> valHandlers = null;
93     /** The doc handler. */
94     private DocumentHandler docHandler = null;
95     /** security context */
96     private SecurityContext securityContext;
97     /** The sessions JAX-RS URI information */
98     private UriInfo uriInfo;
99     /** The current repository session */
100     private Object currentRepositorySession;
101     /** A reference count for the current repository session */
102     private int currentRepoSesssionRefCount = 0;
103
104     /**
105      * Instantiates a new abstract service context impl.
106      */
107     private AbstractServiceContextImpl() {
108         // private constructor for singleton pattern
109     }
110     // request query params
111     /** The query params. */
112     private MultivaluedMap<String, String> queryParams;
113
114     /**
115      * Instantiates a new abstract service context impl.
116      * 
117      * @param serviceName the service name
118      * 
119      * @throws UnauthorizedException the unauthorized exception
120      */
121     protected AbstractServiceContextImpl(String serviceName) throws UnauthorizedException {
122
123         //establish security context
124         securityContext = new SecurityContextImpl();
125         //make sure tenant context exists
126         checkTenantContext();
127
128         String tenantId = securityContext.getCurrentTenantId();
129         if(AuthorizationCommon.ALL_TENANTS_MANAGER_TENANT_ID.equals(tenantId)) {
130                 // Tenant Manager has no tenant binding, so don't bother...
131                 tenantBinding = null;
132                 serviceBinding = null;
133                 repositoryDomain = null;
134         } else {
135                 //retrieve service bindings
136                 TenantBindingConfigReaderImpl tReader =
137                         ServiceMain.getInstance().getTenantBindingConfigReader();
138                 tenantBinding = tReader.getTenantBinding(tenantId);
139                 if (tenantBinding == null) {
140                     String msg = "No tenant binding found for tenantId=" + tenantId
141                             + " while processing request for service= " + serviceName;
142                     logger.error(msg);
143                     throw new IllegalStateException(msg);
144                 }
145                 serviceBinding = tReader.getServiceBinding(tenantId, serviceName);
146                 if (serviceBinding == null) {
147                     String msg = "No service binding found while processing request for "
148                             + serviceName + " for tenant id=" + getTenantId()
149                             + " name=" + getTenantName();
150                     logger.error(msg);
151                     throw new IllegalStateException(msg);
152                 }
153                 if (logger.isDebugEnabled()) {
154                     logger.debug("tenantId=" + tenantId
155                             + " service binding=" + serviceBinding.getName());
156                 }
157                 repositoryDomain = tReader.getRepositoryDomain(tenantId, serviceName);
158                 if (repositoryDomain != null) {
159                     if (logger.isDebugEnabled()) {
160                         logger.debug("tenantId=" + tenantId
161                                 + " repository doamin=" + repositoryDomain.getName());
162                     }
163                 }
164         }
165     }
166
167     /* (non-Javadoc)
168      * @see org.collectionspace.services.common.context.ServiceContext#getCommonPartLabel()
169      */
170     @Override
171     public String getCommonPartLabel() {
172         return getCommonPartLabel(getServiceName());
173     }
174
175     /* (non-Javadoc)
176      * @see org.collectionspace.services.common.context.ServiceContext#getCommonPartLabel(java.lang.String)
177      */
178     public String getCommonPartLabel(String schemaName) {
179         return schemaName.toLowerCase() + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
180     }
181
182     /* (non-Javadoc)
183      * @see org.collectionspace.services.common.context.ServiceContext#getPartsMetadata()
184      */
185     @Override
186     public Map<String, ObjectPartType> getPartsMetadata() {
187         if (objectPartMap.size() != 0) {
188             return objectPartMap;
189         }
190         ServiceBindingUtils.getPartsMetadata(getServiceBinding(), objectPartMap);
191         return objectPartMap;
192     }
193
194     /**
195      * Gets the properties for part.
196      * 
197      * @param partLabel the part label
198      * 
199      * @return the properties for part
200      */
201     public List<PropertyItemType> getPropertiesForPart(String partLabel) {
202         Map<String, ObjectPartType> partMap = getPartsMetadata();
203         ObjectPartType part = partMap.get(partLabel);
204         if (part == null) {
205             throw new RuntimeException("No such part found: " + partLabel);
206         }
207         List<PropertyType> propNodeList = part.getProperties();
208         return propNodeList.isEmpty() ? null : propNodeList.get(0).getItem();
209     }
210
211     /**
212      * @param partLabel The name of the scehma part to search in
213      * @param propName The name of the property (or properties) to find
214      * @param qualified Whether the returned values should be qualified with the
215      *          partLabel. This is when the property values are schema field references.
216      * @return List of property values for the matched property on the named schema part.
217      */
218     public List<String> getPropertyValuesForPart(String partLabel, String propName, boolean qualified) {
219         List<PropertyItemType> allProps = getPropertiesForPart(partLabel);
220         return PropertyItemUtils.getPropertyValuesByName(allProps, propName,
221                 (qualified ? (partLabel + ":") : null));
222     }
223
224     /**
225      * @param propName The name of the property (or properties) to find
226      * @param qualified Whether the returned values should be qualified with the
227      *          partLabel. This is when the property values are schema field references.
228      * @return List of property values for the matched property on any schema part.
229      */
230     public List<String> getAllPartsPropertyValues(String propName, boolean qualified) {
231         return ServiceBindingUtils.getAllPartsPropertyValues(getServiceBinding(), propName, qualified);
232     }
233
234     /* (non-Javadoc)
235      * @see org.collectionspace.services.common.context.ServiceContext#getServiceBindingPropertyValue(java.lang.String)
236      */
237     public String getServiceBindingPropertyValue(String propName) {
238         return ServiceBindingUtils.getPropertyValue(getServiceBinding(), propName);
239     }
240
241     /**
242      * Gets the common part properties.
243      * 
244      * @return the common part properties
245      */
246     public List<PropertyItemType> getCommonPartProperties() {
247         return getPropertiesForPart(getCommonPartLabel());
248     }
249
250     /**
251      * @param propName The name of the property (or properties) to find
252      * @param qualified Whether the returned values should be qualified with the
253      *          partLabel. This is when the property values are schema field references.
254      * @return List of property values for the matched property on the common schema part.
255      */
256     public List<String> getCommonPartPropertyValues(String propName, boolean qualified) {
257         return getPropertyValuesForPart(getCommonPartLabel(), propName, qualified);
258     }
259
260     /* (non-Javadoc)
261      * @see org.collectionspace.services.common.context.ServiceContext#getQualifiedServiceName()
262      */
263     @Override
264     public String getQualifiedServiceName() {
265         return TenantBindingConfigReaderImpl.getTenantQualifiedServiceName(getTenantId(), getServiceName());
266     }
267
268     /* (non-Javadoc)
269      * @see org.collectionspace.services.common.context.ServiceContext#getRepositoryClientName()
270      */
271     @Override
272     public String getRepositoryClientName() {
273         if (repositoryDomain == null) {
274             return null;
275         }
276         return repositoryDomain.getRepositoryClient();
277     }
278
279     /* (non-Javadoc)
280      * @see org.collectionspace.services.common.context.ServiceContext#getRepositoryClientType()
281      */
282     @Override
283     public ClientType getRepositoryClientType() {
284         //assumption: there is only one repository client configured
285         return ServiceMain.getInstance().getClientType();
286     }
287
288     /* (non-Javadoc)
289      * @see org.collectionspace.services.common.context.ServiceContext#getRepositoryDomainName()
290      */
291     @Override
292     public String getRepositoryDomainName() {
293         if (repositoryDomain == null) {
294             return null;
295         }
296         return repositoryDomain.getName();
297     }
298
299     /* (non-Javadoc)
300      * @see org.collectionspace.services.common.context.ServiceContext#getRepositoryDomainName()
301      */
302     @Override
303     public String getRepositoryDomainStorageName() {
304         if (repositoryDomain == null) {
305             return null;
306         }
307         return repositoryDomain.getStorageName();
308     }
309
310     /* (non-Javadoc)
311      * @see org.collectionspace.services.common.context.ServiceContext#getRepositoryWorkspaceId()
312      */
313     @Override
314     public String getRepositoryWorkspaceId() {
315         return ServiceMain.getInstance().getWorkspaceId(getTenantId(), getServiceName());
316     }
317
318     /* (non-Javadoc)
319      * @see org.collectionspace.services.common.context.ServiceContext#getRepositoryWorkspaceName()
320      */
321     @Override
322     public String getRepositoryWorkspaceName() {
323         //service name is workspace name by convention
324         return serviceBinding.getName();
325     }
326
327     /* (non-Javadoc)
328      * @see org.collectionspace.services.common.context.ServiceContext#getServiceBinding()
329      */
330     @Override
331     public ServiceBindingType getServiceBinding() {
332         return serviceBinding;
333     }
334
335     /* (non-Javadoc)
336      * @see org.collectionspace.services.common.context.ServiceContext#getServiceName()
337      */
338     @Override
339     public String getServiceName() {
340         return serviceBinding.getName();
341     }
342
343     /* (non-Javadoc)
344      * @see org.collectionspace.services.common.context.ServiceContext#getDocumentType()
345      */
346     @Override
347     public String getDocumentType() {
348         // If they have not overridden the setting, use the type of the service
349         // object.
350         return (overrideDocumentType != null) ? overrideDocumentType : serviceBinding.getObject().getName();
351     }
352     
353     @Override
354     public String getTenantQualifiedDoctype(String docType) {
355         // If they have not overridden the setting, use the type of the service
356         // object.
357         String result = ServiceBindingUtils.getTenantQualifiedDocType(this.getTenantId(), docType);
358         
359         return result;
360     }
361     
362     @Override
363     public String getTenantQualifiedDoctype() {
364         String docType = (overrideDocumentType != null) ? overrideDocumentType : serviceBinding.getObject().getName();
365         return getTenantQualifiedDoctype(docType);
366     }
367
368     /* (non-Javadoc)
369      * @see org.collectionspace.services.common.context.ServiceContext#setDocumentType(java.lang.String)
370      */
371     @Override
372     public void setDocumentType(String docType) {
373         overrideDocumentType = docType;
374     }
375
376     /* (non-Javadoc)
377      * @see org.collectionspace.services.common.context.ServiceContext#getSecurityContext()
378      */
379     @Override
380     public SecurityContext getSecurityContext() {
381         return securityContext;
382     }
383
384     /* (non-Javadoc)
385      * @see org.collectionspace.services.common.context.ServiceContext#getUserId()
386      */
387     @Override
388     public String getUserId() {
389         return securityContext.getUserId();
390     }
391
392     /* (non-Javadoc)
393      * @see org.collectionspace.services.common.context.ServiceContext#getTenantId()
394      */
395     @Override
396     public String getTenantId() {
397         return securityContext.getCurrentTenantId();
398     }
399
400     /* (non-Javadoc)
401      * @see org.collectionspace.services.common.context.ServiceContext#getTenantName()
402      */
403     @Override
404     public String getTenantName() {
405         return securityContext.getCurrentTenantName();
406     }
407
408     /* (non-Javadoc)
409      * @see org.collectionspace.services.common.context.ServiceContext#getInput()
410      */
411     @Override
412     public abstract IT getInput();
413
414     /* (non-Javadoc)
415      * @see org.collectionspace.services.common.context.ServiceContext#setInput(java.lang.Object)
416      */
417     @Override
418     public abstract void setInput(IT input);
419
420     /* (non-Javadoc)
421      * @see org.collectionspace.services.common.context.ServiceContext#getOutput()
422      */
423     @Override
424     public abstract OT getOutput();
425
426     /* (non-Javadoc)
427      * @see org.collectionspace.services.common.context.ServiceContext#setOutput(java.lang.Object)
428      */
429     @Override
430     public abstract void setOutput(OT output);
431
432     /* (non-Javadoc)
433      * @see org.collectionspace.services.common.context.ServiceContext#getProperties()
434      */
435     @Override
436     public Map<String, Object> getProperties() {
437         return properties;
438     }
439
440     /* (non-Javadoc)
441      * @see org.collectionspace.services.common.context.ServiceContext#setProperties(java.util.Map)
442      */
443     @Override
444     public void setProperties(Map<String, Object> props) {
445         properties.putAll(props);
446     }
447
448     /* (non-Javadoc)
449      * @see org.collectionspace.services.common.context.ServiceContext#getProperty(java.lang.String)
450      */
451     public Object getProperty(String name) {
452         return properties.get(name);
453     }
454
455     /* (non-Javadoc)
456      * @see org.collectionspace.services.common.context.ServiceContext#setProperty(java.lang.String, java.lang.Object)
457      */
458     public void setProperty(String name, Object o) {
459         properties.put(name, o);
460     }
461
462     /**
463      * checkTenantContext makss sure tenant context exists
464      *
465      * @return the string
466      *
467      * @throws UnauthorizedException the unauthorized exception
468      */
469     private void checkTenantContext() throws UnauthorizedException {
470
471         String tenantId = securityContext.getCurrentTenantId();
472         if (tenantId == null) {
473             String msg = "Could not find tenant context";
474             logger.error(msg);
475             throw new UnauthorizedException(msg);
476         }
477     }
478
479     private static String buildWorkflowWhereClause(MultivaluedMap<String, String> queryParams) {
480         String result = null;
481         
482         String includeDeleted = queryParams.getFirst(WorkflowClient.WORKFLOW_QUERY_NONDELETED);
483         if (includeDeleted != null && includeDeleted.equalsIgnoreCase(Boolean.FALSE.toString())) {      
484                 result = "ecm:currentLifeCycleState <> 'deleted'";
485         }
486         
487         return result;
488     }
489     
490     /**
491      * Creates the document handler instance.
492      * 
493      * @return the document handler
494      * 
495      * @throws Exception the exception
496      */
497     private DocumentHandler createDocumentHandlerInstance() throws Exception {
498         docHandler = ServiceConfigUtils.createDocumentHandlerInstance(tenantBinding, serviceBinding);
499         //
500         // Create a default document filter
501         //
502         docHandler.setServiceContext(this);
503         DocumentFilter docFilter = docHandler.createDocumentFilter();
504         //
505         // If the context was created with query parameters,
506         // reflect the values of those parameters in the document filter
507         // to specify sort ordering, pagination, etc.
508         //
509         if (this.getQueryParams() != null) {
510           docFilter.setSortOrder(this.getQueryParams());
511           docFilter.setPagination(this.getQueryParams());
512           String workflowWhereClause = buildWorkflowWhereClause(queryParams);
513           if (workflowWhereClause != null) {
514                   docFilter.appendWhereClause(workflowWhereClause, IQueryManager.SEARCH_QUALIFIER_AND);                 
515           }            
516
517         }
518         docHandler.setDocumentFilter(docFilter);
519
520         return docHandler;
521     }
522
523     /* (non-Javadoc)
524      * @see org.collectionspace.services.common.context.ServiceContext#getDocumentHandler()
525      */
526     @Override
527     public DocumentHandler getDocumentHandler() throws Exception {
528         DocumentHandler result = docHandler;
529         // create a new instance if one does not yet exist
530         if (result == null) {
531             result = createDocumentHandlerInstance();
532         }
533         return result;
534     }
535
536     @Override
537     public void setDocumentHandler(DocumentHandler handler) throws Exception {
538         if (handler != null) {
539                 docHandler = handler;
540         }
541     }
542
543     /* (non-Javadoc)
544      * @see org.collectionspace.services.common.context.ServiceContext#getDocumentHanlder(javax.ws.rs.core.MultivaluedMap)
545      */
546     @Override
547     public DocumentHandler getDocumentHandler(MultivaluedMap<String, String> queryParams) throws Exception {
548         DocumentHandler result = getDocumentHandler();
549         DocumentFilter documentFilter = result.getDocumentFilter(); //to see results in debugger variables view
550         documentFilter.setPagination(queryParams);
551         return result;
552     }
553     
554     /*
555      * If this element is set in the service binding then use it otherwise
556      * assume that asserts are NOT disabled.
557      */
558     private boolean disableValidationAsserts() {
559         boolean result;
560         Boolean disableAsserts = getServiceBinding().isDisableAsserts();
561         result = (disableAsserts != null) ? disableAsserts : false;
562         return result;
563     }
564     
565     /* (non-Javadoc)
566      * @see org.collectionspace.services.common.context.ServiceContext#getValidatorHandlers()
567      */
568     @Override
569     public List<ValidatorHandler<IT, OT>> getValidatorHandlers() throws Exception {
570         if (valHandlers != null) {
571             return valHandlers;
572         }
573         List<String> handlerClazzes = getServiceBinding().getValidatorHandler();
574         List<ValidatorHandler<IT, OT>> handlers = new ArrayList<ValidatorHandler<IT, OT>>(handlerClazzes.size());
575         ClassLoader tccl = Thread.currentThread().getContextClassLoader();
576         for (String clazz : handlerClazzes) {
577             clazz = clazz.trim();
578             Class<?> c = tccl.loadClass(clazz);
579             if (disableValidationAsserts() == false) {
580                 // enable validation assertions
581                 tccl.setClassAssertionStatus(clazz, true);
582             }
583             if (ValidatorHandler.class.isAssignableFrom(c)) {
584                 handlers.add((ValidatorHandler) c.newInstance());
585             }
586         }
587         valHandlers = handlers;
588         return valHandlers;
589     }
590     
591     @Override
592     public void addValidatorHandler(ValidatorHandler<IT, OT> validator) throws Exception {
593         if (valHandlers == null) {
594             valHandlers = new ArrayList<ValidatorHandler<IT, OT>>();
595         }
596         valHandlers.add(validator);
597     }
598
599     /* (non-Javadoc)
600      * @see java.lang.Object#toString()
601      */
602     @Override
603     public String toString() {
604         StringBuilder msg = new StringBuilder();
605         msg.append("AbstractServiceContext [");
606         msg.append("service name=" + serviceBinding.getName() + " ");
607         msg.append("service version=" + serviceBinding.getVersion() + " ");
608         msg.append("tenant id=" + tenantBinding.getId() + " ");
609         msg.append("tenant name=" + tenantBinding.getName() + " ");
610         msg.append(tenantBinding.getDisplayName() + " ");
611         if (repositoryDomain != null) {
612             msg.append("tenant repository domain=" + repositoryDomain.getName());
613         }
614         for (Map.Entry<String, Object> entry : properties.entrySet()) {
615             msg.append("property name=" + entry.getKey() + " value=" + entry.getValue().toString());
616         }
617         msg.append("]");
618         return msg.toString();
619     }
620
621     /* (non-Javadoc)
622      * @see org.collectionspace.services.common.context.ServiceContext#getQueryParams()
623      */
624     @Override
625     public MultivaluedMap<String, String> getQueryParams() {
626
627          if (queryParams == null){
628               if (this.uriInfo != null){
629                 queryParams = this.uriInfo.getQueryParameters();
630             }
631          }
632          if (queryParams == null){
633              queryParams = new org.jboss.resteasy.specimpl.MultivaluedMapImpl<String,String>();
634         }
635         return this.queryParams;
636     }
637
638     @Override
639      public MultivaluedMap<String, String> getQueryParamsPtr() {
640            return this.queryParams;
641     }
642
643     /* (non-Javadoc)
644      * @see org.collectionspace.services.common.context.ServiceContext#setQueryParams(javax.ws.rs.core.MultivaluedMap)
645      */
646     @Override
647     public void setQueryParams(MultivaluedMap<String, String> theQueryParams) {
648         this.queryParams = theQueryParams;
649     }
650
651     @Override
652     public void setUriInfo(UriInfo ui){
653         this.uriInfo = ui;
654     }
655
656         @Override
657         public UriInfo getUriInfo() {
658                 return this.uriInfo;
659         }
660         
661         /*
662          * We expect the 'currentRepositorySession' member to be set only once per instance.  Also, we expect only one open repository session
663          * per HTTP request.  We'll log an error if we see more than one attempt to set a service context's current repo session.
664          * (non-Javadoc)
665          * @see org.collectionspace.services.common.context.ServiceContext#setCurrentRepositorySession(java.lang.Object)
666          */
667         @Override
668         public void setCurrentRepositorySession(Object repoSession) throws Exception {
669                 if (repoSession == null) {
670                         String errMsg = "Setting a service context's repository session to null is not allowed.";
671                         logger.error(errMsg);
672                         throw new Exception(errMsg);
673                 } else if (currentRepositorySession != null && currentRepositorySession != repoSession) {
674                         String errMsg = "The current service context's repository session was replaced.  This may cause unexpected behavior and/or data loss.";
675                         logger.error(errMsg);
676                         throw new Exception(errMsg);
677                 }
678                 
679                 currentRepositorySession = repoSession;
680                 this.currentRepoSesssionRefCount++;
681         }
682         
683         @Override
684         public void clearCurrentRepositorySession() {
685                 if (this.currentRepoSesssionRefCount > 0) {
686                         currentRepoSesssionRefCount--;
687                 }
688                 
689                 if (currentRepoSesssionRefCount == 0) {
690                         this.currentRepositorySession = null;
691                 }
692         }
693         
694         @Override
695         public Object getCurrentRepositorySession() {
696                 // TODO Auto-generated method stub
697                 return currentRepositorySession;
698         }       
699
700         @Override       
701         public RepositoryDomainType getRepositoryDomain() {
702                 return repositoryDomain;
703         }
704
705         @Override       
706         public void setRepositoryDomain(RepositoryDomainType repositoryDomain) {
707                 this.repositoryDomain = repositoryDomain;
708         }
709 }