Change license header, remove stale pkg files.
[shibboleth/cpp-opensaml.git] / saml / saml1 / binding / impl / SAMLArtifactType0001.cpp
index 81c5ca4..d44134a 100644 (file)
@@ -1,23 +1,27 @@
-/*
- *  Copyright 2001-2007 Internet2
- * 
- * Licensed 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
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
+ *
+ * UCAID 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
+ * 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.
+ * 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.
  */
 
 /**
  * SAMLArtifactType0001.cpp
  * 
- * Type 0x0001 SAML 1.x artifact class 
+ * Type 0x0001 SAML 1.x artifact class.
  */
 
 #include "internal.h"
@@ -40,6 +44,10 @@ namespace opensaml {
 const unsigned int SAMLArtifactType0001::SOURCEID_LENGTH = 20;
 const unsigned int SAMLArtifactType0001::HANDLE_LENGTH = 20;
 
+SAMLArtifactType0001::SAMLArtifactType0001(const SAMLArtifactType0001& src) : SAMLArtifact(src)
+{
+}
+
 SAMLArtifactType0001::SAMLArtifactType0001(const char* s) : SAMLArtifact(s)
 {
     // The base class does the work, we just do the checking.
@@ -75,3 +83,27 @@ SAMLArtifactType0001::SAMLArtifactType0001(const string& sourceid, const string&
     m_raw.append(sourceid,0,SOURCEID_LENGTH);
     m_raw.append(handle,0,HANDLE_LENGTH);
 }
+
+SAMLArtifactType0001::~SAMLArtifactType0001()
+{
+}
+
+SAMLArtifactType0001* SAMLArtifactType0001::clone() const
+{
+    return new SAMLArtifactType0001(*this);
+}
+
+string SAMLArtifactType0001::getSource() const
+{
+    return toHex(getSourceID());
+}
+
+string SAMLArtifactType0001::getSourceID() const
+{
+    return m_raw.substr(TYPECODE_LENGTH,SOURCEID_LENGTH);                   // bytes 3-22
+}
+
+string SAMLArtifactType0001::getMessageHandle() const
+{
+    return m_raw.substr(TYPECODE_LENGTH+SOURCEID_LENGTH, HANDLE_LENGTH);    // bytes 23-42
+}