Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

Commit

Permalink
register AX handlers, and a few other random fixes
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/willnorris/Projects/svn-import/java-openid/trunk@82 eae3f9c0-6542-46b9-8785-326aab784c2f
  • Loading branch information
willnorris committed Oct 27, 2009
1 parent fbbea2c commit 5362b4c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
import edu.internet2.middleware.openid.common.OpenIDConstants;
import edu.internet2.middleware.openid.extensions.MessageExtensionMarshaller;
import edu.internet2.middleware.openid.extensions.MessageExtensionUnmarshaller;
import edu.internet2.middleware.openid.extensions.ax.AttributeExchange;
import edu.internet2.middleware.openid.extensions.ax.AttributeExchangeMarshallingDispatcher;
import edu.internet2.middleware.openid.extensions.ax.AttributeExchangeUnmarshallingDispatcher;
import edu.internet2.middleware.openid.extensions.ax.FetchRequest;
import edu.internet2.middleware.openid.extensions.ax.FetchResponse;
import edu.internet2.middleware.openid.extensions.ax.StoreRequest;
import edu.internet2.middleware.openid.extensions.ax.StoreResponse;
import edu.internet2.middleware.openid.extensions.ax.impl.FetchRequestBuilder;
import edu.internet2.middleware.openid.extensions.ax.impl.FetchResponseBuilder;
import edu.internet2.middleware.openid.extensions.ax.impl.StoreRequestBuilder;
import edu.internet2.middleware.openid.extensions.ax.impl.StoreResponseBuilder;
import edu.internet2.middleware.openid.extensions.sreg.SimpleRegistration;
import edu.internet2.middleware.openid.extensions.sreg.SimpleRegistrationMessageMarshaller;
import edu.internet2.middleware.openid.extensions.sreg.SimpleRegistrationMessageUnmarshaller;
Expand Down Expand Up @@ -168,15 +179,26 @@ public static void initializeExtensionProviders() {
MessageExtensionMarshaller marshaller;
MessageExtensionUnmarshaller unmarshaller;

// Simple Registration
marshaller = new SimpleRegistrationMessageMarshaller();
unmarshaller = new SimpleRegistrationMessageUnmarshaller();
//initializeExtensionProvider(SimpleRegistration.SREG_10_NS, marshaller, unmarshaller);
// initializeExtensionProvider(SimpleRegistration.SREG_10_NS, marshaller, unmarshaller);
initializeExtensionProvider(SimpleRegistration.SREG_11_NS, marshaller, unmarshaller);

Configuration.getExtensionBuilders().registerBuilder(SimpleRegistrationRequest.class,
new SimpleRegistrationRequestBuilder());
Configuration.getExtensionBuilders().registerBuilder(SimpleRegistrationResponse.class,
new SimpleRegistrationResponseBuilder());

// Attribute Exchange
marshaller = new AttributeExchangeMarshallingDispatcher();
unmarshaller = new AttributeExchangeUnmarshallingDispatcher();
initializeExtensionProvider(AttributeExchange.AX_10_NS, marshaller, unmarshaller);

Configuration.getExtensionBuilders().registerBuilder(FetchRequest.class, new FetchRequestBuilder());
Configuration.getExtensionBuilders().registerBuilder(FetchResponse.class, new FetchResponseBuilder());
Configuration.getExtensionBuilders().registerBuilder(StoreRequest.class, new StoreRequestBuilder());
Configuration.getExtensionBuilders().registerBuilder(StoreResponse.class, new StoreResponseBuilder());
}

public static void initializeExtensionProvider(String namespace, MessageExtensionMarshaller marshaller,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public final class OpenIDConstants {
* All OpenID indirect messages as well as direct requests include a "mode" parameter to identify to kind of message
* it is. Direct response messages technically do not require a "mode" parameter because these messages are always
* present in the context of an accompanying request. However, when writing a generic factory for message
* {@link edu.internet2.middleware.openid.message.io.MessageUnmarshaller}s, this lack of a "mode" parameter becomes a
* problem. The following fake "mode" values are defined and used within this library solely for the purpose of
* {@link edu.internet2.middleware.openid.message.io.MessageUnmarshaller}s, this lack of a "mode" parameter becomes
* a problem. The following fake "mode" values are defined and used within this library solely for the purpose of
* internal identification of message builders. If a future version of OpenID adds a "mode" parameter to these
* messages, the changes necessary to support that should be quite minimal.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class SimpleRegistration {
/**
* Namespace URI for Simple Registration version 1.0.
*/
public static final String SREG_10_NS = "http://openid.net/extensions/sreg/1.0";
public static final String SREG_10_NS = "http://openid.net/sreg/1.0";

/**
* Namespace URI for Simple Registration version 1.1.
Expand Down Expand Up @@ -127,4 +127,5 @@ public static enum Field {
/** Constructor. */
protected SimpleRegistration() {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import edu.internet2.middleware.openid.extensions.sreg.SimpleRegistration.Field;

/**
* Test case for creating, marshalling, and unmarshalling {@link SimpleRegistrationRequest}.
* Test case for creating, marshalling, and unmarshalling {@link SimpleRegistrationResponse}.
*/
public class SimpleRegistrationResponseTest extends BaseMessageExtensionTestCase {

Expand Down

0 comments on commit 5362b4c

Please sign in to comment.