Example usage for java.util UUID fromString

List of usage examples for java.util UUID fromString

Introduction

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

Prototype

public static UUID fromString(String name) 

Source Link

Document

Creates a UUID from the string standard representation as described in the #toString method.

Usage

From source file:org.sventon.web.ctrl.template.ExportProgressController.java

@Override
protected ModelAndView svnHandle(final SVNConnection connection, final BaseCommand command,
        final long headRevision, final UserRepositoryContext userRepositoryContext,
        final HttpServletRequest request, final HttpServletResponse response, final BindException exception)
        throws Exception {

    final Map<String, Object> model = new HashMap<String, Object>();
    final UUID exportUuid = UUID.fromString(ServletRequestUtils.getRequiredStringParameter(request, "uuid"));
    final boolean download = ServletRequestUtils.getBooleanParameter(request, "download", false);
    final boolean delete = ServletRequestUtils.getBooleanParameter(request, "delete", false);

    if (delete) {
        exportExecutor.delete(exportUuid);
        userRepositoryContext.setIsWaitingForExport(false);
    } else if (download) {
        logger.info("Downloading export file, uuid: " + exportUuid);
        exportExecutor.downloadByUUID(exportUuid, request, response);
        return null;
    } else {//from   ww w  .ja v  a 2  s .  c om
        final int progress = exportExecutor.getProgress(exportUuid);
        logger.debug("Export progress: " + progress);
        model.put("exportProgress", progress);
    }
    return new ModelAndView(getViewName(), model);
}

From source file:org.trustedanalytics.servicebroker.hive.plans.HiveSharedTest.java

@Test
public void bindTest_createsCredentialsMap() throws ServiceBrokerException {
    //given/*from  w w  w  . j a  v  a2  s  .c o  m*/
    HiveShared toTest = new HiveShared(hiveBindingClient, jdbcOperations);

    //when
    toTest.bind(getServiceInstance("04d4e5d2-0568-11e6-8d01-00155d3d2c21"));

    //then
    verify(hiveBindingClient).createCredentialsMap(UUID.fromString("04d4e5d2-0568-11e6-8d01-00155d3d2c21"));
}

From source file:com.haulmont.cuba.security.jmx.UserSessions.java

@Override
public String killSession(String id) {
    UUID sessionId;/* ww  w  . java  2s  . c  o  m*/
    try {
        sessionId = UUID.fromString(id);
    } catch (IllegalArgumentException ex) {
        return "Invalid session Id format: use UUID";
    }
    userSessions.killSession(sessionId);
    return "OK";
}

From source file:agendapoo.Model.Atividade.java

public void setId(String id) {
    this.id = UUID.fromString(id);
}

From source file:net.sf.jasperreports.crosstabs.interactive.SortRowGroupAction.java

@Override
public void performAction() throws ActionException {
    CommandTarget target = getCommandTarget(UUID.fromString(sortData.getCrosstabId()), JRDesignCrosstab.class);
    if (target != null) {
        JRDesignCrosstab crosstab = (JRDesignCrosstab) target.getIdentifiable();
        try {//from w  w  w  .  j ava2s .co  m
            SortRowGroupCommand sortCommand = new SortRowGroupCommand(crosstab, getSortData());
            ResetInCacheCommand command = new ResetInCacheCommand(sortCommand, getJasperReportsContext(),
                    getReportContext(), target.getUri());
            getCommandStack().execute(command);
        } catch (CommandException e) {
            if (log.isDebugEnabled()) {
                log.debug("error sorting crosstab", e);
            }

            throw new ActionException(e);
        }
    }
}

From source file:fm.last.musicbrainz.data.dao.impl.RecordingDaoIT.java

@Test
public void getByNotExistingGidReturnsNull() {
    UUID gid = UUID.fromString("b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d");
    Recording recording = dao.getByGid(gid);
    assertThat(recording, is(nullValue()));
}

From source file:net.sf.jasperreports.crosstabs.interactive.SortByColumnAction.java

@Override
public void performAction() throws ActionException {
    CommandTarget target = getCommandTarget(UUID.fromString(sortData.getCrosstabId()), JRDesignCrosstab.class);
    if (target != null) {
        JRDesignCrosstab crosstab = (JRDesignCrosstab) target.getIdentifiable();
        String targetUri = target.getUri();

        // execute command
        try {/* ww w .j  av a 2  s .c  o m*/
            SortByColumnCommand sortCommand = new SortByColumnCommand(getJasperReportsContext(), crosstab,
                    getSortData());
            ResetInCacheCommand command = new ResetInCacheCommand(sortCommand, getJasperReportsContext(),
                    getReportContext(), targetUri);
            getCommandStack().execute(command);
        } catch (CommandException e) {
            if (log.isDebugEnabled()) {
                log.debug("error sorting crosstab", e);
            }

            throw new ActionException(e);
        }

    }
}

From source file:fm.last.musicbrainz.data.dao.impl.TrackDaoImplIT.java

@Test
public void getByNotExistingGidReturnsNull() {
    UUID gid = UUID.fromString("b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d");
    Track track = dao.getByGid(gid);
    assertThat(track, is(nullValue()));/*w w  w  .j  a v  a  2s . c  om*/
}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrm.CFCrmSecSessionHPKey.java

public CFCrmSecSessionHPKey() {
    super();
    requiredSecSessionId = UUID.fromString(CFCrmSecSessionBuff.SECSESSIONID_INIT_VALUE.toString());

}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternet.CFInternetSecUserHPKey.java

public CFInternetSecUserHPKey() {
    super();
    requiredSecUserId = UUID.fromString(CFInternetSecUserBuff.SECUSERID_INIT_VALUE.toString());

}