|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nci.caarray.services.external.AbstractExternalService
gov.nih.nci.caarray.services.external.v1_0.impl.BaseV1_0ExternalService
public class BaseV1_0ExternalService
Base service for v1_0 external services.
Nested Class Summary | |
---|---|
protected static interface |
BaseV1_0ExternalService.EntityHandler<T extends AbstractCaArrayEntity>
An external entity handler encapsulates the logic to perform generic operations for an external entity type. |
protected static class |
BaseV1_0ExternalService.EntityHandlerRegistry
Class to hold a registry of entity handlers, which can be looked up by class of external entity. |
Field Summary | |
---|---|
protected static java.util.Map<BiomaterialType,java.lang.Class<? extends gov.nih.nci.caarray.domain.sample.AbstractBioMaterial>> |
BIOMATERIAL_TYPE_TO_CLASS_MAP
Map of BiomaterialType to the corresponding AbstractBiomaterial subclass in the internal model. |
Constructor Summary | |
---|---|
BaseV1_0ExternalService()
Constructor. |
Method Summary | ||
---|---|---|
protected java.lang.Object |
getByExternalId(java.lang.String externalId)
Retrieve the entity in the internal domain model identified by the given external id. |
|
protected
|
getByReference(CaArrayEntityReference reference,
java.lang.Class<T> type)
Retrieve the entity for given reference expected to have given type. |
|
protected BaseV1_0ExternalService.EntityHandlerRegistry |
getEntityHandlerRegistry()
|
|
protected java.lang.String |
getMapperVersionKey()
|
|
protected
|
getRequiredByExternalId(java.lang.String externalId,
java.lang.Class<T> type)
Retrieve the entity with given external id expected to exist in the persistent store and have given type. |
|
protected
|
mapRequiredReferencesToEntities(java.util.Collection<CaArrayEntityReference> refs,
java.lang.Class<T> type)
Convert the given list of references to the underlying internal entities pointed to by those references. |
|
protected
|
mapRequiredReferencesToEntities(java.util.Collection<CaArrayEntityReference> refs,
java.util.Collection<T> entities,
java.lang.Class<T> type)
Convert the given list of references to the underlying internal entities pointed to by those references. |
|
void |
setFileTypeRegistry(gov.nih.nci.caarray.domain.file.FileTypeRegistry fileTypeRegistry)
|
|
void |
setMapperVersionKey(java.lang.String mapperVersionKey)
Set a new mapper version key. |
|
protected
|
toInternalParams(LimitOffset params,
com.fiveamsolutions.nci.commons.data.search.SortCriterion<T> sortCriterion,
boolean desc)
convert given external paging params instance into internal paging params. |
|
protected
|
toInternalParams(LimitOffset params,
java.lang.String sortField,
boolean desc)
convert given external paging params instance into internal paging params. |
|
protected
|
toInternalParams(LimitOffset params,
java.lang.String sortField,
boolean desc,
java.lang.Class<T> targetClass)
convert given external paging params instance into internal ones. |
Methods inherited from class gov.nih.nci.caarray.services.external.AbstractExternalService |
---|
applySecurityPolicies, applySecurityPolicies, getClassFromExternalId, getDaoFactory, getHibernateMatchMode, getIdFromExternalId, getMapper, makeExternalId, makeExternalId, mapCollection, mapCollection, mapEntity, setDaoFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.util.Map<BiomaterialType,java.lang.Class<? extends gov.nih.nci.caarray.domain.sample.AbstractBioMaterial>> BIOMATERIAL_TYPE_TO_CLASS_MAP
Constructor Detail |
---|
public BaseV1_0ExternalService()
Method Detail |
---|
@Inject public void setFileTypeRegistry(gov.nih.nci.caarray.domain.file.FileTypeRegistry fileTypeRegistry)
fileTypeRegistry
- the file type registry to useprotected <T> com.fiveamsolutions.nci.commons.data.search.PageSortParams<T> toInternalParams(LimitOffset params, com.fiveamsolutions.nci.commons.data.search.SortCriterion<T> sortCriterion, boolean desc)
T
- type being iterated over.params
- the external paramssortCriterion
- the sort criterion to usedesc
- whether the sort should be in descending order
protected <T> com.fiveamsolutions.nci.commons.data.search.PageSortParams<T> toInternalParams(LimitOffset params, java.lang.String sortField, boolean desc)
T
- type being iterated over.params
- the external paramssortField
- the field to sort ondesc
- whether the sort should be in descending order
protected <T> com.fiveamsolutions.nci.commons.data.search.PageSortParams<T> toInternalParams(LimitOffset params, java.lang.String sortField, boolean desc, java.lang.Class<T> targetClass)
T
- type being iterated over.params
- the external paramssortField
- the field to sort ondesc
- whether the sort should be in descending ordertargetClass
- the class of the element entity of the list being sorted paged.
protected java.lang.String getMapperVersionKey()
getMapperVersionKey
in class gov.nih.nci.caarray.services.external.AbstractExternalService
public void setMapperVersionKey(java.lang.String mapperVersionKey)
mapperVersionKey
- new keyprotected java.lang.Object getByExternalId(java.lang.String externalId)
externalId
- the external id
protected <T> T getRequiredByExternalId(java.lang.String externalId, java.lang.Class<T> type) throws InvalidReferenceException
T
- the entity typeexternalId
- the the external id of entity to retrievetype
- the class for the entity type
InvalidReferenceException
- if no entity exists with given external id or the entity is not of expected
type.protected <T> T getByReference(CaArrayEntityReference reference, java.lang.Class<T> type) throws InvalidReferenceException
T
- the entity typereference
- the reference to the entity to retrievetype
- the class for the entity type
InvalidReferenceException
- if no entity exists for given reference or the entity is not of the expected
type.protected <T> java.util.Collection<T> mapRequiredReferencesToEntities(java.util.Collection<CaArrayEntityReference> refs, java.util.Collection<T> entities, java.lang.Class<T> type) throws InvalidReferenceException
T
- the expected entity type for each referencerefs
- the list of references.entities
- the collection in which to store the referenced internal entities.type
- the class for the entity type
InvalidReferenceException
- if for any reference, no entity exists or is not of the expected type.protected <T> java.util.List<T> mapRequiredReferencesToEntities(java.util.Collection<CaArrayEntityReference> refs, java.lang.Class<T> type) throws InvalidReferenceException
T
- the expected entity type for each referencerefs
- the list of references.type
- the class for the entity type
InvalidReferenceException
- if for any reference, no entity exists or is not of the expected type.protected BaseV1_0ExternalService.EntityHandlerRegistry getEntityHandlerRegistry()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |