Package net.handle.apps.batch
Class BatchUtil
java.lang.Object
net.handle.apps.batch.BatchUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractResponseaddAliasToHandleRecord(String handle, String alias, int index, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponseaddHandleValue(String handle, HandleValue value, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static HandleValue[]addValue(HandleValue[] values, HandleValue value) static HandleValue[]createExampleHandleValues(String handle, String url, String adminHandle, int adminIndex) static AbstractResponsecreateHandleRecord(String handle, HandleValue[] values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponsedeleteHandleRecord(String handle, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static SiteInfogetFirstPrimarySite(HandleValue[] values) static SiteInfogetFirstPrimarySiteFromHserv(HandleValue[] values, HandleResolver resolver) getHandlesFromFile(String fileName) static HandleValuegetHandleValueAtIndex(HandleValue[] handleValues, int index) getLinesFromFile(String fileName) static intgetNextIndex(HandleValue[] values, int start) static SiteInfogetSite(String siteHandle, HandleResolver resolver) static List<HandleValue> getValuesNotOfType(HandleValue[] values, String type) static List<HandleValue> getValuesOfType(HandleValue[] values, String type) static booleanhasHandleValueOfType(HandleValue[] values, String type) static AbstractResponsehomePrefix(String prefix, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) listAllHandlesOnSite(SiteInfo site, HandleResolver resolver, AuthenticationInfo authInfo) listHandles(String prefix, SiteInfo site, HandleResolver resolver, AuthenticationInfo authInfo) listPrefixesOnSite(SiteInfo site, HandleResolver resolver, AuthenticationInfo authInfo) static intlowestAvailableIndex(List<Integer> usedIndexes) static intlowestAvailableIndex(HandleValue[] values) static AbstractResponsemodifyHandleValue(String handle, HandleValue value, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponseremoveValueRequest(String handle, HandleValue value, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponseremoveValuesAtIndices(String handle, int[] indicesToRemove, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static HandleValue[]resolveHandle(String handle, HandleResolver resolver, AuthenticationInfo authInfo) static HandleValue[]resolveHandleFromSite(String handle, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static HandleValue[]signHandleValues(HandleValue[] values, String handleToCreate, String handleOfSigner, int indexOfSigner, PrivateKey privateKeyOfSigner) static HandleValue[]signHandleValuesWithJws(HandleValue[] values, String handleToSign, String handleOfSigner, int indexOfSigner, PrivateKey privateKeyOfSigner, List<String> chain) static voidthrowIfNotSuccess(AbstractResponse response) static AbstractResponseunhomePrefix(String prefix, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponseupdateEntireHandleRecord(String handle, List<HandleValue> values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponseupdateEntireHandleRecord(String handle, HandleValue[] values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static voidwriteHandlesToConsole(List<String> handles) static voidwriteHandlesToFile(List<String> handles, String fileName)
-
Constructor Details
-
BatchUtil
public BatchUtil()
-
-
Method Details
-
getSite
- Throws:
HandleException
-
getHandleValueAtIndex
-
getFirstPrimarySiteFromHserv
public static SiteInfo getFirstPrimarySiteFromHserv(HandleValue[] values, HandleResolver resolver) throws HandleException - Throws:
HandleException
-
getFirstPrimarySite
-
listAllHandlesOnSite
public static List<String> listAllHandlesOnSite(SiteInfo site, HandleResolver resolver, AuthenticationInfo authInfo) throws HandleException - Throws:
HandleException
-
listPrefixesOnSite
public static List<String> listPrefixesOnSite(SiteInfo site, HandleResolver resolver, AuthenticationInfo authInfo) throws HandleException - Throws:
HandleException
-
listHandles
public static List<String> listHandles(String prefix, SiteInfo site, HandleResolver resolver, AuthenticationInfo authInfo) throws HandleException - Throws:
HandleException
-
getHandlesFromFile
- Throws:
FileNotFoundException
-
getLinesFromFile
- Throws:
FileNotFoundException
-
writeHandlesToFile
- Throws:
IOException
-
writeHandlesToConsole
-
addValue
-
getNextIndex
-
lowestAvailableIndex
-
lowestAvailableIndex
-
hasHandleValueOfType
-
getValuesOfType
-
getValuesNotOfType
-
addHandleValue
public static AbstractResponse addHandleValue(String handle, HandleValue value, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
resolveHandle
public static HandleValue[] resolveHandle(String handle, HandleResolver resolver, AuthenticationInfo authInfo) throws HandleException - Throws:
HandleException
-
resolveHandleFromSite
public static HandleValue[] resolveHandleFromSite(String handle, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
addAliasToHandleRecord
public static AbstractResponse addAliasToHandleRecord(String handle, String alias, int index, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
modifyHandleValue
public static AbstractResponse modifyHandleValue(String handle, HandleValue value, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
updateEntireHandleRecord
public static AbstractResponse updateEntireHandleRecord(String handle, List<HandleValue> values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
removeValueRequest
public static AbstractResponse removeValueRequest(String handle, HandleValue value, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
removeValuesAtIndices
public static AbstractResponse removeValuesAtIndices(String handle, int[] indicesToRemove, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
signHandleValues
public static HandleValue[] signHandleValues(HandleValue[] values, String handleToCreate, String handleOfSigner, int indexOfSigner, PrivateKey privateKeyOfSigner) throws Exception - Throws:
Exception
-
signHandleValuesWithJws
public static HandleValue[] signHandleValuesWithJws(HandleValue[] values, String handleToSign, String handleOfSigner, int indexOfSigner, PrivateKey privateKeyOfSigner, List<String> chain) throws Exception - Throws:
Exception
-
createExampleHandleValues
public static HandleValue[] createExampleHandleValues(String handle, String url, String adminHandle, int adminIndex) -
deleteHandleRecord
public static AbstractResponse deleteHandleRecord(String handle, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
createHandleRecord
public static AbstractResponse createHandleRecord(String handle, HandleValue[] values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
updateEntireHandleRecord
public static AbstractResponse updateEntireHandleRecord(String handle, HandleValue[] values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
unhomePrefix
public static AbstractResponse unhomePrefix(String prefix, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
homePrefix
public static AbstractResponse homePrefix(String prefix, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) throws HandleException - Throws:
HandleException
-
throwIfNotSuccess
- Throws:
HandleException
-