Package net.handle.apps.batch
Class BatchUtil
java.lang.Object
net.handle.apps.batch.BatchUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractResponse
addAliasToHandleRecord
(String handle, String alias, int index, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponse
addHandleValue
(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 AbstractResponse
createHandleRecord
(String handle, HandleValue[] values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponse
deleteHandleRecord
(String handle, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static SiteInfo
getFirstPrimarySite
(HandleValue[] values) static SiteInfo
getFirstPrimarySiteFromHserv
(HandleValue[] values, HandleResolver resolver) getHandlesFromFile
(String fileName) static HandleValue
getHandleValueAtIndex
(HandleValue[] handleValues, int index) getLinesFromFile
(String fileName) static int
getNextIndex
(HandleValue[] values, int start) static SiteInfo
getSite
(String siteHandle, HandleResolver resolver) static List
<HandleValue> getValuesNotOfType
(HandleValue[] values, String type) static List
<HandleValue> getValuesOfType
(HandleValue[] values, String type) static boolean
hasHandleValueOfType
(HandleValue[] values, String type) static AbstractResponse
homePrefix
(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 int
lowestAvailableIndex
(List<Integer> usedIndexes) static int
lowestAvailableIndex
(HandleValue[] values) static AbstractResponse
modifyHandleValue
(String handle, HandleValue value, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponse
removeValueRequest
(String handle, HandleValue value, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponse
removeValuesAtIndices
(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 void
throwIfNotSuccess
(AbstractResponse response) static AbstractResponse
unhomePrefix
(String prefix, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponse
updateEntireHandleRecord
(String handle, List<HandleValue> values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static AbstractResponse
updateEntireHandleRecord
(String handle, HandleValue[] values, HandleResolver resolver, AuthenticationInfo authInfo, SiteInfo site) static void
writeHandlesToConsole
(List<String> handles) static void
writeHandlesToFile
(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
-