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.DataCenterIscsiBondNetworkPermissions.java

/**
 * Fetches DataCenterIscsiBondNetworkPermission object by id.
 *
 * @return/*from  www .  ja v a2s  .c  o m*/
 *     {@link DataCenterIscsiBondNetworkPermission }
 *
 * @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 DataCenterIscsiBondNetworkPermission 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.Permission.class,
            DataCenterIscsiBondNetworkPermission.class);
}

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

/**
 * Fetches DataCenterIscsiBondNetworkVnicProfile object by id.
 *
 * @return/* ww  w  . ja va  2  s.  c  o m*/
 *     {@link DataCenterIscsiBondNetworkVnicProfile }
 *
 * @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 DataCenterIscsiBondNetworkVnicProfile 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.VnicProfile.class,
            DataCenterIscsiBondNetworkVnicProfile.class);
}

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

/**
 * Fetches DataCenterNetworkVnicProfilePermission object by id.
 *
 * @return/*www  . j  av a 2 s.  co  m*/
 *     {@link DataCenterNetworkVnicProfilePermission }
 *
 * @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 DataCenterNetworkVnicProfilePermission 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.Permission.class,
            DataCenterNetworkVnicProfilePermission.class);
}

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

/**
 * Fetches DataCenterStorageDomainDiskPermission object by id.
 *
 * @return/*w w  w.  ja  v  a2 s.com*/
 *     {@link DataCenterStorageDomainDiskPermission }
 *
 * @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 DataCenterStorageDomainDiskPermission 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.Permission.class,
            DataCenterStorageDomainDiskPermission.class);
}

From source file:com.rest.UserRest.java

@RequestMapping(value = "/initiateResetPassword", method = RequestMethod.PUT)
@Transactional/*from   w w  w  .j av  a2s. c  o m*/
public ResponseEntity initiateResetPassword(
        @Valid @RequestBody InitiateResetPasswordRequestDto initiateResetPasswordRequestDto) {
    UserEntity user = userRepository.findByUsername(initiateResetPasswordRequestDto.getEmail());

    if (user == null) {
        throw new RuntimeException(bundleMessageReader.getMessage("NoUserFound"));
    }

    UUID resetPasswordToken = UUID.randomUUID();
    user.setResetPasswordToken(resetPasswordToken.toString());

    userRepository.save(user);

    if (emailSender == null) {// this check needed for unit testing perposes
        emailSender = new EmailSender(mailSender, emailTemplateResolver, thymeleaf, user.getUsername(),
                mailSendFrom);
    }

    String requestBaseUrl = this.gatewayHost + ':' + this.gatewayPort + this.contextPath;
    emailSender.sendReserPasswordEmail(resetPasswordToken.toString(), requestBaseUrl);

    return new ResponseEntity(HttpStatus.OK);
}

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

/**
 * Fetches DataCenterIscsiBondNetworkVnicProfilePermission object by id.
 *
 * @return/*  ww  w .ja  v a  2 s .  c  om*/
 *     {@link DataCenterIscsiBondNetworkVnicProfilePermission }
 *
 * @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 DataCenterIscsiBondNetworkVnicProfilePermission 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.Permission.class,
            DataCenterIscsiBondNetworkVnicProfilePermission.class);
}

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

/**
 * Fetches DataCenterIscsiBondStorageConnection object by id.
 *
 * @return/* w  ww . j  av  a2s. c o m*/
 *     {@link DataCenterIscsiBondStorageConnection }
 *
 * @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 DataCenterIscsiBondStorageConnection 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.StorageConnection.class,
            DataCenterIscsiBondStorageConnection.class);
}

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

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

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }/*from www.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 ICFCrmSecSessionObj) {
        UUID secProxyId = ((ICFCrmSecSessionObj) genDef).getOptionalSecProxyId();
        if (secProxyId == null) {
            ret = null;
        } else {
            ret = secProxyId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFCrmSecSessionObj");
    }

    return (ret);
}

From source file:ch.entwine.weblounge.tools.importer.AbstractImporterCallback.java

/**
 * /*from  w ww .  j  ava2s. c om*/
 * @param file
 * @param dest
 * @param folder
 * @param filename
 * @param uuid
 * @param version
 * @return
 */
protected boolean storeFile(File file, File dest, String folder, String filename, UUID uuid, int version) {
    String path = PathUtils.concat(dest.getAbsolutePath(), folder, uuidToPath(uuid.toString()),
            String.valueOf(version), filename);
    File newfile = new File(path);
    if (!newfile.getParentFile().exists()) {
        newfile.getParentFile().mkdirs();
    }
    try {
        FileUtils.copyFile(file, newfile);
    } catch (IOException e) {
        System.err.println(e.getMessage());
        return false;
    }
    return true;
}

From source file:cherry.sqlman.password.PasswordRequestControllerImpl.java

@Override
public ModelAndView create(PasswordRequestForm form, BindingResult binding, Locale locale,
        SitePreference sitePref, NativeWebRequest request, RedirectAttributes redirAttr) {

    if (hasErrors(form, binding)) {
        return withViewname(viewnameOfStart).build();
    }//from   w  w w  . j  ava2 s .  c o m

    UriComponentsSource source = new UriComponentsSource() {
        @Override
        public UriComponents buildUriComponents(UUID token) {
            return fromMethodCall(
                    on(PasswordRequestController.class).edit(token.toString(), null, null, null, null, null))
                            .replaceQueryParam(REQ_TOKEN, token.toString()).build();
        }
    };

    if (!passwordRequestService.createRequest(form.getMailAddr(), locale, source)) {
        LogicalErrorUtil.reject(binding, LogicError.TooManyPasswordRequest);
        return withViewname(viewnameOfStart).build();
    }

    redirAttr.addFlashAttribute(FLASH_CREATED, Boolean.TRUE);

    return redirect(redirectOnExecute()).build();
}