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:com.microsoft.visualstudio.services.account.AccountHttpClient.java

public List<Account> getAccounts(final UUID memberId) {
    final UUID locationId = UUID.fromString("229A6A53-B428-4FFB-A835-E8F36B5B4B1E");
    final ApiResourceVersion apiVersion = new ApiResourceVersion("3.0-preview.1"); //$NON-NLS-1$
    final Map<String, String> queryParams = new HashMap<String, String>();
    queryParams.put("memberId", memberId.toString());

    final Invocation httpRequest = super.createRequest(HttpMethod.GET, locationId, null, apiVersion,
            queryParams, APPLICATION_JSON_TYPE);

    return super.sendRequest(httpRequest, new TypeReference<List<Account>>() {
    });/* www . j  a  v a 2 s .c o  m*/
}

From source file:uk.ac.imperial.presage2.db.json.JsonStorage.java

@Override
protected <T> T fetchTuple(long id, String key, UUID agent, int t, Class<T> type) {
    JsonNode n = getSim(id).with("agenttransproperties").with(agent.toString()).with(Integer.toString(t))
            .path(key);//from  w ww.j  a  v a  2 s.com
    return returnAsType(n, type);
}

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

public Boolean getImageExists(UUID imageId) throws DataAccessException {
    try {/*from   w w w .ja v a2s . co m*/
        return getJdbcTemplate().queryForObject(SQL_EXISTS_IMAGE, new Object[] { imageId.toString() },
                Boolean.class);
    } catch (org.springframework.dao.DataAccessException e) {
        throw new DataAccessException(
                "Error executing SQL '" + SQL_EXISTS_IMAGE + "' with parameter: " + imageId, e);
    }
}

From source file:io.selendroid.standalone.server.model.SelendroidStandaloneDriverTest.java

private void createTestSession(SelendroidConfiguration conf, SelendroidCapabilities caps) throws Exception {
    // Setting up driver with test app and device stub
    SelendroidStandaloneDriver driver = getSelendroidStandaloneDriver();
    driver.initApplicationsUnderTest(conf);
    DeviceStore store = new DeviceStore(EMULATOR_PORT, getDeviceManager());

    DeviceForTest emulator = new DeviceForTest(DeviceTargetPlatform.ANDROID16);
    Random random = new Random();
    final UUID definedSessionId = new UUID(random.nextLong(), random.nextLong());

    emulator.testSessionListener = new TestSessionListener(definedSessionId.toString(), "test") {
        @Override//  w  w  w  .j  a v  a  2 s  .c  o m
        public SelendroidResponse executeSelendroidRequest(Properties params) {
            return null;
        }
    };
    store.addDeviceToStore(emulator);
    driver.setDeviceStore(store);

    // testing new session creation
    caps.setPlatformVersion(DeviceTargetPlatform.ANDROID16);
    try {
        String sessionId = driver.createNewTestSession(new JSONObject(caps.asMap()), 0);
        Assert.assertNotNull(UUID.fromString(sessionId));
    } finally {
        // this will also stop the http server
        emulator.stop();
    }
}

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

/**
 * Fetches DataCenterClusterGlusterVolumeGlusterBrick object by id.
 *
 * @return// ww w.  ja  v a2s .co m
 *     {@link DataCenterClusterGlusterVolumeGlusterBrick }
 *
 * @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 DataCenterClusterGlusterVolumeGlusterBrick 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.GlusterBrick.class,
            DataCenterClusterGlusterVolumeGlusterBrick.class);
}

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

/**
 * Fetches Role object by id./*from w w w. ja  va2s  .  co m*/
 *
 * @return {@link Role }
 *
 * @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 Role get(UUID id) throws ClientProtocolException, ServerException, IOException {
    String url = SLASH + getName() + SLASH + id.toString();
    return getProxy().get(url, org.ovirt.engine.sdk.entities.Role.class, Role.class);
}

From source file:com.aoyun.serviceOld.GetValForYKPOne.java

/**
 * 32??ID/*from  ww  w  .  j av  a2  s .  co  m*/
 *
 * @return
 */
public String getCode() {
    UUID uuid = UUID.randomUUID();
    return uuid.toString().replaceAll("\\-", "");
}

From source file:ResourceClients.BuyerResource.java

/**
 * Resgata o comprador//from   w w  w . jav a  2s .com
 * @param buyerKey
 * @return
 * @throws Exception 
 */
public HttpResponseGenericResponse<GetBuyerDataResponse> GetBuyer(UUID buyerKey) throws Exception {

    HttpVerbEnum httpVerb = HttpVerbEnum.Get;

    BasicHeader[] header = new BasicHeader[1];
    header[0] = new BasicHeader("MerchantKey", this.getMerchantKey().toString());

    String serviceUri = this.getHostUri() + this.getResourceName() + buyerKey.toString();

    return this.getHttpUtility().<GetBuyerDataResponse>SubmitRequest(GetBuyerDataResponse.class, serviceUri,
            httpVerb, this.getHttpContentType(), header);
}

From source file:com.esri.geoportal.harvester.beans.TriggerManagerBean.java

@Override
public boolean delete(UUID id) throws CrudlException {
    try (Connection connection = dataSource.getConnection();
            PreparedStatement st = connection.prepareStatement("DELETE FROM TRIGGERS WHERE ID = ?");) {
        st.setString(1, id.toString());
        return st.executeUpdate() > 0;
    } catch (SQLException ex) {
        throw new CrudlException("Error deleting trigger definition", ex);
    }/*from  ww  w .  j  ava 2  s.c  o m*/
}

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

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