Example usage for java.util UUID toString

List of usage examples for java.util UUID toString

Introduction

In this page you can find the example usage for java.util UUID toString.

Prototype

public String toString() 

Source Link

Document

Returns a String object representing this UUID .

Usage

From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmMssCF.CFCrmMssCFBindSecUserDefaultDevSecUserId.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFCrmMssCFBindSecUserDefaultDevSecUserId.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }/*from   w  w w. j  a v  a 2  s. c om*/

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFCrmSecUserObj) {
        UUID defaultDevSecUserId = ((ICFCrmSecUserObj) genDef).getOptionalDefaultDevSecUserId();
        if (defaultDevSecUserId == null) {
            ret = null;
        } else {
            ret = defaultDevSecUserId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFCrmSecUserObj");
    }

    return (ret);
}

From source file:nl.knaw.huygens.alexandria.storage.EndpointsTest.java

@Test
public void testPutAndAnnotate() {
    UUID uuid = UUID.randomUUID();
    Entity<String> resourcePrototype = jsonEntity(
            "{'resource':{'id':'" + uuid.toString() + "','ref':'Jan Klaassen'}}");
    Response response = target(ROOTPATH).path(uuid.toString()).request().put(resourcePrototype);
    Log.debug("response={}", response);
    assertThat(response.getLocation().toString()).contains("/resources/");
    assertThat(response.getStatus()).isEqualTo(Status.CREATED.getStatusCode());

    Entity<String> annotationPrototype = jsonEntity("{'annotation':{'type':'Tag','value':'Bookmark'}}");
    Response annotateResponse = target(ROOTPATH).path(uuid.toString()).path("annotations").request()
            .post(annotationPrototype);/*from   w w  w  . j  a v a 2  s  .  c  o m*/
    Log.debug("response={}", annotateResponse);
    assertThat(annotateResponse.getStatus()).isEqualTo(Status.CREATED.getStatusCode());
    Log.debug("response.location={}", annotateResponse.getLocation());
}

From source file:org.ovirt.engine.sdk.decorators.Tags.java

/**
 * Fetches Tag object by id./*from   www. j  a  v  a  2s.co m*/
 *
 * @return {@link Tag }
 *
 * @throws ClientProtocolException
 *             Signals that HTTP/S protocol error has occurred.
 * @throws ServerException
 *             Signals that an oVirt api error has occurred.
 * @throws IOException
 *             Signals that an I/O exception of some sort has occurred.
 */
@Override
public Tag get(UUID id) throws ClientProtocolException, ServerException, IOException {
    String url = SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.Tag.class, Tag.class);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMssCF.CFAsteriskMssCFBindSecUserPasswordResetUuid.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFAsteriskMssCFBindSecUserPasswordResetUuid.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }/*  ww w.j ava 2  s  .c  o m*/

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFAsteriskSecUserObj) {
        UUID passwordResetUuid = ((ICFAsteriskSecUserObj) genDef).getOptionalPasswordResetUuid();
        if (passwordResetUuid == null) {
            ret = null;
        } else {
            ret = passwordResetUuid.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFAsteriskSecUserObj");
    }

    return (ret);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMssCF.CFAccMssCFBindAccountEntrySplitEntryId.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFAccMssCFBindAccountEntrySplitEntryId.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }//  ww w .  j  a v a2  s  . c  o m

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFAccAccountEntryObj) {
        UUID splitEntryId = ((ICFAccAccountEntryObj) genDef).getOptionalSplitEntryId();
        if (splitEntryId == null) {
            ret = null;
        } else {
            ret = splitEntryId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFAccAccountEntryObj");
    }

    return (ret);
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindSecUserDefaultDevSecUserId.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFBamMssCFBindSecUserDefaultDevSecUserId.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }//from w  w w.j  a va 2  s  . c o  m

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFBamSecUserObj) {
        UUID defaultDevSecUserId = ((ICFBamSecUserObj) genDef).getOptionalDefaultDevSecUserId();
        if (defaultDevSecUserId == null) {
            ret = null;
        } else {
            ret = defaultDevSecUserId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFBamSecUserObj");
    }

    return (ret);
}

From source file:org.ohmage.query.impl.UserImageQueries.java

/**
 * Returns whether or not a photo prompt response exists for some user 
 * whose response value is the photo's ID.
 *  // w  ww.  ja v a 2 s.c  o  m
 * @param username The username of the user.
 * 
 * @param imageId The image's unique identifier.
 * 
 * @return Whether or not a photo prompt response exists for some user
 *          whose response value is the photo's ID.
 * 
 * @throws DataAccessException Thrown if there is an error.
 */
public Boolean responseExistsForUserWithImage(String username, UUID imageId) throws DataAccessException {
    try {
        return getJdbcTemplate().queryForObject(SQL_EXISTS_IMAGE_FOR_USER_IN_RESPONSE,
                new Object[] { username, imageId.toString() }, Boolean.class);
    } catch (org.springframework.dao.DataAccessException e) {
        throw new DataAccessException("Error executing SQL '" + SQL_EXISTS_IMAGE_FOR_USER_IN_RESPONSE
                + "' with parameters: " + username + ", " + imageId, e);
    }
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_4.CFFreeSwitchMssCF.CFFreeSwitchMssCFBindSecUserPasswordResetUuid.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFFreeSwitchMssCFBindSecUserPasswordResetUuid.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }// w  ww .  ja v  a2 s.c o  m

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFFreeSwitchSecUserObj) {
        UUID passwordResetUuid = ((ICFFreeSwitchSecUserObj) genDef).getOptionalPasswordResetUuid();
        if (passwordResetUuid == null) {
            ret = null;
        } else {
            ret = passwordResetUuid.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFFreeSwitchSecUserObj");
    }

    return (ret);
}

From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashMssCF.CFGCashMssCFBindAccountEntrySplitEntryId.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFGCashMssCFBindAccountEntrySplitEntryId.expandBody() ";

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }/*from ww  w.j  a  v  a  2 s . c om*/

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFGCashAccountEntryObj) {
        UUID splitEntryId = ((ICFGCashAccountEntryObj) genDef).getOptionalSplitEntryId();
        if (splitEntryId == null) {
            ret = null;
        } else {
            ret = splitEntryId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFGCashAccountEntryObj");
    }

    return (ret);
}

From source file:com.azaptree.services.security.commands.subjectRepository.AddSubjectCredential.java

public AddSubjectCredential(final HashServiceConfiguration hashServiceConfig) {
    Assert.notNull(hashServiceConfig, "hashServiceConfig is required");

    hashService = hashServiceConfig.getHashService();
    hashServiceId = hashServiceConfig.getEntityId();

    setValidator(new CommandContextValidatorSupport() {

        @Override/*from www.  j  a  va2  s  . c  o m*/
        protected void checkInput(final Command command, final Context ctx) {
            final UUID subjectId = get(ctx, SUBJECT_ID);
            if (!subjectDAO.exists(subjectId)) {
                throw new UnknownSubjectException(subjectId.toString());
            }

            final Credential credential = get(ctx, CREDENTIAL);
            if (!securityCredentialsService.isCredentialSupported(credential.getName(),
                    credential.getCredential())) {
                throw new UnsupportedCredentialTypeException();
            }

            if (hashedCredentialDAO.existsForSubjectIdAndName(subjectId, credential.getName())) {
                throw new DuplicateCredentialException(credential.getName());
            }

            final UUID updatedBySubjectId = get(ctx, UPDATED_BY_SUBJECT_ID);
            if (updatedBySubjectId != null) {
                Assert.isTrue(!subjectId.equals(updatedBySubjectId), String.format(
                        "The updatedBy subject (%s) cannot be the same as the subject (%s) which we are adding the credential to",
                        subjectId, updatedBySubjectId));
                if (!subjectDAO.exists(updatedBySubjectId)) {
                    throw new UnknownSubjectException(
                            String.format("Subject for updatedBy does not exist: %s", updatedBySubjectId));
                }
            }

        }

        @Override
        protected void checkOutput(final Command command, final Context ctx) {
            // none required
        }

    });

    setInputKeys(SUBJECT_ID, CREDENTIAL, UPDATED_BY_SUBJECT_ID);
    setOutputKeys(HASHED_CREDENTIAL);
}