class ExternalInterfaceServiceImpl implements ExternalInterfaceService {

    @Override
    public ExternalInterface deleteExternalInterface(ExternalInterfaceKey externalInterfaceKey)
    {
        // Perform validation and trim.
        validateAndTrimExternalInterfaceKey(externalInterfaceKey);

        // Retrieve and ensure that an external interface already exists with the specified name.
        ExternalInterfaceEntity externalInterfaceEntity =
            externalInterfaceDaoHelper.getExternalInterfaceEntity(externalInterfaceKey.getExternalInterfaceName());

        // Delete the external interface.
        externalInterfaceDao.delete(externalInterfaceEntity);

        // Create and return the external interface object from the deleted entity.
        return createExternalInterfaceFromEntity(externalInterfaceEntity);
    }

}