com.elasticpath.service.catalog
Interface SkuOptionService

All Superinterfaces:
EpPersistenceService, EpService
All Known Implementing Classes:
SkuOptionServiceImpl

public interface SkuOptionService
extends EpPersistenceService

Provide sku option related business service.


Method Summary
 SkuOption add(SkuOption skuOption)
          Adds the given sku option.
 SkuOption addOptionValue(SkuOptionValue skuOptionValue, SkuOption skuOption)
          Add the sku option value.
 SkuOption findByKey(java.lang.String key)
          Find the sku option with the given key.
 long findUidPkByKey(java.lang.String key)
          Find the sku option with the given key.
 SkuOption get(long skuOptionUid)
          Get the sku option with the given UID.
 java.util.List getSkuOptionInUseUidList()
          Return a list of uids for all sku options in use.
 java.util.List getSkuOptionValueInUseUidList()
          Return a list of uids for all sku options value in use.
 boolean keyExists(SkuOption skuOption)
          Check whether the given sku option's key exists or not.
 boolean keyExists(java.lang.String key)
          Checks whether the given sku option key exists or not.
 java.util.List list()
          Lists all sku option stored in the database.
 SkuOption load(long skuOptionUid)
          Load the sku option with the given UID.
 void remove(SkuOption skuOption)
          Delete the sku option.
 SkuOption removeOptionValue(SkuOptionValue skuOptionValue, SkuOption skuOption)
          Delete the sku option value.
 void saveOrUpdate(SkuOption skuOption)
          Save or update the given skuOption.
 SkuOption update(SkuOption skuOption)
          Updates the given sku option.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

SkuOption add(SkuOption skuOption)
              throws SkuOptionKeyExistException
Adds the given sku option.

Parameters:
skuOption - the sku option to add
Returns:
the persisted instance of sku option
Throws:
SkuOptionKeyExistException - - if the sepcified skuOptionKey is already in use.

addOptionValue

SkuOption addOptionValue(SkuOptionValue skuOptionValue,
                         SkuOption skuOption)
                         throws SkuOptionKeyExistException
Add the sku option value.

Parameters:
skuOptionValue - the sku option value to add
skuOption - the sku option to update
Returns:
skuOtion as SkuOption
Throws:
SkuOptionKeyExistException - - if the sepcified skuOptionKey is already in use.

findByKey

SkuOption findByKey(java.lang.String key)
                    throws EpServiceException
Find the sku option with the given key.

Parameters:
key - the sku option key.
Returns:
the sku option that matches the given key, otherwise null
Throws:
EpServiceException - - in case of any errors

findUidPkByKey

long findUidPkByKey(java.lang.String key)
                    throws EpServiceException
Find the sku option with the given key.

Parameters:
key - the sku option key.
Returns:
the sku option uid that matches the given key, otherwise return -1
Throws:
EpServiceException - - in case of any errors

get

SkuOption get(long skuOptionUid)
              throws EpServiceException
Get the sku option with the given UID. Return null if no matching record exists.

Parameters:
skuOptionUid - the sku option UID
Returns:
the sku option if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getSkuOptionInUseUidList

java.util.List getSkuOptionInUseUidList()
Return a list of uids for all sku options in use.

Returns:
a list of uids for all sku options in use

getSkuOptionValueInUseUidList

java.util.List getSkuOptionValueInUseUidList()
Return a list of uids for all sku options value in use.

Returns:
a list of uids for all sku options value in use

keyExists

boolean keyExists(SkuOption skuOption)
                  throws EpServiceException
Check whether the given sku option's key exists or not.

Parameters:
skuOption - the sku option to check
Returns:
true if a different sku option with the given sku option's key exists
Throws:
EpServiceException - - in case of any errors

keyExists

boolean keyExists(java.lang.String key)
                  throws EpServiceException
Checks whether the given sku option key exists or not.

Parameters:
key - the sku option key.
Returns:
true if the given key exists.
Throws:
EpServiceException - - in case of any errors

list

java.util.List list()
                    throws EpServiceException
Lists all sku option stored in the database.

Returns:
a list of sku option
Throws:
EpServiceException - - in case of any errors

load

SkuOption load(long skuOptionUid)
               throws EpServiceException
Load the sku option with the given UID. Throw an unrecoverable exception if there is no matching database row.

Parameters:
skuOptionUid - the sku option UID
Returns:
the sku option if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

remove

void remove(SkuOption skuOption)
            throws EpServiceException
Delete the sku option.

Parameters:
skuOption - the sku option to remove
Throws:
EpServiceException - - in case of any errors

removeOptionValue

SkuOption removeOptionValue(SkuOptionValue skuOptionValue,
                            SkuOption skuOption)
                            throws EpServiceException
Delete the sku option value.

Parameters:
skuOptionValue - the sku option value to remove
skuOption - the sku option to update
Returns:
skuOtion as SkuOption
Throws:
EpServiceException - - in case of any errors

saveOrUpdate

void saveOrUpdate(SkuOption skuOption)
                  throws EpServiceException
Save or update the given skuOption.

Parameters:
skuOption - the brand to save or update
Throws:
EpServiceException - - in case of any errors

update

SkuOption update(SkuOption skuOption)
                 throws SkuOptionKeyExistException
Updates the given sku option.

Parameters:
skuOption - the sku option to update
Returns:
skuOtion as SkuOption
Throws:
SkuOptionKeyExistException - - if the sepcified skuOptionKey is already in use.