gpt4 book ai didi

org.eclipse.scada.da.core.WriteAttributeResults.put()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 09:55:05 26 4
gpt4 key购买 nike

本文整理了Java中org.eclipse.scada.da.core.WriteAttributeResults.put()方法的一些代码示例,展示了WriteAttributeResults.put()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriteAttributeResults.put()方法的具体详情如下:
包路径:org.eclipse.scada.da.core.WriteAttributeResults
类名称:WriteAttributeResults
方法名:put

WriteAttributeResults.put介绍

暂无

代码示例

代码示例来源:origin: de.dentrassi.eclipse.neoscada.core/org.eclipse.scada.da.server.common

@Override
public WriteAttributeResults setAttributes ( final Map<String, Variant> attributes )
{
  final WriteAttributeResults writeAttributeResults = new WriteAttributeResults ();
  for ( final Map.Entry<String, Variant> entry : attributes.entrySet () )
  {
    if ( this.reservedAttributes.contains ( entry.getKey () ) )
    {
      writeAttributeResults.put ( entry.getKey (), new WriteAttributeResult ( new Exception ( "Attribute may not be set" ) ) );
    }
  }
  return writeAttributeResults;
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.core/org.eclipse.scada.ae.monitor.datasource

protected void handleConfigUpdate ( final Map<String, String> configUpdate, final Map<String, Variant> attributes, final WriteAttributeResults result )
{
  final Variant active = attributes.get ( this.prefix + ".active" );
  if ( active != null )
  {
    configUpdate.put ( "active", active.asBoolean () ? "true" : "false" );
    result.put ( intern ( this.prefix + ".active" ), WriteAttributeResult.OK );
  }
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.core/org.eclipse.scada.da.server.common

@Override
public NotifyFuture<WriteAttributeResults> startSetAttributes ( final Map<String, Variant> attributes, final OperationParameters operationParameters )
{
  final WriteAttributeResults writeAttributeResults = new WriteAttributeResults ();
  this.attributes.update ( null, attributes );
  for ( final Map.Entry<String, Variant> entry : attributes.entrySet () )
  {
    writeAttributeResults.put ( entry.getKey (), WriteAttributeResult.OK );
  }
  return new InstantFuture<WriteAttributeResults> ( writeAttributeResults );
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.core/org.eclipse.scada.da.server.common

writeAttributeResults.put ( name, WriteAttributeResult.OK );

代码示例来源:origin: de.dentrassi.eclipse.neoscada.core/org.eclipse.scada.da.server.common

/**
 * This method sets all unprocessed attribute write requests to an <q>unsupported</q> error ({@link UnsupportedOperationException});
 * 
 * @param initialResults
 *            The results generated so far
 * @param attributes
 *            The attributes to write
 * @return the initial results including the unprocessed results
 */
public static WriteAttributeResults errorUnhandled ( final WriteAttributeResults initialResults, final Map<String, Variant> attributes )
{
  final WriteAttributeResults writeAttributeResults;
  if ( initialResults == null )
  {
    writeAttributeResults = new WriteAttributeResults ();
  }
  else
  {
    writeAttributeResults = initialResults;
  }
  for ( final String name : attributes.keySet () )
  {
    if ( !writeAttributeResults.containsKey ( name ) )
    {
      writeAttributeResults.put ( name, new WriteAttributeResult ( new UnsupportedOperationException ( "Operation not supported" ) ) );
    }
  }
  return writeAttributeResults;
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.core/org.eclipse.scada.da.server.common

protected WriteAttributeResults processSetAttributes ( final Map<String, Variant> attributes, final OperationParameters operationParameters )
{
  final WriteAttributeResults writeAttributeResults = new WriteAttributeResults ();
  for ( final ChainProcessEntry chainEntry : this.chain )
  {
    final ChainItem chainItem = chainEntry.getWhat ();
    final WriteAttributeResults partialResult = chainItem.setAttributes ( attributes );
    if ( partialResult != null )
    {
      for ( final Map.Entry<String, WriteAttributeResult> entry : partialResult.entrySet () )
      {
        if ( entry.getValue ().isError () )
        {
          attributes.remove ( entry.getKey () );
        }
        writeAttributeResults.put ( entry.getKey (), entry.getValue () );
      }
    }
  }
  process ();
  return handleUnhandledAttributes ( writeAttributeResults, attributes );
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.core/org.eclipse.scada.da.client.ngp

public static WriteAttributeResults convertResults ( final List<AttributeWriteResultEntry> attributeResults )
{
  final WriteAttributeResults result = new WriteAttributeResults ();
  for ( final AttributeWriteResultEntry entry : attributeResults )
  {
    result.put ( entry.getAttribute (), convertResult ( entry.getErrorInformation () ) );
  }
  return result;
}

代码示例来源:origin: org.eclipse.neoscada.core/org.eclipse.scada.da.master

for ( final String attr : data.keySet () )
  result.put ( attr, new WriteAttributeResult ( error ) );
  result.put ( attr, WriteAttributeResult.OK );

代码示例来源:origin: org.eclipse.neoscada.core/org.eclipse.scada.da.master

result.put ( attr, new WriteAttributeResult ( new OperationException ( String.format ( "Attribute '%s' is not supported", this.dotPrefix + attr ) ) ) ); //$NON-NLS-1$
fullResults.put ( fullKey, entry.getValue () );

代码示例来源:origin: de.dentrassi.eclipse.neoscada.core/org.eclipse.scada.da.server.common

@Override
protected WriteAttributeResults handleUnhandledAttributes ( final WriteAttributeResults writeAttributeResults, final Map<String, Variant> attributes )
{
  final AttributeWriteHandler handler = this.writeHandler;
  WriteAttributeResults result = null;
  try
  {
    result = handler.handleWrite ( attributes );
    // remove handled attributes
    for ( final String attr : result.keySet () )
    {
      attributes.remove ( attr );
    }
    return super.handleUnhandledAttributes ( result, attributes );
  }
  catch ( final Exception e )
  {
    if ( result == null )
    {
      result = new WriteAttributeResults ();
    }
    for ( final String attr : attributes.keySet () )
    {
      result.put ( attr, new WriteAttributeResult ( e ) );
    }
    return result;
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com