Package com.shop.cache.api.commands

Examples of com.shop.cache.api.commands.SCDataBuilder


    {
      command = null;
    }
    if ( command != null )
    {
      SCDataBuilder    builder = command.newBuilder();
      for ( SCDataBuilderTypeAndCount tc : command.getTypesAndCounts() )
      {
        switch ( tc.type )
        {
          case FIXED_SIZE_VALUE_SET:
          {
            for ( int i = 0; i < tc.count; ++i )
            {
              builder.addNextValue(fClient.readLine());
            }
            break;
          }

          case BOUNDED_VALUE_SET:
          {
            int      lineQty = sizeFromLine(fClient.readLine());
            for ( int i = 0; i < lineQty; ++i )
            {
              builder.addNextValue(fClient.readLine());
            }
            break;
          }

          case OBJECT:
          {
            int    size = sizeFromLine(fClient.readLine());
            if ( size > 0 )
            {
              ChunkedByteArray    bytes = fClient.readBytes(size);
              builder.addNextObject(bytes);
            }
            break;
          }

          case UNBOUNDED_VALUE_SET:
          {
            for(;;)
            {
              String     nextLine = fClient.readLine();
              if ( nextLine.trim().length() == 0 )
              {
                break;
              }
              builder.addNextValue(nextLine);
            }
            break;
          }
        }
      }

      builder.executeCommand(fServer, this);
      fClient.flush();
    }

    fCurrentCommand = null;
  }
View Full Code Here

TOP

Related Classes of com.shop.cache.api.commands.SCDataBuilder

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.