01: /*_############################################################################
02: _##
03: _## SNMP4J-Agent - SerializableManagedObject.java
04: _##
05: _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
06: _##
07: _## Licensed under the Apache License, Version 2.0 (the "License");
08: _## you may not use this file except in compliance with the License.
09: _## You may obtain a copy of the License at
10: _##
11: _## http://www.apache.org/licenses/LICENSE-2.0
12: _##
13: _## Unless required by applicable law or agreed to in writing, software
14: _## distributed under the License is distributed on an "AS IS" BASIS,
15: _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: _## See the License for the specific language governing permissions and
17: _## limitations under the License.
18: _##
19: _##########################################################################*/
20:
21: package org.snmp4j.agent;
22:
23: import org.snmp4j.agent.io.MOInput;
24: import org.snmp4j.agent.io.MOOutput;
25: import java.io.IOException;
26: import org.snmp4j.smi.OID;
27:
28: /**
29: * The <code>SerializableManagedObject</code> interface is implemented by
30: * <code>ManagedObject</code>s whose (data) content can be serialized
31: * using {@link MOInput} and {@link MOOutput}.
32: *
33: * @author Frank Fock
34: * @version 1.0
35: */
36: public interface SerializableManagedObject {
37:
38: /**
39: * Gets the unique object ID of the managed object.
40: * @return
41: * an OID.
42: */
43: OID getID();
44:
45: /**
46: * Loads the content of the managed object from the specified input (stream).
47: * @param input
48: * a <code>MOInput</code> instance.
49: * @throws IOException
50: */
51: void load(MOInput input) throws IOException;
52:
53: /**
54: * Saves the (non-volatile) content of this managed object to the specified
55: * output (stream).
56: * @param output
57: * a <code>MOOutput</code> instance.
58: * @throws IOException
59: */
60: void save(MOOutput output) throws IOException;
61:
62: /**
63: * Tests if this instance of a SerializableManagedObject should be
64: * serialized or deserialized through persistent storage
65: * load or save operation.
66: * @return
67: * <code>true</code> if {@link #load} and {@link #save} should not be
68: * called through a persistent storage operation and <code>false</code>
69: * if these method should be called.
70: */
71: boolean isVolatile();
72:
73: }
|