Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-03-05 17:43:38 -0500
committerslewis2018-03-05 17:43:38 -0500
commita1e2e7aa30f08c1d9e33a1c653b325ef930e8802 (patch)
treec32f2ca3b3445746b9f3c9cbd5409a6f9168127b /framework/bundles/org.eclipse.ecf.identity/src
parentf245ae29d20f798a2bfb7f8d5797c527a94168bf (diff)
downloadorg.eclipse.ecf-a1e2e7aa30f08c1d9e33a1c653b325ef930e8802.tar.gz
org.eclipse.ecf-a1e2e7aa30f08c1d9e33a1c653b325ef930e8802.tar.xz
org.eclipse.ecf-a1e2e7aa30f08c1d9e33a1c653b325ef930e8802.zip
Update to use gogo for console commands
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java24
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java2
2 files changed, 11 insertions, 15 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java
index 27f2156bf..c084da12d 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java
@@ -24,7 +24,7 @@ public class GUID extends StringID {
private static final long serialVersionUID = -8546568877571886386L;
public GUIDNamespace() {
- super(GUID.class.getName(), "GUID Namespace"); //$NON-NLS-1$
+ super(GUID.class.getName(), "GUID Namespace. Default based upon 20-byte SecureRandom in Base64 format"); //$NON-NLS-1$
}
public ID createInstance(Object[] args) throws IDCreateException {
@@ -56,7 +56,7 @@ public class GUID extends StringID {
* getSupportedParameterTypesForCreateInstance()
*/
public Class<?>[][] getSupportedParameterTypes() {
- return new Class[][] { {}, { Integer.class } };
+ return new Class[][] { {}, { Integer.class }, { String.class } };
}
}
@@ -80,15 +80,13 @@ public class GUID extends StringID {
* @param byteLength
* the length of the target number (in bytes)
*/
- protected GUID(Namespace n, String algo, String provider, int byteLength)
- throws IDCreateException {
+ protected GUID(Namespace n, String algo, String provider, int byteLength) throws IDCreateException {
super(n, ""); //$NON-NLS-1$
// Get SecureRandom instance for class
try {
getRandom(algo, provider);
} catch (Exception e) {
- throw new IDCreateException(
- "GUID creation failure: " + e.getMessage()); //$NON-NLS-1$
+ throw new IDCreateException("GUID creation failure: " + e.getMessage()); //$NON-NLS-1$
}
// make sure we have reasonable byteLength
if (byteLength <= 0)
@@ -116,17 +114,16 @@ public class GUID extends StringID {
* Get SecureRandom instance for creation of random number.
*
* @param algo
- * the String algorithm specification (e.g. "SHA1PRNG") for
- * creation of the SecureRandom instance
+ * the String algorithm specification (e.g. "SHA1PRNG") for creation
+ * of the SecureRandom instance
* @param provider
- * the provider of the implementation of the given algorighm
- * (e.g. "SUN")
+ * the provider of the implementation of the given algorighm (e.g.
+ * "SUN")
* @return SecureRandom
* @exception Exception
* thrown if SecureRandom instance cannot be created/accessed
*/
- protected static synchronized SecureRandom getRandom(String algo,
- String provider) throws Exception {
+ protected static synchronized SecureRandom getRandom(String algo, String provider) throws Exception {
// Given algo and provider, get SecureRandom instance
if (random == null) {
initializeRandom(algo, provider);
@@ -134,8 +131,7 @@ public class GUID extends StringID {
return random;
}
- protected static synchronized void initializeRandom(String algo,
- String provider) throws Exception {
+ protected static synchronized void initializeRandom(String algo, String provider) throws Exception {
if (provider == null) {
if (algo == null) {
try {
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java
index 8a0124b23..9e3b94be8 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java
@@ -53,7 +53,7 @@ public class LongID extends BaseID {
* getSupportedParameterTypesForCreateInstance()
*/
public Class<?>[][] getSupportedParameterTypes() {
- return new Class[][] { { Long.class } };
+ return new Class[][] { { Long.class }, { String.class } };
}
}

Back to the top