private void validateServiceInstanceMetadataQuery ( ServiceInstanceQuery query ) throws ServiceException { if ( query == null ) { throw new ServiceException ( ErrorCode . SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR , ErrorCode . SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR . getMessageTemplate ( ) , "service instance query" ) ; } for ( QueryCriterion criterion : query . getCriteria ( ) ) { if ( criterion instanceof ContainQueryCriterion || criterion instanceof NotContainQueryCriterion ) { throw new ServiceException ( ErrorCode . QUERY_CRITERION_ILLEGAL_IN_QUERY ) ; } } }
Validate the metadata query for the queryInstanceByMetadataKey queryInstancesByMetadataKey and getAllInstancesByMetadataKey methods . For those methods the ContainQueryCriterion and NotContainQueryCriterion are not supported .