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:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindUuidDefNullValue.java

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

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }/* w w  w. j av  a2s.co  m*/

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

    String ret;

    if (genDef instanceof ICFBamUuidDefObj) {
        UUID nullValue = ((ICFBamUuidDefObj) genDef).getOptionalNullValue();
        if (nullValue == null) {
            ret = null;
        } else {
            ret = nullValue.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFBamUuidDefObj");
    }

    return (ret);
}

From source file:eu.loopit.f2011.library.BitmapManager.java

private InputStream cacheImage(String url, InputStream input) throws IOException {
    if (context == null)
        return input;
    UUID uuid = UUID.nameUUIDFromBytes(url.getBytes());
    FileOutputStream output = null;
    try {/*w  w w. j  av  a2  s.c o m*/
        output = context.openFileOutput(uuid.toString(), Context.MODE_PRIVATE);
        byte[] array = new byte[8196];
        int read = 0;
        while ((read = input.read(array)) != -1) {
            output.write(array, 0, read);
        }
    } finally {
        if (output != null)
            output.close();
    }
    Log.i(TAG, "Wrote " + uuid.toString() + " to image cache. URL:" + url);
    return fetch(uuid);
}

From source file:org.nebulaframework.grid.cluster.manager.services.registration.ClusterRegistrationServiceImpl.java

/**
 * {@inheritDoc}//from   w ww.j av  a  2  s  . c  o  m
 */
public void unregisterNode(UUID id) {
    synchronized (this) {
        this.clusterNodes.remove(id);
    }
    ServiceMessage message = new ServiceMessage(id.toString(), ServiceMessageType.NODE_UNREGISTERED);
    cluster.getServiceMessageSender().sendServiceMessage(message);
    log.info("Node unregistered [ID:" + id + "]");
}

From source file:gov.nih.nci.ncicb.tcga.dcc.dam.webservice.WSFilePackagerFactory.java

/**
 * Return the <code>QuartzQueueJobDetails</code> with the given <code>UUID</code> as the key
 *
 * @param key the Quartz job name/*from  ww  w. j av  a  2  s.c  o m*/
 * @return the <code>QuartzQueueJobDetails</code> with the given <code>UUID</code> as the key
 */
@Override
public QuartzQueueJobDetails getQuartzQueueJobDetails(final UUID key) {
    return getQuartzQueueJobDetailsService().getQuartzSmallOrBigQueueJobDetails(key.toString(),
            FilePackagerEnqueuer.JOB_GROUP_FILE_PACKAGER);
}

From source file:com.github.rolecraftdev.guild.GuildRank.java

/**
 * Serialise this {@link GuildRank}./*from   ww w.jav a2s  .c o m*/
 *
 * @return the serialised version
 * @since 0.0.5
 */
@Nonnull
public String serialize() {
    StringBuilder res = new StringBuilder();
    res.append(name);
    res.append(":");
    for (final GuildAction action : permitted) {
        res.append(action.ordinal());
        res.append("#");
    }
    res = new StringBuilder(res.substring(0, res.length() - 1));
    res.append(":");
    for (final UUID id : members) {
        res.append(id.toString());
        res.append("#");
    }
    return res.substring(0, res.length() - 1);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMssCF.CFAsteriskMssCFBindSecSessionSecProxyId.java

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

    if (genContext == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1,
                "genContext");
    }//w w w. j  ava2 s.  com

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

    String ret;

    if (genDef instanceof ICFAsteriskSecSessionObj) {
        UUID secProxyId = ((ICFAsteriskSecSessionObj) genDef).getOptionalSecProxyId();
        if (secProxyId == null) {
            ret = null;
        } else {
            ret = secProxyId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFAsteriskSecSessionObj");
    }

    return (ret);
}

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

/**
 * Fetches DiskPermission object by id./*from   www . j a va  2  s  . c  om*/
 *
 * @return
 *     {@link DiskPermission }
 *
 * @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 DiskPermission 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, DiskPermission.class);
}

From source file:com.kolich.pusachat.spring.controllers.AbstractPusaChatController.java

protected Message postMessage(final UUID roomId, final UUID clientId, final String message) {
    // Build a new message.
    final Message m = new Message(clientId.toString(), makeHyperlinks(escapeHtml4(message)));
    // Post the event to the room so it's picked up by any waiting clients.
    postEvent(roomId, m);/*from  w  w  w .  j  av  a2  s  .  com*/
    return m;
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_4.CFFreeSwitchMssCF.CFFreeSwitchMssCFBindSecSessionSecProxyId.java

public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFFreeSwitchMssCFBindSecSessionSecProxyId.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 ICFFreeSwitchSecSessionObj) {
        UUID secProxyId = ((ICFFreeSwitchSecSessionObj) genDef).getOptionalSecProxyId();
        if (secProxyId == null) {
            ret = null;
        } else {
            ret = secProxyId.toString();
        }
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody",
                "genContext.getGenDef()", genDef, "ICFFreeSwitchSecSessionObj");
    }

    return (ret);
}

From source file:org.trustedanalytics.users.orgs.OrgsControllerTest.java

@Test
public void renameOrg_positive() {
    UUID orgId = UUID.randomUUID();
    String testName = "test-name";

    OrgNameRequest request = new OrgNameRequest();
    request.setName(testName);/* w w w. jav  a2s  . c o  m*/
    sut.renameOrg(request, orgId.toString());
    verify(cfClient).renameOrg(orgId, testName);
}