Permalink
Browse files

https://issues.apache.org/jira/browse/AMQCPP-511

  • Loading branch information...
1 parent 204deea commit 5be7173ddc8f20889e4a073fcc5d20c486366dcc @tabish121 tabish121 committed Oct 24, 2013
@@ -351,6 +351,8 @@ cc_sources = \
decaf/internal/net/SocketFileDescriptor.cpp \
decaf/internal/net/URIEncoderDecoder.cpp \
decaf/internal/net/URIHelper.cpp \
+ decaf/internal/net/URIType.cpp \
+ decaf/internal/net/URLType.cpp \
decaf/internal/net/ssl/DefaultSSLContext.cpp \
decaf/internal/net/ssl/DefaultSSLServerSocketFactory.cpp \
decaf/internal/net/ssl/DefaultSSLSocketFactory.cpp \
@@ -475,6 +477,8 @@ cc_sources = \
decaf/lang/exceptions/NumberFormatException.cpp \
decaf/lang/exceptions/OutOfMemoryError.cpp \
decaf/lang/exceptions/RuntimeException.cpp \
+ decaf/lang/exceptions/SecurityException.cpp \
+ decaf/lang/exceptions/StringIndexOutOfBoundsException.cpp \
decaf/lang/exceptions/UnsupportedOperationException.cpp \
decaf/net/BindException.cpp \
decaf/net/ConnectException.cpp \
@@ -491,6 +495,7 @@ cc_sources = \
decaf/net/NoRouteToHostException.cpp \
decaf/net/PortUnreachableException.cpp \
decaf/net/ProtocolException.cpp \
+ decaf/net/Proxy.cpp \
decaf/net/ServerSocket.cpp \
decaf/net/ServerSocketFactory.cpp \
decaf/net/Socket.cpp \
@@ -1020,6 +1025,7 @@ h_sources = \
decaf/internal/net/URIEncoderDecoder.h \
decaf/internal/net/URIHelper.h \
decaf/internal/net/URIType.h \
+ decaf/internal/net/URLType.h \
decaf/internal/net/ssl/DefaultSSLContext.h \
decaf/internal/net/ssl/DefaultSSLServerSocketFactory.h \
decaf/internal/net/ssl/DefaultSSLSocketFactory.h \
@@ -1152,6 +1158,8 @@ h_sources = \
decaf/lang/exceptions/NumberFormatException.h \
decaf/lang/exceptions/OutOfMemoryError.h \
decaf/lang/exceptions/RuntimeException.h \
+ decaf/lang/exceptions/SecurityException.h \
+ decaf/lang/exceptions/StringIndexOutOfBoundsException.h \
decaf/lang/exceptions/UnsupportedOperationException.h \
decaf/net/BindException.h \
decaf/net/ConnectException.h \
@@ -1168,6 +1176,7 @@ h_sources = \
decaf/net/NoRouteToHostException.h \
decaf/net/PortUnreachableException.h \
decaf/net/ProtocolException.h \
+ decaf/net/Proxy.h \
decaf/net/ServerSocket.h \
decaf/net/ServerSocketFactory.h \
decaf/net/Socket.h \
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+#include "URIType.h"
+
+using namespace decaf;
+using namespace decaf::internal;
+using namespace decaf::internal::net;
+
+////////////////////////////////////////////////////////////////////////////////
+URIType::URIType(const std::string& source) : source(source),
+ scheme(),
+ schemeSpecificPart(),
+ authority(),
+ userinfo(),
+ host(),
+ port(-1),
+ path(),
+ query(),
+ fragment(),
+ opaque(false),
+ absolute(false),
+ serverAuthority(false),
+ valid(false),
+ hashCode(-1) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+URIType::URIType() : source(),
+ scheme(),
+ schemeSpecificPart(),
+ authority(),
+ userinfo(),
+ host(),
+ port( -1 ),
+ path(),
+ query(),
+ fragment(),
+ opaque(false),
+ absolute(false),
+ serverAuthority(false),
+ valid(false),
+ hashCode(-1) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+URIType::~URIType() {}
@@ -45,42 +45,14 @@ namespace net {
bool absolute;
bool serverAuthority;
bool valid;
+ int hashCode;
public:
- URIType( const std::string& source ) : source( source ),
- scheme(),
- schemeSpecificPart(),
- authority(),
- userinfo(),
- host(),
- port( -1 ),
- path(),
- query(),
- fragment(),
- opaque( false ),
- absolute( false ),
- serverAuthority( false ),
- valid( false ) {
- }
-
- URIType() : source(),
- scheme(),
- schemeSpecificPart(),
- authority(),
- userinfo(),
- host(),
- port( -1 ),
- path(),
- query(),
- fragment(),
- opaque( false ),
- absolute( false ),
- serverAuthority( false ),
- valid( false ) {
- }
+ URIType();
+ URIType(const std::string& source);
- virtual ~URIType() {}
+ virtual ~URIType();
/**
* Gets the source URI string that was parsed to obtain this URIType
@@ -96,7 +68,7 @@ namespace net {
* instance and the resulting data,
* @param source - the source URI string
*/
- void setSource( const std::string& source ) {
+ void setSource(const std::string& source) {
this->source = source;
}
@@ -112,7 +84,7 @@ namespace net {
* Sets the Scheme of the URI, e.g. scheme ("http"/"ftp"/...).
* @param scheme - scheme part string.
*/
- void setScheme( const std::string& scheme ) {
+ void setScheme(const std::string& scheme) {
this->scheme = scheme;
}
@@ -128,7 +100,7 @@ namespace net {
* Sets the Scheme Specific Part of the URI.
* @param schemeSpecificPart - scheme specific part string.
*/
- void setSchemeSpecificPart( const std::string& schemeSpecificPart ) {
+ void setSchemeSpecificPart(const std::string& schemeSpecificPart) {
this->schemeSpecificPart = schemeSpecificPart;
}
@@ -144,7 +116,7 @@ namespace net {
* Sets the Authority of the URI.
* @param authority Authority part string.
*/
- void setAuthority( const std::string& authority ) {
+ void setAuthority(const std::string& authority) {
this->authority = authority;
}
@@ -162,7 +134,7 @@ namespace net {
* http://user:passwd@host:port/
* @param userinfo - user info part string.
*/
- void setUserInfo( const std::string& userinfo ) {
+ void setUserInfo(const std::string& userinfo) {
this->userinfo = userinfo;
}
@@ -178,7 +150,7 @@ namespace net {
* Sets the Host name part of the URI.
* @param host - Host name part string.
*/
- void setHost( const std::string& host ) {
+ void setHost(const std::string& host) {
this->host = host;
}
@@ -194,7 +166,7 @@ namespace net {
* Sets the port part of the URI.
* @param port - port part string, -1 if not set.
*/
- void setPort( int port ) {
+ void setPort(int port) {
this->port = port;
}
@@ -210,7 +182,7 @@ namespace net {
* Sets the Path part of the URI.
* @param path - Path part string.
*/
- void setPath( const std::string& path ) {
+ void setPath(const std::string& path) {
this->path = path;
}
@@ -226,7 +198,7 @@ namespace net {
* Sets the Query part of the URI.
* @param query - Query part string.
*/
- void setQuery( const std::string& query ) {
+ void setQuery(const std::string& query) {
this->query = query;
}
@@ -242,7 +214,7 @@ namespace net {
* Sets the Fragment part of the URI.
* @param fragment - Fragment part string.
*/
- void setFragment( const std::string& fragment ) {
+ void setFragment(const std::string& fragment) {
this->fragment = fragment;
}
@@ -258,7 +230,7 @@ namespace net {
* Sets if the URI is Opaque.
* @param opaque true if opaque.
*/
- void setOpaque( bool opaque ) {
+ void setOpaque(bool opaque) {
this->opaque = opaque;
}
@@ -274,7 +246,7 @@ namespace net {
* Sets if the URI is Absolute.
* @param absolute - true if Absolute.
*/
- void setAbsolute( bool absolute ) {
+ void setAbsolute(bool absolute) {
this->absolute = absolute;
}
@@ -290,7 +262,7 @@ namespace net {
* Sets if the URI is a Server Authority.
* @param serverAuthority - true if Server Authority.
*/
- void setServerAuthority( bool serverAuthority ) {
+ void setServerAuthority(bool serverAuthority) {
this->serverAuthority = serverAuthority;
}
@@ -308,10 +280,28 @@ namespace net {
* parsed and all relevant data fields have been set.
* @param valid - true if the URIType contains valid data.
*/
- void setValid( bool valid ) {
+ void setValid(bool valid) {
this->valid = valid;
}
+ /**
+ * Gets the computed hashCode for this URIType or return -1 if non is set
+ *
+ * @returns the hash code for this URIType instance or -1 if not set.
+ */
+ int getHashCode() const {
+ return this->hashCode;
+ }
+
+ /**
+ * Sets the hash code for this URIType instance.
+ *
+ * @param hashCode
+ * The new hash code that's been computed for this URIType instance.
+ */
+ void setHashCode(int hashCode) {
+ this->hashCode = hashCode;
+ }
};
}}}
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+#include "URLType.h"
+
+using namespace decaf;
+using namespace decaf::internal;
+using namespace decaf::internal::net;
+
+////////////////////////////////////////////////////////////////////////////////
+URLType::URLType() : file(),
+ protocol(),
+ host(),
+ port(-1),
+ authority(),
+ userInfo(),
+ path(),
+ query(),
+ ref(),
+ hashCode(-1) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+URLType::~URLType() {}
Oops, something went wrong.

0 comments on commit 5be7173

Please sign in to comment.