public abstract class AbstractCommerceIdentifierRestSubresource extends GenericService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static int |
DEFAULT_PAGE_SIZE |
protected java.lang.String |
mEmbeddedCommerceItemRelationshipName |
protected java.lang.String |
mEmbeddedPaymentGroupRelationshipName |
protected java.lang.String |
mEmbeddedShippingGroupRelationshipName |
static java.lang.String |
RESOURCE_NAME |
static java.util.ResourceBundle |
sResourceBundle
Resource Bundle
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
AbstractCommerceIdentifierRestSubresource() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCreatedItemUri(RepresentationModel.Builder pBuilder,
java.lang.String pResourceId,
CommerceIdentifier pCreatedItem)
Adds a created uri to the given RepresentationModel.Builder, based on the given resource id
and the CommerceIdentifier.
|
protected java.lang.String[] |
buildMemberUris(java.util.Collection<CommerceIdentifier> pCommerceIdentifiers,
<any> pQueryParams)
Build the members URIs for the given list of items of type
CommerceIdentifier . |
protected java.lang.String |
getCartUri()
Build a resource URI for the Cart.
|
protected java.net.URI |
getCreatedItemUri(atg.service.jaxrs.ResourceUpdateInfo pResourceUpdateInfo)
Build a URI to the newly added/created item if present.
|
int |
getDefaultLimit()
Returns the default limit to use for paging if no 'limit' param set
|
java.lang.String |
getEmbeddedCartRelationshipName()
Get the relationship name used when embedding the cart resource.
|
java.lang.String |
getEmbeddedCommerceItemRelationshipName()
Get the relationship name used for the embedded commerce item resource.
|
java.lang.String |
getEmbeddedPaymentGroupRelationshipName()
Get the relationship name used for the embedded payment group resource.
|
java.lang.String |
getEmbeddedShippingGroupRelationshipName()
Get the relationship name used for the embedded shipping group resource.
|
Order |
getOrder()
Retrieve the Order from the request cache.
|
protected java.util.Optional<Relationship> |
getRelationshipCreated(java.util.List<Relationship> pPreRelationships,
java.util.List<Relationship> pPostRelationships)
Compare the pre and post lists of Relationships, returning the first unmatched Relationship.
|
protected java.util.List<Relationship> |
getRelationships(java.util.List<Relationship> pRelationships)
Copy the given list to a new list of Relationships.
|
protected RepresentationModel.Builder |
getRepresentationModelBuilder(java.util.Collection<CommerceIdentifier> pMembers)
Gets the RepresentationModel.Builder with the given collection of CommerceIdentifiers
being used to build member URIs.
|
protected RepresentationModel.Builder |
getRepresentationModelBuilder(java.lang.Object pState)
Gets the RepresentationModel.Builder with the given object acting as the state.
|
protected RepresentationModel.Builder |
getRepresentationModelBuilderWithCart(java.util.Collection<CommerceIdentifier> pMembers)
Gets the RepresentationModel.Builder with the given collection of CommerceIdentifiers
being used to build member URIs.
|
protected RepresentationModel.Builder |
getRepresentationModelBuilderWithCart(java.lang.Object pState)
Gets the RepresentationModel.Builder with the given object acting as the state.
|
protected RepresentationModel.Builder |
getRepresentationModelBuilderWithPaging(java.util.Collection<CommerceIdentifier> pMembers)
Gets the RepresentationModel.Builder with the given collection of
CommerceIdentifiers being used to build member URIs and page the collection.
|
protected Link |
getSelfLink(java.lang.String pItemId)
Build a self link for the item resource.
|
void |
setDefaultLimit(int pDefaultLimit)
Sets the default limit to use for paging if no 'limit' param set
|
void |
setEmbeddedCartRelationshipName(java.lang.String pEmbeddedCartRelationshipName)
Configure the relationship name used for the embedded cart resource.
|
void |
setEmbeddedCommerceItemRelationshipName(java.lang.String pEmbeddedCommerceItemRelationshipName)
Configure the relationship name used for the embedded commerce item resource.
|
void |
setEmbeddedPaymentGroupRelationshipName(java.lang.String pEmbeddedPaymentGroupRelationshipName)
Configure the relationship name used for the embedded payment group resource.
|
void |
setEmbeddedShippingGroupRelationshipName(java.lang.String pEmbeddedShippingGroupRelationshipName)
Configure the relationship name used for the embedded shipping group resource.
|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public static final java.lang.String RESOURCE_NAME
public static final int DEFAULT_PAGE_SIZE
public static java.util.ResourceBundle sResourceBundle
protected java.lang.String mEmbeddedCommerceItemRelationshipName
protected java.lang.String mEmbeddedPaymentGroupRelationshipName
protected java.lang.String mEmbeddedShippingGroupRelationshipName
public AbstractCommerceIdentifierRestSubresource()
public void setEmbeddedCartRelationshipName(java.lang.String pEmbeddedCartRelationshipName)
pEmbeddedCartRelationshipName
- the name of the relationship to the embedded resourcepublic java.lang.String getEmbeddedCartRelationshipName()
public void setEmbeddedCommerceItemRelationshipName(java.lang.String pEmbeddedCommerceItemRelationshipName)
pEmbeddedCommerceItemRelationshipName
- the name of the relationship to the embedded commerce item resource.public java.lang.String getEmbeddedCommerceItemRelationshipName()
public void setEmbeddedPaymentGroupRelationshipName(java.lang.String pEmbeddedPaymentGroupRelationshipName)
pEmbeddedPaymentGroupRelationshipName
- the name of the relationship to the embedded payment group resource.public java.lang.String getEmbeddedPaymentGroupRelationshipName()
public void setEmbeddedShippingGroupRelationshipName(java.lang.String pEmbeddedShippingGroupRelationshipName)
pEmbeddedShippingGroupRelationshipName
- the name of the relationship to the embedded shipping group resource.public java.lang.String getEmbeddedShippingGroupRelationshipName()
public int getDefaultLimit()
public void setDefaultLimit(int pDefaultLimit)
pDefaultLimit
- the limit to setpublic Order getOrder() throws RestException
RestException
- if there is a problem obtaining the Order.protected Link getSelfLink(java.lang.String pItemId)
pItemId
- - Item Id from which to build the self link.protected java.lang.String getCartUri()
protected java.net.URI getCreatedItemUri(atg.service.jaxrs.ResourceUpdateInfo pResourceUpdateInfo)
pResourceUpdateInfo
- - ResourceUpdateInfo representing the actions taken.protected void addCreatedItemUri(RepresentationModel.Builder pBuilder, java.lang.String pResourceId, CommerceIdentifier pCreatedItem)
pBuilder
- the builder to which the created uri will be addedpResourceId
- the id of the rest resource that was createdpCreatedItem
- the created item whose id will be used in the creation of the uriprotected java.lang.String[] buildMemberUris(java.util.Collection<CommerceIdentifier> pCommerceIdentifiers, <any> pQueryParams) throws RestException
CommerceIdentifier
.pCommerceIdentifiers
- the list of commerce identifier items from which to build the member URIspQueryParams
- optional map of query param key/value pairs to be added to any built uris, null if noneRestException
- if a problem occurred whilst building the member URIsprotected RepresentationModel.Builder getRepresentationModelBuilder(java.lang.Object pState)
pState
- the state that will be added to the representation modelprotected RepresentationModel.Builder getRepresentationModelBuilderWithCart(java.lang.Object pState) throws RestException
Also includes the embedded cart.
pState
- the state that will be added to the representation modelRestException
protected RepresentationModel.Builder getRepresentationModelBuilder(java.util.Collection<CommerceIdentifier> pMembers) throws RestException
pMembers
- the members that will be added to the representation modelRestException
- if the member URIs could not be builtprotected RepresentationModel.Builder getRepresentationModelBuilderWithPaging(java.util.Collection<CommerceIdentifier> pMembers) throws RestException
RestException
protected RepresentationModel.Builder getRepresentationModelBuilderWithCart(java.util.Collection<CommerceIdentifier> pMembers) throws RestException
Also includes the embedded cart.
pMembers
- the members that will be added to the representation modelRestException
- if the member URIs could not be builtprotected java.util.Optional<Relationship> getRelationshipCreated(java.util.List<Relationship> pPreRelationships, java.util.List<Relationship> pPostRelationships)
pPreRelationships
- the list of relations pre-processing of an operation.pPostRelationships
- the list of relations post-processing of an operation.protected java.util.List<Relationship> getRelationships(java.util.List<Relationship> pRelationships)
pRelationships
- list to be copied.