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.ovirt.engine.sdk.decorators.VMTags.java

/**
 * Fetches VMTag object by id./*from   w  w w. jav a2s. co  m*/
 *
 * @return
 *     {@link VMTag }
 *
 * @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 VMTag 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.Tag.class, VMTag.class);
}

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

@Override
public EntityDefinition read(UUID id) throws CrudlException {
    try (Connection connection = dataSource.getConnection();
            PreparedStatement st = connection.prepareStatement("SELECT * FROM BROKERS WHERE ID = ?");) {
        st.setString(1, id.toString());
        ResultSet rs = st.executeQuery();
        if (rs.next()) {
            try {
                EntityDefinition brokerDef = deserialize(rs.getString("brokerDefinition"),
                        EntityDefinition.class);
                brokerDef.setRef(id.toString());
                return brokerDef;
            } catch (IOException | SQLException ex) {
                LOG.warn("Error reading broker definition", ex);
            }//from   w  w  w.  j  a  v  a  2 s  .co m
        }
    } catch (SQLException ex) {
        throw new CrudlException("Error reading broker definition", ex);
    }

    return null;
}

From source file:org.trustedanalytics.user.invite.InvitationsIT.java

License:asdf

@Test
public void newRegistration_validData_statusOkAndUserCreated() {
    final String username = "validcode@test";
    final String password = "asdasd";
    final String organization = "testorg";
    final String defaultSpaceName = "default";
    final UUID orgGuid = UUID.randomUUID();
    final UUID userGuid = UUID.randomUUID();
    final UUID spaceGuid = UUID.randomUUID();
    final String userGuidString = userGuid.toString();
    final String code = codeService.generateCode(username).getCode();

    when(uaaClient.createUser(anyString(), anyString()))
            .thenReturn(new ScimUser(userGuidString, username, null, null));

    when(ccClient.getOrgs()).thenReturn(Observable.<CcOrg>empty());

    setUpNotExistingUserRequest(username);

    when(ccClient.createOrganization(organization)).thenReturn(orgGuid);
    when(ccClient.createSpace(orgGuid, defaultSpaceName)).thenReturn(spaceGuid);

    when(accessInvitations.isEligibleToCreateOrg()).thenReturn(true);
    when(accessInvitationsService.getAccessInvitations(anyString())).thenReturn(Optional.of(accessInvitations));
    when(accessInvitationsService.getOrgCreationEligibility(anyString())).thenReturn(true);

    ResponseEntity<String> response = restTemplate.getForEntity(baseUrl + "rest/registrations/{code}",
            String.class, code);
    assertThat(response.getStatusCode(), equalTo(HttpStatus.OK));
    assertThat(response.getBody(), containsString(username));

    RegistrationModel user = new RegistrationModel();
    user.setOrg(organization);/*w  w w  .j av a 2s  .  c o m*/
    user.setPassword(password);

    response = restTemplate.postForEntity(baseUrl + "rest/registrations?code={code}", user, String.class, code);

    assertThat(response.getStatusCode(), equalTo(HttpStatus.OK));

    verify(uaaClient).createUser(username, password);
    verify(ccClient).createUser(userGuid);
    verify(ccClient).createOrganization(organization);
    verify(ccClient).assignUserToOrganization(userGuid, orgGuid);
    verify(ccClient).assignUserToSpace(userGuid, spaceGuid);
}

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

/**
 * Fetches GroupRolePermit object by id.
 *
 * @return//  w w w  .  ja va  2  s .c  om
 *     {@link GroupRolePermit }
 *
 * @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 GroupRolePermit 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.Permit.class, GroupRolePermit.class);
}

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

/**
 * Fetches UserRolePermit object by id.//  w ww.  ja  v  a 2  s  .co m
 *
 * @return
 *     {@link UserRolePermit }
 *
 * @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 UserRolePermit 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.Permit.class, UserRolePermit.class);
}

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

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

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }//from   w  w w .j av 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 ICFCrmSecDeviceObj) {
        UUID secUserId = ((ICFCrmSecDeviceObj) genDef).getRequiredSecUserId();
        if (secUserId == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 0,
                    "Value");
        }
        ret = secUserId.toString();
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFCrmSecDeviceObj");
    }

    return (ret);
}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmMssCF.CFCrmMssCFBindSecUserSecUserId.java

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

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }//from  w w w. java  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 secUserId = ((ICFCrmSecUserObj) genDef).getRequiredSecUserId();
        if (secUserId == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 0,
                    "Value");
        }
        ret = secUserId.toString();
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFCrmSecUserObj");
    }

    return (ret);
}

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

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

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

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

    String ret;

    if (genDef instanceof ICFCrmSecSessionObj) {
        UUID secUserId = ((ICFCrmSecSessionObj) genDef).getRequiredSecUserId();
        if (secUserId == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 0,
                    "Value");
        }
        ret = secUserId.toString();
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFCrmSecSessionObj");
    }

    return (ret);
}

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

/**
 * Fetches ClusterNetwork object by id./*from w w  w  .j  a v  a  2  s  .  c  o  m*/
 *
 * @return
 *     {@link ClusterNetwork }
 *
 * @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 ClusterNetwork 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.Network.class, ClusterNetwork.class);
}

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

/**
 * Fetches TemplateWatchDog object by id.
 *
 * @return/*from  www  .ja  va 2s  .co  m*/
 *     {@link TemplateWatchDog }
 *
 * @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 TemplateWatchDog 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.WatchDog.class, TemplateWatchDog.class);
}