juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1479420 - in /juddi/branches/juddi-3.2.x/juddi-core/src/main: java/org/apache/juddi/api/impl/ java/org/apache/juddi/validation/ resources/
Date Sun, 05 May 2013 23:20:35 GMT
Author: alexoree
Date: Sun May  5 23:20:34 2013
New Revision: 1479420

URL: http://svn.apache.org/r1479420
Log:
Fix for JIRA-590

Modified:
    juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/PublicationHelper.java
    juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
    juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidateSubscription.java
    juddi/branches/juddi-3.2.x/juddi-core/src/main/resources/messages.properties

Modified: juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/PublicationHelper.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/PublicationHelper.java?rev=1479420&r1=1479419&r2=1479420&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/PublicationHelper.java
(original)
+++ juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/PublicationHelper.java
Sun May  5 23:20:34 2013
@@ -43,6 +43,8 @@ public class PublicationHelper {
 		businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
 		
 		List<org.apache.juddi.model.PublisherAssertion> pubAssertionList = FindPublisherAssertionByBusinessQuery.select(em,
businessKeysFound, completionStatus);
+                if (pubAssertionList==null)
+                    return result;
 		for(org.apache.juddi.model.PublisherAssertion modelPubAssertion : pubAssertionList) {
 			org.uddi.api_v3.AssertionStatusItem apiAssertionStatusItem = new org.uddi.api_v3.AssertionStatusItem();
 

Modified: juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java?rev=1479420&r1=1479419&r2=1479420&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
(original)
+++ juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
Sun May  5 23:20:34 2013
@@ -80,6 +80,10 @@ import org.apache.juddi.v3.error.FatalEr
 import org.apache.juddi.v3.error.InvalidValueException;
 import org.apache.juddi.validation.ValidateSubscription;
 
+/**
+ * 
+ * This is jUDDI's implementation of the UDDIv3 Subscription API
+ */
 @WebService(serviceName="UDDISubscriptionService", 
 			endpointInterface="org.uddi.v3_service.UDDISubscriptionPortType",
 			targetNamespace = "urn:uddi-org:v3_service")
@@ -818,7 +822,7 @@ public class UDDISubscriptionImpl extend
 	}
 
 
-	/* (non-Javadoc)
+	/* 
 	 * @see org.uddi.v3_service.UDDISubscriptionPortType#saveSubscription(java.lang.String,
javax.xml.ws.Holder)
 	 * 
 	 * Notes: The matching keys are saved on a new subscription (or renewed subscription) for
the find_* filters only.  With the other filter 

Modified: juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidateSubscription.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidateSubscription.java?rev=1479420&r1=1479419&r2=1479420&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidateSubscription.java
(original)
+++ juddi/branches/juddi-3.2.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidateSubscription.java
Sun May  5 23:20:34 2013
@@ -60,7 +60,7 @@ public class ValidateSubscription extend
 		}
 	}
 	
-	public void validateSubscription(EntityManager em, org.uddi.sub_v3.Subscription subscription)
throws DispositionReportFaultMessage {
+	private void validateSubscription(EntityManager em, org.uddi.sub_v3.Subscription subscription)
throws DispositionReportFaultMessage {
 
 		// A supplied subscription can't be null
 		if (subscription == null)
@@ -103,12 +103,30 @@ public class ValidateSubscription extend
 			if (!isUniqueKey(em, entityKey))
 				throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists",
entityKey));
 		}
-		
+                //AO, if it's already expired, why even allow it?
+		if (subscription.getExpiresAfter()!=null)
+                {
+                    long expiresat= subscription.getExpiresAfter().toGregorianCalendar().getTimeInMillis();
+                    if (System.currentTimeMillis() > expiresat)
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.subscription.expired"));
+                }
+                if (subscription.getMaxEntities()!=null)
+                {
+                    if (subscription.getMaxEntities().intValue() <= 0)
+                    {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.subscription.maxrecordstoosmall"));
+                    }
+                }
 		
 		validateSubscriptionFilter(subscription.getSubscriptionFilter(), entityExists);
 	}
-
-	public void validateSubscriptionFilter(SubscriptionFilter subscriptionFilter, boolean entityExists)
throws DispositionReportFaultMessage {
+        /**
+         * this handles just the filter items only
+         * @param subscriptionFilter
+         * @param entityExists or more accurately, is this a new item or not?
+         * @throws DispositionReportFaultMessage 
+         */
+	private void validateSubscriptionFilter(SubscriptionFilter subscriptionFilter, boolean entityExists)
throws DispositionReportFaultMessage {
 		if (!entityExists && subscriptionFilter == null)
 			throw new ValueNotAllowedException(new ErrorMessage("errors.subscription.NoFilterOnNewSubscription"));
 			

Modified: juddi/branches/juddi-3.2.x/juddi-core/src/main/resources/messages.properties
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-core/src/main/resources/messages.properties?rev=1479420&r1=1479419&r2=1479420&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-core/src/main/resources/messages.properties (original)
+++ juddi/branches/juddi-3.2.x/juddi-core/src/main/resources/messages.properties Sun May 
5 23:20:34 2013
@@ -190,6 +190,8 @@ errors.subscription.NullInput=The subscr
 errors.subscription.NoFilterOnNewSubscription=No subscription filter was provided on this
new subscription request
 errors.subscription.BlankFilter=A filter structure was provided but no filter criteria was
specified
 errors.subscription.TooManyFilters=Only one filter is allowed per subscription request
+errors.subscription.expired=The expiration timestamp has already passed.
+errors.subscription.maxrecordstoosmall=When specifying the maxium record, it must be greater
than zero
 errors.getsubscriptionresult.SubscriptionExpired=The passed subscription has expired
 errors.getsubscriptionresult.NullCoveragePeriod=The coverage period cannot be blank
 errors.getsubscriptionresult.InvalidDateInCoveragePeriod=The coverage period must contain
valid dates for start and end points



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message