You are viewing a plain text version of this content. The canonical link for it is here.
Posted to nuvem-commits@incubator.apache.org by lr...@apache.org on 2012/03/14 04:38:15 UTC
svn commit: r1300462 - in
/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud:
data/ dataService/
Author: lresende
Date: Wed Mar 14 04:38:14 2012
New Revision: 1300462
URL: http://svn.apache.org/viewvc?rev=1300462&view=rev
Log:
Formatting using the Nuvem code style
Modified:
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Collection.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/DocumentService.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Entry.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Item.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/NotFoundException.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataService.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataServiceException.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Element.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Feature.java
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Collection.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Collection.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Collection.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Collection.java Wed Mar 14 04:38:14 2012
@@ -22,7 +22,7 @@ package org.apache.nuvem.cloud.data;
import org.oasisopen.sca.annotation.Remotable;
@Remotable
-public interface Collection <K, D> {
+public interface Collection<K, D> {
/**
* Get the whole collection.
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/DocumentService.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/DocumentService.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/DocumentService.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/DocumentService.java Wed Mar 14 04:38:14 2012
@@ -19,7 +19,6 @@
package org.apache.nuvem.cloud.data;
-
public interface DocumentService<K, D> extends Collection<K, D> {
/**
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Entry.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Entry.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Entry.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Entry.java Wed Mar 14 04:38:14 2012
@@ -19,19 +19,20 @@
package org.apache.nuvem.cloud.data;
-public class Entry <K, D> {
+public class Entry<K, D> {
private K key;
private D data;
-
+
/**
* Constructs a new entry.
*/
public Entry() {
}
-
+
/**
* Constructs a new entry.
+ *
* @param key the entry key
* @param data the entry data
*/
@@ -39,42 +40,50 @@ public class Entry <K, D> {
this.key = key;
this.data = data;
}
-
+
/**
* Returns the entry key.
+ *
* @return the key
*/
public K getKey() {
return key;
}
-
+
/**
* Sets the entry key.
+ *
* @param key the key
*/
public void setKey(K key) {
this.key = key;
}
-
+
/**
* Returns the entry data.
+ *
* @return the entry data
*/
public D getData() {
return data;
}
-
+
/**
* Sets the entry data
+ *
* @param data the entry data
*/
public void setData(D data) {
this.data = data;
}
- //FIXME Temporary methods to make JAXB register the Item
- // class when the Entry class is registered in a JAXB context
- public void setDummy(Item item) {}
- public Item getDummy() { return null; }
-
-}
\ No newline at end of file
+ // FIXME Temporary methods to make JAXB register the Item
+ // class when the Entry class is registered in a JAXB context
+ public void setDummy(Item item) {
+ }
+
+ public Item getDummy() {
+ return null;
+ }
+
+}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Item.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Item.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Item.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/Item.java Wed Mar 14 04:38:14 2012
@@ -29,7 +29,7 @@ public class Item {
private String related;
private String alternate;
private Date date;
-
+
/**
* Constructs a new item.
*/
@@ -38,6 +38,7 @@ public class Item {
/**
* Constructs a new item.
+ *
* @param title the item title
* @param contents the item contents
* @param link the item link to a web resource
@@ -54,6 +55,7 @@ public class Item {
/**
* Returns the item title.
+ *
* @return the item title
*/
public String getTitle() {
@@ -62,6 +64,7 @@ public class Item {
/**
* Sets the item title.
+ *
* @param title the item title
*/
public void setTitle(String title) {
@@ -70,6 +73,7 @@ public class Item {
/**
* Returns the item contents
+ *
* @return the item contents
*/
public String getContents() {
@@ -78,6 +82,7 @@ public class Item {
/**
* Sets the item contents
+ *
* @param contents the item contents
*/
public void setContents(String contents) {
@@ -86,6 +91,7 @@ public class Item {
/**
* Returns the item link to a web resource
+ *
* @return the item link to a web resource
*/
public String getLink() {
@@ -94,6 +100,7 @@ public class Item {
/**
* Sets the item link to a web resource
+ *
* @param link the item link to a web resource
*/
public void setLink(String link) {
@@ -102,6 +109,7 @@ public class Item {
/**
* Returns the item link to a related web resource
+ *
* @return the item link to a related web resource
*/
public String getRelated() {
@@ -110,7 +118,7 @@ public class Item {
/**
* Sets the item link to a related web resource.
- *
+ *
* @param related the item link to a related web resource
*/
public void setRelated(String related) {
@@ -119,6 +127,7 @@ public class Item {
/**
* Returns the item link to an alternate web resource
+ *
* @return the item link to an alternate web resource
*/
public String getAlternate() {
@@ -127,7 +136,7 @@ public class Item {
/**
* Sets the item link to an alternate web resource.
- *
+ *
* @param alternate the item link to an alternate web resource
*/
public void setAlternate(String alternate) {
@@ -136,6 +145,7 @@ public class Item {
/**
* Returns the item date
+ *
* @return the item date
*/
public Date getDate() {
@@ -144,12 +154,11 @@ public class Item {
/**
* Sets the item date
+ *
* @param date the item date
*/
public void setDate(Date date) {
this.date = date;
}
-
}
-
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/NotFoundException.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/NotFoundException.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/NotFoundException.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/data/NotFoundException.java Wed Mar 14 04:38:14 2012
@@ -37,5 +37,4 @@ public class NotFoundException extends E
super(message, cause);
}
-
}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataService.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataService.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataService.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataService.java Wed Mar 14 04:38:14 2012
@@ -30,43 +30,42 @@ import org.oasisopen.sca.annotation.Remo
*/
@Remotable
public interface DataService {
-
- /**
- * Creates the element.
- *
- * @param element the element
- * @return the element
- * @throws DataServiceException the data service exception
- */
- public Element createElement(Element element) throws DataServiceException;
-
- /**
- * Update element.
- *
- * @param element the element
- * @return the element
- * @throws DataServiceException the data service exception
- */
- public Element updateElement(Element element) throws DataServiceException;
-
- /**
- * Gets the element.
- *
- * @param kind the kind
- * @param id the id
- * @return the element
- * @throws DataServiceException the data service exception
- */
- public Element getElement(String kind,String id) throws DataServiceException;
-
- /**
- * Delete element.
- *
- * @param element the element
- * @return true, if successful
- * @throws DataServiceException the data service exception
- */
- public boolean deleteElement(Element element) throws DataServiceException;
-
+
+ /**
+ * Creates the element.
+ *
+ * @param element the element
+ * @return the element
+ * @throws DataServiceException the data service exception
+ */
+ public Element createElement(Element element) throws DataServiceException;
+
+ /**
+ * Update element.
+ *
+ * @param element the element
+ * @return the element
+ * @throws DataServiceException the data service exception
+ */
+ public Element updateElement(Element element) throws DataServiceException;
+
+ /**
+ * Gets the element.
+ *
+ * @param kind the kind
+ * @param id the id
+ * @return the element
+ * @throws DataServiceException the data service exception
+ */
+ public Element getElement(String kind, String id) throws DataServiceException;
+
+ /**
+ * Delete element.
+ *
+ * @param element the element
+ * @return true, if successful
+ * @throws DataServiceException the data service exception
+ */
+ public boolean deleteElement(Element element) throws DataServiceException;
}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataServiceException.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataServiceException.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataServiceException.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/DataServiceException.java Wed Mar 14 04:38:14 2012
@@ -23,9 +23,7 @@ package org.apache.nuvem.cloud.dataServi
* The Class DataServiceException.
*/
public class DataServiceException extends Exception {
- /**
- *
- */
+
private static final long serialVersionUID = -1669425810168896007L;
/**
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Element.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Element.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Element.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Element.java Wed Mar 14 04:38:14 2012
@@ -18,186 +18,185 @@
*/
package org.apache.nuvem.cloud.dataService;
+
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
/**
* The Class Element.
*/
public class Element {
-
- /** The features. */
- private Set<Feature> features;
-
- /** The type. */
- private String type;
-
- /** The id. */
- private String id;
-
- /** The key. */
- private String key;
-
- /** The persist. */
- private boolean persist;
-
- /**
- * Checks if is persist.
- *
- * @return true, if is persist
- */
- public boolean isPersist() {
- return persist;
- }
-
- /**
- * Sets the persist.
- */
- public void setPersist() {
- this.persist = true;
- }
-
- /**
- * Instantiates a new element.
- *
- * @param type the type
- */
- public Element(String type){
- this.type = type;
- this.persist = false;
- this.features = new HashSet<Feature>();
- }
-
- /**
- * Instantiates a new element.
- *
- * @param type the type
- * @param features the features
- */
- public Element(String type, Set<Feature> features){
- this.type = type;
- this.features=features;
-
- }
-
- /**
- * Sets the key.
- *
- * @param key the new key
- */
- public void setKey(String key) {
- this.key = key;
- }
-
- /**
- * Gets the id.
- *
- * @return the id
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the id.
- *
- * @param id the new id
- */
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * Gets the key.
- *
- * @return the key
- */
- public String getKey() {
- if(key == null){
- setKey(getType().concat("(").concat(getId()).concat(")"));
- }
- return key;
- }
-
- /**
- * Gets the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type.
- *
- * @param type the new type
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * Instantiates a new element.
- *
- * @param featuresList the features list
- */
- public Element(List<Feature> featuresList){
- this.features = new HashSet<Feature>(featuresList);
-
- }
-
- /**
- * Adds the feature.
- *
- * @param feature the feature
- */
- public void addFeature(Feature feature){
- getFeatures().add(feature);
- }
-
- /**
- * Adds the feature.
- *
- * @param name the name
- * @param propValue the prop value
- */
- public void addFeature(String name,Object propValue){
- getFeatures().add(new Feature(name,propValue));
- }
-
- /**
- * Removes the feature.
- *
- * @param feature the feature
- */
- public void removeFeature(Feature feature){
- getFeatures().remove(feature);
- }
-
- public void removeFeatures(Set<Feature> features){
- getFeatures().remove(features);
- }
-
-
- /**
- * Gets the features.
- *
- * @return the features
- */
- public Set<Feature> getFeatures() {
- return features;
- }
-
- /**
- * Sets the features.
- *
- * @param features the new features
- */
- public void setFeatures(Set<Feature> features) {
- this.features = features;
- }
+
+ /** The features. */
+ private Set<Feature> features;
+
+ /** The type. */
+ private String type;
+
+ /** The id. */
+ private String id;
+
+ /** The key. */
+ private String key;
+
+ /** The persist. */
+ private boolean persist;
+
+ /**
+ * Checks if is persist.
+ *
+ * @return true, if is persist
+ */
+ public boolean isPersist() {
+ return persist;
+ }
+
+ /**
+ * Sets the persist.
+ */
+ public void setPersist() {
+ this.persist = true;
+ }
+
+ /**
+ * Instantiates a new element.
+ *
+ * @param type the type
+ */
+ public Element(String type) {
+ this.type = type;
+ this.persist = false;
+ this.features = new HashSet<Feature>();
+ }
+
+ /**
+ * Instantiates a new element.
+ *
+ * @param type the type
+ * @param features the features
+ */
+ public Element(String type, Set<Feature> features) {
+ this.type = type;
+ this.features = features;
+
+ }
+
+ /**
+ * Sets the key.
+ *
+ * @param key the new key
+ */
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the id.
+ *
+ * @param id the new id
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * Gets the key.
+ *
+ * @return the key
+ */
+ public String getKey() {
+ if (key == null) {
+ setKey(getType().concat("(").concat(getId()).concat(")"));
+ }
+ return key;
+ }
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Instantiates a new element.
+ *
+ * @param featuresList the features list
+ */
+ public Element(List<Feature> featuresList) {
+ this.features = new HashSet<Feature>(featuresList);
+
+ }
+
+ /**
+ * Adds the feature.
+ *
+ * @param feature the feature
+ */
+ public void addFeature(Feature feature) {
+ getFeatures().add(feature);
+ }
+
+ /**
+ * Adds the feature.
+ *
+ * @param name the name
+ * @param propValue the prop value
+ */
+ public void addFeature(String name, Object propValue) {
+ getFeatures().add(new Feature(name, propValue));
+ }
+
+ /**
+ * Removes the feature.
+ *
+ * @param feature the feature
+ */
+ public void removeFeature(Feature feature) {
+ getFeatures().remove(feature);
+ }
+
+ public void removeFeatures(Set<Feature> features) {
+ getFeatures().remove(features);
+ }
+
+ /**
+ * Gets the features.
+ *
+ * @return the features
+ */
+ public Set<Feature> getFeatures() {
+ return features;
+ }
+
+ /**
+ * Sets the features.
+ *
+ * @param features the new features
+ */
+ public void setFeatures(Set<Feature> features) {
+ this.features = features;
+ }
}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Feature.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Feature.java?rev=1300462&r1=1300461&r2=1300462&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Feature.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/dataService/Feature.java Wed Mar 14 04:38:14 2012
@@ -23,100 +23,96 @@ package org.apache.nuvem.cloud.dataServi
* The Class Feature.
*/
public class Feature {
-
- /** The name. */
- String name;
-
- /** The value. */
- Object value;
-
- /**
- * Instantiates a new feature.
- */
- public Feature(){
-
- }
-
- /**
- * Instantiates a new feature.
- *
- * @param name the name
- * @param propValue the prop value
- */
- public Feature(String name, Object propValue){
- this.name=name;
- this.value=propValue;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Gets the value.
- *
- * @return the value
- */
- public Object getValue() {
- return value;
- }
-
- /**
- * Sets the value.
- *
- * @param value the new value
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((value == null) ? 0 : value.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Feature other = (Feature) obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (value == null) {
- if (other.value != null)
- return false;
- } else if (!value.equals(other.value))
- return false;
- return true;
- }
-
-
-
-
+
+ /** The name. */
+ String name;
+
+ /** The value. */
+ Object value;
+
+ /**
+ * Instantiates a new feature.
+ */
+ public Feature() {
+
+ }
+
+ /**
+ * Instantiates a new feature.
+ *
+ * @param name the name
+ * @param propValue the prop value
+ */
+ public Feature(String name, Object propValue) {
+ this.name = name;
+ this.value = propValue;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public Object getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value the new value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Feature other = (Feature)obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!value.equals(other.value))
+ return false;
+ return true;
+ }
}