@Override protected WriteAttributeResults handleUnhandledAttributes ( final WriteAttributeResults initialResults, final Map<String, Variant> attributes ) { // check for null WriteAttributeResults writeAttributeResults = initialResults; if ( writeAttributeResults == null ) { writeAttributeResults = new WriteAttributeResults (); } // gather the list of open requests final Map<String, Variant> requests = new HashMap<String, Variant> ( 0 ); for ( final Map.Entry<String, Variant> entry : attributes.entrySet () ) { if ( !writeAttributeResults.containsKey ( entry.getKey () ) ) { requests.put ( entry.getKey (), entry.getValue () ); } } writeAttributeResults.putAll ( this.variable.handleAttributes ( requests ) ); // default for the rest return super.handleUnhandledAttributes ( writeAttributeResults, attributes ); }
if ( !writeAttributeResults.containsKey ( name ) )
/** * 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; }