@RestResource(id="atg.commerce.profile.restresources.CreditCardRestSubresource") public class CreditCardRestSubresource extends GenericService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
CommerceProfileTools |
mProfileTools |
static java.lang.String |
MSG_ERR_MATCHING_CREDIT_CARD |
static java.lang.String |
MSG_NO_CREDIT_CARD_FOUND |
static java.lang.String |
RESOURCE_NAME |
static java.util.ResourceBundle |
sResourceBundle
Resource bundle
|
static java.lang.String |
SUBRESOURCE_CONTEXT_MISSING |
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 |
---|
CreditCardRestSubresource() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String[] |
buildMemberUris(java.util.Collection<RepositoryItem> pMembers,
<any> pQueryParams)
Build the members URIs for the given list of items of type
RepositoryItem . |
RepresentationModel |
getCreditCard(java.lang.String pCreditCardId,
java.lang.String pNickname)
Returns the singular credit card resource for the current profile and for a given credit card id.
|
RepresentationModel |
getCreditCards()
Returns all the credit cards associated to the given user profile.
|
protected RepositoryItem |
getProfile()
Retrieves the current profile and makes sure there is one.
|
CommerceProfileTools |
getProfileTools()
Returns the profileTools component
|
protected RepresentationModel.Builder |
getRepresentationModelBuilder(java.util.Collection<RepositoryItem> pMembers)
Gets the RepresentationModel.Builder with the given collection of RepositoryItems
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.
|
void |
setProfileTools(CommerceProfileTools pProfileTools)
Sets the profileTools component
|
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 SUBRESOURCE_CONTEXT_MISSING
public static final java.lang.String MSG_NO_CREDIT_CARD_FOUND
public static final java.lang.String MSG_ERR_MATCHING_CREDIT_CARD
public static final java.lang.String RESOURCE_NAME
public static java.util.ResourceBundle sResourceBundle
public CommerceProfileTools mProfileTools
public void setProfileTools(CommerceProfileTools pProfileTools)
pProfileTools
- The profileTools componentpublic CommerceProfileTools getProfileTools()
@Endpoint(id="/creditCards/{creditCardId}#GET", isSingular=true, filterId="creditCards.id-Default") public RepresentationModel getCreditCard(java.lang.String pCreditCardId, java.lang.String pNickname) throws RestException, RepositoryException
pCreditCardId
- the id of the credit card for which the resource has to be retrievedpNickname
- the nickname of the credit card for which the resource has to be retrieved
This is an optional input query parameter.RestException
- if an internal server error occursRepositoryException
@Endpoint(id="/creditCards/#GET", isSingular=false, filterId="creditCards-Default") public RepresentationModel getCreditCards() throws RestException
RestException
- if an internal server error occursprotected RepositoryItem getProfile() throws RestException
RestException
- if there is a problem obtaining the profileprotected RepresentationModel.Builder getRepresentationModelBuilder(java.lang.Object pState)
pState
- the state that will be added to the representation modelprotected RepresentationModel.Builder getRepresentationModelBuilder(java.util.Collection<RepositoryItem> pMembers) throws RestException
pMembers
- the members that will be added to the representation modelRestException
- if the member URIs could not be builtprotected java.lang.String[] buildMemberUris(java.util.Collection<RepositoryItem> pMembers, <any> pQueryParams) throws RestException
RepositoryItem
.pMembers
- the list of repository 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 URIs