http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/4f6a3052/modules/core/src/flex/messaging/config/NetworkSettings.java ---------------------------------------------------------------------- diff --git a/modules/core/src/flex/messaging/config/NetworkSettings.java b/modules/core/src/flex/messaging/config/NetworkSettings.java old mode 100755 new mode 100644 index 916ada0..8cf22b6 --- a/modules/core/src/flex/messaging/config/NetworkSettings.java +++ b/modules/core/src/flex/messaging/config/NetworkSettings.java @@ -1,165 +1,165 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package flex.messaging.config; - -/** - * Network policy settings for a MessageDestination. - * - * @author neville - */ -public class NetworkSettings -{ - protected String clusterId; - protected ThrottleSettings throttleSettings; - protected int subscriptionTimeoutMinutes; - // This is the more common case so make it the default - protected boolean sharedBackend = true; - private boolean sharedBackendSet = false; - private boolean reliable; - - public static final String NETWORK_ELEMENT = "network"; - public static final String RELIABLE_ELEMENT = "reliable"; - public static final String SUBSCRIPTION_TIMEOUT_MINUTES = "subscription-timeout-minutes"; - public static final String SESSION_TIMEOUT = "session-timeout"; // Deprecated - renamed to subscription-timeout-minutes; retained for legacy config support. - public static final int DEFAULT_TIMEOUT = 0; // Defaults to being invalidated when the associated FlexSession shuts down. - - /** - * Constructs a default <code>NetworkSettings</code> instance with - * default session timeout. - */ - public NetworkSettings() - { - throttleSettings = new ThrottleSettings(); - subscriptionTimeoutMinutes = DEFAULT_TIMEOUT; - } - - /** - * Returns the cluster id. - * - * @return The cluster id. - */ - public String getClusterId() - { - return clusterId; - } - - /** - * Sets the cluster id. - * - * @param id The cluster id. - */ - public void setClusterId(String id) - { - this.clusterId = id; - } - - /** - * Returns the <code>reliable</code> setting. - * - * @return The <code>reliable</code> setting. - */ - public boolean isReliable() - { - return reliable; - } - - /** - * Sets the <code>reliable</code> setting. - * - * @param value The value to set the <code>reliable</code> setting to. - */ - public void setReliable(boolean value) - { - reliable = value; - } - - /** - * Returns the <code>subscription-timeout-minutes</code> property. - * - * @return the <code>subscription-timeout-minutes</code> property. - */ - public int getSubscriptionTimeoutMinutes() - { - return subscriptionTimeoutMinutes; - } - - /** - * Sets the <code>subscription-timeout-minutes</code> property which is the idle time in - * minutes before a subscriber that no messages are being pushed to will be unsubscribed. - * A value of 0 will cause subscriptions to be kept alive as long as the associated FlexSession - * they are created over is active. - * - * @param value The value to set the <code>subscription-timeout-minutes</code> property to. - */ - public void setSubscriptionTimeoutMinutes(int value) - { - subscriptionTimeoutMinutes = value; - } - - /** - * Returns the <code>shared-backend</code> property. - * - * @return the <code>shared-backend</code> property. - */ - public boolean isSharedBackend() - { - return sharedBackend; - } - - /** - * Sets the <code>shared-backend</code> property. - * - * @param sharedBackend The value to set the <code>shared-backend</code> property to. - */ - public void setSharedBackend(boolean sharedBackend) - { - this.sharedBackend = sharedBackend; - this.sharedBackendSet = true; - } - - /** - * Returns true if the shared backend has been set or false if it is - * still using the default. - * - * @return <code>true</code> if the shared backend has been set; <code>false</code> otherwise. - */ - public boolean isSharedBackendSet() - { - return sharedBackendSet; - } - - /** - * Returns the <code>ThrottleSettings</code> property. - * - * @return the <code>ThrottleSettings</code> property. - */ - public ThrottleSettings getThrottleSettings() - { - return throttleSettings; - } - - /** - * Sets the <code>ThrottleSettings</code> property. - * - * @param value The value to set the <code>ThrottleSettings</code> property to. - */ - public void setThrottleSettings(ThrottleSettings value) - { - throttleSettings = value; - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package flex.messaging.config; + +/** + * Network policy settings for a MessageDestination. + * + * @author neville + */ +public class NetworkSettings +{ + protected String clusterId; + protected ThrottleSettings throttleSettings; + protected int subscriptionTimeoutMinutes; + // This is the more common case so make it the default + protected boolean sharedBackend = true; + private boolean sharedBackendSet = false; + private boolean reliable; + + public static final String NETWORK_ELEMENT = "network"; + public static final String RELIABLE_ELEMENT = "reliable"; + public static final String SUBSCRIPTION_TIMEOUT_MINUTES = "subscription-timeout-minutes"; + public static final String SESSION_TIMEOUT = "session-timeout"; // Deprecated - renamed to subscription-timeout-minutes; retained for legacy config support. + public static final int DEFAULT_TIMEOUT = 0; // Defaults to being invalidated when the associated FlexSession shuts down. + + /** + * Constructs a default <code>NetworkSettings</code> instance with + * default session timeout. + */ + public NetworkSettings() + { + throttleSettings = new ThrottleSettings(); + subscriptionTimeoutMinutes = DEFAULT_TIMEOUT; + } + + /** + * Returns the cluster id. + * + * @return The cluster id. + */ + public String getClusterId() + { + return clusterId; + } + + /** + * Sets the cluster id. + * + * @param id The cluster id. + */ + public void setClusterId(String id) + { + this.clusterId = id; + } + + /** + * Returns the <code>reliable</code> setting. + * + * @return The <code>reliable</code> setting. + */ + public boolean isReliable() + { + return reliable; + } + + /** + * Sets the <code>reliable</code> setting. + * + * @param value The value to set the <code>reliable</code> setting to. + */ + public void setReliable(boolean value) + { + reliable = value; + } + + /** + * Returns the <code>subscription-timeout-minutes</code> property. + * + * @return the <code>subscription-timeout-minutes</code> property. + */ + public int getSubscriptionTimeoutMinutes() + { + return subscriptionTimeoutMinutes; + } + + /** + * Sets the <code>subscription-timeout-minutes</code> property which is the idle time in + * minutes before a subscriber that no messages are being pushed to will be unsubscribed. + * A value of 0 will cause subscriptions to be kept alive as long as the associated FlexSession + * they are created over is active. + * + * @param value The value to set the <code>subscription-timeout-minutes</code> property to. + */ + public void setSubscriptionTimeoutMinutes(int value) + { + subscriptionTimeoutMinutes = value; + } + + /** + * Returns the <code>shared-backend</code> property. + * + * @return the <code>shared-backend</code> property. + */ + public boolean isSharedBackend() + { + return sharedBackend; + } + + /** + * Sets the <code>shared-backend</code> property. + * + * @param sharedBackend The value to set the <code>shared-backend</code> property to. + */ + public void setSharedBackend(boolean sharedBackend) + { + this.sharedBackend = sharedBackend; + this.sharedBackendSet = true; + } + + /** + * Returns true if the shared backend has been set or false if it is + * still using the default. + * + * @return <code>true</code> if the shared backend has been set; <code>false</code> otherwise. + */ + public boolean isSharedBackendSet() + { + return sharedBackendSet; + } + + /** + * Returns the <code>ThrottleSettings</code> property. + * + * @return the <code>ThrottleSettings</code> property. + */ + public ThrottleSettings getThrottleSettings() + { + return throttleSettings; + } + + /** + * Sets the <code>ThrottleSettings</code> property. + * + * @param value The value to set the <code>ThrottleSettings</code> property to. + */ + public void setThrottleSettings(ThrottleSettings value) + { + throttleSettings = value; + } + +}
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/4f6a3052/modules/core/src/flex/messaging/config/SecuritySettings.java ---------------------------------------------------------------------- diff --git a/modules/core/src/flex/messaging/config/SecuritySettings.java b/modules/core/src/flex/messaging/config/SecuritySettings.java old mode 100755 new mode 100644 index eec6179..22ca8b5 --- a/modules/core/src/flex/messaging/config/SecuritySettings.java +++ b/modules/core/src/flex/messaging/config/SecuritySettings.java @@ -1,104 +1,104 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package flex.messaging.config; - -import flex.messaging.security.SecurityException; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Peter Farland - * @exclude - */ -public class SecuritySettings -{ - // Exception/error message numbers. - private static final int NO_SEC_CONSTRAINT = 10062; - - private String serverInfo; - private Map loginCommandSettings; - private Map constraints; - private boolean recreateHttpSessionAfterLogin; - - public SecuritySettings() - { - constraints = new HashMap(); - loginCommandSettings = new HashMap(); - } - - public void addConstraint(SecurityConstraint sc) - { - constraints.put(sc.getId(), sc); - } - - public SecurityConstraint getConstraint(String ref) - { - // If an attempt is made to use a constraint that we do not know about, - // do not let the authorization succeed - if (constraints.get(ref) == null) - { - // Security constraint {0} is not defined. - SecurityException se = new SecurityException(); - se.setMessage(NO_SEC_CONSTRAINT, new Object[] {ref}); - throw se; - } - return (SecurityConstraint)constraints.get(ref); - } - - public void addLoginCommandSettings(LoginCommandSettings lcs) - { - loginCommandSettings.put(lcs.getServer(), lcs); - } - - public Map getLoginCommands() - { - return loginCommandSettings; - } - - /** - * Returns a read-only set of constraints. - * - * @return the set of security constraints - */ - public Collection<SecurityConstraint> getConstraints() - { - return Collections.unmodifiableCollection(constraints.values()); - } - - public void setServerInfo(String s) - { - serverInfo = s; - } - - public String getServerInfo() - { - return serverInfo; - } - - public boolean isRecreateHttpSessionAfterLogin() - { - return recreateHttpSessionAfterLogin; - } - - public void setRecreateHttpSessionAfterLogin(boolean value) - { - recreateHttpSessionAfterLogin = value; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package flex.messaging.config; + +import flex.messaging.security.SecurityException; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Peter Farland + * @exclude + */ +public class SecuritySettings +{ + // Exception/error message numbers. + private static final int NO_SEC_CONSTRAINT = 10062; + + private String serverInfo; + private Map loginCommandSettings; + private Map constraints; + private boolean recreateHttpSessionAfterLogin; + + public SecuritySettings() + { + constraints = new HashMap(); + loginCommandSettings = new HashMap(); + } + + public void addConstraint(SecurityConstraint sc) + { + constraints.put(sc.getId(), sc); + } + + public SecurityConstraint getConstraint(String ref) + { + // If an attempt is made to use a constraint that we do not know about, + // do not let the authorization succeed + if (constraints.get(ref) == null) + { + // Security constraint {0} is not defined. + SecurityException se = new SecurityException(); + se.setMessage(NO_SEC_CONSTRAINT, new Object[] {ref}); + throw se; + } + return (SecurityConstraint)constraints.get(ref); + } + + public void addLoginCommandSettings(LoginCommandSettings lcs) + { + loginCommandSettings.put(lcs.getServer(), lcs); + } + + public Map getLoginCommands() + { + return loginCommandSettings; + } + + /** + * Returns a read-only set of constraints. + * + * @return the set of security constraints + */ + public Collection<SecurityConstraint> getConstraints() + { + return Collections.unmodifiableCollection(constraints.values()); + } + + public void setServerInfo(String s) + { + serverInfo = s; + } + + public String getServerInfo() + { + return serverInfo; + } + + public boolean isRecreateHttpSessionAfterLogin() + { + return recreateHttpSessionAfterLogin; + } + + public void setRecreateHttpSessionAfterLogin(boolean value) + { + recreateHttpSessionAfterLogin = value; + } +}