*/
public class ModifyPeerNote extends FcpMessage {
- /**
- * Creates a new “ModifyPeerNote” request that changes peer note of the
- * given type and node to the given text.
- *
- * @see PeerNote
- * @param nodeIdentifier
- * The identifier of the node, i.e. name, identity, or IP
- * address and port
- * @param noteText
- * The base64-encoded text
- * @param peerNoteType
- * The type of the note to change, possible values are only
- * {@link PeerNote#TYPE_PRIVATE_PEER_NOTE} at the moment
- */
+ // TODO: move base64-encoding to this class
+
+ public ModifyPeerNote(String identifier, String nodeIdentifier) {
+ super("ModifyPeerNote");
+ setField("Identifier", identifier);
+ setField("NodeIdentifier", nodeIdentifier);
+ }
+
+ @Deprecated
public ModifyPeerNote(String nodeIdentifier, String noteText, int peerNoteType) {
super("ModifyPeerNote");
setField("NodeIdentifier", nodeIdentifier);
setField("PeerNoteType", String.valueOf(peerNoteType));
}
+ public void setNoteText(String noteText) {
+ setField("NoteText", noteText);
+ }
+
+ public void setPeerNoteType(PeerNoteType peerNoteType) {
+ setField("PeerNoteType", peerNoteType.toString());
+ }
+
}
--- /dev/null
+package net.pterodactylus.fcp;
+
+/**
+ * All possible peer note types.
+ *
+ * @author <a href="mailto:bombe@freenetproject.org">David ‘Bombe’ Roden</a>
+ */
+public enum PeerNoteType {
+
+ PRIVATE_DARKNET_COMMENT(1);
+
+ private int value;
+
+ PeerNoteType(int value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+}