001 /*
002 * Copyright 2005 Stephen J. McConnell.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
013 * implied.
014 *
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019 package net.dpml.transit.model;
020
021 import java.net.URL;
022 import java.net.PasswordAuthentication;
023
024 /**
025 * An event pertaining to a modification to a host model base url,
026 * index, request identifier or connection credentials.
027 *
028 * @author <a href="http://www.dpml.net">Digital Product Meta Library</a>
029 * @version 1.0.3
030 */
031 public class HostChangeEvent extends HostEvent
032 {
033 /**
034 * Serial version identifier.
035 */
036 static final long serialVersionUID = 1L;
037
038 private final URL m_base;
039 private final URL m_index;
040 private final RequestIdentifier m_identifier;
041 private final PasswordAuthentication m_authentication;
042 private final boolean m_enabled;
043 private final boolean m_trusted;
044
045 /**
046 * Creation of a new host change event.
047 * @param host the host model that was changed
048 * @param base the host base url
049 * @param index the host index url
050 * @param identifier the host request identifier
051 * @param auth the host authentication credentials
052 * @param enabled the host enabled state
053 * @param trusted the host trusted status
054 */
055 public HostChangeEvent(
056 HostModel host, URL base, URL index,
057 RequestIdentifier identifier, PasswordAuthentication auth,
058 boolean enabled, boolean trusted )
059 {
060 super( host );
061 m_base = base;
062 m_index = index;
063 m_identifier = identifier;
064 m_authentication = auth;
065 m_enabled = enabled;
066 m_trusted = trusted;
067 }
068
069 /**
070 * Return the host base URL.
071 * @return the base url
072 */
073 public URL getBaseURL()
074 {
075 return m_base;
076 }
077
078 /**
079 * Return the host index URL.
080 * @return the index url
081 */
082 public URL getIndexURL()
083 {
084 return m_index;
085 }
086
087 /**
088 * Return the host request identifier.
089 * @return the request identifier
090 */
091 public RequestIdentifier getRequestIdentifier()
092 {
093 return m_identifier;
094 }
095
096 /**
097 * Return the host password authentication credentials.
098 * @return the authentication credentials
099 */
100 public PasswordAuthentication getPasswordAuthentication()
101 {
102 return m_authentication;
103 }
104
105 /**
106 * Return the host enabled status.
107 * @return the enabled status
108 */
109 public boolean getEnabled()
110 {
111 return m_enabled;
112 }
113
114 /**
115 * Return the host trusted status.
116 * @return the trusted status
117 */
118 public boolean getTrusted()
119 {
120 return m_trusted;
121 }
122 }