Example usage for java.io Serializable toString

List of usage examples for java.io Serializable toString

Introduction

In this page you can find the example usage for java.io Serializable toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.pentaho.platform.repository2.unified.fs.FileSystemRepositoryFileDao.java

@Deprecated
public List<RepositoryFile> getChildren(Serializable folderId, String filter, Boolean showHiddenFiles) {
    return getChildren(new RepositoryRequest(folderId.toString(), showHiddenFiles, -1, filter));
}

From source file:org.pentaho.di.repository.pur.metastore.PurRepositoryMetaStore.java

private List<RepositoryFile> getChildren(Serializable folderId, boolean showHiddenFiles) {
    return pur.getChildren(new RepositoryRequest(folderId.toString(), showHiddenFiles, -1, null));
}

From source file:org.pentaho.platform.repository2.unified.fs.FileSystemRepositoryFileDao.java

@SuppressWarnings("unchecked")
public <T extends IRepositoryFileData> T getData(Serializable fileId, Serializable versionId,
        Class<T> dataClass) {
    File f = new File(fileId.toString());
    T data = null;/* w ww  .  j a va2  s  . c o m*/
    try {
        if (SimpleRepositoryFileData.class.getName().equals(dataClass.getName())) {
            data = (T) new SimpleRepositoryFileData(new FileInputStream(f), "UTF-8", "text/plain");

        } else if (NodeRepositoryFileData.class.getName().equals(dataClass.getName())) {
            throw new UnsupportedOperationException("This operation is not support by this repository");
        }

    } catch (FileNotFoundException e) {
        throw new UnifiedRepositoryException(e);
    }
    return data;
}

From source file:org.grails.datastore.gorm.neo4j.Neo4jDatastore.java

@Override
public Neo4jDatastore getDatastoreForTenantId(Serializable tenantId) {
    if (getMultiTenancyMode() == MultiTenancySettings.MultiTenancyMode.DATABASE) {
        return this.datastoresByConnectionSource.get(tenantId.toString());
    }//from w w w  . ja v  a 2 s  .c o m
    return this;
}

From source file:org.guzz.service.core.impl.SlowUpdateServiceImpl.java

public void updateCount(String dbGroup, String tableName, String columnToUpdate, String pkColName,
        Serializable pkValue, int countToInc) {
    if (!isAvailable()) {
        throw new GuzzException(
                "slowUpdateService is not available. use the config server's [slowUpdate] to active this service.");
    }/*from www  .j a  v  a 2s . com*/

    IncUpdateBusiness ut = new IncUpdateBusiness(dbGroup);

    ut.setTableName(tableName);
    ut.setPkColunName(pkColName);

    ut.setColumnToUpdate(columnToUpdate);
    ut.setPkValue(pkValue.toString());
    ut.setCountToInc(countToInc);

    this.updateThread.addToQueue(ut);

    if (this.updateThread.isSleeping()) {
        synchronized (updateThread) {
            try {
                this.updateThread.notify();
            } catch (Exception e) {
            }
        }
    }
}

From source file:org.pentaho.platform.repository2.unified.jcr.JcrRepositoryFileUtils.java

/**
 * Returns the metadata regarding that identifies what transformer wrote this file's data.
 *//*from   www. ja va2 s . c o  m*/
public static String getFileContentType(final Session session, final PentahoJcrConstants pentahoJcrConstants,
        final Serializable fileId, final Serializable versionId) throws RepositoryException {
    Assert.notNull(fileId);
    Node fileNode = session.getNodeByIdentifier(fileId.toString());
    if (versionId != null) {
        Version version = session.getWorkspace().getVersionManager().getVersionHistory(fileNode.getPath())
                .getVersion(versionId.toString());
        Node nodeAtVersion = getNodeAtVersion(pentahoJcrConstants, version);
        return nodeAtVersion.getProperty(pentahoJcrConstants.getPHO_CONTENTTYPE()).getString();
    }

    return fileNode.getProperty(pentahoJcrConstants.getPHO_CONTENTTYPE()).getString();
}

From source file:ddf.catalog.transformer.response.query.atom.AtomTransformer.java

private List<Position> getGeoRssPositions(Metacard metacard) {

    List<Position> georssPositions = new ArrayList<Position>();

    for (AttributeDescriptor ad : metacard.getMetacardType().getAttributeDescriptors()) {

        if (ad != null && ad.getType() != null
                && BasicTypes.GEO_TYPE.getAttributeFormat().equals(ad.getType().getAttributeFormat())) {

            Attribute geoAttribute = metacard.getAttribute(ad.getName());

            if (geoAttribute == null) {
                continue;
            }/*from www .ja va2s  .c  o  m*/

            for (Serializable geo : geoAttribute.getValues()) {

                if (geo != null) {

                    try {
                        Geometry geometry = reader.read(geo.toString());

                        CompositeGeometry formatter = CompositeGeometry.getCompositeGeometry(geometry);

                        if (null != formatter) {
                            georssPositions.addAll(formatter.toGeoRssPositions());
                        } else {
                            LOGGER.info(
                                    "When cycling through geometries, could not get composite geometry [{}]",
                                    geo);
                        }

                    } catch (ParseException e) {
                        LOGGER.info("When cycling through geometries, could not parse [{}]", geo, e);
                    }

                }

            }
        }

    }
    return georssPositions;
}

From source file:com.bluexml.xforms.actions.AbstractWorkflowAction.java

/**
 * Resolves the actorId using the indirection format supported by Alfresco
 * in workflow/*from w  w w. java  2 s.  co m*/
 * definitions.
 * 
 * @param actorId
 *            e.g. "#{wfbxifremer_user1}"
 * @param properties
 * @return
 */
protected String resolveActorId(String actorId, HashMap<QName, Serializable> properties) {
    // #1532: support for expressions in actorId/pooledActors
    // 
    int pos = actorId.indexOf("#{");
    if (pos != 0) {
        return actorId;
    }
    pos += 2;
    int posEnd = actorId.indexOf("}", pos);
    if (posEnd == -1) {
        return actorId;
    }

    String expr = actorId.substring(pos, posEnd);
    pos = expr.indexOf('_');
    if (pos == -1) {
        return actorId;
    }
    String property = expr.substring(pos + 1);
    for (QName qname : properties.keySet()) {
        if (qname.getLocalName().endsWith(property)) {
            Serializable serializable = properties.get(qname);
            return serializable.toString();
        }
    }
    return actorId;
}

From source file:org.pentaho.platform.repository2.unified.jcr.JcrRepositoryFileUtils.java

@Deprecated
public static List<RepositoryFile> getChildren(final Session session,
        final PentahoJcrConstants pentahoJcrConstants, final IPathConversionHelper pathConversionHelper,
        final ILockHelper lockHelper, final Serializable folderId, final String filter, Boolean showHiddenFiles)
        throws RepositoryException {
    RepositoryRequest repositoryRequest = new RepositoryRequest(folderId.toString(), showHiddenFiles, 0,
            filter);/*from   w  w  w .j ava 2  s.  c o m*/
    return getChildren(session, pentahoJcrConstants, pathConversionHelper, lockHelper, repositoryRequest);
}

From source file:org.apache.jcs.engine.memory.mru.MRUMemoryCache.java

/**
 * Removes an item from the cache./*  www . ja  v  a 2s . c  o  m*/
 * @return
 * @param key
 * @exception IOException
 */
public boolean remove(Serializable key) throws IOException {
    if (log.isDebugEnabled()) {
        log.debug("remove> key=" + key);
    }

    boolean removed = false;

    // handle partial removal
    if (key instanceof String && key.toString().endsWith(CacheConstants.NAME_COMPONENT_DELIMITER)) {
        // remove all keys of the same name hierarchy.
        synchronized (lockMe) {
            for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) {
                Map.Entry entry = (Map.Entry) itr.next();
                Object k = entry.getKey();
                if (k instanceof String && k.toString().startsWith(key.toString())) {
                    itr.remove();
                    Serializable keyR = (Serializable) entry.getKey();
                    // map.remove( keyR );
                    mrulist.remove(keyR);
                    removed = true;
                }
            }
        }
    } else if (key instanceof GroupId) {
        // remove all keys of the same name hierarchy.
        synchronized (lockMe) {
            for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) {
                Map.Entry entry = (Map.Entry) itr.next();
                Object k = entry.getKey();

                if (k instanceof GroupAttrName && ((GroupAttrName) k).groupId.equals(key)) {
                    itr.remove();
                    mrulist.remove(k);
                    removed = true;
                }
            }
        }
    } else {
        // remove single item.
        if (map.containsKey(key)) {
            synchronized (lockMe) {
                map.remove(key);
                mrulist.remove(key);
            }
            removed = true;
        }
    }
    // end else not hierarchical removal
    return removed;
}