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:org.ohmage.query.impl.CampaignSurveyResponseQueries.java

public String getCampaignIdFromSurveyId(UUID surveyResponseId) throws DataAccessException {
    try {//w ww .jav a  2  s .  c  om
        return getJdbcTemplate().queryForObject(SQL_GET_CAMPAIGN_ID_FROM_SURVEY_RESPONSE_ID,
                new Object[] { surveyResponseId.toString() }, String.class);
    } catch (org.springframework.dao.IncorrectResultSizeDataAccessException e) {
        if (e.getActualSize() > 1) {
            throw new DataAccessException("One survey response belongs to multiple campaigns.", e);
        }

        return null;
    } catch (org.springframework.dao.DataAccessException e) {
        throw new DataAccessException("Error running SQL '" + SQL_GET_CAMPAIGN_ID_FROM_SURVEY_RESPONSE_ID
                + "' with parameter: " + surveyResponseId, e);
    }
}

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

/**
 * Fetches DataCenterClusterAffinityGroupVM object by id.
 *
 * @return//from w w  w . j  ava2 s . c o  m
 *     {@link DataCenterClusterAffinityGroupVM }
 *
 * @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 DataCenterClusterAffinityGroupVM get(UUID id)
        throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.VM.class, DataCenterClusterAffinityGroupVM.class);
}

From source file:org.trustedanalytics.user.common.UaaProblemReaderTest.java

@Test
public void test_read() {
    UUID userId = UUID.randomUUID();
    HttpClientErrorException exception = TestUtils.createDummyHttpClientException(userId);
    UaaProblem expectedError = new UaaProblem("Username already in use: test@example.com",
            "scim_resource_already_exists", userId.toString());
    Assert.assertThat(UaaProblemReader.read(exception), CoreMatchers.equalTo(expectedError));
}

From source file:org.energyos.espi.common.repositories.jpa.UsagePointRepositoryImpl.java

@Override
public UsagePoint findByUUID(UUID uuid) {
    return (UsagePoint) this.em.createNamedQuery(UsagePoint.QUERY_FIND_BY_UUID)
            .setParameter("uuid", uuid.toString().toUpperCase()).getSingleResult();
}

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

/**
 * Fetches DataCenterClusterAffinityGroup object by id.
 *
 * @return//  w w  w.  j  av a 2s  .co  m
 *     {@link DataCenterClusterAffinityGroup }
 *
 * @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 DataCenterClusterAffinityGroup get(UUID id)
        throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.AffinityGroup.class,
            DataCenterClusterAffinityGroup.class);
}

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

/**
 * Fetches DataCenterClusterGlusterVolume object by id.
 *
 * @return/*www.j a  v a2  s .c om*/
 *     {@link DataCenterClusterGlusterVolume }
 *
 * @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 DataCenterClusterGlusterVolume get(UUID id)
        throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.GlusterVolume.class,
            DataCenterClusterGlusterVolume.class);
}

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

/**
 * Fetches DataCenterIscsiBondNetworkLabel object by id.
 *
 * @return//from   w w w .j  a  v  a 2  s  . c o  m
 *     {@link DataCenterIscsiBondNetworkLabel }
 *
 * @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 DataCenterIscsiBondNetworkLabel get(UUID id)
        throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.Label.class,
            DataCenterIscsiBondNetworkLabel.class);
}

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

/**
 * Fetches DomainGroup object by id.//from  w  w  w .  j  a  v  a2  s . c  om
 *
 * @return
 *     {@link DomainGroup }
 *
 * @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 DomainGroup get(UUID id) throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.Group.class, DomainGroup.class);
}

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

/**
 * Fetches DomainUser object by id.//w w w.ja v  a  2  s  .c o m
 *
 * @return
 *     {@link DomainUser }
 *
 * @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 DomainUser get(UUID id) throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.User.class, DomainUser.class);
}

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

/**
 * Fetches StorageDomainFile object by id.
 *
 * @return/*from  w  ww.  j  a  v a2 s . c  om*/
 *     {@link StorageDomainFile }
 *
 * @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 StorageDomainFile get(UUID id) throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.File.class, StorageDomainFile.class);
}