// QueryActivities queries the given activity store using the provided criteria
// and returns a results iterator.
QueryActivities queries the given activity store using the provided criteria
and returns a results iterator.
// QueryActivities queries the given activity store using the provided criteria // and returns a results iterator .
func (s *Provider) QueryActivities(query *spi.Criteria, opts ...spi.QueryOpt) (spi.ActivityIterator, error) {
	logger.Debugf("[%s] Querying activities - Query: %+v", s.serviceName, query)
	options := storeutil.GetQueryOptions(opts...)
	if query.ReferenceType != "" && query.ObjectIRI != nil {
		return s.queryActivitiesByRef(query.ReferenceType, query, opts...)
	}
	if len(query.ActivityIRIs) == 0 && len(query.Types) == 0 { 
		iterator, err := s.activityStore.Query(activityTag,
			ariesstorage.WithSortOrder(&ariesstorage.SortOptions{
				Order:   ariesstorage.SortOrder(options.SortOrder),
				TagName: timeAddedTagName,
			}),
			ariesstorage.WithPageSize(options.PageSize),
			ariesstorage.WithInitialPageNum(options.PageNumber))
		if err != nil {
			return nil, orberrors.NewTransient(fmt.Errorf("failed to query store: %w", err))
		}
		return &activityIterator{ariesIterator: iterator}, nil
	}
	return nil, errors.New("unsupported query criteria")
}
func ( s * Provider ) QueryActivities ( query * spi . Criteria , opts ... spi . QueryOpt ) ( spi . ActivityIterator , error ) { logger . Debugf ( " " , s . serviceName , query ) options := storeutil . GetQueryOptions ( opts ... ) if query . ReferenceType != " " && query . ObjectIRI != nil { return s . queryActivitiesByRef ( query . ReferenceType , query , opts ... ) } if len ( query . ActivityIRIs ) == 0 && len ( query . Types ) == 0 { iterator , err := s . activityStore . Query ( activityTag , ariesstorage . WithSortOrder ( & ariesstorage . SortOptions { Order : ariesstorage . SortOrder ( options . SortOrder ) , TagName : timeAddedTagName , } ) , ariesstorage . WithPageSize ( options . PageSize ) , ariesstorage . WithInitialPageNum ( options . PageNumber ) ) if err != nil { return nil , orberrors . NewTransient ( fmt . Errorf ( " " , err ) ) } return & activityIterator { ariesIterator : iterator } , nil } return nil , errors . New ( " " ) }
QueryActivities queries the given activity store using the provided criteria
and returns a results iterator.
QueryActivities queries the given activity store using the provided criteria and returns a results iterator .
// Get all activities