Added: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java?rev=1554543&view=auto ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java (added) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java Tue Dec 31 15:35:27 2013 @@ -0,0 +1,98 @@ +/* + * Copyright 2001-2008 The Apache Software Foundation. + * + * 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 + * + * 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 org.apache.juddi.model; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "j3_chg_record") +public class ChangeRecord implements Serializable { + + protected String nodeID; + protected Long originatingUSN; + + private Long id; + + @Column(name="change_contents") + public byte[] getContents() { + return contents; + } + + public void setContents(byte[] contents) { + this.contents = contents; + } + /*protected ChangeRecordIDType changeID; + protected Object changeRecordNull; + protected ChangeRecordNewData changeRecordNewData; + protected ChangeRecordDelete changeRecordDelete; + protected ChangeRecordPublisherAssertion changeRecordPublisherAssertion; + protected ChangeRecordHide changeRecordHide; + protected ChangeRecordDeleteAssertion changeRecordDeleteAssertion; + protected ChangeRecordAcknowledgement changeRecordAcknowledgement; + protected ChangeRecordCorrection changeRecordCorrection; + protected ChangeRecordNewDataConditional changeRecordNewDataConditional; + protected ChangeRecordConditionFailed changeRecordConditionFailed; + protected boolean acknowledgementRequested; + * */ + byte[] contents; + + enum RecordType { + + ChangeRecordNewData, + ChangeRecordDelete, + ChangeRecordPublisherAssertion, + ChangeRecordHide, + ChangeRecordDeleteAssertion, + ChangeRecordAcknowledgement, + ChangeRecordCorrection, + ChangeRecordNewDataConditional, + ChangeRecordConditionFailed + } + + @Id + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @Column(name="node_id") + public String getNodeID() { + return nodeID; + } + + public void setNodeID(String value) { + this.nodeID = value; + } + + + @Column(name="orginating_usn") + public Long getOriginatingUSN() { + return originatingUSN; + } + + public void setOriginatingUSN(Long value) { + this.originatingUSN = value; + } +} + \ No newline at end of file
Added: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java?rev=1554543&view=auto ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java (added) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java Tue Dec 31 15:35:27 2013 @@ -0,0 +1,89 @@ +/* + * Copyright 2001-2008 The Apache Software Foundation. + * + * 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 + * + * 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 org.apache.juddi.model; + +import java.io.Serializable; +import java.util.ArrayList; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "j3_chg_graph") +public class CommunicationGraph implements Serializable { + + private Long id; + private List<Node> node; + private List<ControlMessage> controlledMessage; + private List<Edge> edge; + + + @OneToMany(targetEntity = Node.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + public List<Node> getNode() { + if (node == null) { + node = new ArrayList<Node>(); + } + return this.node; + } + + public void setNode(List<Node> nodes) { + + this.node = nodes; + } + + @OneToMany(targetEntity = ControlMessage.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + public List<ControlMessage> getControlMessage() { + if (controlledMessage == null) { + controlledMessage = new ArrayList<ControlMessage>(); + } + return this.controlledMessage; + } + + public void setControlMessage(List<ControlMessage> controlledMessages) { + + this.controlledMessage = controlledMessages; + } + + // @OneToMany( fetch = FetchType.LAZY,targetEntity = Edge.class, mappedBy = "Edge") + @OneToMany(targetEntity = Edge.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + public List<Edge> getEdge() { + return this.edge; + } + + public void setEdge( List<Edge> edges) { + this.edge=edges; + } + + @Id + @Column(name = "j3_id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} + \ No newline at end of file Added: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java?rev=1554543&view=auto ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java (added) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java Tue Dec 31 15:35:27 2013 @@ -0,0 +1,54 @@ +/* + * Copyright 2013 The Apache Software Foundation. + * + * 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 + * + * 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 org.apache.juddi.model; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; + +/** + * + * @author Alex O'Ree + */ +@Entity(name = "j3_ctrl_msg") +public class ControlMessage implements Serializable{ + private static final long serialVersionUID = 1L; + + + private Long id; + + private String message; + + @Column(name = "j3_message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Id + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} Added: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Edge.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Edge.java?rev=1554543&view=auto ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Edge.java (added) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Edge.java Tue Dec 31 15:35:27 2013 @@ -0,0 +1,131 @@ +/* + * Copyright 2013 The Apache Software Foundation. + * + * 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 + * + * 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 org.apache.juddi.model; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "j3_edge") +public class Edge { + + private Long id; + private Set<ReplicationMessage> message; + private Node messageSender; + private Node messageReceiver; + private Set<Node> messageReceiverAlternate; + private CommunicationGraph parent; + + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = CommunicationGraph.class) + //@JoinColumn(name = "OWNER_ID") + public CommunicationGraph getCommunicationGraph() { + return parent; + } + + public void setCommunicationGraph(CommunicationGraph val) { + parent = val; + } + + /** + * The message elements contain the local name of the Replication API message elements + * @return + */ + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = ReplicationMessage.class) + public Set<ReplicationMessage> getMessages() { + if (message == null) { + message = new HashSet<ReplicationMessage>(); + } + return this.message; + } + public void setMessages(Set<ReplicationMessage> values) { + this.message = values; + } + + @JoinColumn(referencedColumnName ="name" ) + @ManyToOne(targetEntity = Node.class) + public Node getMessageSender() { + return messageSender; + } + + public void setMessageSender(Node value) { + this.messageSender = value; + } + + /** + * For each directed edge, the primary edge Node id + * + * @return + */ + @JoinColumn(referencedColumnName ="name" ) + @ManyToOne(targetEntity = Node.class) + public Node getMessageReceiver() { + return messageReceiver; + } + + public void setMessageReceiver(Node value) { + this.messageReceiver = value; + } + + /** + * For each directed edge, an ordered sequence of zero or more + * alternate, backup edges MAY be listed using the + * messageReceiverAlternate element + * + * @return + */ + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Node.class) + public Set<Node> getMessageReceiverAlternate() { + if (messageReceiverAlternate == null) { + messageReceiverAlternate = new HashSet<Node>(); + } + return this.messageReceiverAlternate; + } + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getId() { + return id; + } + + public void setMessage(Set<ReplicationMessage> message) { + this.message = message; + } + + public void setMessageReceiverAlternate(Set<Node> messageReceiverAlternate) { + this.messageReceiverAlternate = messageReceiverAlternate; + } + + public void setParent(CommunicationGraph parent) { + this.parent = parent; + } + + public void setId(Long id) { + this.id = id; + } +} Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/KeyDataValue.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/KeyDataValue.java?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/KeyDataValue.java (original) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/KeyDataValue.java Tue Dec 31 15:35:27 2013 @@ -142,6 +142,9 @@ public class KeyDataValue implements jav @Override public String toString() { - return "KeyDataValue{" + "id=" + id + ", keyDataType=" + keyDataType + ", keyDataName=" + keyDataName + ", keyDataValueBytes=" + keyDataValueBytes + ", keyDataValueString=" + keyDataValueString + ", keyDataValueList=" + keyDataValueList + '}'; + return "KeyDataValue{" + "id=" +getId() + ", keyDataType=" +getKeyDataType() + + ", keyDataName=" + getKeyDataName() + ", keyDataValueBytes=" + + getKeyDataValueBytes() + ", keyDataValueString=" + getKeyDataValueString() + + ", keyDataValueList=" + getKeyDataValueList() + '}'; } } Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/KeyInfo.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/KeyInfo.java?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/KeyInfo.java (original) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/KeyInfo.java Tue Dec 31 15:35:27 2013 @@ -24,6 +24,7 @@ import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.OrderBy; import javax.persistence.Table; @@ -68,4 +69,23 @@ public class KeyInfo implements java.io. public void setXmlID(String xmlID) { this.xmlID = xmlID; } + + private CommunicationGraph comgraph; + @ManyToOne(cascade = CascadeType.ALL, optional = true, fetch = FetchType.LAZY,targetEntity = CommunicationGraph.class) + public CommunicationGraph getCommunicationGraph(){ + return this.comgraph; + } + + public void setCommunicationGraph(CommunicationGraph v){ + this.comgraph=v; + } + + /* private KeyInfo ki; + @ManyToOne(cascade = CascadeType.ALL, optional = true, fetch = FetchType.LAZY, targetEntity = KeyInfo.class) + public KeyInfo getKeyInfo(){ + return this.ki; + } + public void setKeyInfo(KeyInfo value){ + this.ki=value; + }*/ } Added: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Operator.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Operator.java?rev=1554543&view=auto ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Operator.java (added) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Operator.java Tue Dec 31 15:35:27 2013 @@ -0,0 +1,92 @@ +/* + * Copyright 2001-2008 The Apache Software Foundation. + * + * 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 + * + * 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 org.apache.juddi.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + + +@Entity +@Table(name = "j3_operator") +public class Operator implements Serializable { + + private String operatorNodeID; + private OperatorStatusType operatorStatus; + private List<Contact> contact; + private String soapReplicationURL; + private List<KeyInfo> keyInfo; + + @Id + public String getOperatorNodeID() { + return operatorNodeID; + } + public void setOperatorNodeID(String value) { + this.operatorNodeID = value; + } + + @Column(name = "operator_status") + public OperatorStatusType getOperatorStatus() { + return operatorStatus; + } + + public void setOperatorStatus(OperatorStatusType value) { + this.operatorStatus = value; + } + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Contact.class) + public List<Contact> getContact() { + if (contact == null) { + contact = new ArrayList<Contact>(); + } + return this.contact; + } + + public void setContact(List<Contact> c) { + + this.contact = c; + } + + @Column(name = "replicationurl") + public String getSoapReplicationURL() { + return soapReplicationURL; + } + + public void setSoapReplicationURL(String value) { + this.soapReplicationURL = value; + } + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = KeyInfo.class) + public List<KeyInfo> getKeyInfo() { + if (keyInfo == null) { + keyInfo = new ArrayList<KeyInfo>(); + } + return this.keyInfo; + } + + public void setKeyInfo(List<KeyInfo> c) { + this.keyInfo=c; + } +} + \ No newline at end of file Added: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/OperatorStatusType.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/OperatorStatusType.java?rev=1554543&view=auto ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/OperatorStatusType.java (added) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/OperatorStatusType.java Tue Dec 31 15:35:27 2013 @@ -0,0 +1,52 @@ +/* + * Copyright 2001-2008 The Apache Software Foundation. + * + * 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 + * + * 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 org.apache.juddi.model; + +import java.io.Serializable; + + +public enum OperatorStatusType implements Serializable{ + + + NEW("new"), + + NORMAL("normal"), + + RESIGNED("resigned"); + private final String value; + + OperatorStatusType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static OperatorStatusType fromValue(String v) { + for (OperatorStatusType c: OperatorStatusType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} + \ No newline at end of file Added: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java?rev=1554543&view=auto ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java (added) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java Tue Dec 31 15:35:27 2013 @@ -0,0 +1,199 @@ +/* + * Copyright 2001-2008 The Apache Software Foundation. + * + * 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 + * + * 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 org.apache.juddi.model; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.OrderBy; +import javax.persistence.Table; + +@Entity +@Table(name = "j3_chg_replconf") +public class ReplicationConfiguration implements Serializable { + + private static final long serialVersionUID = 1L; + + private long serialNumber; + private String timeOfConfigurationUpdate; + private List<Operator> operator = new ArrayList<Operator>(0); + private CommunicationGraph communicationGraph; + private BigInteger maximumTimeToSyncRegistry; + private BigInteger maximumTimeToGetChanges; + private List<Signature> signatures = new ArrayList<Signature>(0); + private Contact contact; + + /** + * Gets the value of the contact property. + * + * @return possible object is {@link Contact } + * + */ + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Contact.class) + public Contact getContact() { + return contact; + } + + /** + * Sets the value of the contact property. + * + * @param value allowed object is {@link Contact } + * + */ + public void setContact(Contact value) { + this.contact = value; + } + + /** + * Gets the value of the serialNumber property. + * + */ + @Column(name = "serialnumb") + @OrderBy(value = "SerialNumber DESC") + @Id + public long getSerialNumber() { + return serialNumber; + } + + /** + * Sets the value of the serialNumber property. + * + */ + public void setSerialNumber(long value) { + this.serialNumber = value; + } + + /** + * Gets the value of the timeOfConfigurationUpdate property. + * + * @return possible object is {@link String } + * + */ + @Column(name = "configupdate") + public String getTimeOfConfigurationUpdate() { + return timeOfConfigurationUpdate; + } + + /** + * Sets the value of the timeOfConfigurationUpdate property. + * + * @param value allowed object is {@link String } + * + */ + public void setTimeOfConfigurationUpdate(String value) { + this.timeOfConfigurationUpdate = value; + } + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Operator.class) + public List<Operator> getOperator() { + if (operator == null) { + operator = new ArrayList<Operator>(); + } + return this.operator; + } + + + public void setOperator(List<Operator> v) { + + this.operator=v; + } + + /** + * Gets the value of the communicationGraph property. + * + * @return possible object is {@link CommunicationGraph } + * + */ + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = CommunicationGraph.class) + public CommunicationGraph getCommunicationGraph() { + return communicationGraph; + } + + /** + * Sets the value of the communicationGraph property. + * + * @param value allowed object is {@link CommunicationGraph } + * + */ + public void setCommunicationGraph(CommunicationGraph value) { + this.communicationGraph = value; + } + + /** + * Gets the value of the maximumTimeToSyncRegistry property. + * + * @return possible object is {@link BigInteger } + * + */ + @Column(name = "maxsynctime") + public BigInteger getMaximumTimeToSyncRegistry() { + return maximumTimeToSyncRegistry; + } + + /** + * Sets the value of the maximumTimeToSyncRegistry property. + * + * @param value allowed object is {@link BigInteger } + * + */ + public void setMaximumTimeToSyncRegistry(BigInteger value) { + this.maximumTimeToSyncRegistry = value; + } + + /** + * Gets the value of the maximumTimeToGetChanges property. + * + * @return possible object is {@link BigInteger } + * + */ + @Column(name = "maxgettime") + public BigInteger getMaximumTimeToGetChanges() { + return maximumTimeToGetChanges; + } + + /** + * Sets the value of the maximumTimeToGetChanges property. + * + * @param value allowed object is {@link BigInteger } + * + */ + public void setMaximumTimeToGetChanges(BigInteger value) { + this.maximumTimeToGetChanges = value; + } + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "replicationConfiguration") + @OrderBy + public List<Signature> getSignatures() { + return signatures; + } + + public void setSignatures(List<Signature> signatures) { + this.signatures = signatures; + } + + +} + \ No newline at end of file Added: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ReplicationMessage.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ReplicationMessage.java?rev=1554543&view=auto ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ReplicationMessage.java (added) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/ReplicationMessage.java Tue Dec 31 15:35:27 2013 @@ -0,0 +1,51 @@ +/* + * Copyright 2013 The Apache Software Foundation. + * + * 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 + * + * 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 org.apache.juddi.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; + +/** + * + * @author Alex O'Ree + */ +@Entity(name = "j3_repl_messages") +public class ReplicationMessage { + + private Long id; + private String msg; + + @Column(name ="j3_repl_message") + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + @Id + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + +} Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Signature.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Signature.java?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Signature.java (original) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/model/Signature.java Tue Dec 31 15:35:27 2013 @@ -46,6 +46,7 @@ public class Signature implements java.i private BusinessService businessService; private Publisher publisher; private BindingTemplate bindingTemplate; + private ReplicationConfiguration replConfig; private Tmodel tmodel; private String xmlID; @@ -68,6 +69,18 @@ public class Signature implements java.i public void setBindingTemplate(BindingTemplate bindingTemplate) { this.bindingTemplate = bindingTemplate; } + + + @ManyToOne + @JoinColumn(name = "repl_config_key", nullable = true) + public ReplicationConfiguration getReplicationConfiguration() { + return replConfig; + } + + public void setReplicationConfiguration(ReplicationConfiguration bindingTemplate) { + this.replConfig = bindingTemplate; + } + @ManyToOne @JoinColumn(name = "tmodel_key", nullable = true) Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java (original) +++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java Tue Dec 31 15:35:27 2013 @@ -16,28 +16,31 @@ */ package org.apache.juddi.replication; -import java.util.ArrayList; -import java.util.Date; +import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.Queue; import java.util.Timer; import java.util.TimerTask; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; +import javax.persistence.EntityManager; +import javax.persistence.EntityTransaction; +import javax.persistence.Query; import javax.xml.ws.BindingProvider; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.juddi.api.impl.ServiceCounterLifecycleResource; -import org.apache.juddi.api.impl.UDDIReplicationImpl; -import org.apache.juddi.api.impl.UDDIServiceCounter; +import org.apache.juddi.api_v3.Node; import org.apache.juddi.config.AppConfig; +import org.apache.juddi.config.PersistenceManager; import org.apache.juddi.config.Property; +import org.apache.juddi.mapping.MappingModelToApi; +import org.apache.juddi.model.ReplicationConfiguration; + import org.apache.juddi.v3.client.UDDIService; import org.uddi.repl_v3.ChangeRecordIDType; +import org.uddi.repl_v3.CommunicationGraph; import org.uddi.repl_v3.HighWaterMarkVectorType; import org.uddi.repl_v3.NotifyChangeRecordsAvailable; import org.uddi.v3_service.UDDIReplicationPortType; @@ -54,14 +57,6 @@ public class ReplicationNotifier extends private long startBuffer = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_START_BUFFER, 20000l); // 20s startup delay default private long interval = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_INTERVAL, 300000l); //5 min default private long acceptableLagTime = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_ACCEPTABLE_LAGTIME, 1000l); //1000 milliseconds - private int maxTries = AppConfig.getConfiguration().getInt(Property.JUDDI_NOTIFICATION_MAX_TRIES, 3); - private long badListResetInterval = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_LIST_RESET_INTERVAL, 1000l * 3600); //one hour - private Boolean alwaysNotify = false; - private Date desiredDate = null; - private int lastUpdateCounter; - private UDDIServiceCounter serviceCounter = ServiceCounterLifecycleResource.getServiceCounter(UDDIReplicationImpl.class); - private static Map<String, Integer> badNotifications = new ConcurrentHashMap<String, Integer>(); - private static Date lastBadNotificationReset = new Date(); /** * default constructor @@ -91,36 +86,109 @@ public class ReplicationNotifier extends static Queue queue; public synchronized void run() { - //TODO stuff - log.info("Replication thread trigger"); - if (queue==null) + log.debug("Replication thread triggered"); + if (queue == null) { queue = new ConcurrentLinkedQueue(); + } while (!queue.isEmpty()) { - log.info("Notifying nodes of change records"); + log.info("Notifying nodes of change records " + queue.size()); + //TODO identify chnage set format Object j = queue.poll(); - List<String> endpoints = new ArrayList<String>(); //TODO getReplicationEndpoints - for (int i = 0; i < endpoints.size(); i++) { + org.uddi.repl_v3.ReplicationConfiguration repcfg = FetchEdges(); + if (repcfg == null) { + log.debug("No replication configuration is defined!"); + queue.clear(); + break; + } + Iterator<CommunicationGraph.Edge> it = repcfg.getCommunicationGraph().getEdge().iterator(); + + while (it.hasNext()) { + + //for (int i = 0; i < endpoints.size(); i++) { UDDIReplicationPortType x = new UDDIService().getUDDIReplicationPort(); - ((BindingProvider)x).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoints.get(i)); - NotifyChangeRecordsAvailable req = new NotifyChangeRecordsAvailable(); - String node="UNKNOWN"; - try { - node = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); - } catch (ConfigurationException ex) { - log.fatal(ex); - } - req.setNotifyingNode(node); - HighWaterMarkVectorType highWaterMarkVectorType = new HighWaterMarkVectorType(); - String nextWatermark = ""; //TODO get current watermark + 1 toString() - //TODO save watermark - highWaterMarkVectorType.getHighWaterMark().add(new ChangeRecordIDType(node, 1L)); - req.setChangesAvailable(highWaterMarkVectorType); - try { - x.notifyChangeRecordsAvailable(req); - } catch (Exception ex) { - log.warn("Unable to send change notification to "); + CommunicationGraph.Edge next = it.next(); + next.getMessageReceiver(); //Node ID + Node destinationNode = getNode(next.getMessageSender()); + if (destinationNode == null) { + log.warn(next.getMessageSender() + " node was not found, cannot deliver replication messages"); + } else { + ((BindingProvider) x).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, destinationNode.getReplicationUrl()); + NotifyChangeRecordsAvailable req = new NotifyChangeRecordsAvailable(); + String node = "UNKNOWN"; + try { + node = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); + } catch (ConfigurationException ex) { + log.fatal(ex); + } + req.setNotifyingNode(node); + HighWaterMarkVectorType highWaterMarkVectorType = new HighWaterMarkVectorType(); + String nextWatermark = ""; //TODO get current watermark + 1 toString() + //TODO save watermark along with change set + + highWaterMarkVectorType.getHighWaterMark().add(new ChangeRecordIDType(node, 1L)); + req.setChangesAvailable(highWaterMarkVectorType); + try { + x.notifyChangeRecordsAvailable(req); + } catch (Exception ex) { + log.warn("Unable to send change notification to " + next.getMessageSender(), ex); + } } } } } + + private org.uddi.repl_v3.ReplicationConfiguration FetchEdges() { + + EntityManager em = PersistenceManager.getEntityManager(); + EntityTransaction tx = null; + org.uddi.repl_v3.ReplicationConfiguration item = new org.uddi.repl_v3.ReplicationConfiguration(); + try { + tx = em.getTransaction(); + tx.begin(); + Query q = em.createQuery("SELECT item FROM ReplicationConfiguration item"); + q.setMaxResults(1); + List<ReplicationConfiguration> results = (List<ReplicationConfiguration>) q.getResultList(); + // ReplicationConfiguration find = em.find(ReplicationConfiguration.class, null); + if (results != null && !results.isEmpty()) { + MappingModelToApi.mapReplicationConfiguration(results.get(0), item); + } else { + item = null; + } + tx.commit(); + return item; + } catch (Exception ex) { + log.error("error", ex); + if (tx != null && tx.isActive()) { + tx.rollback(); + } + } finally { + em.close(); + } + return null; + } + + private Node getNode(String messageSender) { + EntityManager em = PersistenceManager.getEntityManager(); + EntityTransaction tx = null; + org.uddi.repl_v3.ReplicationConfiguration item = new org.uddi.repl_v3.ReplicationConfiguration(); + try { + tx = em.getTransaction(); + tx.begin(); + Node api = new Node(); + org.apache.juddi.model.Node find = em.find(org.apache.juddi.model.Node.class, messageSender); + if (find != null) { + MappingModelToApi.mapNode(find, api); + } + tx.commit(); + return api; + } catch (Exception ex) { + log.error("error", ex); + if (tx != null && tx.isActive()) { + tx.rollback(); + } + } finally { + em.close(); + } + return null; + } } Modified: juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/META-INF/persistence.xml?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/META-INF/persistence.xml (original) +++ juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/META-INF/persistence.xml Tue Dec 31 15:35:27 2013 @@ -72,6 +72,13 @@ <class>org.apache.juddi.model.UddiEntityPublisher</class> <class>org.apache.juddi.model.ValueSetValues</class> <class>org.apache.juddi.model.ValueSetValue</class> + <class>org.apache.juddi.model.ChangeRecord</class> + <class>org.apache.juddi.model.CommunicationGraph</class> + <class>org.apache.juddi.model.Operator</class> + <class>org.apache.juddi.model.ReplicationConfiguration</class> + <class>org.apache.juddi.model.Edge</class> + <class>org.apache.juddi.model.ControlMessage</class> + <class>org.apache.juddi.model.ReplicationMessage</class> <properties> <property name="hibernate.archive.autodetection" value="class"/> Modified: juddi/branches/juddi-3.3.x/juddi-examples/hello-world-embedded/src/main/resources/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-examples/hello-world-embedded/src/main/resources/META-INF/persistence.xml?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-examples/hello-world-embedded/src/main/resources/META-INF/persistence.xml (original) +++ juddi/branches/juddi-3.3.x/juddi-examples/hello-world-embedded/src/main/resources/META-INF/persistence.xml Tue Dec 31 15:35:27 2013 @@ -72,6 +72,13 @@ <class>org.apache.juddi.model.UddiEntityPublisher</class> <class>org.apache.juddi.model.ValueSetValues</class> <class>org.apache.juddi.model.ValueSetValue</class> + <class>org.apache.juddi.model.ChangeRecord</class> + <class>org.apache.juddi.model.CommunicationGraph</class> + <class>org.apache.juddi.model.Operator</class> + <class>org.apache.juddi.model.ReplicationConfiguration</class> + <class>org.apache.juddi.model.Edge</class> + <class>org.apache.juddi.model.ControlMessage</class> + <class>org.apache.juddi.model.ReplicationMessage</class> <properties> <property name="hibernate.archive.autodetection" value="class"/> Modified: juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/test/resources/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/test/resources/META-INF/persistence.xml?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/test/resources/META-INF/persistence.xml (original) +++ juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/test/resources/META-INF/persistence.xml Tue Dec 31 15:35:27 2013 @@ -72,6 +72,13 @@ <class>org.apache.juddi.model.UddiEntityPublisher</class> <class>org.apache.juddi.model.ValueSetValues</class> <class>org.apache.juddi.model.ValueSetValue</class> + <class>org.apache.juddi.model.ChangeRecord</class> + <class>org.apache.juddi.model.CommunicationGraph</class> + <class>org.apache.juddi.model.Operator</class> + <class>org.apache.juddi.model.ReplicationConfiguration</class> + <class>org.apache.juddi.model.Edge</class> + <class>org.apache.juddi.model.ControlMessage</class> + <class>org.apache.juddi.model.ReplicationMessage</class> <properties> <property name="hibernate.archive.autodetection" value="class"/> Modified: juddi/branches/juddi-3.3.x/juddiv3-war/JPA/Hibernate-JBoss/WEB-INF/classes/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddiv3-war/JPA/Hibernate-JBoss/WEB-INF/classes/META-INF/persistence.xml?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddiv3-war/JPA/Hibernate-JBoss/WEB-INF/classes/META-INF/persistence.xml (original) +++ juddi/branches/juddi-3.3.x/juddiv3-war/JPA/Hibernate-JBoss/WEB-INF/classes/META-INF/persistence.xml Tue Dec 31 15:35:27 2013 @@ -72,6 +72,14 @@ <class>org.apache.juddi.model.UddiEntityPublisher</class> <class>org.apache.juddi.model.ValueSetValues</class> <class>org.apache.juddi.model.ValueSetValue</class> + <class>org.apache.juddi.model.ChangeRecord</class> + <class>org.apache.juddi.model.CommunicationGraph</class> + <class>org.apache.juddi.model.Operator</class> + <class>org.apache.juddi.model.ReplicationConfiguration</class> + <class>org.apache.juddi.model.Edge</class> + <class>org.apache.juddi.model.ControlMessage</class> + <class>org.apache.juddi.model.ReplicationMessage</class> + <properties> <property name="hibernate.archive.autodetection" value="class"/> Modified: juddi/branches/juddi-3.3.x/juddiv3-war/JPA/Hibernate/WEB-INF/classes/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddiv3-war/JPA/Hibernate/WEB-INF/classes/META-INF/persistence.xml?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddiv3-war/JPA/Hibernate/WEB-INF/classes/META-INF/persistence.xml (original) +++ juddi/branches/juddi-3.3.x/juddiv3-war/JPA/Hibernate/WEB-INF/classes/META-INF/persistence.xml Tue Dec 31 15:35:27 2013 @@ -72,6 +72,13 @@ <class>org.apache.juddi.model.UddiEntityPublisher</class> <class>org.apache.juddi.model.ValueSetValues</class> <class>org.apache.juddi.model.ValueSetValue</class> + <class>org.apache.juddi.model.ChangeRecord</class> + <class>org.apache.juddi.model.CommunicationGraph</class> + <class>org.apache.juddi.model.Operator</class> + <class>org.apache.juddi.model.ReplicationConfiguration</class> + <class>org.apache.juddi.model.Edge</class> + <class>org.apache.juddi.model.ControlMessage</class> + <class>org.apache.juddi.model.ReplicationMessage</class> <properties> <property name="hibernate.archive.autodetection" value="class"/> Modified: juddi/branches/juddi-3.3.x/juddiv3-war/JPA/OpenJPA-JBossAS7Up/WEB-INF/classes/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddiv3-war/JPA/OpenJPA-JBossAS7Up/WEB-INF/classes/META-INF/persistence.xml?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddiv3-war/JPA/OpenJPA-JBossAS7Up/WEB-INF/classes/META-INF/persistence.xml (original) +++ juddi/branches/juddi-3.3.x/juddiv3-war/JPA/OpenJPA-JBossAS7Up/WEB-INF/classes/META-INF/persistence.xml Tue Dec 31 15:35:27 2013 @@ -72,6 +72,14 @@ <class>org.apache.juddi.model.UddiEntityPublisher</class> <class>org.apache.juddi.model.ValueSetValues</class> <class>org.apache.juddi.model.ValueSetValue</class> + <class>org.apache.juddi.model.ChangeRecord</class> + <class>org.apache.juddi.model.CommunicationGraph</class> + <class>org.apache.juddi.model.Operator</class> + <class>org.apache.juddi.model.ReplicationConfiguration</class> + <class>org.apache.juddi.model.Edge</class> + <class>org.apache.juddi.model.ControlMessage</class> + <class>org.apache.juddi.model.ReplicationMessage</class> + <properties> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add')"/> Modified: juddi/branches/juddi-3.3.x/juddiv3-war/JPA/OpenJPA/WEB-INF/classes/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddiv3-war/JPA/OpenJPA/WEB-INF/classes/META-INF/persistence.xml?rev=1554543&r1=1554542&r2=1554543&view=diff ============================================================================== --- juddi/branches/juddi-3.3.x/juddiv3-war/JPA/OpenJPA/WEB-INF/classes/META-INF/persistence.xml (original) +++ juddi/branches/juddi-3.3.x/juddiv3-war/JPA/OpenJPA/WEB-INF/classes/META-INF/persistence.xml Tue Dec 31 15:35:27 2013 @@ -72,6 +72,14 @@ <class>org.apache.juddi.model.UddiEntityPublisher</class> <class>org.apache.juddi.model.ValueSetValues</class> <class>org.apache.juddi.model.ValueSetValue</class> + <class>org.apache.juddi.model.ChangeRecord</class> + <class>org.apache.juddi.model.CommunicationGraph</class> + <class>org.apache.juddi.model.Edge</class> + <class>org.apache.juddi.model.Operator</class> + <class>org.apache.juddi.model.ReplicationConfiguration</class> + + <class>org.apache.juddi.model.ReplicationMessage</class> + <properties> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add')"/> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
