Package net.pterodactylus.sone.data

Examples of net.pterodactylus.sone.data.SoneImpl


      /* TODO - mark Sone as bad. */
      logger.log(Level.WARNING, String.format("Could not parse XML for Sone %s!", originalSone));
      return null;
    }

    Sone sone = new SoneImpl(originalSone.getId(), originalSone.isLocal()).setIdentity(originalSone.getIdentity());

    SimpleXML soneXml;
    try {
      soneXml = SimpleXML.fromDocument(document);
    } catch (NullPointerException npe1) {
View Full Code Here


    /**
     * {@inheritDoc}
     */
    @Override
    public Optional<Sone> getSone(final String soneId) {
      return Optional.<Sone>of(new SoneImpl(soneId, false) {

        /**
         * {@inheritDoc}
         */
        @Override
 
View Full Code Here

              if (!sone.isPresent()) {
                /*
                 * don’t use create=true above, we don’t want
                 * the empty shell.
                 */
                sone = Optional.<Sone>of(new SoneImpl(soneId, false));
              }
              parts.add(new SonePart(sone.get()));
              line = line.substring(50);
            } else {
              parts.add(new PlainTextPart(line));
View Full Code Here

   */
  public Sone getLocalSone(String id, boolean create) {
    synchronized (sones) {
      Sone sone = sones.get(id);
      if ((sone == null) && create) {
        sone = new SoneImpl(id, true);
        sones.put(id, sone);
      }
      if ((sone != null) && !sone.isLocal()) {
        sone = new SoneImpl(id, true);
        sones.put(id, sone);
      }
      return sone;
    }
  }
View Full Code Here

   */
  public Sone getRemoteSone(String id, boolean create) {
    synchronized (sones) {
      Sone sone = sones.get(id);
      if ((sone == null) && create && (id != null) && (id.length() == 43)) {
        sone = new SoneImpl(id, false);
        sones.put(id, sone);
      }
      return sone;
    }
  }
View Full Code Here

TOP

Related Classes of net.pterodactylus.sone.data.SoneImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.