com.elasticpath.service.asset.impl
Class DigitalAssetAuditServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
          extended by com.elasticpath.service.asset.impl.DigitalAssetAuditServiceImpl
All Implemented Interfaces:
DigitalAssetAuditService, EpPersistenceService, EpService

public class DigitalAssetAuditServiceImpl
extends AbstractEpPersistenceServiceImpl
implements DigitalAssetAuditService

DigitalAssetServiceImpl.


Constructor Summary
DigitalAssetAuditServiceImpl()
           
 
Method Summary
 DigitalAssetAudit add(DigitalAssetAudit digitalAssetAudit)
          Adds the given digitalAssetAudit.
 DigitalAssetAudit addDigitalAssetAudit(java.lang.String ipAddress, long digitalAssetUid, long orderSkuUid)
          Add an audit record to for digital asset download.
 java.lang.String findOrderNumberByOrderSkuID(long orderSkuUid)
          Retrieves order number found by the orderSku Uid.
 DigitalAssetAudit get(long digitalAssetAuditUid)
          Get the digitalAssetAudit with the given UID.
 DigitalAsset getDigitalAsset(long orderSkuUid)
          Retrieves DigitalAsset.
 java.lang.Object getObject(long uid)
          Generic load method for all persistable domain models.
 OrderSku getOrderSku(long orderSkuUid)
          Retrieves OrderSku found by the orderSku Uid.
 int isValidDADownloadRequest(long digitalAssetUid, long orderSkuUid)
          Check if the asset uid and ordersku uid from download request is a valid download request.
 java.util.List list()
          Lists all digitalAssets stored in the database.
 DigitalAssetAudit load(long digitalAssetAuditUid)
          Load the digitalAssetAudit with the given UID.
 void remove(DigitalAssetAudit digitalAssetAudit)
          Delete the digitalAssetAudit.
 void update(DigitalAssetAudit digitalAssetAudit)
          Updates the given digitalAssetAudit.
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
getPersistenceEngine, setPersistenceEngine
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Constructor Detail

DigitalAssetAuditServiceImpl

public DigitalAssetAuditServiceImpl()
Method Detail

add

public DigitalAssetAudit add(DigitalAssetAudit digitalAssetAudit)
                      throws EpServiceException
Adds the given digitalAssetAudit.

Specified by:
add in interface DigitalAssetAuditService
Parameters:
digitalAssetAudit - the digitalAssetAudit to add
Returns:
the persisted instance of digitalAssetAudit
Throws:
EpServiceException - - if digitalAssetAudit with the specified name already exists

addDigitalAssetAudit

public DigitalAssetAudit addDigitalAssetAudit(java.lang.String ipAddress,
                                              long digitalAssetUid,
                                              long orderSkuUid)
Add an audit record to for digital asset download.

Specified by:
addDigitalAssetAudit in interface DigitalAssetAuditService
Parameters:
ipAddress - the IP address
digitalAssetUid - the digital asset uid
orderSkuUid - the order sku id
Returns:
the added DigitalAssetAudit

findOrderNumberByOrderSkuID

public java.lang.String findOrderNumberByOrderSkuID(long orderSkuUid)
Retrieves order number found by the orderSku Uid.

Specified by:
findOrderNumberByOrderSkuID in interface DigitalAssetAuditService
Parameters:
orderSkuUid - the orderSku Uid
Returns:
order number found by the orderSku Uid

get

public DigitalAssetAudit get(long digitalAssetAuditUid)
                      throws EpServiceException
Get the digitalAssetAudit with the given UID. Return null if no matching record exists.

Specified by:
get in interface DigitalAssetAuditService
Parameters:
digitalAssetAuditUid - the digitalAssetAudit UID
Returns:
the digitalAssetAudit if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getDigitalAsset

public DigitalAsset getDigitalAsset(long orderSkuUid)
Retrieves DigitalAsset.

Specified by:
getDigitalAsset in interface DigitalAssetAuditService
Parameters:
orderSkuUid - the orderSku Uid
Returns:
DigitalAsset

getObject

public java.lang.Object getObject(long uid)
                           throws EpServiceException
Generic load method for all persistable domain models.

Specified by:
getObject in interface EpPersistenceService
Parameters:
uid - the persisted instance uid
Returns:
the persisted instance if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getOrderSku

public OrderSku getOrderSku(long orderSkuUid)
Retrieves OrderSku found by the orderSku Uid.

Specified by:
getOrderSku in interface DigitalAssetAuditService
Parameters:
orderSkuUid - the orderSku Uid
Returns:
OrderSku found by the orderSku Uid

isValidDADownloadRequest

public int isValidDADownloadRequest(long digitalAssetUid,
                                    long orderSkuUid)
Check if the asset uid and ordersku uid from download request is a valid download request.

Specified by:
isValidDADownloadRequest in interface DigitalAssetAuditService
Parameters:
digitalAssetUid - the digital asset uid
orderSkuUid - the order Sku uid
Returns:
the error code if fail in validation, otherwise return 0.

list

public java.util.List list()
                    throws EpServiceException
Lists all digitalAssets stored in the database.

Specified by:
list in interface DigitalAssetAuditService
Returns:
a list of digitalAssets
Throws:
EpServiceException - - in case of any errors

load

public DigitalAssetAudit load(long digitalAssetAuditUid)
                       throws EpServiceException
Load the digitalAssetAudit with the given UID. Throw an unrecoverable exception if there is no matching database row.

Specified by:
load in interface DigitalAssetAuditService
Parameters:
digitalAssetAuditUid - the digitalAssetAudit UID
Returns:
the digitalAssetAudit if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

remove

public void remove(DigitalAssetAudit digitalAssetAudit)
            throws EpServiceException
Delete the digitalAssetAudit.

Specified by:
remove in interface DigitalAssetAuditService
Parameters:
digitalAssetAudit - the digitalAssetAudit to remove
Throws:
EpServiceException - - in case of any errors

update

public void update(DigitalAssetAudit digitalAssetAudit)
            throws EpServiceException
Updates the given digitalAssetAudit.

Specified by:
update in interface DigitalAssetAuditService
Parameters:
digitalAssetAudit - the digitalAssetAudit to update
Throws:
EpServiceException - - if digitalAssetAudit with the specified name already exists