2 * Sone - OwnIdentity.java - Copyright © 2010 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.sone.freenet.wot;
24 * Defines a local identity, an own identity.
26 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
28 public interface OwnIdentity extends Identity {
31 * Returns the insert URI of the identity.
33 * @return The insert URI of the identity
35 public String getInsertUri();
38 * Adds the given context to this identity.
40 * This method is only called by the {@link IdentityManager}.
44 * @throws WebOfTrustException
47 public void addContext(String context) throws WebOfTrustException;
50 * Sets all contexts of this identity.
52 * This method is only called by the {@link IdentityManager}.
55 * All contexts of the identity
56 * @throws WebOfTrustException
59 public void setContexts(Set<String> contexts) throws WebOfTrustException;
62 * Removes the given context from this identity.
64 * This method is only called by the {@link IdentityManager}.
67 * The context to remove
68 * @throws WebOfTrustException
71 public void removeContext(String context) throws WebOfTrustException;
74 * Sets the property with the given name to the given value.
77 * The name of the property
79 * The value of the property
80 * @throws WebOfTrustException
83 public void setProperty(String name, String value) throws WebOfTrustException;
86 * Sets all properties of this identity.
88 * This method is only called by the {@link IdentityManager}.
91 * The new properties of this identity
92 * @throws WebOfTrustException
95 public void setProperties(Map<String, String> properties) throws WebOfTrustException;
98 * Removes the property with the given name.
100 * This method is only called by the {@link IdentityManager}.
103 * The name of the property to remove
104 * @throws WebOfTrustException
107 public void removeProperty(String name) throws WebOfTrustException;
110 * Sets the trust for the given target identity.
113 * The target to set the trust for
115 * The new trust value (from {@code -100} or {@code 100})
117 * The comment for the trust assignment
118 * @throws WebOfTrustException
121 public void setTrust(Identity target, int trustValue, String comment) throws WebOfTrustException;
124 * Removes any trust assignment for the given target identity.
127 * The targe to remove the trust assignment for
128 * @throws WebOfTrustException
131 public void removeTrust(Identity target) throws WebOfTrustException;