Skip to content

Commit

Permalink
Add javadoc to AuthorityValueService interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kshepherd committed Sep 18, 2024
1 parent 22dcb83 commit 05f1073
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class AuthorityValueServiceImpl implements AuthorityValueService {

private final Logger log = org.apache.logging.log4j.LogManager.getLogger(AuthorityValueServiceImpl.class);

@Autowired(required = true)
@Autowired()
protected AuthorityTypes authorityTypes;

protected AuthorityValueServiceImpl() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.apache.solr.common.SolrDocument;
import org.dspace.authority.AuthorityValue;
import org.dspace.core.Context;

/**
* This service contains all methods for using authority values
Expand All @@ -25,32 +24,125 @@ public interface AuthorityValueService {
public static final String SPLIT = "::";
public static final String GENERATE = "will be generated" + SPLIT;

public AuthorityValue generate(Context context, String authorityKey, String content, String field);

/**
* Generates an {@link AuthorityValue} based on the given parameters.
*
* @param authorityKey the authority key to be assigned to the generated authority value
* @param content the content of the generated authority value
* @param field the field of the generated authority value
* @return the generated {@link AuthorityValue}
*/
public AuthorityValue generate(String authorityKey, String content, String field);

/**
* Updates an AuthorityValue.
*
* @param value the AuthorityValue to be updated
* @return the updated AuthorityValue
*/
public AuthorityValue update(AuthorityValue value);

/**
* Finds an AuthorityValue based on the provided authorityID.
*
* @param authorityID the authority ID used to search for the AuthorityValue
* @return the found AuthorityValue, or null if no match is found
*/
public AuthorityValue findByUID(String authorityID);

public List<AuthorityValue> findByValue(Context context, String field, String value);

public AuthorityValue findByOrcidID(Context context, String orcid_id);

public List<AuthorityValue> findByName(Context context, String schema, String element, String qualifier,
/**
* Finds AuthorityValues in the given context based on field and value.
*
* @param field the field to search for AuthorityValues
* @param value the value to search for AuthorityValues
* @return a list of found AuthorityValues matching the given field and value, or an empty list if no match is found
*/
public List<AuthorityValue> findByValue(String field, String value);

/**
* Finds an {@link AuthorityValue} based on the provided ORCID ID.
*
* @param orcid_id the ORCID ID used to search for the AuthorityValue
* @return the found AuthorityValue, or null if no match is found
*/
public AuthorityValue findByOrcidID(String orcid_id);

/**
* Finds {@link AuthorityValue}s based on the provided metadata schema, element, qualifier, and name.
*
* @param schema the schema of the AuthorityValue
* @param element the element of the AuthorityValue
* @param qualifier the qualifier of the AuthorityValue
* @param name the name of the AuthorityValue
* @return a list of found AuthorityValues matching the given schema, element, qualifier, and name,
* or an empty list if no match is found
*/
public List<AuthorityValue> findByName(String schema, String element, String qualifier,
String name);

public List<AuthorityValue> findByAuthorityMetadata(Context context, String schema, String element,
/**
* Finds {@link AuthorityValue}s based on the provided metadata schema, element, qualifier, and value.
*
* @param schema the schema of the AuthorityValue
* @param element the element of the AuthorityValue
* @param qualifier the qualifier of the AuthorityValue
* @param value the value of the AuthorityValue
* @return a list of found AuthorityValues matching the given schema, element, qualifier, and value,
* or an empty list if no match is found
*/
public List<AuthorityValue> findByAuthorityMetadata(String schema, String element,
String qualifier, String value);

public List<AuthorityValue> findByExactValue(Context context, String field, String value);

public List<AuthorityValue> findByValue(Context context, String schema, String element, String qualifier,
/**
* Finds {@link AuthorityValue}s in the given context based on the exact field and value.
*
* @param field the field to search for AuthorityValues
* @param value the value to search for AuthorityValues
* @return a list of found AuthorityValues matching the given field and value,
* or an empty list if no match is found
*/
public List<AuthorityValue> findByExactValue(String field, String value);

/**
* Finds {@link AuthorityValue}s based on the provided metadata schema, element, qualifier, and value.
*
* @param schema the schema of the AuthorityValue
* @param element the element of the AuthorityValue
* @param qualifier the qualifier of the AuthorityValue
* @param value the value of the AuthorityValue
* @return a list of found AuthorityValues matching the given schema, element, qualifier, and value,
* or an empty list if no match is found
*/
public List<AuthorityValue> findByValue(String schema, String element, String qualifier,
String value);

public List<AuthorityValue> findOrcidHolders(Context context);

public List<AuthorityValue> findAll(Context context);

/**
* Finds AuthorityValues that are ORCID person authority values.
*
* @return a list of AuthorityValues or an empty list if no matching values are found
*/
public List<AuthorityValue> findOrcidHolders();

/**
* Retrieves all AuthorityValues from Solr.
*
* @return A list of all AuthorityValues.
*/
public List<AuthorityValue> findAll();

/**
* Converts a SolrDocument into an AuthorityValue object.
*
* @param solrDocument the SolrDocument to convert
* @return the converted AuthorityValue object
*/
public AuthorityValue fromSolr(SolrDocument solrDocument);

/**
* Retrieves the type of authority value based on the provided metadata string.
*
* @param metadataString the metadata string used to determine the authority value type
* @return the {@link AuthorityValue} representing the type of authority value, or null if no match is found
*/
public AuthorityValue getAuthorityValueType(String metadataString);
}

0 comments on commit 05f1073

Please sign in to comment.